summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-bsp/u-boot/u-boot-spl-zynq-init.inc69
-rw-r--r--recipes-bsp/u-boot/u-boot-xlnx-dev.bb2
2 files changed, 36 insertions, 35 deletions
diff --git a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
index 6fd6559d..be92de5c 100644
--- a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
+++ b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
@@ -1,48 +1,49 @@
1inherit xilinx-platform-init 1inherit xilinx-platform-init
2 2
3FORCE_PLATFORM_INIT[doc] = "This variable is used to force the overriding of all platform init files in u-boot source."
4
3PLATFORM_BOARD_DIR ?= "" 5PLATFORM_BOARD_DIR ?= ""
4PLATFORM_BOARD_DIR_zynq = "board/xilinx/zynq" 6PLATFORM_BOARD_DIR_zynq = "board/xilinx/zynq"
5PLATFORM_BOARD_DIR_zynqmp = "board/xilinx/zynqmp" 7PLATFORM_BOARD_DIR_zynqmp = "board/xilinx/zynqmp"
6 8
7do_configure_prepend() { 9do_zynq_platform_init() {
8 if ${@bb.utils.contains('DEPENDS', 'virtual/xilinx-platform-init', 'true', 'false', d)}; then 10 for f in ${PLATFORM_INIT_FILES}; do
9 for f in ${PLATFORM_INIT_FILES}; do 11 if [ -d "${S}/${PLATFORM_BOARD_DIR}/custom_hw_platform" ]; then
10 if [ -d "${S}/${PLATFORM_BOARD_DIR}/custom_hw_platform" ]; then 12 cp ${PLATFORM_INIT_STAGE_DIR}/$f ${S}/${PLATFORM_BOARD_DIR}/custom_hw_platform/
11 cp ${PLATFORM_INIT_STAGE_DIR}/$f ${S}/${PLATFORM_BOARD_DIR}/custom_hw_platform/ 13 else
12 else 14 cp ${PLATFORM_INIT_STAGE_DIR}/$f ${S}/${PLATFORM_BOARD_DIR}/
13 cp ${PLATFORM_INIT_STAGE_DIR}/$f ${S}/${PLATFORM_BOARD_DIR}/ 15 fi
14 fi 16 # Newer u-boot sources use the init files in a sub directory named
15 # Newer u-boot sources use the init files in a sub directory named 17 # based on the name of the device tree. This is not straight forward to
16 # based on the name of the device tree. This is not straight 18 # detect. Instead of detecting just overwrite all the platform init
17 # forward to detect. Instead of detecting just overwrite all the 19 # files so that the correct one is always used. This shotgun approach
18 # platform init files so that the correct one is always used. This 20 # only works due to this recipe being machine arch specific. Do this
19 # shotgun approach only works due to this recipe being machine arch 21 # overwrite un-conditionally as there is no guarantees that the chosen
20 # specific. Do this overwrite un-conditionally as there is no 22 # board config does not have the device tree config set.
21 # guarantees that the chosen board config does not have the device 23 for i in ${S}/${PLATFORM_BOARD_DIR}/*/; do
22 # tree config set. 24 [ -d $i ] && cp ${PLATFORM_INIT_STAGE_DIR}/$f $i
23 for i in ${S}/${PLATFORM_BOARD_DIR}/*/; do
24 [ -d $i ] && cp ${PLATFORM_INIT_STAGE_DIR}/$f $i
25 done
26 done 25 done
27 fi 26 done
28} 27}
29 28
30FORCE_PLATFORM_INIT[doc] = "This variable is used to force the overriding of all platform init files in u-boot source."
31
32python () { 29python () {
33 hasconfigs = (d.getVar("HAS_PLATFORM_INIT") or "").split() + (d.getVar("HAS_PS7INIT") or "").split() 30 # strip the tail _config/_defconfig for better comparison
34 forceoverride = (d.getVar("FORCE_PLATFORM_INIT") == "1") or (d.getVar("FORCE_PS7INIT")) 31 def strip_config_name(c):
32 for i in ["_config", "_defconfig"]:
33 if c.endswith(i):
34 return c[0:len(c) - len(i)]
35 return c
35 36
36 # Determine if target machine needs to provide a custom platform init files 37 # Determine if target machine needs to provide a custom platform init files
37 if d.getVar("SOC_FAMILY") in ["zynq", "zynqmp"]: 38 if d.getVar("SPL_BINARY") and d.getVar("SOC_FAMILY") in ["zynq", "zynqmp"]:
38 if d.getVar("SPL_BINARY"): 39 hasconfigs = [strip_config_name(c) for c in (d.getVar("HAS_PLATFORM_INIT") or "").split()]
39 # only add the dependency if u-boot doesn't already provide the platform init files 40 currentconfig = strip_config_name(d.getVar("UBOOT_MACHINE"))
40 if forceoverride or not (d.getVar("UBOOT_MACHINE") in hasconfigs):
41 # force the dependency on a recipe that provides the platform init files
42 d.appendVar("DEPENDS", " virtual/xilinx-platform-init")
43 41
44 if d.getVar("SPL_BINARY") == "boot.bin": 42 # only add the dependency if u-boot doesn't already provide the platform init files
45 # Add this for backwards compatibility 43 if (currentconfig not in hasconfigs) or (d.getVar("FORCE_PLATFORM_INIT") == "1"):
46 d.setVar("PROVIDES", "%s virtual/boot-bin" % d.getVar("PROVIDES")) 44 # force the dependency on a recipe that provides the platform init files
45 d.appendVar("DEPENDS", " virtual/xilinx-platform-init")
46 # setup task to modify platform init after unpack and before configure
47 bb.build.addtask("do_zynq_platform_init", "do_configure", "do_prepare_recipe_sysroot", d)
47} 48}
48 49
diff --git a/recipes-bsp/u-boot/u-boot-xlnx-dev.bb b/recipes-bsp/u-boot/u-boot-xlnx-dev.bb
index 7653da5a..3e40bfa1 100644
--- a/recipes-bsp/u-boot/u-boot-xlnx-dev.bb
+++ b/recipes-bsp/u-boot/u-boot-xlnx-dev.bb
@@ -18,7 +18,7 @@ SRCREV ?= "${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/bootloader", "u-b
18PV = "${UBRANCH}-xilinx-dev+git${SRCPV}" 18PV = "${UBRANCH}-xilinx-dev+git${SRCPV}"
19 19
20# Newer versions of u-boot have support for these 20# Newer versions of u-boot have support for these
21HAS_PS7INIT ?= " \ 21HAS_PLATFORM_INIT ?= " \
22 zynq_microzed_config \ 22 zynq_microzed_config \
23 zynq_zed_config \ 23 zynq_zed_config \
24 zynq_zc702_config \ 24 zynq_zc702_config \