From fdb3e6e167665315899e796e3a6eadc8e645f44b Mon Sep 17 00:00:00 2001 From: Sandeep Gundlupet Raju Date: Sat, 24 Dec 2022 21:59:59 -0700 Subject: zynqmp-generic: Update machine conf file using gen-machineconf tool 1. Update machine conf file using gen-machineconf tool by parsing zcu102 xsa. 2. Use TFA_BL33_LOAD for TF-A preloadded bl33 base address. 3. Move variables which changes based on xsa before required inclusion file to handle pre-expansion values. 4. Remove uEnv.txt from IMAGE_BOOT_FILES. 5. Disable U-boot SPL boot by default. User has to set explicitly to use it. Signed-off-by: Sandeep Gundlupet Raju Signed-off-by: Mark Hatle --- meta-xilinx-core/conf/machine/zynqmp-generic.conf | 129 ++++++++++++++-------- 1 file changed, 85 insertions(+), 44 deletions(-) (limited to 'meta-xilinx-core/conf') diff --git a/meta-xilinx-core/conf/machine/zynqmp-generic.conf b/meta-xilinx-core/conf/machine/zynqmp-generic.conf index 3aff9c65..bf95c117 100644 --- a/meta-xilinx-core/conf/machine/zynqmp-generic.conf +++ b/meta-xilinx-core/conf/machine/zynqmp-generic.conf @@ -1,6 +1,6 @@ #@TYPE: Machine -#@NAME: Generic zynqmp -#@DESCRIPTION: zynqmp devices +#@NAME: zynqmp-generic +#@DESCRIPTION: Machine configuration for the zynqmp-generic devices # Deprecated board config USE_BOARD = "${@"conf/machine/include/xilinx-board-pre.inc" if d.getVar("BOARD") or d.getVar("BOARD_VARIANT") else ""}" @@ -11,76 +11,117 @@ unset USE_BOARD MACHINEOVERRIDES =. "${@['', 'zynqmp-generic:']['zynqmp-generic' != '${MACHINE}']}" #### Regular settings follow +# Variables that changes based on hw design or board specific requirement must be +# defined before calling the required inclusion file else pre-expansion value +# defined in local.conf without machine override will not be reflected. + +# Yocto device-tree variables +YAML_CONSOLE_DEVICE_CONFIG:pn-device-tree ?= "psu_uart_0" +YAML_MAIN_MEMORY_CONFIG:pn-device-tree ?= "PSU_DDR_0" +DT_PADDING_SIZE:pn-device-tree ?= "0x1000" +DTC_FLAGS:pn-device-tree = "-@" +YAML_DT_BOARD_FLAGS ?= "{BOARD zcu102-rev1.0}" + +# Yocto ZynqMP u-boot-xlnx variables +UBOOT_MACHINE ?= "xilinx_zynqmp_virt_defconfig" +BOOTMODE ?= "generic.root" + +# By default U-boot SPL boot is disabled +SPL_BINARY ?= "" + +# If user needs U-boot SPL boot, then enable SPL from local.conf as shown below. +# SPL_BINARY = "spl/boot.bin" + +# Yocto ZynqMP arm-trusted-firmware(TF-A) variables +TFA_BL33_LOAD ?= "0x8000000" + +# Yocto ZynqMP PMUFW variables +YAML_SERIAL_CONSOLE_STDIN:pn-pmu-firmware ?= "psu_uart_0" +YAML_SERIAL_CONSOLE_STDOUT:pn-pmu-firmware ?= "psu_uart_0" + +# Yocto ZynqMP FSBL variables +YAML_SERIAL_CONSOLE_STDIN:pn-fsbl-firmware ?= "psu_uart_0" +YAML_SERIAL_CONSOLE_STDOUT:pn-fsbl-firmware ?= "psu_uart_0" + +# Yocto ZynqMP KERNEL Variables +UBOOT_ENTRYPOINT ?= "0x200000" +UBOOT_LOADADDRESS ?= "0x200000" +KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}" + +# ZynqMP Serial Console +SERIAL_CONSOLES ?= "115200;ttyPS0" +SERIAL_CONSOLES_CHECK = "${SERIAL_CONSOLES}" +YAML_SERIAL_CONSOLE_BAUDRATE ?= "115200" + require conf/machine/include/soc-zynqmp.inc require conf/machine/include/machine-xilinx-default.inc require conf/machine/include/machine-xilinx-qemu.inc +# zynqmp-generic.conf uses zcu102-zynqmp xsa as reference input. +# User can override with custom xsa using HDF_BASE and HDF_PATH variables from +# local.conf. +HDF_MACHINE = "zcu102-zynqmp" + # Machine features must result in a superset # Basic features: -MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost" -# Ultra96 features: -MACHINE_FEATURES += " usbgadget wifi bluetooth" +MACHINE_FEATURES += "rtc ext2 ext3 vfat usbhost usbgadget wifi bluetooth" -# Qemu Xilinx Native when targeting ZynqMP generic requries the pmu rom +# Qemu Xilinx Native when targeting ZynqMP generic requires the pmu rom DEPENDS:append:pn-qemu-xilinx-native = " pmu-rom-native" -EXTRA_IMAGEDEPENDS += "libyaml-native python3-cython-native python3-pyyaml-native" - -UBOOT_MACHINE ?= "xilinx_zynqmp_virt_defconfig" -SPL_BINARY ?= "spl/boot.bin" -BOOTMODE ?= "generic.root" - # Default SD image build onfiguration, use qemu-sd to pad IMAGE_CLASSES += "image-types-xilinx-qemu" # Add wic.qemu-sd only if initramfs_image not set due to circular dependecies IMAGE_FSTYPES += "${@'wic.qemu-sd' if (d.getVar('INITRAMFS_IMAGE') or '') == '' else 'cpio.gz.u-boot'}" -SERIAL_CONSOLES ?= "115200;ttyPS0" - MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "device-tree" -# We need a generic one that works with QEMU... -HDF_MACHINE = "zcu102-zynqmp" - EXTRA_IMAGEDEPENDS += " \ - u-boot-xlnx-uenv \ - arm-trusted-firmware \ - qemu-devicetrees \ - virtual/boot-bin \ - virtual/bootloader \ - u-boot-xlnx-scr \ - " + libyaml-native \ + python3-cython-native \ + python3-pyyaml-native \ + virtual/fsbl \ + virtual/pmu-firmware \ + arm-trusted-firmware \ + virtual/boot-bin \ + virtual/bootloader \ + qemu-devicetrees \ + u-boot-xlnx-uenv \ + u-boot-xlnx-scr \ + " IMAGE_BOOT_FILES += " \ - uEnv.txt \ - atf-uboot.ub \ - ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ - boot.scr \ - " + boot.bin \ + ${@bb.utils.contains('PREFERRED_PROVIDER_virtual/dtb', 'device-tree', 'system.dtb', '', d)} \ + boot.scr \ + Image \ + " +# ZynqMP QEMU Configurations # This machine has a QEMU model, runqemu setup: QB_MEM = "-m 4096" QB_NETWORK_DEVICE = "-net nic -net nic -net nic -net nic,netdev=net0,macaddr=@MAC@" # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) QB_OPT_APPEND = " \ - -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,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000,force-raw=on \ - ${@qemu_add_extra_args(d)} \ - " + -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,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000,force-raw=on \ + ${@qemu_add_extra_args(d)} \ + " QB_PMU_OPT = " \ - -M microblaze-fdt \ - -display none \ - -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \ - -kernel ${PMU_ROM} \ - -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \ - -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ - -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ - " + -M microblaze-fdt \ + -display none \ + -hw-dtb ${DEPLOY_DIR_IMAGE}/qemu-hw-devicetrees/multiarch/zynqmp-pmu.dtb \ + -kernel ${PMU_ROM} \ + -device loader,file=${PMU_FIRMWARE_DEPLOY_DIR}/${PMU_FIRMWARE_IMAGE_NAME}.elf \ + -device loader,addr=0xfd1a0074,data=0x1011003,data-len=4 \ + -device loader,addr=0xfd1a007C,data=0x1010f03,data-len=4 \ + " + QB_OPT_APPEND += " -pmu-args '${QB_PMU_OPT}'" do_write_qemuboot_conf[depends] += "u-boot-xlnx-uenv:do_deploy" -- cgit v1.2.3-54-g00ecf