[meta-xilinx] [PATCH v2 5/6] zcu102-zynqmp: Setup the use of multiarch QEMU
Nathan Rossi
nathan at nathanrossi.com
Sat Jun 3 06:27:15 PDT 2017
On 31 May 2017 at 04:14, Alistair Francis <alistair23 at gmail.com> wrote:
> On Tue, May 30, 2017 at 4:45 AM, Nathan Rossi <nathan at nathanrossi.com> wrote:
>> Setup the qemuboot variables and qemu-xilinx-helper-native environment
>> to use the multiarch script to start a QEMU multiarch instance with the
>> MicroBlaze PMU.
>>
>> Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>
>> ---
>> Changes in v2:
>> * Setup PMU instance args using --pmu-args
>> * Rebase against master
>> ---
>> conf/machine/include/machine-xilinx-qemu.inc | 5 +++++
>> conf/machine/zcu102-zynqmp.conf | 21 ++++++++++++++++++---
>> .../qemu/qemu-xilinx-helper-native_1.0.bb | 5 ++++-
>> 3 files changed, 27 insertions(+), 4 deletions(-)
>>
>> diff --git a/conf/machine/include/machine-xilinx-qemu.inc b/conf/machine/include/machine-xilinx-qemu.inc
>> index 938d76d461..dd275f3b48 100644
>> --- a/conf/machine/include/machine-xilinx-qemu.inc
>> +++ b/conf/machine/include/machine-xilinx-qemu.inc
>> @@ -36,6 +36,11 @@ def qemu_target_binary(d):
>> ta = "aarch64"
>> return "qemu-system-%s" % ta
>>
>> +def qemu_zynqmp_unhalt(d, multiarch):
>> + if multiarch:
>> + return "-global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true"
>> + return "-device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4"
>> +
>> # For qemuboot, default setup across all machines in meta-xilinx
>> QB_SYSTEM_NAME ?= "${@qemu_target_binary(d)}"
>> QB_DEFAULT_FSTYPE ?= "cpio"
>> diff --git a/conf/machine/zcu102-zynqmp.conf b/conf/machine/zcu102-zynqmp.conf
>> index 054a17906c..bbc9f04a97 100644
>> --- a/conf/machine/zcu102-zynqmp.conf
>> +++ b/conf/machine/zcu102-zynqmp.conf
>> @@ -41,10 +41,13 @@ QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MA
>> # Use qemu-xilinx instead of mainline
>> PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native"
>>
>> -# Reset and unhalt CPU0, load the boot media.
>> +# Use the multiarch script instead of launching QEMU directly
>> +QB_SYSTEM_NAME_append = "-multiarch"
>> +
>> +# Setup hw-dtb, unhalt, atf and u-boot loading
>> QB_OPT_APPEND_append_qemuboot-xilinx = " \
>> - -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/zcu102-arm.dtb \
>> - -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 \
>> + -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zcu102-arm.dtb \
>> + ${@qemu_zynqmp_unhalt(d, True)} \
>> -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \
>> -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \
>> "
>> @@ -55,4 +58,16 @@ QB_ROOTFS_OPT_qemuboot-xilinx = " -device loader,addr=0x6000000,file=@ROOTFS@,fo
>> QB_OPT_APPEND_append_qemuboot-xilinx = " \
>> -device loader,addr=0x4000000,file=${DEPLOY_DIR_IMAGE}/${QB_DTB} \
>> -device loader,addr=0x80000,file=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} \
>> + -pmu-args '${QB_PMU_OPT}' \
>> + "
>> +
>> +QB_PMU_OPT = " \
>> + -M microblaze-fdt \
>> + -display none \
>> + -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \
>> + -kernel ${DEPLOY_DIR_IMAGE}/pmu-rom.elf \
>
> Can we save this in a variable instead?
>
> Something like this:
> PMU_ROM ?= ${DEPLOY_DIR_IMAGE}/pmu-rom.elf
>
> That way people can override it and point to somewhere else. As the
> ROM isn't built by Yocto it makes more sense to not tie it to the
> deploy directory.
I've updated this patch to add exactly what you describe above, but
since it is such a small change I will skip sending a v3 so that I can
go ahead and merge this series.
Thanks,
Nathan
>
> Thanks,
> Alistair
>
>> + -device loader,file=${DEPLOY_DIR_IMAGE}/pmu-${MACHINE}.elf \
>> + -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \
>> + -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \
>> "
>> +
>> diff --git a/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb b/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb
>> index f48a8d40a0..55b35b53e5 100644
>> --- a/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb
>> +++ b/recipes-devtools/qemu/qemu-xilinx-helper-native_1.0.bb
>> @@ -21,5 +21,8 @@ PROVIDES += "qemu-helper-native"
>>
>> # replace qemu with qemu-xilinx
>> DEPENDS_remove = "qemu-native"
>> -DEPENDS_append = " qemu-xilinx-native"
>> +DEPENDS_append = " \
>> + qemu-xilinx-native \
>> + qemu-xilinx-multiarch-helper-native \
>> + "
>>
>> --
>> 2.11.0
>>
>> --
>> _______________________________________________
>> meta-xilinx mailing list
>> meta-xilinx at yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/meta-xilinx
More information about the meta-xilinx
mailing list