summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2024-11-21 13:54:05 -0600
committerMark Hatle <mark.hatle@amd.com>2024-11-21 13:54:05 -0600
commit1241013c7bce4262a6128eb4ccb3db410831746d (patch)
treeda79ab94a5b4ae9abf6211d8289a4bf5dbdcde9f /meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
parent6e3a214d268c7d75a42a9a329b5621fb5a49a89a (diff)
parent10531c26195f97f9565e9770c21977805e53c46b (diff)
downloadmeta-xilinx-1241013c7bce4262a6128eb4ccb3db410831746d.tar.gz
Merge remote-tracking branch 'origin/scarthgap' into yocto-master
This moves the system to scarthgap. It is known to NOT work with Styhead and master, Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb')
-rw-r--r--meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb42
1 files changed, 35 insertions, 7 deletions
diff --git a/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb b/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
index aabced59..b9236f55 100644
--- a/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
+++ b/meta-xilinx-core/recipes-bsp/bootbin/xilinx-bootbin_1.0.bb
@@ -7,6 +7,8 @@ LICENSE = "BSD"
7 7
8include machine-xilinx-${SOC_FAMILY}.inc 8include machine-xilinx-${SOC_FAMILY}.inc
9 9
10BOOTBIN_INCLUDE ?= ""
11
10inherit deploy 12inherit deploy
11 13
12# Don't allow building for microblaze MACHINE 14# Don't allow building for microblaze MACHINE
@@ -18,10 +20,11 @@ COMPATIBLE_MACHINE:versal-net = ".*"
18 20
19PROVIDES = "virtual/boot-bin" 21PROVIDES = "virtual/boot-bin"
20 22
21DEPENDS += "bootgen-native" 23DEPENDS += "bootgen-native u-boot-xlnx-scr"
22 24
23# There is no bitstream recipe, so really depend on virtual/bitstream 25# There is no bitstream recipe, so really depend on virtual/bitstream
24DEPENDS += "${@(d.getVar('BIF_PARTITION_ATTR') or "").replace('bitstream', 'virtual/bitstream')}" 26# We need to refer to virtual/arm-trusted-firmware and not arm-trusted-firmware as there may be multiple providers
27DEPENDS += "${@(d.getVar('BIF_PARTITION_ATTR') or "").replace('bitstream', 'virtual/bitstream').replace('arm-trusted-firmware', 'virtual/arm-trusted-firmware')}"
25 28
26PACKAGE_ARCH = "${MACHINE_ARCH}" 29PACKAGE_ARCH = "${MACHINE_ARCH}"
27 30
@@ -32,8 +35,6 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda
32 35
33SRC_URI += "${@('file://' + d.getVar("BIF_FILE_PATH")) if d.getVar("BIF_FILE_PATH") != (d.getVar('B') + '/bootgen.bif') else ''}" 36SRC_URI += "${@('file://' + d.getVar("BIF_FILE_PATH")) if d.getVar("BIF_FILE_PATH") != (d.getVar('B') + '/bootgen.bif') else ''}"
34 37
35S = "${UNPACKDIR}"
36
37# bootgen command -arch option for different SOC architectures 38# bootgen command -arch option for different SOC architectures
38# zynq7000 : zynq 39# zynq7000 : zynq
39# zynqmp : zynqmp 40# zynqmp : zynqmp
@@ -47,8 +48,17 @@ BOOTGEN_ARCH_DEFAULT:versal-net = "versalnet"
47BOOTGEN_ARCH ?= "${BOOTGEN_ARCH_DEFAULT}" 48BOOTGEN_ARCH ?= "${BOOTGEN_ARCH_DEFAULT}"
48BOOTGEN_EXTRA_ARGS ?= "" 49BOOTGEN_EXTRA_ARGS ?= ""
49 50
51QEMU_FLASH_TYPE ?= "qspi"
52BOOTSCR_DEP = ''
53BOOTSCR_DEP:versal = 'u-boot-xlnx-scr:do_deploy'
54BOOTSCR_DEP:versal-net = 'u-boot-xlnx-scr:do_deploy'
55
56BIF_BITSTREAM_ATTR ?= "${@bb.utils.contains('MACHINE_FEATURES', 'fpga-overlay', '', 'bitstream', d)}"
57
50do_patch[noexec] = "1" 58do_patch[noexec] = "1"
51 59
60do_compile[depends] .= " ${BOOTSCR_DEP}"
61
52def create_bif(config, attrflags, attrimage, ids, common_attr, biffd, d): 62def create_bif(config, attrflags, attrimage, ids, common_attr, biffd, d):
53 arch = d.getVar("SOC_FAMILY") 63 arch = d.getVar("SOC_FAMILY")
54 bb.error("create_bif function not defined for arch: %s" % (arch)) 64 bb.error("create_bif function not defined for arch: %s" % (arch))
@@ -168,10 +178,10 @@ do_configure[vardeps] += "BIF_PARTITION_ATTR BIF_PARTITION_IMAGE BIF_COMMON_ATTR
168do_configure[vardeps] += "BIF_FSBL_ATTR BIF_BITSTREAM_ATTR BIF_ATF_ATTR BIF_DEVICETREE_ATTR BIF_SSBL_ATTR" 178do_configure[vardeps] += "BIF_FSBL_ATTR BIF_BITSTREAM_ATTR BIF_ATF_ATTR BIF_DEVICETREE_ATTR BIF_SSBL_ATTR"
169 179
170do_compile() { 180do_compile() {
171 cd ${UNPACKDIR} 181 cd ${WORKDIR}
172 rm -f ${B}/BOOT.bin 182 rm -f ${B}/BOOT.bin
173 if [ "${BIF_FILE_PATH}" != "${B}/bootgen.bif" ];then 183 if [ "${BIF_FILE_PATH}" != "${B}/bootgen.bif" ];then
174 BIF_FILE_PATH="${UNPACKDIR}${BIF_FILE_PATH}" 184 BIF_FILE_PATH="${WORKDIR}${BIF_FILE_PATH}"
175 fi 185 fi
176 bootgen -image ${BIF_FILE_PATH} -arch ${BOOTGEN_ARCH} ${BOOTGEN_EXTRA_ARGS} -w -o ${B}/BOOT.bin 186 bootgen -image ${BIF_FILE_PATH} -arch ${BOOTGEN_ARCH} ${BOOTGEN_EXTRA_ARGS} -w -o ${B}/BOOT.bin
177 if [ ! -e ${B}/BOOT.bin ]; then 187 if [ ! -e ${B}/BOOT.bin ]; then
@@ -179,6 +189,18 @@ do_compile() {
179 fi 189 fi
180} 190}
181 191
192do_compile:append:versal() {
193 dd if=/dev/zero bs=256M count=1 > ${B}/qemu-${QEMU_FLASH_TYPE}.bin
194 dd if=${B}/BOOT.bin of=${B}/qemu-${QEMU_FLASH_TYPE}.bin bs=1 seek=0 conv=notrunc
195 dd if=${DEPLOY_DIR_IMAGE}/boot.scr of=${B}/qemu-${QEMU_FLASH_TYPE}.bin bs=1 seek=66584576 conv=notrunc
196}
197
198do_compile:append:versal-net() {
199 dd if=/dev/zero bs=256M count=1 > ${B}/qemu-${QEMU_FLASH_TYPE}.bin
200 dd if=${B}/BOOT.bin of=${B}/qemu-${QEMU_FLASH_TYPE}.bin bs=1 seek=0 conv=notrunc
201 dd if=${DEPLOY_DIR_IMAGE}/boot.scr of=${B}/qemu-${QEMU_FLASH_TYPE}.bin bs=1 seek=66584576 conv=notrunc
202}
203
182do_install() { 204do_install() {
183 install -d ${D}/boot 205 install -d ${D}/boot
184 install -m 0644 ${B}/BOOT.bin ${D}/boot/BOOT.bin 206 install -m 0644 ${B}/BOOT.bin ${D}/boot/BOOT.bin
@@ -186,7 +208,7 @@ do_install() {
186 208
187inherit image-artifact-names 209inherit image-artifact-names
188 210
189QEMUQSPI_BASE_NAME ?= "QEMU_qspi-${MACHINE}${IMAGE_VERSION_SUFFIX}" 211QEMU_FLASH_IMAGE_NAME ?= "qemu-${QEMU_FLASH_TYPE}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
190 212
191BOOTBIN_BASE_NAME ?= "BOOT-${MACHINE}${IMAGE_VERSION_SUFFIX}" 213BOOTBIN_BASE_NAME ?= "BOOT-${MACHINE}${IMAGE_VERSION_SUFFIX}"
192 214
@@ -201,12 +223,18 @@ do_deploy:append:versal () {
201 223
202 install -m 0644 ${B}/BOOT_bh.bin ${DEPLOYDIR}/${BOOTBIN_BASE_NAME}_bh.bin 224 install -m 0644 ${B}/BOOT_bh.bin ${DEPLOYDIR}/${BOOTBIN_BASE_NAME}_bh.bin
203 ln -sf ${BOOTBIN_BASE_NAME}_bh.bin ${DEPLOYDIR}/BOOT-${MACHINE}_bh.bin 225 ln -sf ${BOOTBIN_BASE_NAME}_bh.bin ${DEPLOYDIR}/BOOT-${MACHINE}_bh.bin
226
227 install -m 0644 ${B}/qemu-${QEMU_FLASH_TYPE}.bin ${DEPLOYDIR}/${QEMU_FLASH_IMAGE_NAME}.bin
228 ln -sf ${QEMU_FLASH_IMAGE_NAME}.bin ${DEPLOYDIR}/qemu-${QEMU_FLASH_TYPE}-${MACHINE}.bin
204} 229}
205 230
206do_deploy:append:versal-net () { 231do_deploy:append:versal-net () {
207 232
208 install -m 0644 ${B}/BOOT_bh.bin ${DEPLOYDIR}/${BOOTBIN_BASE_NAME}_bh.bin 233 install -m 0644 ${B}/BOOT_bh.bin ${DEPLOYDIR}/${BOOTBIN_BASE_NAME}_bh.bin
209 ln -sf ${BOOTBIN_BASE_NAME}_bh.bin ${DEPLOYDIR}/BOOT-${MACHINE}_bh.bin 234 ln -sf ${BOOTBIN_BASE_NAME}_bh.bin ${DEPLOYDIR}/BOOT-${MACHINE}_bh.bin
235
236 install -m 0644 ${B}/qemu-${QEMU_FLASH_TYPE}.bin ${DEPLOYDIR}/${QEMU_FLASH_IMAGE_NAME}.bin
237 ln -sf ${QEMU_FLASH_IMAGE_NAME}.bin ${DEPLOYDIR}/qemu-${QEMU_FLASH_TYPE}-${MACHINE}.bin
210} 238}
211 239
212FILES:${PN} += "/boot/BOOT.bin" 240FILES:${PN} += "/boot/BOOT.bin"