From c91bf97045c3f0187eff32d19840e89dd1157390 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Thu, 26 Nov 2015 18:59:29 +1000 Subject: u-boot-xlnx_2015.04: Refactor U-Boot SPL generation Refactor the way the recipe handles depending, configuring and building SPL with external or internally provided Zynq Platform Init code. This refactor allows for the handling of all three configuration cases for how the platform init files are provided, as well as simplifying how machines define whether SPL/boot.bin can be built. This change also reduces the need for a seperate SPL recipe and makes it much simpler to have multiple recipes that can provide this feature. Signed-off-by: Nathan Rossi --- recipes-bsp/u-boot/u-boot-spl-xlnx_2015.04.bb | 37 --------------------------- recipes-bsp/u-boot/u-boot-spl-zynq-init.inc | 28 ++++++++++++++++++++ recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc | 15 ----------- recipes-bsp/u-boot/u-boot-xlnx_2015.04.bb | 16 +++++++++++- 4 files changed, 43 insertions(+), 53 deletions(-) delete mode 100644 recipes-bsp/u-boot/u-boot-spl-xlnx_2015.04.bb create mode 100644 recipes-bsp/u-boot/u-boot-spl-zynq-init.inc delete mode 100644 recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc diff --git a/recipes-bsp/u-boot/u-boot-spl-xlnx_2015.04.bb b/recipes-bsp/u-boot/u-boot-spl-xlnx_2015.04.bb deleted file mode 100644 index 052a65d4..00000000 --- a/recipes-bsp/u-boot/u-boot-spl-xlnx_2015.04.bb +++ /dev/null @@ -1,37 +0,0 @@ -include u-boot-xlnx.inc -include u-boot-xlnx-2015.04.inc - -COMPATIBLE_MACHINE = "zynq" - -PROVIDES = "virtual/boot-bin" - -SPL_BINARY = "boot.bin" -UBOOT_MAKE_TARGET ?= "boot.bin" - -inherit zynq7-platform-paths - -DEPENDS += "virtual/zynq7-platform-init" - -do_configure_prepend() { - [ -e ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ] && \ - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/ - [ -e ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ] && \ - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/ -} - -do_install () { - if [ "x${SPL_BINARY}" != "x" ]; then - install -d ${D}/boot - install ${S}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} - ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARY} - fi -} - -do_deploy () { - if [ "x${SPL_BINARY}" != "x" ]; then - install ${S}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} - rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK} - ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARY} - ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK} - fi -} diff --git a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc new file mode 100644 index 00000000..9e8cef05 --- /dev/null +++ b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc @@ -0,0 +1,28 @@ +inherit zynq7-platform-paths + +do_configure_prepend() { + if ${@bb.utils.contains('DEPENDS', 'virtual/zynq7-platform-init', 'true', 'false', d)}; then + if [ -d ${S}/board/xilinx/zynq/custom_hw_platform ]; then + cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/custom_hw_platform/ + cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/custom_hw_platform/ + else + cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/ + cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/ + fi + fi +} + +python () { + # Determine if target machine needs to provide a custom ps7_init_gpl.* + if d.getVar("SOC_FAMILY", True) == "zynq": + if d.getVar("SPL_BINARY", True): + # only add the dependency if u-bopt doesn't already provide the platofmr init files + if not bb.utils.contains("HAS_PS7INIT", d.getVar("UBOOT_MACHINE", True), True, False, d): + # force the dependency on a recipe that provides the platform init files + d.setVar("DEPENDS", "%s virtual/zynq7-platform-init" % d.getVar("DEPENDS", True)) + + if d.getVar("SPL_BINARY", True) == "boot.bin": + # Add this for backwards compatiblity + d.setVar("PROVIDES", "%s virtual/boot-bin" % d.getVar("PROVIDES", True)) +} + diff --git a/recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc b/recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc deleted file mode 100644 index 28c4faa1..00000000 --- a/recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc +++ /dev/null @@ -1,15 +0,0 @@ - -SRCREV = "1160fbcc619f23bf87cde01ed651566474e17eb9" -PV = "v2015.04${XILINX_EXTENSION}+git${SRCPV}" - -FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot-xlnx:" -SRC_URI += " \ - file://zynq-Add-Zynq-PicoZed-board-support.patch \ - file://microblaze-Fix-EMAC-Lite-initialization.patch \ - file://microblaze-generic_defconfig-Disable-configs.patch \ - file://0001-microblaze-Fix-style-issues-in-header-files.patch \ - file://0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch \ - " - -LIC_FILES_CHKSUM = "file://README;beginline=1;endline=6;md5=157ab8408beab40cd8ce1dc69f702a6c" - diff --git a/recipes-bsp/u-boot/u-boot-xlnx_2015.04.bb b/recipes-bsp/u-boot/u-boot-xlnx_2015.04.bb index a8bd128c..6bf9ba9a 100644 --- a/recipes-bsp/u-boot/u-boot-xlnx_2015.04.bb +++ b/recipes-bsp/u-boot/u-boot-xlnx_2015.04.bb @@ -1,6 +1,20 @@ include u-boot-xlnx.inc -include u-boot-xlnx-2015.04.inc include u-boot-extra.inc +include u-boot-spl-zynq-init.inc + +SRCREV = "1160fbcc619f23bf87cde01ed651566474e17eb9" +PV = "v2015.04${XILINX_EXTENSION}+git${SRCPV}" + +FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot-xlnx:" +SRC_URI += " \ + file://zynq-Add-Zynq-PicoZed-board-support.patch \ + file://microblaze-Fix-EMAC-Lite-initialization.patch \ + file://microblaze-generic_defconfig-Disable-configs.patch \ + file://0001-microblaze-Fix-style-issues-in-header-files.patch \ + file://0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch \ + " + +LIC_FILES_CHKSUM = "file://README;beginline=1;endline=6;md5=157ab8408beab40cd8ce1dc69f702a6c" UBOOT_ENV_zc702-zynq7 = "uEnv" UBOOT_ENV_zedboard-zynq7 = "uEnv" -- cgit v1.2.3-54-g00ecf