[meta-xilinx] [PATCH v3 12/12] zcu102-zynqmp: Setup runqemu to boot from an SD image

Manjukumar Harthikote Matha manjukumar.harthikote-matha at xilinx.com
Tue Nov 21 15:01:06 PST 2017



On 11/21/2017 02:43 PM, Alistair Francis wrote:
> On Tue, Nov 14, 2017 at 5:15 AM, Nathan Rossi <nathan at nathanrossi.com> wrote:
>> This sets up the zcu102-zynqmp machine to by default generate a padded
>> SD card image for which runqemu can use to boot from. This image
>> includes all the components that are expected from to boot and mirrors
>> the same requirements that the real board has.
>>
>> The QEMU args are changed to default to the SD boot mode and only U-Boot
>> SPL is passed in as a ROM image to boot the QEMU instance.
>>
>> This setup mimics the boot flow of the physical target where the Boot
>> ROM loads U-Boot SPL and the PMU Firmware from the boot.bin.
>>
>> Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>
>> ---
>> Changes in v3:
>>   * NEW
>> ---
>>   conf/machine/zcu102-zynqmp.conf | 27 ++++++++++++++++-----------
>>   1 file changed, 16 insertions(+), 11 deletions(-)
>>
>> diff --git a/conf/machine/zcu102-zynqmp.conf b/conf/machine/zcu102-zynqmp.conf
>> index 41e9e11952..80b6d6f37f 100644
>> --- a/conf/machine/zcu102-zynqmp.conf
>> +++ b/conf/machine/zcu102-zynqmp.conf
>> @@ -13,6 +13,11 @@ MACHINE_FEATURES = "rtc ext2 ext3 vfat usbhost"
>>   UBOOT_MACHINE = "xilinx_zynqmp_zcu102_rev1_0_defconfig"
>>   SPL_BINARY = "spl/boot.bin"
>>
>> +# Default SD image build onfiguration, use qemu-sd to pad
>> +IMAGE_CLASSES += "image-types-xilinx-qemu"
>> +IMAGE_FSTYPES += "wic.qemu-sd"
>> +WKS_FILES ?= "sdimage-bootpart.wks"
>> +
>>   SERIAL_CONSOLE = "115200 ttyPS0"
>>   SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}"
>>
>> @@ -23,11 +28,14 @@ PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-xlnx"
>>   PREFERRED_PROVIDER_virtual/pmu-firmware ?= "zynqmp-pmu-pmu-firmware"
>>
>>   EXTRA_IMAGEDEPENDS += " \
>> +               u-boot-zynq-uenv \
>>                  arm-trusted-firmware \
>>                  qemu-devicetrees \
>>                  virtual/pmu-firmware \
>>                  "
>>
>> +IMAGE_BOOT_FILES += "uEnv.txt atf-uboot.ub ${KERNEL_IMAGETYPE}-zynqmp-zcu102-rev1.0.dtb"
>> +
>>   # This machine has a QEMU model, runqemu setup:
>>   IMAGE_CLASSES += "qemuboot-xilinx"
>>   QB_MACHINE = "-machine xlnx-zcu102"
>> @@ -41,23 +49,19 @@ PREFERRED_PROVIDER_qemu-helper-native = "qemu-xilinx-helper-native"
>>   # Use the multiarch script instead of launching QEMU directly
>>   QB_SYSTEM_NAME_append = "-multiarch"
>>
>> -# Setup hw-dtb, unhalt, atf and u-boot loading
>> +# Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW)
>>   QB_OPT_APPEND_append_qemuboot-xilinx = " \
>>                  -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 \
>> +               -device loader,addr=0xfffc0000,file=${DEPLOY_DIR_IMAGE}/u-boot-spl.bin,cpu-num=0 \
> 
> I only just got around to looking at this.
> 
> What is the reason to use u-boot SPL instead of ATF and u-boot? We
> don't need FSBL/SPL on QEMU so this shouldn't be required and we don't
> test u-boot-spl internally so we won't catch breakages here.
> 

It would be good to support both : ATF/u-boot like before and current 
u-boot-spl.bin. We can use some sort of switch based on SPL_BINARY

Thanks,
Manju
> Alistair
> 
>>                  "
>>
>> -# Load the kernel image so the user can run 'booti 0x80000 0x6000000 0x4000000' to boot the kernel
>> -QB_DEFAULT_FSTYPE_qemuboot-xilinx = "cpio.gz.u-boot"
>> -QB_ROOTFS_OPT_qemuboot-xilinx = " -device loader,addr=0x6000000,file=@ROOTFS@,force-raw=true"
>> -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}' \
>> -               "
>> +# Attach the rootfs disk image to the second SD interface of QEMU (which is SD0)
>> +QB_DEFAULT_FSTYPE_qemuboot-xilinx = "wic.qemu-sd"
>> +QB_OPT_APPEND_append_qemuboot-xilinx = " -boot mode=3"
>> +QB_ROOTFS_OPT_qemuboot-xilinx = " -drive if=sd,index=1,file=@ROOTFS@,format=raw"
>>
>> +# PMU instance args
>>   PMU_ROM ?= "${DEPLOY_DIR_IMAGE}/pmu-rom.elf"
>>   QB_PMU_OPT = " \
>>                  -M microblaze-fdt \
>> @@ -68,4 +72,5 @@ QB_PMU_OPT = " \
>>                  -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \
>>                  -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \
>>                  "
>> +QB_OPT_APPEND_append_qemuboot-xilinx = " -pmu-args '${QB_PMU_OPT}'"
>>
>> --
>> 2.15.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