@@ -379,6 +379,28 @@ config BR2_TARGET_UBOOT_ZYNQMP
(downloaded by the zynqmp-pmufw-binaries package) formatted
with the Xilinx-specific format.
+if BR2_TARGET_UBOOT_ZYNQMP
+config BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR
+ string "Custom psu_init_gpl files"
+ help
+ On ZynqMP the booloader is responsible for some basic
+ initializations, such as enabling peripherals and configuring
+ pinmuxes. The psu_init_gpl.c file (and, optionally,
+ psu_init_gpl.h), generated by the Xilinx development tools,
+ contains the code for such initializations.
+
+ Although U-Boot contains psu_init_gpl.c files for some boards,
+ each of them describes only one specific configuration. Users of
+ a different board, or needing a different configuration, can
+ provide a different file here, and U-Boot will build and link
+ the user-provided file instead of the built-in one.
+
+ Set this variable to the path where the psu_init_gpl.c file (and
+ psu_init_gpl.h if needed) is located. Leave empty to use the
+ files provided by U-Boot.
+
+endif
+
config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC
bool "CRC image for Altera SoC FPGA (mkpimage)"
depends on BR2_arm
@@ -289,6 +289,18 @@ define UBOOT_ZYNQMP_COPY_PMUFW
endef
UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PMUFW
+ifneq ($(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR)),)
+define UBOOT_ZYNQMP_COPY_PSU_INIT
+# In U-Boot's board/xilinx/zynqmp/Makefile the bundled psu_init_gpl.c
+# has precedence over ours if placed in a subdir whose name matches
+# CONFIG_DEFAULT_DEVICE_TREE. Delete them all to be sure we use ours.
+ rm -f $(@D)/board/xilinx/zynqmp/*/psu_init*.[ch]
+ cp $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR))/psu_init_gpl.[ch] \
+ $(@D)/board/xilinx/zynqmp/
+endef
+UBOOT_PRE_CONFIGURE_HOOKS += UBOOT_ZYNQMP_COPY_PSU_INIT
+endif # BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_DIR
+
endif # BR2_TARGET_UBOOT_ZYNQMP
define UBOOT_INSTALL_OMAP_IFT_IMAGE
U-Boot SPL configures pinmuxes, clocks and other low-level devices. On the Xilinx ZynqMP SoCs the code to do this resides in a file called psu_init_gpl.c which is initially generated by the Xilinx development tools. Add an option to pass these files from the outside (e.g. in the board files). Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> --- Changes v1 -> v2: - split from a larger patch doing 2 things - document the option of having psu_init_gpl.c without .h --- boot/uboot/Config.in | 22 ++++++++++++++++++++++ boot/uboot/uboot.mk | 12 ++++++++++++ 2 files changed, 34 insertions(+)