diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2015-11-26 18:59:29 +1000 |
---|---|---|
committer | Nathan Rossi <nathan@nathanrossi.com> | 2015-11-26 19:09:17 +1000 |
commit | c91bf97045c3f0187eff32d19840e89dd1157390 (patch) | |
tree | 45e875dfc793d9fd94bd10c88df2c4aed562cab6 | |
parent | 0b2dc91d157f5e105794363ed550e33401b81496 (diff) | |
download | meta-xilinx-c91bf97045c3f0187eff32d19840e89dd1157390.tar.gz |
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 <nathan@nathanrossi.com>
-rw-r--r-- | recipes-bsp/u-boot/u-boot-spl-xlnx_2015.04.bb | 37 | ||||
-rw-r--r-- | recipes-bsp/u-boot/u-boot-spl-zynq-init.inc | 28 | ||||
-rw-r--r-- | recipes-bsp/u-boot/u-boot-xlnx-2015.04.inc | 15 | ||||
-rw-r--r-- | recipes-bsp/u-boot/u-boot-xlnx_2015.04.bb | 16 |
4 files changed, 43 insertions, 53 deletions
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 @@ | |||
1 | include u-boot-xlnx.inc | ||
2 | include u-boot-xlnx-2015.04.inc | ||
3 | |||
4 | COMPATIBLE_MACHINE = "zynq" | ||
5 | |||
6 | PROVIDES = "virtual/boot-bin" | ||
7 | |||
8 | SPL_BINARY = "boot.bin" | ||
9 | UBOOT_MAKE_TARGET ?= "boot.bin" | ||
10 | |||
11 | inherit zynq7-platform-paths | ||
12 | |||
13 | DEPENDS += "virtual/zynq7-platform-init" | ||
14 | |||
15 | do_configure_prepend() { | ||
16 | [ -e ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ] && \ | ||
17 | cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/ | ||
18 | [ -e ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ] && \ | ||
19 | cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/ | ||
20 | } | ||
21 | |||
22 | do_install () { | ||
23 | if [ "x${SPL_BINARY}" != "x" ]; then | ||
24 | install -d ${D}/boot | ||
25 | install ${S}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE} | ||
26 | ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARY} | ||
27 | fi | ||
28 | } | ||
29 | |||
30 | do_deploy () { | ||
31 | if [ "x${SPL_BINARY}" != "x" ]; then | ||
32 | install ${S}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE} | ||
33 | rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK} | ||
34 | ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARY} | ||
35 | ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK} | ||
36 | fi | ||
37 | } | ||
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 @@ | |||
1 | inherit zynq7-platform-paths | ||
2 | |||
3 | do_configure_prepend() { | ||
4 | if ${@bb.utils.contains('DEPENDS', 'virtual/zynq7-platform-init', 'true', 'false', d)}; then | ||
5 | if [ -d ${S}/board/xilinx/zynq/custom_hw_platform ]; then | ||
6 | cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/custom_hw_platform/ | ||
7 | cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/custom_hw_platform/ | ||
8 | else | ||
9 | cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/ | ||
10 | cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/ | ||
11 | fi | ||
12 | fi | ||
13 | } | ||
14 | |||
15 | python () { | ||
16 | # Determine if target machine needs to provide a custom ps7_init_gpl.* | ||
17 | if d.getVar("SOC_FAMILY", True) == "zynq": | ||
18 | if d.getVar("SPL_BINARY", True): | ||
19 | # only add the dependency if u-bopt doesn't already provide the platofmr init files | ||
20 | if not bb.utils.contains("HAS_PS7INIT", d.getVar("UBOOT_MACHINE", True), True, False, d): | ||
21 | # force the dependency on a recipe that provides the platform init files | ||
22 | d.setVar("DEPENDS", "%s virtual/zynq7-platform-init" % d.getVar("DEPENDS", True)) | ||
23 | |||
24 | if d.getVar("SPL_BINARY", True) == "boot.bin": | ||
25 | # Add this for backwards compatiblity | ||
26 | d.setVar("PROVIDES", "%s virtual/boot-bin" % d.getVar("PROVIDES", True)) | ||
27 | } | ||
28 | |||
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 @@ | |||
1 | |||
2 | SRCREV = "1160fbcc619f23bf87cde01ed651566474e17eb9" | ||
3 | PV = "v2015.04${XILINX_EXTENSION}+git${SRCPV}" | ||
4 | |||
5 | FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot-xlnx:" | ||
6 | SRC_URI += " \ | ||
7 | file://zynq-Add-Zynq-PicoZed-board-support.patch \ | ||
8 | file://microblaze-Fix-EMAC-Lite-initialization.patch \ | ||
9 | file://microblaze-generic_defconfig-Disable-configs.patch \ | ||
10 | file://0001-microblaze-Fix-style-issues-in-header-files.patch \ | ||
11 | file://0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch \ | ||
12 | " | ||
13 | |||
14 | LIC_FILES_CHKSUM = "file://README;beginline=1;endline=6;md5=157ab8408beab40cd8ce1dc69f702a6c" | ||
15 | |||
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 @@ | |||
1 | include u-boot-xlnx.inc | 1 | include u-boot-xlnx.inc |
2 | include u-boot-xlnx-2015.04.inc | ||
3 | include u-boot-extra.inc | 2 | include u-boot-extra.inc |
3 | include u-boot-spl-zynq-init.inc | ||
4 | |||
5 | SRCREV = "1160fbcc619f23bf87cde01ed651566474e17eb9" | ||
6 | PV = "v2015.04${XILINX_EXTENSION}+git${SRCPV}" | ||
7 | |||
8 | FILESEXTRAPATHS_prepend := "${THISDIR}/u-boot-xlnx:" | ||
9 | SRC_URI += " \ | ||
10 | file://zynq-Add-Zynq-PicoZed-board-support.patch \ | ||
11 | file://microblaze-Fix-EMAC-Lite-initialization.patch \ | ||
12 | file://microblaze-generic_defconfig-Disable-configs.patch \ | ||
13 | file://0001-microblaze-Fix-style-issues-in-header-files.patch \ | ||
14 | file://0002-microblaze-Fix-C99-gnu99-compatiblity-for-inline-fun.patch \ | ||
15 | " | ||
16 | |||
17 | LIC_FILES_CHKSUM = "file://README;beginline=1;endline=6;md5=157ab8408beab40cd8ce1dc69f702a6c" | ||
4 | 18 | ||
5 | UBOOT_ENV_zc702-zynq7 = "uEnv" | 19 | UBOOT_ENV_zc702-zynq7 = "uEnv" |
6 | UBOOT_ENV_zedboard-zynq7 = "uEnv" | 20 | UBOOT_ENV_zedboard-zynq7 = "uEnv" |