From 5c22bdc0e1c0e25a87bf2f7feb61bd12f5d1dba7 Mon Sep 17 00:00:00 2001 From: Varalaxmi Bingi Date: Fri, 29 Apr 2022 14:49:20 +0530 Subject: u-boot-xlnx_%.bbappend: reorganizing u-boot recipe code This patch will move the u-boot code from meta-xilinx-tools to meta-xilinx. Not all flows use the meta-xilinx-tools layer. Signed-off-by: Varalaxmi Bingi Signed-off-by: Mark Hatle (cherry picked from commit ea12b72b50072cf43ce0aa142100d2a3166f21e7) Signed-off-by: Mark Hatle --- .../recipes-bsp/u-boot/u-boot-xlnx.inc | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'meta-xilinx-core/recipes-bsp') diff --git a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc index d9113cc7..d152c15c 100644 --- a/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc +++ b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc @@ -18,3 +18,43 @@ B = "${WORKDIR}/build" FILESEXTRAPATHS:prepend := "${THISDIR}/u-boot:" SYSROOT_DIRS += "/boot" + +BASE_DTS ?= "${@os.path.basename(d.getVar('CONFIG_DTFILE') or "system-top")}" +DTB_PATH ?= "/boot/devicetree/" +DTB_NAME ?= "" + +EXTRA_OEMAKE += "${@'EXT_DTB=${RECIPE_SYSROOT}/${DTB_PATH}/${DTB_NAME}' if (d.getVar('DTB_NAME') != '') else '' }" + +python __anonymous () { + #check if there are any dtb providers + providerdtb = d.getVar("PREFERRED_PROVIDER_virtual/dtb") + if providerdtb: + d.appendVarFlag('do_configure', 'depends', ' virtual/dtb:do_populate_sysroot') + if d.getVar("DTB_NAME") is not None: + d.setVar('DTB_NAME', d.getVar('BASE_DTS')+ '.dtb') + + if d.getVar('UBOOT_IMAGE_BLOB') == "1": + d.appendVarFlag('do_compile', 'postfuncs', ' do_blob_generate') +} + +UBOOTELF_NODTB_IMAGE ?= "u-boot-nodtb.elf" +UBOOTELF_NODTB_BINARY ?= "u-boot" +do_deploy:prepend() { + cd ${B} + + if [ -f "${UBOOTELF_NODTB_BINARY}" ]; then + install ${UBOOTELF_NODTB_BINARY} ${DEPLOYDIR}/${UBOOTELF_NODTB_IMAGE} + fi + + #following lines are from uboot-sign.bbclass, vars are defined there + if [ -e "${UBOOT_DTB_BINARY}" ]; then + install ${UBOOT_DTB_BINARY} ${DEPLOYDIR}/${UBOOT_DTB_IMAGE} + ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_BINARY} + ln -sf ${UBOOT_DTB_IMAGE} ${DEPLOYDIR}/${UBOOT_DTB_SYMLINK} + fi + if [ -f "${UBOOT_NODTB_BINARY}" ]; then + install ${UBOOT_NODTB_BINARY} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE} + ln -sf ${UBOOT_NODTB_IMAGE} ${DEPLOYDIR}/${UBOOT_NODTB_SYMLINK} + ln -sf ${UBOOT_NODTB_IMAGE} ${DEPLOYDIR}/${UBOOT_NODTB_BINARY} + fi +} -- cgit v1.2.3-54-g00ecf