diff options
| author | Nathan Rossi <nathan@nathanrossi.com> | 2017-11-14 23:15:23 +1000 |
|---|---|---|
| committer | Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | 2017-11-21 11:19:00 -0800 |
| commit | b302f65c8ab5bd030d2aa21896e8028e584d19dc (patch) | |
| tree | 4c660882d996cea2aa6ecea04ccfdbe87fe471d9 | |
| parent | eb0abe02308a8c10a6bb7d77e0d29a343d710cb5 (diff) | |
| download | meta-xilinx-b302f65c8ab5bd030d2aa21896e8028e584d19dc.tar.gz | |
u-boot-spl-zynq-init.inc: Use task and rework logic
Change the include so that is adds a task for platform-init setup when
required. This avoids the need to modify the do_configure task which
prevents changes to its taskhash and avoids issues with taskhash
modification when the meta-xilinx layer is added but no configuration is
changed or used from it.
Improve the logic around how configs are detected such that
UBOOT_MACHINE can specify either the make target or the defconfig file
name (e.g. *_config or *_defconfig). U-Boot and u-boot.inc accept both
targets as valid configs since the values are passed directory to
U-Boot's kbuild/kconfig.
This change also drops compatibility with the older variable names
HAS_PS7INIT and FORCE_PS7INIT. Additionally the 'virtual/boot-bin'
provide logic was broken in most cases since SPL_BINARY =
"spl/boot.bin", so remove it.
Clean up use of tabs in python.
Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
| -rw-r--r-- | recipes-bsp/u-boot/u-boot-spl-zynq-init.inc | 69 | ||||
| -rw-r--r-- | recipes-bsp/u-boot/u-boot-xlnx-dev.bb | 2 |
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 @@ | |||
| 1 | inherit xilinx-platform-init | 1 | inherit xilinx-platform-init |
| 2 | 2 | ||
| 3 | FORCE_PLATFORM_INIT[doc] = "This variable is used to force the overriding of all platform init files in u-boot source." | ||
| 4 | |||
| 3 | PLATFORM_BOARD_DIR ?= "" | 5 | PLATFORM_BOARD_DIR ?= "" |
| 4 | PLATFORM_BOARD_DIR_zynq = "board/xilinx/zynq" | 6 | PLATFORM_BOARD_DIR_zynq = "board/xilinx/zynq" |
| 5 | PLATFORM_BOARD_DIR_zynqmp = "board/xilinx/zynqmp" | 7 | PLATFORM_BOARD_DIR_zynqmp = "board/xilinx/zynqmp" |
| 6 | 8 | ||
| 7 | do_configure_prepend() { | 9 | do_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 | ||
| 30 | FORCE_PLATFORM_INIT[doc] = "This variable is used to force the overriding of all platform init files in u-boot source." | ||
| 31 | |||
| 32 | python () { | 29 | python () { |
| 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 | |||
| 18 | PV = "${UBRANCH}-xilinx-dev+git${SRCPV}" | 18 | PV = "${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 |
| 21 | HAS_PS7INIT ?= " \ | 21 | HAS_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 \ |
