From bb928649a4829ab50daf9bf8ccf4f35f815003b1 Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Sat, 10 Sep 2016 00:04:24 +1000 Subject: u-boot-spl-zynq-init.inc: Enable the FORCE_PS7INIT for new U-Boot The directory structure in U-Boot for platform init files has changed in more recent versions of U-Boot. The new naming scheme uses the name of the device-tree (that is provided in U-Boot) to determine the name of the directory in board/xilinx/zynq/. This patch changes how FORCE_PS7INIT functions, such that it is a toggle instead of requiring the target directory name. FORCE_PS7INIT is changed to overwrite all the ps7_init_gpl* files in the board/xilinx/zynq/* directories. This removes the need to specify the target directory/config and also avoids any issues with the differences in names between older and newer U-Boot versions. Additionally this patch adds a [doc] string for the variable. Signed-off-by: Nathan Rossi --- recipes-bsp/u-boot/u-boot-spl-zynq-init.inc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 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 3d4b75ef..cc06de6c 100644 --- a/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc +++ b/recipes-bsp/u-boot/u-boot-spl-zynq-init.inc @@ -9,14 +9,19 @@ do_configure_prepend() { 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 - if [ -n "${FORCE_PS7INIT}" -a -d "${S}/board/xilinx/zynq/${FORCE_PS7INIT}_hw_platform/" ]; then - # overwrite the existing platforms ps7_init files - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h ${S}/board/xilinx/zynq/${FORCE_PS7INIT}_hw_platform/ - cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c ${S}/board/xilinx/zynq/${FORCE_PS7INIT}_hw_platform/ + if [ -n "${FORCE_PS7INIT}" ]; then + # overwrite all the existing platforms ps7_init files, this is a shotgun approach and only works due to + # u-boot being built for each machine seperately with seperate source directories. + for i in ${S}/board/xilinx/zynq/*/; do + cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.h $i + cp ${PLATFORM_INIT_STAGE_DIR}/ps7_init_gpl.c $i + done fi fi } +FORCE_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." + python () { # Determine if target machine needs to provide a custom ps7_init_gpl.* if d.getVar("SOC_FAMILY", True) == "zynq": -- cgit v1.2.3-54-g00ecf