diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-11-03 16:43:32 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-11-03 16:43:32 +0000 |
commit | eb5f222b5c125de1b47970c6096a3107ffe1d69b (patch) | |
tree | 1a52e60e8070f9b664f761bce085edde569a5986 /target-xtensa/import_core.sh | |
parent | 7135781f65f1267a72bf554ee2b7bd605f9e59aa (diff) | |
parent | 437a8c11c06f53ed3bcdcc3e5abc5d20b2d439bd (diff) |
Merge remote-tracking branch 'remotes/xtensa/tags/20141103-xtensa' into staging
Xtensa fixes and improvements 2014-11-03:
- build fixes for cores w/o windowed registers and with profiling
interrupts;
- fix uImage load address for MMUv2 cores;
- add script for automatic core import from xtensa configuration overlay.
# gpg: Signature made Sun 02 Nov 2014 22:04:44 GMT using RSA key ID F83FA044
# gpg: Good signature from "Max Filippov <max.filippov@cogentembedded.com>"
# gpg: aka "Max Filippov <jcmvbkbc@gmail.com>"
* remotes/xtensa/tags/20141103-xtensa:
MAINTAINERS: update xtensa boards
target-xtensa: fix build for cores w/o windowed registers
target-xtensa: add core importing script
hw/xtensa/xtfpga: treat uImage load address as virtual
hw/core/loader: implement address translation in uimage loader
target-xtensa: avoid duplicate timer interrupt delivery
target-xtensa: tests: pre-process tests linker script
target-xtensa: add definition for XTHAL_INTTYPE_PROFILING
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-xtensa/import_core.sh')
-rwxr-xr-x | target-xtensa/import_core.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/target-xtensa/import_core.sh b/target-xtensa/import_core.sh new file mode 100755 index 0000000000..73791ec545 --- /dev/null +++ b/target-xtensa/import_core.sh @@ -0,0 +1,53 @@ +#! /bin/bash -e + +OVERLAY="$1" +NAME="$2" +FREQ=40000 +BASE=$(dirname "$0") +TARGET="$BASE"/core-$NAME + +[ $# -ge 2 -a -f "$OVERLAY" ] || { cat <<EOF +Usage: $0 overlay-archive-to-import core-name [frequency-in-KHz] + overlay-archive-to-import: file name of xtensa-config-overlay.tar.gz + to import configuration from. + core-name: QEMU name of the imported core. Must be valid + C identifier. + frequency-in-KHz: core frequency (40MHz if not specified). +EOF +exit +} + +[ $# -ge 3 ] && FREQ="$3" +mkdir -p "$TARGET" +tar -xf "$OVERLAY" -C "$TARGET" --strip-components=1 \ + --xform='s/core/core-isa/' config/core.h +tar -xf "$OVERLAY" -O gdb/xtensa-config.c | \ + sed -n '1,/*\//p;/pc/,/a15/p' > "$TARGET"/gdb-config.c +NUM_REGS=$(grep XTREG "$TARGET"/gdb-config.c | wc -l) + +cat <<EOF > "${TARGET}.c" +#include "cpu.h" +#include "exec/exec-all.h" +#include "exec/gdbstub.h" +#include "qemu/host-utils.h" + +#include "core-$NAME/core-isa.h" +#include "overlay_tool.h" + +static const XtensaConfig $NAME __attribute__((unused)) = { + .name = "$NAME", + .gdb_regmap = { + .num_regs = $NUM_REGS, + .reg = { +#include "core-$NAME/gdb-config.c" + } + }, + .clock_freq_khz = $FREQ, + DEFAULT_SECTIONS +}; + +REGISTER_CORE($NAME) +EOF + +grep -q core-${NAME}.o "$BASE"/Makefile.objs || \ + echo "obj-y += core-${NAME}.o" >> "$BASE"/Makefile.objs |