From: Tom Rini Date: Fri, 11 Oct 2024 18:23:25 +0000 (-0600) Subject: Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD" X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=47e544f576699ca4630e20448db6a05178960697;p=u-boot.git Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD" Simon Glass says: When the SPL build-phase was first created it was designed to solve a particular problem (the need to init SDRAM so that U-Boot proper could be loaded). It has since expanded to become an important part of U-Boot, with three phases now present: TPL, VPL and SPL Due to this history, the term 'SPL' is used to mean both a particular phase (the one before U-Boot proper) and all the non-proper phases. This has become confusing. For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL' phases, not just SPL. So code which can only be compiled for actual SPL, for example, must use something like this: #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD) In Makefiles we have similar issues. SPL_ has been used as a variable which expands to either SPL_ or nothing, to chose between options like CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was updated to support 'VPL_' as well. This series starts a change in terminology and usage to resolve the above issues: - The word 'xPL' is used instead of 'SPL' to mean a non-proper build - A new CONFIG_XPL_BUILD define indicates that the current build is an 'xPL' build - The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now defined for TPL and VPL phases - The existing SPL_ Makefile variable is renamed to SPL_ - The existing SPL_TPL Makefile variable is renamed to PHASE_ It should be noted that xpl_phase() can generally be used instead of the above CONFIGs without a code-space or run-time penalty. This series does not attempt to convert all of U-Boot to use this new terminology but it makes a start. In particular, renaming spl.h and common/spl seems like a bridge too far at this point. The series is fully bisectable. It has also been checked to ensure there are no code-size changes on any commit. --- 47e544f576699ca4630e20448db6a05178960697 diff --cc arch/arm/mach-sc5xx/Makefile index cac768ba56,598a13031b..47b28200a0 --- a/arch/arm/mach-sc5xx/Makefile +++ b/arch/arm/mach-sc5xx/Makefile @@@ -11,13 -11,9 +11,13 @@@ obj-y += soc.o init/ obj-$(CONFIG_SC57X) += sc57x.o +obj-$(CONFIG_SC57X) += sc57x-spl.o obj-$(CONFIG_SC58X) += sc58x.o +obj-$(CONFIG_SC58X) += sc58x-spl.o obj-$(CONFIG_SC59X) += sc59x.o +obj-$(CONFIG_SC59X) += sc59x-spl.o obj-$(CONFIG_SC59X_64) += sc59x_64.o +obj-$(CONFIG_SC59X_64) += sc59x_64-spl.o - obj-$(CONFIG_SPL_BUILD) += spl.o + obj-$(CONFIG_XPL_BUILD) += spl.o obj-$(CONFIG_SYSCON) += rcu.o diff --cc arch/riscv/lib/Makefile index bcfdb516b7,608118135d..268116f375 --- a/arch/riscv/lib/Makefile +++ b/arch/riscv/lib/Makefile @@@ -36,11 -36,15 +36,11 @@@ CFLAGS_REMOVE_$(EFI_CRT0) := $(CFLAGS_N CFLAGS_$(EFI_RELOC) := $(CFLAGS_EFI) CFLAGS_REMOVE_$(EFI_RELOC) := $(CFLAGS_NON_EFI) - obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMSET) += memset.o - obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMMOVE) += memmove.o - obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_MEMCPY) += memcpy.o - obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_STRLEN) += strlen_zbb.o - obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_STRCMP) += strcmp_zbb.o - obj-$(CONFIG_$(SPL_TPL_)USE_ARCH_STRNCMP) += strncmp_zbb.o -extra-$(CONFIG_CMD_BOOTEFI_HELLO_COMPILE) += $(EFI_CRT0) $(EFI_RELOC) -extra-$(CONFIG_CMD_BOOTEFI_SELFTEST) += $(EFI_CRT0) $(EFI_RELOC) -extra-$(CONFIG_EFI) += $(EFI_CRT0) $(EFI_RELOC) - + obj-$(CONFIG_$(PHASE_)USE_ARCH_MEMSET) += memset.o + obj-$(CONFIG_$(PHASE_)USE_ARCH_MEMMOVE) += memmove.o + obj-$(CONFIG_$(PHASE_)USE_ARCH_MEMCPY) += memcpy.o + obj-$(CONFIG_$(PHASE_)USE_ARCH_STRLEN) += strlen_zbb.o + obj-$(CONFIG_$(PHASE_)USE_ARCH_STRCMP) += strcmp_zbb.o + obj-$(CONFIG_$(PHASE_)USE_ARCH_STRNCMP) += strncmp_zbb.o - obj-$(CONFIG_$(SPL_TPL_)SEMIHOSTING) += semihosting.o + obj-$(CONFIG_$(PHASE_)SEMIHOSTING) += semihosting.o diff --cc drivers/misc/Makefile index f7fd1d5cae,79e54c4a1b..dac805e4cd --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@@ -68,9 -68,9 +68,9 @@@ obj-$(CONFIG_QFW_MMIO) += qfw_mmio. obj-$(CONFIG_QFW_SMBIOS) += qfw_smbios.o obj-$(CONFIG_SANDBOX) += qfw_sandbox.o endif - obj-$(CONFIG_$(SPL_TPL_)ROCKCHIP_EFUSE) += rockchip-efuse.o - obj-$(CONFIG_$(SPL_TPL_)ROCKCHIP_OTP) += rockchip-otp.o - obj-$(CONFIG_$(SPL_TPL_)ROCKCHIP_IODOMAIN) += rockchip-io-domain.o -obj-$(CONFIG_ROCKCHIP_EFUSE) += rockchip-efuse.o -obj-$(CONFIG_ROCKCHIP_OTP) += rockchip-otp.o ++obj-$(CONFIG_$(PHASE_)ROCKCHIP_EFUSE) += rockchip-efuse.o ++obj-$(CONFIG_$(PHASE_)ROCKCHIP_OTP) += rockchip-otp.o + obj-$(CONFIG_$(PHASE_)ROCKCHIP_IODOMAIN) += rockchip-io-domain.o obj-$(CONFIG_SANDBOX) += syscon_sandbox.o misc_sandbox.o obj-$(CONFIG_SIFIVE_OTP) += sifive-otp.o obj-$(CONFIG_SMSC_LPC47M) += smsc_lpc47m.o diff --cc drivers/mmc/rockchip_dw_mmc.c index 5ba99d68b7,ca5752d24f..422b8f7e4c --- a/drivers/mmc/rockchip_dw_mmc.c +++ b/drivers/mmc/rockchip_dw_mmc.c @@@ -80,10 -80,10 +80,10 @@@ static int rockchip_dwmmc_of_to_plat(st priv->fifo_depth = dev_read_u32_default(dev, "fifo-depth", 0); if (priv->fifo_depth < 0) - return -EINVAL; + return log_msg_ret("rkp", -EINVAL); priv->fifo_mode = dev_read_bool(dev, "fifo-mode"); - #ifdef CONFIG_SPL_BUILD + #ifdef CONFIG_XPL_BUILD if (!priv->fifo_mode) priv->fifo_mode = dev_read_bool(dev, "u-boot,spl-fifo-mode"); #endif diff --cc drivers/pinctrl/mediatek/pinctrl-mtk-common.c index a3662d46bd,2c373c7c12..3760c4611c --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@@ -791,16 -791,6 +791,16 @@@ bind } #endif +int mtk_pinctrl_common_bind(struct udevice *dev) +{ +#if CONFIG_IS_ENABLED(DM_GPIO) || \ - (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_GPIO)) ++ (defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_GPIO)) + return mtk_gpiochip_register(dev); +#else + return 0; +#endif +} + int mtk_pinctrl_common_probe(struct udevice *dev, const struct mtk_pinctrl_soc *soc) { diff --cc drivers/usb/gadget/Makefile index da76b6524d,a44b2bfc1f..4bda224ff1 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@@ -21,8 -21,7 +21,8 @@@ obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY obj-$(CONFIG_USB_GADGET_DWC2_OTG) += dwc2_udc_otg.o obj-$(CONFIG_USB_GADGET_DWC2_OTG_PHY) += dwc2_udc_otg_phy.o obj-$(CONFIG_USB_GADGET_MAX3420) += max3420_udc.o +obj-$(CONFIG_USB_RENESAS_USBHS) += rcar/ - ifndef CONFIG_SPL_BUILD + ifndef CONFIG_XPL_BUILD obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o obj-$(CONFIG_DFU_OVER_USB) += f_dfu.o diff --cc fs/Makefile index a3ee0a361d,ec3e31c7c7..1e54ac11ab --- a/fs/Makefile +++ b/fs/Makefile @@@ -4,8 -4,8 +4,8 @@@ # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. - ifdef CONFIG_SPL_BUILD + ifdef CONFIG_XPL_BUILD -obj-$(CONFIG_FS_LOADER) += fs.o +obj-$(CONFIG_SPL_FS_LOADER) += fs.o obj-$(CONFIG_SPL_FS_FAT) += fat/ obj-$(CONFIG_SPL_FS_EXT4) += ext4/ obj-$(CONFIG_SPL_FS_CBFS) += cbfs/ diff --cc lib/fdtdec.c index 106bb40636,b2d38795a4..85f4426f90 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@@ -1230,9 -1230,9 +1230,9 @@@ static void *fdt_find_separate(void if (IS_ENABLED(CONFIG_SANDBOX)) return NULL; - #ifdef CONFIG_SPL_BUILD + #ifdef CONFIG_XPL_BUILD /* FDT is at end of BSS unless it is in a different memory region */ - if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) + if (CONFIG_IS_ENABLED(SEPARATE_BSS)) fdt_blob = (ulong *)_image_binary_end; else fdt_blob = (ulong *)__bss_end;