]> git.baikalelectronics.ru Git - uboot.git/commitdiff
arm64: zynqmp: Do not include psu_init to U-Boot by default
authorMichal Simek <michal.simek@amd.com>
Fri, 2 Dec 2022 08:18:06 +0000 (09:18 +0100)
committerMichal Simek <michal.simek@amd.com>
Mon, 5 Dec 2022 07:55:55 +0000 (08:55 +0100)
The commit 3b8f882be314 ("Convert CONFIG_ZYNQMP_PSU_INIT_ENABLED to
Kconfig") converted CONFIG_ZYNQMP_PSU_INIT_ENABLED symbol and enabled it by
default which is not correct configuration.
Intention of this config was to have it enabled by default for SPL and
provide an option to users to also do low level initialization directly
from U-Boot.
That's why it is necessary to define second symbol with SPL marking in it
and properly use symbols depends on usage in Makefile.
Also disable ZYNQMP_PSU_INIT_ENABLED from boards which enables it by
default. CONFIG_SPL_ZYNQMP_PSU_INIT_ENABLED is enabled by default when SPL
is enabled.

Reported-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/d5fcbd66b05bf0d7ef594e66464ee23b48c5e4cc.1669969083.git.michal.simek@amd.com
arch/arm/mach-zynqmp/Kconfig
arch/arm/mach-zynqmp/Makefile
board/xilinx/zynqmp/Makefile
configs/avnet_ultrazedev_cc_v1_0_ultrazedev_som_v1_0_defconfig
configs/xilinx_zynqmp_mini_defconfig
configs/xilinx_zynqmp_mini_emmc0_defconfig
configs/xilinx_zynqmp_mini_emmc1_defconfig
configs/xilinx_zynqmp_mini_nand_defconfig
configs/xilinx_zynqmp_mini_nand_single_defconfig
configs/xilinx_zynqmp_mini_qspi_defconfig

index 66045067d2fe1adf1b908f9a9babc2cbb322e5cd..fd6f07715a83a8c4e97bf19ab44afc4c1515ca2a 100644 (file)
@@ -142,7 +142,14 @@ config ZYNQMP_PSU_INIT_ENABLED
        bool "Include psu_init"
        select BOARD_EARLY_INIT_F
        help
-         Include psu_init to full u-boot. SPL include psu_init by default.
+         Include psu_init to full u-boot.
+
+config SPL_ZYNQMP_PSU_INIT_ENABLED
+       bool "Include psu_init in SPL"
+       default y if SPL
+       select BOARD_EARLY_INIT_F
+       help
+         Include psu_init by default in SPL.
 
 config SPL_ZYNQMP_ALT_BOOTMODE_ENABLED
        bool "Overwrite SPL bootmode"
index 4f9f6b56a98a9bb0c15c8724d6742d6d8260a1cd..bb1830c84625a87839827e704be409d31e79c11c 100644 (file)
@@ -8,4 +8,4 @@ obj-y   += cpu.o
 obj-$(CONFIG_MP)       += mp.o
 obj-$(CONFIG_SPL_BUILD) += spl.o handoff.o psu_spl_init.o
 obj-$(CONFIG_SPL_ZYNQMP_DRAM_ECC_INIT) += ecc_spl_init.o
-obj-$(CONFIG_ZYNQMP_PSU_INIT_ENABLED)  += psu_spl_init.o
+obj-$(CONFIG_$(SPL_)ZYNQMP_PSU_INIT_ENABLED)   += psu_spl_init.o
index a91402875332c2dbb6ad7d583aade0a62ce77e0b..732f909fc215674dc1f3f2319328e5525316623c 100644 (file)
@@ -31,11 +31,7 @@ $(warning Put custom psu_init_gpl.c/h to board/xilinx/zynqmp/custom_hw_platform/
 endif
 endif
 
-ifdef_any_of = $(filter-out undefined,$(foreach v,$(1),$(origin $(v))))
-
-ifneq ($(call ifdef_any_of, CONFIG_ZYNQMP_PSU_INIT_ENABLED CONFIG_SPL_BUILD),)
-obj-y += $(init-objs)
-endif
+obj-$(CONFIG_$(SPL_)ZYNQMP_PSU_INIT_ENABLED) += $(init-objs)
 
 ifdef CONFIG_SPL_BUILD
 ifneq ($(CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE),"")
index ce07f1633e04a2cb79ecf7788fbb0dc538fd9165..0a3d710a8b1f0dde5c81a9418428300ef80619b4 100644 (file)
@@ -8,7 +8,6 @@ CONFIG_DEFAULT_DEVICE_TREE="avnet-ultrazedev-cc-v1.0-ultrazedev-som-v1.0"
 CONFIG_SPL=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI=y
-CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_DEBUG_UART=y
 CONFIG_SYS_MEMTEST_START=0x00000000
index 245b6a42b93594e4a0af833638e02b5656f50388..959b14859fefdcd7760295f8d3ef204ab3d3257a 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_SYS_MALLOC_LEN=0x1a00
 CONFIG_ENV_SIZE=0x80
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini"
 CONFIG_SYS_MEM_RSVD_FOR_MMU=y
-CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_SYS_MEMTEST_START=0x00000000
index adf1dae66edea6c95816e9bcbc5959d10ef2e05a..3aa4b6d5b720bd93710ec91cf4f4c221ff528c33 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_ENV_SIZE=0x80
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-emmc0"
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x600
 CONFIG_SPL=y
-CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
index 9d799ad0e3d5f230368e460916e449234638dfad..ecbb7c4f1d17d9b5778bba79bb2fb0615c3d6b5b 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_ENV_SIZE=0x80
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-emmc1"
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x600
 CONFIG_SPL=y
-CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
index 29040a39e97087ecc71b9e74b96c316925971d40..0b1ee4560d97a525ae97fdfcf2256d15a9041a7e 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_SYS_MALLOC_LEN=0x800000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x80
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-nand"
-CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
index 7c17c061d424661d92e06cdd52d67f2f6d0e84a4..c25d5cb371497688abe7fcf0d7d9837284371c85 100644 (file)
@@ -7,7 +7,6 @@ CONFIG_SYS_MALLOC_LEN=0x800000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x80
 CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-nand"
-CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
 CONFIG_SYS_LOAD_ADDR=0x8000000
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
index 513b51998d253586dd451c3a94bc0676928d2db0..af88565be0cc3ed583daf013062ba84a372a5ac6 100644 (file)
@@ -10,7 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="zynqmp-mini-qspi"
 CONFIG_SPL=y
 CONFIG_SYS_MEM_RSVD_FOR_MMU=y
 CONFIG_ZYNQMP_NO_DDR=y
-CONFIG_ZYNQMP_PSU_INIT_ENABLED=y
 # CONFIG_CMD_ZYNQMP is not set
 # CONFIG_PSCI_RESET is not set
 CONFIG_SYS_LOAD_ADDR=0x8000000