summaryrefslogtreecommitdiffstats
path: root/recipes-bsp
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2017-01-14 21:38:18 +1000
committerNathan Rossi <nathan@nathanrossi.com>2017-04-28 00:22:54 +1000
commit807626359d4de89f0dffedec29ec19cb78899cf4 (patch)
tree663dc949dfa39d7c29ef3c5b5f9373735175d908 /recipes-bsp
parentaa0b08892caf05f8ac35e56db5fef104538042bc (diff)
downloadmeta-xilinx-807626359d4de89f0dffedec29ec19cb78899cf4.tar.gz
u-boot-spl-zynq-init.inc: Add support for ZynqMP
Update to using the xilinx-platform-init.bbclass and depending on the 'virtual/xilinx-platform-init' provider. This allows for more generic support of platform-init (between Zynq7, ZynqMP and any future targets). This change also renames some of the variables used for defining the source of the platform-init files for SPL. Specifically HAS_PS7INIT is renamed to HAS_PLATFORM_INIT, and FORCE_PS7INIT is renamed to FORCE_PLATFORM_INIT. However for compatibility the existing variables still function as expected. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/u-boot/u-boot-spl-zynq-init.inc62
-rw-r--r--recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb2
-rw-r--r--recipes-bsp/u-boot/u-boot_%.bbappend2
3 files changed, 38 insertions, 28 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 cc06de6c..6fd6559d 100644
--- a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
+++ b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc
@@ -1,38 +1,48 @@
1inherit zynq7-platform-paths 1inherit xilinx-platform-init
2
3PLATFORM_BOARD_DIR ?= ""
4PLATFORM_BOARD_DIR_zynq = "board/xilinx/zynq"
5PLATFORM_BOARD_DIR_zynqmp = "board/xilinx/zynqmp"
2 6
3do_configure_prepend() { 7do_configure_prepend() {
4 if ${@bb.utils.contains('DEPENDS', 'virtual/zynq7-platform-init', 'true', 'false', d)}; then 8 if ${@bb.utils.contains('DEPENDS', 'virtual/xilinx-platform-init', 'true', 'false', d)}; then
5 if [ -d "${S}/board/xilinx/zynq/custom_hw_platform" ]; then 9 for f in ${PLATFORM_INIT_FILES}; do
6 cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/custom_hw_platform/ 10 if [ -d "${S}/${PLATFORM_BOARD_DIR}/custom_hw_platform" ]; then
7 cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/custom_hw_platform/ 11 cp ${PLATFORM_INIT_STAGE_DIR}/$f ${S}/${PLATFORM_BOARD_DIR}/custom_hw_platform/
8 else 12 else
9 cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/ 13 cp ${PLATFORM_INIT_STAGE_DIR}/$f ${S}/${PLATFORM_BOARD_DIR}/
10 cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/ 14 fi
11 fi 15 # Newer u-boot sources use the init files in a sub directory named
12 if [ -n "${FORCE_PS7INIT}" ]; then 16 # based on the name of the device tree. This is not straight
13 # overwrite all the existing platforms ps7_init files, this is a shotgun approach and only works due to 17 # forward to detect. Instead of detecting just overwrite all the
14 # u-boot being built for each machine seperately with seperate source directories. 18 # platform init files so that the correct one is always used. This
15 for i in ${S}/board/xilinx/zynq/*/; do 19 # shotgun approach only works due to this recipe being machine arch
16 cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h $i 20 # specific. Do this overwrite un-conditionally as there is no
17 cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c $i 21 # guarantees that the chosen board config does not have the device
22 # tree config set.
23 for i in ${S}/${PLATFORM_BOARD_DIR}/*/; do
24 [ -d $i ] && cp ${PLATFORM_INIT_STAGE_DIR}/$f $i
18 done 25 done
19 fi 26 done
20 fi 27 fi
21} 28}
22 29
23FORCE_PS7INIT[doc] = "This variable is used to force the overriding of all ps7_init_gpl.* files in u-boot source with what is provided by virtual/zynq7-platform-init." 30FORCE_PLATFORM_INIT[doc] = "This variable is used to force the overriding of all platform init files in u-boot source."
24 31
25python () { 32python () {
26 # Determine if target machine needs to provide a custom ps7_init_gpl.* 33 hasconfigs = (d.getVar("HAS_PLATFORM_INIT") or "").split() + (d.getVar("HAS_PS7INIT") or "").split()
27 if d.getVar("SOC_FAMILY", True) == "zynq": 34 forceoverride = (d.getVar("FORCE_PLATFORM_INIT") == "1") or (d.getVar("FORCE_PS7INIT"))
28 if d.getVar("SPL_BINARY", True): 35
29 # only add the dependency if u-bopt doesn't already provide the platform init files 36 # Determine if target machine needs to provide a custom platform init files
30 if d.getVar("FORCE_PS7INIT", True) or not bb.utils.contains("HAS_PS7INIT", d.getVar("UBOOT_MACHINE", True), True, False, d): 37 if d.getVar("SOC_FAMILY") in ["zynq", "zynqmp"]:
38 if d.getVar("SPL_BINARY"):
39 # only add the dependency if u-boot doesn't already provide the platform init files
40 if forceoverride or not (d.getVar("UBOOT_MACHINE") in hasconfigs):
31 # force the dependency on a recipe that provides the platform init files 41 # force the dependency on a recipe that provides the platform init files
32 d.setVar("DEPENDS", "%s virtual/zynq7-platform-init" % d.getVar("DEPENDS", True)) 42 d.appendVar("DEPENDS", " virtual/xilinx-platform-init")
33 43
34 if d.getVar("SPL_BINARY", True) == "boot.bin": 44 if d.getVar("SPL_BINARY") == "boot.bin":
35 # Add this for backwards compatiblity 45 # Add this for backwards compatibility
36 d.setVar("PROVIDES", "%s virtual/boot-bin" % d.getVar("PROVIDES", True)) 46 d.setVar("PROVIDES", "%s virtual/boot-bin" % d.getVar("PROVIDES"))
37} 47}
38 48
diff --git a/recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb b/recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb
index 5f385376..99ce95a0 100644
--- a/recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb
+++ b/recipes-bsp/u-boot/u-boot-xlnx_2016.4.bb
@@ -27,7 +27,7 @@ SRC_URI_append_zc702-zynq7 = " file://uEnv.txt"
27SRC_URI_append_zedboard-zynq7 = " file://uEnv.txt" 27SRC_URI_append_zedboard-zynq7 = " file://uEnv.txt"
28 28
29# u-boot 2016.07 has support for these 29# u-boot 2016.07 has support for these
30HAS_PS7INIT ?= " \ 30HAS_PLATFORM_INIT ?= " \
31 zynq_microzed_config \ 31 zynq_microzed_config \
32 zynq_zed_config \ 32 zynq_zed_config \
33 zynq_zc702_config \ 33 zynq_zc702_config \
diff --git a/recipes-bsp/u-boot/u-boot_%.bbappend b/recipes-bsp/u-boot/u-boot_%.bbappend
index 85136706..b8522369 100644
--- a/recipes-bsp/u-boot/u-boot_%.bbappend
+++ b/recipes-bsp/u-boot/u-boot_%.bbappend
@@ -1,7 +1,7 @@
1include u-boot-spl-zynq-init.inc 1include u-boot-spl-zynq-init.inc
2 2
3# u-boot 2016.11 has support for these 3# u-boot 2016.11 has support for these
4HAS_PS7INIT ??= " \ 4HAS_PLATFORM_INIT ??= " \
5 zynq_microzed_config \ 5 zynq_microzed_config \
6 zynq_zed_config \ 6 zynq_zed_config \
7 zynq_zc702_config \ 7 zynq_zc702_config \