diff options
| author | Mark Hatle <mark.hatle@amd.com> | 2023-03-16 10:39:40 -0700 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2023-03-17 09:21:29 -0500 |
| commit | 9453122a77763873cd43ef2484260c279449d30f (patch) | |
| tree | f6e2598e76345a55ac9bc5ac672ebaa2d8064ab0 /meta-xilinx-core/conf | |
| parent | ac586bcb6787a84125fe02ddc5cb2c8de6b189d7 (diff) | |
| download | meta-xilinx-9453122a77763873cd43ef2484260c279449d30f.tar.gz | |
zynqmp-generic: Emulate FSBL hand-off for qemu boot
Qemu boots by loading ATF and jumping to it directory. A recent change
adds a verification that the data structure passed by the FSBL is correct
in a 'mode 5' (SD card) boot. If it's not valid ATF will fail to continue
to boot. (JTAG, 'mode 0' boot will proceed but other system behavior
changes.)
In order to emulate the FSBL handoff to ATF, we need to populate a data
structure in fffc0000, and tell ATF to look at that address. See the
comments for more information. This also ends up hard-coding the u-boot
address. If it changes booting will fail.
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
(cherry picked from commit 800a7efd0aced9445b215451f6e2314cdd7025fc)
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/conf')
| -rw-r--r-- | meta-xilinx-core/conf/machine/zynqmp-generic.conf | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/meta-xilinx-core/conf/machine/zynqmp-generic.conf b/meta-xilinx-core/conf/machine/zynqmp-generic.conf index a2d20869..d24da3b4 100644 --- a/meta-xilinx-core/conf/machine/zynqmp-generic.conf +++ b/meta-xilinx-core/conf/machine/zynqmp-generic.conf | |||
| @@ -101,9 +101,37 @@ QEMU_HW_DTB_PS = "${QEMU_HW_DTB_PATH}/zcu102-arm.dtb" | |||
| 101 | QEMU_HW_DTB_PMU = "${QEMU_HW_DTB_PATH}/zynqmp-pmu.dtb" | 101 | QEMU_HW_DTB_PMU = "${QEMU_HW_DTB_PATH}/zynqmp-pmu.dtb" |
| 102 | 102 | ||
| 103 | # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) | 103 | # Replicate BootROM like behaviour, having loaded SPL and PMU(ROM+FW) |
| 104 | # | ||
| 105 | # In an actual device the FSBL will run first, load ATF and setup the | ||
| 106 | # following data structure to tell ATF what to continue booting with. | ||
| 107 | # | ||
| 108 | # In QEMU emulation we start booting directly from ATF, so we need to | ||
| 109 | # setup the structure ourselves. | ||
| 110 | # | ||
| 111 | # Write to OCM (See UG1085 for more information), address 0xfffc0000 | ||
| 112 | # the address to boot from (where u-boot is): | ||
| 113 | # fffc0000 58 4c 4e 58 01 00 00 00 |XLNX....| | ||
| 114 | # fffc0008 00 00 00 08 00 00 00 00 |........| | ||
| 115 | # fffc0010 10 00 00 00 00 00 00 00 |........| | ||
| 116 | # | ||
| 117 | # Then write that address (fffc0000) to 0xffd80048 so ATF can find this block | ||
| 118 | # | ||
| 119 | # fffc0008 defines the u-boot load address as 0x8000000, if u-boot is | ||
| 120 | # expected to be elsewhere in memory, you must adjust the value. | ||
| 121 | # | ||
| 122 | # We write the structure as big endian to make it easier to match/read | ||
| 123 | # the table above. Remember the CPU is running in little endian mode, | ||
| 124 | # with the default resulting in: | ||
| 125 | # 00000000fffc0000: 0x584e4c58 0x00000001 0x08000000 0x00000000 | ||
| 126 | # 00000000fffc0010: 0x00000010 0x00000000 | ||
| 127 | # | ||
| 104 | QB_OPT_APPEND = " \ | 128 | QB_OPT_APPEND = " \ |
| 105 | -hw-dtb ${QEMU_HW_DTB_PS} \ | 129 | -hw-dtb ${QEMU_HW_DTB_PS} \ |
| 106 | ${@qemu_zynqmp_unhalt(d, True)} \ | 130 | ${@qemu_zynqmp_unhalt(d, True)} \ |
| 131 | -device loader,addr=0xfffc0000,data=0x584c4e5801000000,data-be=true,data-len=8 \ | ||
| 132 | -device loader,addr=0xfffc0008,data=0x0000000800000000,data-be=true,data-len=8 \ | ||
| 133 | -device loader,addr=0xfffc0010,data=0x1000000000000000,data-be=true,data-len=8 \ | ||
| 134 | -device loader,addr=0xffd80048,data=0xfffc0000,data-len=4,attrs-secure=on \ | ||
| 107 | -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \ | 135 | -device loader,file=${DEPLOY_DIR_IMAGE}/arm-trusted-firmware.elf,cpu-num=0 \ |
| 108 | -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \ | 136 | -device loader,file=${DEPLOY_DIR_IMAGE}/u-boot.elf \ |
| 109 | -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000,force-raw=on \ | 137 | -device loader,file=${DEPLOY_DIR_IMAGE}/system.dtb,addr=0x100000,force-raw=on \ |
