diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2017-05-30 21:30:27 +1000 |
---|---|---|
committer | Nathan Rossi <nathan@nathanrossi.com> | 2017-06-03 16:55:31 +1000 |
commit | be24cbc4fe77f943f8f549ef7bc4f795a9a20e75 (patch) | |
tree | fa18897213da8334d60663ba9bac6b3b1614e094 /recipes-devtools | |
parent | a1d592f4595ac5961c1d698b31c7dbff6a8c62a6 (diff) | |
download | meta-xilinx-be24cbc4fe77f943f8f549ef7bc4f795a9a20e75.tar.gz |
qemu-xilinx-multiarch-helper-native: Recipe to provide a helper script
This recipe provides a helper script which is executed instead of the
main qemu-system-aarch64 binary. This script is used to configure a
multiarch QEMU setup where a MicroBlaze PMU instance is running along
side the ZynqMP AArch64 instance.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Tested-by: Alistair Francis <alistair.francis@xilinx.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r-- | recipes-devtools/qemu/files/qemu-system-aarch64-multiarch | 32 | ||||
-rw-r--r-- | recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb | 20 |
2 files changed, 52 insertions, 0 deletions
diff --git a/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch b/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch new file mode 100644 index 00000000..15124c1b --- /dev/null +++ b/recipes-devtools/qemu/files/qemu-system-aarch64-multiarch | |||
@@ -0,0 +1,32 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | BINPATH=$(dirname $0) | ||
4 | MACHINE_PATH=$(mktemp -d) | ||
5 | |||
6 | APU_ARGS= | ||
7 | PMU_ARGS= | ||
8 | |||
9 | while [ ! -z "$1" ]; do | ||
10 | if [ "$1" = "-pmu-args" ]; then | ||
11 | PMU_ARGS+=" $2" | ||
12 | shift | ||
13 | else | ||
14 | APU_ARGS+=" $1" | ||
15 | fi | ||
16 | shift | ||
17 | done | ||
18 | |||
19 | PMU_ROM=$(last=; for i in $PMU_ARGS; do if [ "$last" = "-kernel" ]; then echo "$i"; break; fi; last=$i; done) | ||
20 | if [ ! -e $PMU_ROM ]; then | ||
21 | echo "------" | ||
22 | echo "Error: Missing PMU ROM - $PMU_ROM" | ||
23 | echo " See 'meta-xilinx/README.qemu.md' for more information on accquiring the PMU ROM." | ||
24 | echo "------" | ||
25 | exit 255 | ||
26 | fi | ||
27 | |||
28 | # start the PMU instance | ||
29 | $BINPATH/qemu-system-microblazeel $PMU_ARGS -machine-path $MACHINE_PATH & | ||
30 | # start the APU instance | ||
31 | $BINPATH/qemu-system-aarch64 $APU_ARGS -machine-path $MACHINE_PATH | ||
32 | |||
diff --git a/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb b/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb new file mode 100644 index 00000000..a9b11c6c --- /dev/null +++ b/recipes-devtools/qemu/qemu-xilinx-multiarch-helper-native_1.0.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Helper scripts for executing a multi-arch instance of Xilinx QEMU" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
4 | RDEPENDS_${PN} = "qemu-xilinx-native" | ||
5 | |||
6 | inherit native | ||
7 | |||
8 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
9 | |||
10 | SRC_URI = "file://qemu-system-aarch64-multiarch" | ||
11 | |||
12 | do_configure[noexec] = "1" | ||
13 | do_compile[noexec] = "1" | ||
14 | |||
15 | SYSROOT_DIRS += "${bindir}/qemu-xilinx" | ||
16 | |||
17 | do_install() { | ||
18 | install -Dm 0755 ${WORKDIR}/qemu-system-aarch64-multiarch ${D}${bindir}/qemu-xilinx/qemu-system-aarch64-multiarch | ||
19 | } | ||
20 | |||