diff --git a/board/zynq/readme.txt b/board/zynq/readme.txt index 87df7236f0..085f47b09b 100644 --- a/board/zynq/readme.txt +++ b/board/zynq/readme.txt @@ -71,17 +71,18 @@ you need to add them by yourself. 1) Start with a defconfig supported by Buildroot (e.g. Zedboard) make zynq_zed_defconfig -2) make uboot-menuconfig - Visit the following menu and enable CONFIG_XILINX_PS_INIT_FILE +2) make menuconfig + Visit the following menu to enable BR2_TARGET_UBOOT_ZYNQ - ARM architecture ---> - [*] Zynq/ZynqMP PS init file(s) location + Bootloaders ---> + U-Boot ---> + [*] Boot on the Xilinx Zynq SoCs -3) Copy ps7_init_gpl.c/h generated by the Xilinx Vivado tools into - output/build/uboot-custom/board/xilinx/zynq/custom_hw_platform/ +3) make menuconfig + In the same menu, configure BR2_TARGET_UBOOT_ZYNQ_PS7_INIT_FILE + + Bootloaders ---> + U-Boot ---> + () Custom ps7_init_gpl file 4) make - -Note: The files in step 3 will need to be re-copied after cleaning the -output directory and at this time, there is no way to save them as -part of the buildroot configuration, except as a U-Boot patch. diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in index 52e6050c81..18b58753a7 100644 --- a/boot/uboot/Config.in +++ b/boot/uboot/Config.in @@ -701,6 +701,40 @@ config BR2_TARGET_UBOOT_ZYNQMP_PSU_INIT_FILE endif +config BR2_TARGET_UBOOT_ZYNQ + bool "Boot on the Xilinx Zynq SoCs" + depends on BR2_arm + help + Enable options specific to the Xilinx Zynq family of SoCs. + +config BR2_TARGET_UBOOT_ZYNQ_PS7_INIT_FILE + string "Custom ps7_init_gpl file" + depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG + depends on BR2_TARGET_UBOOT_ZYNQ + help + On Zynq the booloader is responsible for some basic + initializations, such as enabling peripherals and + configuring pinmuxes. The ps7_init_gpl.c file (and, + optionally, ps7_init_gpl.h) contains the code for such + initializations. + + Although U-Boot contains ps7_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 generate custom files using + the Xilinx Vivado development tools. + + Set this variable to the path to your ps7_init_gpl.c file + (e.g. "board/myboard/ps7_init_gpl.c"). ps7_init_gpl.h, if + needed, should be in the same directory. U-Boot will build + and link the user-provided file instead of the built-in. + + Leave empty to use the files provided by U-Boot. + + This feature requires commit + 6da4f67ad09cd8b311d77b2b04e557b7ef65b56c from upstream + U-Boot, available from versions after 2018.07. + config BR2_TARGET_UBOOT_ALTERA_SOCFPGA_IMAGE_CRC bool "CRC image for Altera SoC FPGA (mkpimage)" depends on BR2_arm diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk index 2796b0a310..c92568a559 100644 --- a/boot/uboot/uboot.mk +++ b/boot/uboot/uboot.mk @@ -520,6 +520,17 @@ endif endif # BR2_TARGET_UBOOT_ZYNQMP +ifeq ($(BR2_TARGET_UBOOT_ZYNQ),y) +UBOOT_ZYNQ_PS7_INIT = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQ_PS7_INIT_FILE)) +UBOOT_ZYNQ_PS7_INIT_PATH = $(shell readlink -f $(UBOOT_ZYNQ_PS7_INIT)) + +ifneq ($(UBOOT_ZYNQ_PS7_INIT),) +define UBOOT_ZYNQ_KCONFIG_PS7_INIT + $(call KCONFIG_SET_OPT,CONFIG_XILINX_PS_INIT_FILE,"$(UBOOT_ZYNQ_PS7_INIT_PATH)") +endef +endif +endif # BR2_TARGET_UBOOT_ZYNQ + define UBOOT_INSTALL_OMAP_IFT_IMAGE cp -dpf $(@D)/$(UBOOT_BIN_IFT) $(BINARIES_DIR)/ endef @@ -562,6 +573,7 @@ define UBOOT_KCONFIG_FIXUP_CMDS $(UBOOT_ZYNQMP_KCONFIG_PMUFW) $(UBOOT_ZYNQMP_KCONFIG_PM_CFG) $(UBOOT_ZYNQMP_KCONFIG_PSU_INIT) + $(UBOOT_ZYNQ_KCONFIG_PS7_INIT) $(UBOOT_KCONFIG_DEFAULT_ENV_FILE) endef