Skip to contentSkip to conversation

RFC: Migrate to split config

PATCH In review Simon Glass 6 participants 118 messages Feb 12, 2023 – Feb 23, 2023 Page 1 of 2

Subsystems (101)
lore
Share & tools
lore
#0 lore raw

v3 cover RFC: Migrate to split config

U-Boot uses an SPL prefix on CONFIG options to indicate when an option relates to SPL. For example, while CONFIG_TEXT_BASE is the text base for U-Boot proper, CONFIG_SPL_TEXT_BASE is the text base for SPL.

Within the code it is possible do things like CONFIG_VAL(TEXT_BASE) to get that value. It returns the appropriate option, depending on the phase being built.

The same applies for boolean options, like CONFIG_BLK and CONFIG_SPL_BLK but in that case we use CONFIG_IS_ENABLED(BLK) to obtain the value.

For Makefiles we use an SPL_TPL_ macro which evalutes either to empty, SPL, TPL or even VPL depending on the build phase. So we can do things like:

   obj-$(CONFIG_$(SPL_TPL_)CLK) += clk-uclass.o

To complicate things a little, some options like CONFIG_ARCH_APPLE do not have an SPL version, so people have to remember to use IS_ENABLED() instead of CONFIG_IS_ENABLED(). If the latter is used, the value will be false.

All of this is rather confusing, since:

- people have to know whether to use IS_ENABLED() or CONFIG_IS_ENABLED()
- the Makefiles are cluttered with $(SPL_TPL_) constructs
- plain use of a CONFIG option (e.g. #ifdef CONFIG_CLK) may be correct in some cases but not in others

This series updates U-Boot to use separate config files for each phase of the build. It drops use of CONFIG_IS_ENABLED() and SPL_TPL_ as well.

For now this series does not fully work due to inconsistencies in the Kconfig options. Many of these have been fixed [1] [2a] [2b] but more remain.

This series is available at u-boot-dm/splc-working

Size changes are available here: https://pastebin.com/hSjhM3y7

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=339004
[2a] https://patchwork.ozlabs.org/project/uboot/list/?series=339199&state=*
[2b] https://patchwork.ozlabs.org/project/uboot/list/?series=339208&state=*

Changes in v3:
- Add new patch to disable QFW bootmeth in SPL
- Move the option down to the non-SPL part of drivers/Makefile
- Add a bracket to (SPL
- Add (SPL) to the end of the comment
- Use a consistent format for the comment
- Add new patch with a Kconfig for SPL_FSP_VERSION2
- Move SPL_GENERATE_ACPI_TABLE patch to this series
- Move SPL_EFI_LOADER patch to this series
- Correct 'VPL' typo
- Use a consistent format for the comment
- Rework commit submit
- Use a consistent format for the comment
- Use a consistent format for the comment
- Use a consistent format for the comment
- Fix a transitory build error with sandbox_spl
- Add DFU_VIRT FSL_ISBC_KEY_EXT GENERATE_SMBIOS_TABLE GMAC_ROCKCHIP I8259_PIC IMX_RDC NXP_FSPI PCI_PNP PHY_CADENCE_TORRENT QFW_PIO SEC_FIRMWARE_ARMV8_PSCI SPI_FLASH_BAR SPI_FLASH_MACRONIX
- Add CMD_BOOTEFI_BOOTMGR CMD_EFICONFIG CMD_PXE
- Fix move_config typo
- Add ARCH_VERSAL_NET CMD_DHCP ENV_WRITEABLE_LIST EXPO
- Add TARGET_KMCOGE5NE TARGET_KMETER1
- Drop header-file changes not needed in this patch
- Make sure that the config is rebuilt with this change
- Move header-file changes into this patch
- Add more explanation to the commit message
- Add new patch to allow distroboot environment to be the same in SPL
- Add a new patch to disallow commands in SPL
- Reword commit message and subject
- Update to work with latest source
- Drop a comment which mentions CONFIG_IS_ENABLED()
- Move to conf_nospl: CMD_DHCP DFU_VIRT GENERATE_SMBIOS_TABLE
- Move to conf_nospl: GMAC_ROCKCHIP I8259_PIC IMX_RDC NXP_FSPI PCI_PNP
- Move to conf_nospl: PHY_CADENCE_TORRENT QFW_PIO SEC_FIRMWARE_ARMV8_PSCI
- Move to conf_nospl: SPI_FLASH_BAR SPI_FLASH_MACRONIX
- Move to conf_nospl: SCMD_BOOTEFI_BOOTMGR CMD_EFICONFIG CMD_PXE

Changes in v2:
- Rebase to previous series
- Correct the tag
- Redo commit message
- Introduce CONFIG_PPL approach
- Include code from 'Update CONFIG_IS_ENABLED() for split files' too
- Reworked based on earlier patches
- Move patches from splb which add new Kconfig options

Simon Glass (95):
mtd: Drop unused kb9202_nand driver
mtd: Drop unused CONFIG_ONENAND_U_BOOT
sh4: Drop unused twl6030 driver
moveconfig: Update to detect / correct missing SPL Kconfigs
bootstd: Disable QFW bootmeth in SPL
Correct SPL uses of ARCH_MVEBU
Correct SPL uses of DISPLAY_AER_FULL
Correct SPL uses of FSL_ISBC_KEY_EXT
Correct SPL uses of MULTIPLEXER
Correct SPL use of PG_WCOM_UBOOT_UPDATE_SUPPORTED Correct SPL use of PHY_CADENCE_SIERRA
Correct SPL uses of PHY_FIXED
boot: Add a Kconfig for SPL_FIT_CIPHER
boot: Add a Kconfig for SPL_BOOTSTD_FULL
boot: Add Kconfigs for BOOTMETH_VBE_REQUEST Correct SPL use of DM_RNG
boot: Add a Kconfig for SPL_BOOTDEV_SPI_FLASH
boot: Add a Kconfig for SPL_BOOTDEV_ETH
dm: Add a Kconfig for SPL_DEVRES
dm: Add a Kconfig for SPL_DM_HWSPINLOCK
boot: Add a Kconfig for SPL_OF_LIVE
cmd: Add a Kconfig for SPL_CRC32_VERIFY
console: Add a Kconfig for SPL_CONSOLE_MUX et al
button: Add a Kconfig for SPL_BUTTON
lib: Add a Kconfig for SPL_ERRNO_STR
lib: Add a Kconfig for SPL_FSP_VERSION2
iommu: Add a Kconfig for SPL_IOMMU
pinctrl: Add a Kconfig for SPL_PINCTRL_ARMADA_38X
virtio: Add a Kconfig for SPL_VIRTIO
lib: Add a Kconfig for SPL_BZIP2
acpi: Add a Kconfig for SPL_ACPIGEN
rockchip: Add a Kconfig for SPL_RESET_ROCKCHIP
mediatek: Add a Kconfig for SPL_RESET_MEDIATEK
lib: Add a Kconfig for SPL_GENERATE_ACPI_TABLE
efi: Add a Kconfig for SPL_EFI_LOADER et al
moveconfig: Various minor improvements
sandbox: Expand size for VPL image
event: Add Kconfig options for SPL
bootstd: Add Kconfig options for SPL
cmd: Add SPL Kconfigs for CMDLINE and HUSH
boot: Add a Kconfig for SPL_QCOM_PMIC_GPIO
cros_ec: Add SPL Kconfigs for cros_ec features
boot: Add a Kconfig for SPL_UT_COMPRESSION
env: Avoid checking ENV_IS_IN when env disabled
boot: Add a Kconfig for SPL_AVB_VERIFY
env: Allow VPL environment to be nowhere
lib: Add VPL options for SHA1 and SHA256
x86: Use string functions for all 32-bit builds
lib: Fix build condition for tiny-printf
sandbox: Tidy up RTC options
sandbox: Use the generic VPL option to enable VPL
sandbox: Tidy up I2C options
fixdep: Add support for VPL
fixdep: Refactor to make testing easier
fixdep: Add some tests for parse_config_line()
test: Add SPL versions of the TEST_KCONFIG options
lib: Add an SPL config for LIB_UUID
test: Tidy up sandbox handling in test-main
kconfig: Add a configuration file for nospl
kconfig: Refactor code into separate writer functions
kconfig: Support writing separate SPL files Rename CONFIG_TEXT_BASE
x86: Fix up some Kconfig options
Add VPL options for BLOBLIST
omap: Correct an SPL build error with watchdog
freescale: pm9g45: Fix problems with ls1021aqds_nand et al
imx: watchdog: Correct watchdog error condition
socfpga: Use the correct condition for SYS_L2_PL310
rockchip: Avoid checking environment without ENV_SUPPORT
freescale: Drop old pre-DM_ETH code
imx: Use SATA instead of CMD_SATA
net: Add an SPL config for atheros
freescale: Fix odd use of ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE
serial: Support ns16550 driver in TPL
pci: Use the correct symbol to enable struct members
x86: Fix monitor base for split config
dm: Add a TPL symbol for simple-bus
x86: coral: Avoid build errors with missing SPL symbols
power: wanderboard: Correct conditions for split config
venice: Simplify conditions for network init Allow distroboot environment to be the same in SPL
command: Don't allow commands in SPL
Makefile: Include the config for the phase being built
Makefile: Use empty SPL_ and SPL_TPL_ vars
kconfig: Drop single-param use of CONFIG_IS_ENABLED()
kconfig: Adjust the meaning of CONFIG_IS_ENABLED()
kconfig: Drop CONFIG_IF_ENABLED_INT()
kconfig: Drop CONFIG_IS_ENABLED()
kconfig: drop config_opt_enabled()
kconfig: Drop CONFIG_VAL()
Makefile: Clean up an unnecessary Makefile piece
fixdep: Drop support for CONFIG_IS_ENABLED and CONFIG_VAL
kconfig: Move closer to the Linux version
checkpatch: Remove unwanted CONFIG_IS_ENABLED rules
Makefile: Drop SPL_ and SPL_TPL_ macros

 Makefile                                      |  50 +-
 arch/arc/lib/bootm.c                          |   2 +-
 arch/arc/lib/start.S                          |   4 +-
 arch/arm/config.mk                            |   6 +-
 arch/arm/cpu/arm11/cpu.c                      |  12 +-
 arch/arm/cpu/arm1136/start.S                  |   8 +-
 arch/arm/cpu/arm1176/start.S                  |   2 +-
 arch/arm/cpu/arm720t/start.S                  |  10 +-
 arch/arm/cpu/arm920t/Makefile                 |   2 +-
 arch/arm/cpu/arm920t/start.S                  |   8 +-
 arch/arm/cpu/arm926ejs/Makefile               |   2 +-
 arch/arm/cpu/arm926ejs/cache.c                |  14 +-
 arch/arm/cpu/arm926ejs/cpu.c                  |   2 +-
 arch/arm/cpu/arm926ejs/mxs/Makefile           |   4 +-
 arch/arm/cpu/arm926ejs/start.S                |  10 +-
 arch/arm/cpu/arm946es/start.S                 |   6 +-
 arch/arm/cpu/armv7/Makefile                   |   2 +-
 arch/arm/cpu/armv7/cache_v7.c                 |   8 +-
 arch/arm/cpu/armv7/cache_v7_asm.S             |   2 +-
 .../cpu/armv7/iproc-common/hwinit-common.c    |   2 +-
 arch/arm/cpu/armv7/ls102xa/cpu.c              |   4 +-
 arch/arm/cpu/armv7/ls102xa/fdt.c              |  14 +-
 arch/arm/cpu/armv7/start.S                    |  16 +-
 arch/arm/cpu/armv7/vf610/generic.c            |   2 +-
 arch/arm/cpu/armv7m/cache.c                   |   8 +-
 arch/arm/cpu/armv8/Makefile                   |   6 +-
 arch/arm/cpu/armv8/cache_v8.c                 |  12 +-
 arch/arm/cpu/armv8/cpu-dt.c                   |   2 +-
 arch/arm/cpu/armv8/fsl-layerscape/Makefile    |   2 +-
 arch/arm/cpu/armv8/fsl-layerscape/cpu.c       |   8 +-
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c       |  10 +-
 arch/arm/cpu/armv8/fsl-layerscape/ppa.c       |   2 +-
 arch/arm/cpu/armv8/fsl-layerscape/soc.c       |   2 +-
 arch/arm/cpu/armv8/fsl-layerscape/spl.c       |   2 +-
 .../armv8/linux-kernel-image-header-vars.h    |   2 +-
 arch/arm/cpu/armv8/start.S                    |   2 +-
 arch/arm/include/asm/arch-am33xx/chilisom.h   |   2 +-
 .../asm/arch-fsl-layerscape/fsl_icid.h        |   2 +-
 arch/arm/include/asm/arch-lpc32xx/i2c.h       |   2 +-
 arch/arm/include/asm/arch-mxs/sys_proto.h     |   2 +-
 arch/arm/include/asm/arch-rockchip/boot0.h    |   2 +-
 .../include/asm/arch-rockchip/sdram_rk322x.h  |   2 +-
 .../include/asm/arch-rockchip/sdram_rk3288.h  |   2 +-
 arch/arm/include/asm/arch-sunxi/boot0.h       |   2 +-
 arch/arm/include/asm/assembler.h              |   2 +-
 arch/arm/include/asm/cache.h                  |   2 +-
 arch/arm/include/asm/global_data.h            |   2 +-
 arch/arm/include/asm/mach-imx/mxc_i2c.h       |   6 +-
 arch/arm/include/asm/omap_gpio.h              |   2 +-
 arch/arm/include/asm/omap_i2c.h               |   2 +-
 arch/arm/include/asm/proc-armv/ptrace.h       |   2 +-
 arch/arm/include/asm/string.h                 |   6 +-
 arch/arm/lib/Makefile                         |  18 +-
 arch/arm/lib/bdinfo.c                         |   6 +-
 arch/arm/lib/bootm-fdt.c                      |   2 +-
 arch/arm/lib/bootm.c                          |   4 +-
 arch/arm/lib/cache-cp15.c                     |   6 +-
 arch/arm/lib/cache.c                          |   6 +-
 arch/arm/lib/crt0.S                           |  10 +-
 arch/arm/lib/crt0_64.S                        |   4 +-
 arch/arm/lib/interrupts_64.c                  |   2 +-
 arch/arm/lib/lib1funcs.S                      |   2 +-
 arch/arm/lib/memcpy.S                         |   2 +-
 arch/arm/lib/memset.S                         |   2 +-
 arch/arm/lib/psci-dt.c                        |   6 +-
 arch/arm/lib/relocate_64.S                    |   2 +-
 arch/arm/lib/spl.c                            |   4 +-
 arch/arm/lib/vectors.S                        |   6 +-
 arch/arm/mach-at91/arm920t/lowlevel_init.S    |   8 +-
 arch/arm/mach-at91/arm926ejs/Makefile         |   4 +-
 arch/arm/mach-at91/arm926ejs/eflash.c         |   4 +-
 arch/arm/mach-at91/arm926ejs/lowlevel_init.S  |   2 +-
 arch/arm/mach-at91/include/mach/at91sam9260.h |   2 +-
 arch/arm/mach-at91/spl_at91.c                 |   2 +-
 arch/arm/mach-davinci/da850_lowlevel.c        |   2 +-
 arch/arm/mach-davinci/include/mach/gpio.h     |   2 +-
 arch/arm/mach-exynos/mmu-arm64.c              |   4 +-
 arch/arm/mach-exynos/pinmux.c                 |   2 +-
 arch/arm/mach-exynos/soc.c                    |   2 +-
 arch/arm/mach-exynos/spl_boot.c               |  10 +-
 arch/arm/mach-imx/Makefile                    |  10 +-
 arch/arm/mach-imx/cache.c                     |   2 +-
 arch/arm/mach-imx/hab.c                       |   4 +-
 arch/arm/mach-imx/i2c-mxv7.c                  |   2 +-
 arch/arm/mach-imx/imx8/cpu.c                  |   6 +-
 arch/arm/mach-imx/imx8m/soc.c                 |   6 +-
 arch/arm/mach-imx/mx5/soc.c                   |   2 +-
 arch/arm/mach-imx/mx7/soc.c                   |   6 +-
 arch/arm/mach-imx/spl.c                       |   2 +-
 arch/arm/mach-imx/syscounter.c                |   2 +-
 arch/arm/mach-k3/am642_init.c                 |   4 +-
 arch/arm/mach-k3/am654_init.c                 |   6 +-
 arch/arm/mach-k3/common.c                     |   4 +-
 arch/arm/mach-k3/sysfw-loader.c               |  22 +-
 arch/arm/mach-keystone/init.c                 |   2 +-
 arch/arm/mach-lpc32xx/devices.c               |   2 +-
 arch/arm/mach-nexell/include/mach/boot0.h     |   6 +-
 arch/arm/mach-octeontx/cpu.c                  |   2 +-
 arch/arm/mach-octeontx2/cpu.c                 |   2 +-
 arch/arm/mach-omap2/Makefile                  |   2 +-
 arch/arm/mach-omap2/am33xx/Makefile           |   2 +-
 arch/arm/mach-omap2/am33xx/board.c            |  18 +-
 arch/arm/mach-omap2/am33xx/chilisom.c         |   4 +-
 arch/arm/mach-omap2/am33xx/clk_synthesizer.c  |   6 +-
 arch/arm/mach-omap2/boot-common.c             |   4 +-
 arch/arm/mach-omap2/clocks-common.c           |   2 +-
 arch/arm/mach-omap2/omap3/board.c             |   8 +-
 arch/arm/mach-omap2/omap3/lowlevel_init.S     |   4 +-
 arch/arm/mach-omap2/omap5/hwinit.c            |   2 +-
 arch/arm/mach-omap2/omap5/sec_entry_cpu1.S    |   6 +-
 arch/arm/mach-omap2/sec-common.c              |   4 +-
 arch/arm/mach-orion5x/Makefile                |   4 +-
 arch/arm/mach-rmobile/cpu_info.c              |   2 +-
 arch/arm/mach-rockchip/Makefile               |   2 +-
 arch/arm/mach-rockchip/bootrom.c              |   4 +-
 arch/arm/mach-rockchip/px30/syscon_px30.c     |   2 +-
 arch/arm/mach-rockchip/rk3036/rk3036.c        |   2 +-
 arch/arm/mach-rockchip/rk3066/syscon_rk3066.c |   2 +-
 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c |   2 +-
 arch/arm/mach-rockchip/rk3288/syscon_rk3288.c |   2 +-
 arch/arm/mach-rockchip/rk3368/syscon_rk3368.c |   2 +-
 arch/arm/mach-rockchip/rk3399/syscon_rk3399.c |   4 +-
 arch/arm/mach-rockchip/rk3568/syscon_rk3568.c |   2 +-
 arch/arm/mach-rockchip/rv1126/syscon_rv1126.c |   2 +-
 arch/arm/mach-rockchip/spl-boot-order.c       |   4 +-
 arch/arm/mach-rockchip/spl.c                  |   2 +-
 arch/arm/mach-rockchip/tpl.c                  |   2 +-
 arch/arm/mach-s5pc1xx/cache.c                 |   2 +-
 arch/arm/mach-socfpga/misc.c                  |   8 +-
 arch/arm/mach-socfpga/spl_agilex.c            |   2 +-
 arch/arm/mach-socfpga/spl_n5x.c               |   2 +-
 arch/arm/mach-socfpga/spl_s10.c               |   2 +-
 arch/arm/mach-stm32mp/Makefile                |   2 +-
 .../mach-stm32mp/cmd_stm32prog/stm32prog.c    |  12 +-
 arch/arm/mach-stm32mp/cpu.c                   |   4 +-
 arch/arm/mach-stm32mp/fdt.c                   |   2 +-
 arch/arm/mach-stm32mp/spl.c                   |   2 +-
 arch/arm/mach-sunxi/board.c                   |   8 +-
 arch/arm/mach-sunxi/pmic_bus.c                |   8 +-
 arch/arm/mach-sunxi/spl_spi_sunxi.c           |   2 +-
 arch/arm/mach-tegra/board.c                   |   4 +-
 arch/arm/mach-tegra/clock.c                   |   4 +-
 arch/arm/mach-tegra/tegra114/clock.c          |   4 +-
 arch/arm/mach-tegra/tegra124/clock.c          |   4 +-
 arch/arm/mach-tegra/tegra20/clock.c           |   4 +-
 arch/arm/mach-tegra/tegra30/clock.c           |   4 +-
 arch/arm/mach-u8500/cache.c                   |   2 +-
 .../arm/mach-uniphier/debug-uart/debug-uart.c |   4 +-
 arch/arm/mach-zynq/cpu.c                      |   6 +-
 arch/arm/mach-zynqmp/Makefile                 |   2 +-
 arch/m68k/cpu/mcf52x2/start.S                 |  12 +-
 arch/m68k/cpu/mcf530x/start.S                 |   4 +-
 arch/m68k/cpu/mcf5445x/start.S                |  16 +-
 arch/microblaze/cpu/cache.c                   |   4 +-
 arch/microblaze/cpu/exception.c               |   4 +-
 arch/microblaze/cpu/relocate.c                |   6 +-
 arch/microblaze/cpu/start.S                   |  10 +-
 arch/microblaze/lib/bootm.c                   |   2 +-
 arch/mips/cpu/cpu.c                           |   2 +-
 arch/mips/cpu/start.S                         |  14 +-
 arch/mips/lib/bootm.c                         |  22 +-
 arch/mips/mach-jz47xx/jz4780/jz4780.c         |   4 +-
 arch/mips/mach-mscc/lowlevel_init.S           |   2 +-
 arch/mips/mach-mtmips/mt7621/spl/start.S      |  12 +-
 arch/mips/mach-mtmips/mt7628/lowlevel_init.S  |   6 +-
 arch/powerpc/cpu/mpc83xx/start.S              |   8 +-
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c     |   6 +-
 arch/powerpc/cpu/mpc85xx/start.S              |  42 +-
 arch/powerpc/cpu/mpc85xx/tlb.c                |   2 +-
 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds       |   6 +-
 arch/powerpc/cpu/mpc85xx/u-boot.lds           |   4 +-
 arch/powerpc/cpu/mpc8xxx/law.c                |   4 +-
 arch/powerpc/include/asm/fsl_i2c.h            |   2 +-
 arch/powerpc/lib/Makefile                     |   2 +-
 arch/riscv/cpu/ax25/cache.c                   |  26 +-
 arch/riscv/cpu/ax25/cpu.c                     |   2 +-
 arch/riscv/cpu/ax25/spl.c                     |   2 +-
 arch/riscv/cpu/cpu.c                          |  10 +-
 arch/riscv/cpu/fu740/spl.c                    |   2 +-
 arch/riscv/cpu/start.S                        |  28 +-
 arch/riscv/include/asm/encoding.h             |   2 +-
 arch/riscv/include/asm/global_data.h          |   6 +-
 arch/riscv/include/asm/string.h               |   6 +-
 arch/riscv/lib/Makefile                       |  16 +-
 arch/riscv/lib/asm-offsets.c                  |   2 +-
 arch/riscv/lib/bootm.c                        |   4 +-
 arch/riscv/lib/interrupts.c                   |   2 +-
 arch/riscv/lib/smp.c                          |   2 +-
 arch/riscv/lib/spl.c                          |   2 +-
 arch/sandbox/cpu/start.c                      |   4 +-
 arch/sandbox/dts/sandbox.dts                  |   4 +-
 arch/sandbox/dts/sandbox.dtsi                 |   6 +-
 arch/sandbox/dts/sandbox_vpl.dtsi             |   4 +-
 arch/sandbox/include/asm/clk.h                |   2 +-
 arch/sandbox/include/asm/rtc.h                |   2 +-
 arch/sandbox/include/asm/serial.h             |   2 +-
 arch/sh/lib/start.S                           |   4 +-
 arch/x86/Kconfig                              |   7 +
 arch/x86/Makefile                             |   8 +-
 arch/x86/cpu/Makefile                         |  22 +-
 arch/x86/cpu/acpi_gpe.c                       |   4 +-
 arch/x86/cpu/apollolake/cpu_common.c          |   2 +-
 arch/x86/cpu/apollolake/cpu_spl.c             |   2 +-
 arch/x86/cpu/apollolake/hostbridge.c          |  10 +-
 arch/x86/cpu/apollolake/lpc.c                 |   2 +-
 arch/x86/cpu/apollolake/pch.c                 |   2 +-
 arch/x86/cpu/apollolake/pmc.c                 |   4 +-
 arch/x86/cpu/apollolake/spl.c                 |   6 +-
 arch/x86/cpu/apollolake/uart.c                |   6 +-
 arch/x86/cpu/broadwell/Makefile               |  10 +-
 arch/x86/cpu/broadwell/pch.c                  |   2 +-
 arch/x86/cpu/cpu.c                            |   2 +-
 arch/x86/cpu/i386/interrupt.c                 |   2 +-
 arch/x86/cpu/intel_common/Makefile            |  14 +-
 arch/x86/cpu/intel_common/car2.S              |   6 +-
 arch/x86/cpu/intel_common/cpu_from_spl.c      |   2 +-
 arch/x86/cpu/intel_common/itss.c              |   8 +-
 arch/x86/cpu/intel_common/p2sb.c              |   8 +-
 arch/x86/cpu/irq.c                            |   4 +-
 arch/x86/cpu/ivybridge/Makefile               |   6 +-
 arch/x86/cpu/qemu/Makefile                    |   2 +-
 arch/x86/cpu/qemu/qemu.c                      |   4 +-
 arch/x86/cpu/quark/quark.c                    |   2 +-
 arch/x86/cpu/start.S                          |   6 +-
 arch/x86/cpu/u-boot-spl.lds                   |   2 +-
 arch/x86/include/asm/arch-apollolake/gpio.h   |   2 +-
 .../include/asm/arch-apollolake/hostbridge.h  |   2 +-
 arch/x86/include/asm/arch-apollolake/pmc.h    |   2 +-
 arch/x86/include/asm/arch-apollolake/uart.h   |   2 +-
 arch/x86/include/asm/byteorder.h              |   2 +-
 arch/x86/include/asm/cpu.h                    |   2 +-
 arch/x86/include/asm/global_data.h            |   4 +-
 arch/x86/include/asm/itss.h                   |   2 +-
 arch/x86/include/asm/mp.h                     |   2 +-
 arch/x86/include/asm/msr.h                    |   2 +-
 arch/x86/include/asm/p2sb.h                   |   2 +-
 arch/x86/include/asm/string.h                 |   2 +-
 arch/x86/include/asm/sysreset.h               |   2 +-
 arch/x86/include/asm/types.h                  |   2 +-
 arch/x86/lib/Makefile                         |   8 +-
 arch/x86/lib/acpi_table.c                     |   2 +-
 arch/x86/lib/bootm.c                          |   6 +-
 arch/x86/lib/e820.c                           |   4 +-
 arch/x86/lib/fsp/fsp_common.c                 |   2 +-
 arch/x86/lib/fsp/fsp_dram.c                   |   8 +-
 arch/x86/lib/fsp2/fsp_dram.c                  |   4 +-
 arch/x86/lib/init_helpers.c                   |   2 +-
 arch/x86/lib/interrupts.c                     |  12 +-
 arch/x86/lib/lpc-uclass.c                     |   2 +-
 arch/x86/lib/relocate.c                       |  10 +-
 arch/x86/lib/spl.c                            |   8 +-
 arch/x86/lib/tpl.c                            |   4 +-
 arch/xtensa/cpu/start.S                       |   8 +-
 board/BuS/eb_cpu5282/eb_cpu5282.c             |   2 +-
 board/Marvell/octeontx2_cn913x/board.c        |   2 +-
 board/Seagate/dockstar/dockstar.c             |   2 +-
 board/Seagate/goflexhome/goflexhome.c         |   2 +-
 board/alliedtelesis/x530/x530.c               |   2 +-
 board/beacon/beacon-rzg2m/beacon-rzg2m.c      |   2 +-
 board/bosch/acc/acc.c                         |   2 +-
 board/bosch/guardian/Makefile                 |   2 +-
 board/bosch/guardian/board.c                  |   2 +-
 board/bosch/shc/board.c                       |   2 +-
 board/broadcom/bcmstb/bcmstb.c                |   4 +-
 board/buffalo/lsxl/lsxl.c                     |   2 +-
 board/cavium/thunderx/thunderx.c              |   2 +-
 board/cloudengines/pogo_v4/pogo_v4.c          |   2 +-
 board/compulab/cl-som-imx7/cl-som-imx7.c      |   4 +-
 board/compulab/common/Makefile                |   2 +-
 board/compulab/common/eeprom.h                |   2 +-
 board/congatec/cgtqmx8/cgtqmx8.c              |   2 +-
 board/davinci/da8xxevm/omapl138_lcdk.c        |   2 +-
 board/eets/pdu001/board.c                     |   6 +-
 board/engicam/imx8mp/icore_mx8mp.c            |   2 +-
 board/engicam/imx8mp/spl.c                    |   2 +-
 board/engicam/stm32mp1/spl.c                  |   2 +-
 board/engicam/stm32mp1/stm32mp1.c             |   6 +-
 board/freescale/common/Makefile               |   4 +-
 board/freescale/common/emc2305.c              |   4 +-
 board/freescale/common/fsl_validate.c         |  18 +-
 board/freescale/common/i2c_common.c           |   2 +-
 board/freescale/common/i2c_common.h           |   2 +-
 board/freescale/common/qixis.c                |   4 +-
 board/freescale/common/sys_eeprom.c           |  20 +-
 board/freescale/imx8mn_evk/spl.c              |   2 +-
 board/freescale/imx8mp_evk/imx8mp_evk.c       |   2 +-
 board/freescale/imx8mp_evk/spl.c              |   2 +-
 board/freescale/imx8mq_evk/spl.c              |   2 +-
 board/freescale/imx8qm_mek/imx8qm_mek.c       |   2 +-
 board/freescale/imx8qxp_mek/imx8qxp_mek.c     |   2 +-
 board/freescale/imx8ulp_evk/imx8ulp_evk.c     |   2 +-
 board/freescale/imx93_evk/spl.c               |   2 +-
 board/freescale/ls1012aqds/ls1012aqds.c       |   2 +-
 board/freescale/ls1012ardb/eth.c              |   2 +-
 board/freescale/ls1012ardb/ls1012ardb.c       |  12 +-
 board/freescale/ls1021aqds/ls1021aqds.c       |   2 +-
 board/freescale/ls1021atsn/ls1021atsn.c       |   2 +-
 board/freescale/ls1021atwr/ls1021atwr.c       |   4 +-
 board/freescale/ls1028a/ls1028a.c             |   2 +-
 board/freescale/ls1043aqds/ls1043aqds.c       |   2 +-
 board/freescale/ls1088a/eth_ls1088aqds.c      |  16 +-
 board/freescale/ls1088a/ls1088a.c             |  58 +-
 board/freescale/ls2080aqds/eth.c              |  14 +-
 board/freescale/ls2080aqds/ls2080aqds.c       |   2 +-
 board/freescale/mpc837xerdb/mpc837xerdb.c     |   2 +-
 board/freescale/p1010rdb/p1010rdb.c           |   8 +-
 board/freescale/p1010rdb/spl.c                |  10 +-
 board/freescale/p1010rdb/tlb.c                |   2 +-
 board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c   |   2 +-
 board/freescale/p1_p2_rdb_pc/spl.c            |  12 +-
 board/freescale/p1_p2_rdb_pc/tlb.c            |   2 +-
 board/freescale/t102xrdb/t102xrdb.c           |   2 +-
 board/friendlyarm/nanopi2/lcds.c              |   2 +-
 board/friendlyarm/nanopi2/onewire.c           |   6 +-
 board/gateworks/gw_ventana/eeprom.c           |  10 +-
 board/gateworks/venice/venice.c               |   6 +-
 board/google/chromebook_coral/coral.c         |   4 +-
 board/google/veyron/veyron.c                  |   4 +-
 board/grinn/chiliboard/board.c                |   4 +-
 board/hisilicon/hikey/hikey.c                 |   2 +-
 board/hisilicon/hikey960/hikey960.c           |   2 +-
 board/hisilicon/poplar/poplar.c               |   2 +-
 board/hoperun/hihope-rzg2/hihope-rzg2.c       |   2 +-
 board/k+p/kp_imx53/kp_imx53.c                 |   2 +-
 board/keymile/common/common.c                 |   6 +-
 board/keymile/common/ivm.c                    |   2 +-
 board/keymile/km83xx/km83xx.c                 |   2 +-
 board/kontron/pitx_imx8m/spl.c                |   6 +-
 board/kontron/sl-mx6ul/sl-mx6ul.c             |   4 +-
 board/kontron/sl-mx8mm/sl-mx8mm.c             |   4 +-
 board/kontron/sl28/sl28.c                     |   2 +-
 board/l+g/vinco/vinco.c                       |   4 +-
 board/mediatek/mt8183/mt8183_pumpkin.c        |   4 +-
 board/mediatek/mt8516/mt8516_pumpkin.c        |   4 +-
 board/nokia/rx51/lowlevel_init.S              |   6 +-
 board/qca/ap152/ap152.c                       |   2 +-
 board/qualcomm/dragonboard820c/head.S         |   2 +-
 board/renesas/draak/draak.c                   |   2 +-
 board/renesas/falcon/falcon.c                 |   2 +-
 board/renesas/salvator-x/salvator-x.c         |   4 +-
 board/renesas/ulcb/ulcb.c                     |   2 +-
 board/rockchip/evb_rk3399/evb-rk3399.c        |   4 +-
 board/samsung/common/board.c                  |   4 +-
 board/samsung/trats/trats.c                   |  10 +-
 board/samsung/trats2/trats2.c                 |   6 +-
 board/sandbox/sandbox.c                       |   2 +-
 board/siemens/common/board.c                  |   2 +-
 board/siemens/common/factoryset.c             |  14 +-
 board/siemens/common/factoryset.h             |   2 +-
 board/siemens/draco/board.c                   |   2 +-
 board/siemens/iot2050/board.c                 |   2 +-
 board/silinux/ek874/ek874.c                   |   2 +-
 board/solidrun/mx6cuboxi/mx6cuboxi.c          |   2 +-
 board/somlabs/visionsom-6ull/visionsom-6ull.c |   2 +-
 board/st/common/stm32mp_dfu.c                 |   4 +-
 board/st/stih410-b2260/board.c                |   2 +-
 board/st/stm32mp1/spl.c                       |   4 +-
 board/st/stm32mp1/stm32mp1.c                  |  16 +-
 board/st/stv0991/stv0991.c                    |   2 +-
 board/sunxi/board.c                           |   2 +-
 board/synopsys/hsdk/hsdk.c                    |   2 +-
 board/tcl/sl50/Makefile                       |   2 +-
 board/tcl/sl50/board.c                        |   2 +-
 board/technexion/pico-imx7d/pico-imx7d.c      |   2 +-
 .../puma_rk3399/puma-rk3399.c                 |   2 +-
 .../ringneck_px30/ringneck-px30.c             |   2 +-
 board/ti/am335x/Makefile                      |   2 +-
 board/ti/am335x/board.c                       |   6 +-
 board/ti/am43xx/Makefile                      |   2 +-
 board/ti/am43xx/board.c                       |  10 +-
 board/ti/am57xx/board.c                       |   6 +-
 board/ti/am64x/evm.c                          |   4 +-
 board/ti/common/board_detect.c                |   4 +-
 board/ti/dra7xx/evm.c                         |   6 +-
 board/ti/j721e/evm.c                          |   2 +-
 board/ti/ks2_evm/board.c                      |   2 +-
 board/ti/ks2_evm/board_k2g.c                  |   2 +-
 board/toradex/apalis-imx8/apalis-imx8.c       |   2 +-
 board/toradex/verdin-imx8mp/spl.c             |   2 +-
 board/tplink/wdr4300/wdr4300.c                |   2 +-
 board/tq/tqma6/tqma6.c                        |   6 +-
 board/vscom/baltos/Makefile                   |   2 +-
 board/wandboard/wandboard.c                   |   4 +-
 board/xilinx/common/board.c                   |   4 +-
 board/xilinx/common/fru_ops.c                 |   2 +-
 board/xilinx/versal/board.c                   |   2 +-
 board/xilinx/zynq/board.c                     |   2 +-
 board/xilinx/zynqmp/Makefile                  |   2 +-
 board/xilinx/zynqmp/zynqmp.c                  |  12 +-
 boot/Kconfig                                  |  45 +-
 boot/Makefile                                 |  54 +-
 boot/bootm.c                                  |  22 +-
 boot/bootm_os.c                               |   2 +-
 boot/bootstd-uclass.c                         |   2 +-
 boot/image-board.c                            |  26 +-
 boot/image-fdt.c                              |  12 +-
 boot/image-fit-sig.c                          |   2 +-
 boot/image-fit.c                              |  10 +-
 boot/image-pre-load.c                         |   2 +-
 boot/image.c                                  |  14 +-
 boot/vbe_request.c                            |   2 +-
 boot/vbe_simple.c                             |   2 +-
 boot/vbe_simple_fw.c                          |   2 +-
 cmd/Kconfig                                   |  10 +
 cmd/Makefile                                  |   2 +-
 cmd/bdinfo.c                                  |   2 +-
 cmd/bootefi.c                                 |   6 +-
 cmd/clk.c                                     |   4 +-
 cmd/date.c                                    |   4 +-
 cmd/disk.c                                    |   6 +-
 cmd/dm.c                                      |   4 +-
 cmd/eeprom.c                                  |  10 +-
 cmd/i2c.c                                     | 106 ++--
 cmd/mmc.c                                     |  28 +-
 cmd/mvebu/bubt.c                              |   2 +-
 cmd/nvedit.c                                  |   2 +
 cmd/reiser.c                                  |   2 +-
 cmd/sb.c                                      |   2 +-
 cmd/sf.c                                      |   6 +-
 cmd/spi.c                                     |   6 +-
 cmd/zfs.c                                     |   2 +-
 common/Kconfig                                |  59 +-
 common/Makefile                               |  26 +-
 common/autoboot.c                             |   8 +-
 common/bloblist.c                             |   2 +-
 common/board_f.c                              |  30 +-
 common/board_r.c                              |  16 +-
 common/bootstage.c                            |   2 +-
 common/cli.c                                  |   4 +-
 common/console.c                              |  42 +-
 common/dlmalloc.c                             |  18 +-
 common/event.c                                |   8 +-
 common/hash.c                                 |  34 +-
 common/hwconfig.c                             |   2 +-
 common/init/Makefile                          |   2 +-
 common/init/board_init.c                      |  22 +-
 common/iomux.c                                |   2 +-
 common/log.c                                  |   2 +-
 common/malloc_simple.c                        |   4 +-
 common/spl/Makefile                           |  48 +-
 common/spl/spl.c                              | 100 +--
 common/spl/spl_atf.c                          |   6 +-
 common/spl/spl_ext.c                          |   2 +-
 common/spl/spl_fat.c                          |   2 +-
 common/spl/spl_fit.c                          |  16 +-
 common/spl/spl_mmc.c                          |  10 +-
 common/spl/spl_nand.c                         |   8 +-
 common/spl/spl_net.c                          |   2 +-
 common/spl/spl_nor.c                          |   2 +-
 common/spl/spl_optee.S                        |   2 +-
 common/spl/spl_ram.c                          |  10 +-
 common/spl/spl_sata.c                         |   2 +-
 common/spl/spl_spi.c                          |   6 +-
 common/spl/spl_ubi.c                          |   2 +-
 common/spl/spl_usb.c                          |   2 +-
 common/spl/spl_xip.c                          |   2 +-
 common/stdio.c                                |   4 +-
 common/usb.c                                  |  14 +-
 common/usb_hub.c                              |  18 +-
 common/usb_kbd.c                              |  12 +-
 common/usb_storage.c                          |  34 +-
 common/xyzModem.c                             |   4 +-
 configs/chromebook_coral_defconfig            |   3 +
 configs/wandboard_defconfig                   |   1 +
 disk/Kconfig                                  |   8 +
 disk/Makefile                                 |  18 +-
 disk/disk-uclass.c                            |   2 +-
 disk/part.c                                   |  14 +-
 disk/part_amiga.h                             |   2 +-
 disk/part_dos.c                               |   6 +-
 disk/part_efi.c                               |  10 +-
 disk/part_mac.h                               |   2 +-
 doc/develop/driver-model/i2c-howto.rst        |   2 +-
 doc/develop/driver-model/livetree.rst         |   2 +-
 doc/develop/driver-model/of-plat.rst          |  10 +-
 doc/develop/spl.rst                           |   6 +-
 doc/develop/tests_writing.rst                 |   6 +-
 drivers/Makefile                              |  72 +--
 drivers/adc/meson-saradc.c                    |   6 +-
 drivers/ata/Makefile                          |   2 +-
 drivers/ata/dwc_ahsata.c                      |   2 +-
 drivers/block/Makefile                        |   6 +-
 drivers/block/blk-uclass.c                    |   2 +-
 drivers/block/host-uclass.c                   |   2 +-
 drivers/block/host_dev.c                      |   2 +-
 drivers/bus/Makefile                          |   2 +-
 drivers/button/Kconfig                        |   4 +
 drivers/cache/Makefile                        |   2 +-
 drivers/clk/Makefile                          |  14 +-
 drivers/clk/clk-uclass.c                      |  14 +-
 drivers/clk/clk_fixed_factor.c                |   2 +-
 drivers/clk/clk_fixed_rate.c                  |   4 +-
 drivers/clk/clk_sandbox.c                     |   2 +-
 drivers/clk/clk_scmi.c                        |   2 +-
 drivers/clk/imx/Makefile                      |  18 +-
 drivers/clk/imx/clk-imx8mm.c                  |   8 +-
 drivers/clk/imx/clk-imx8mn.c                  |   4 +-
 drivers/clk/mediatek/clk-mt7622.c             |   2 +-
 drivers/clk/mediatek/clk-mt7623.c             |   2 +-
 drivers/clk/mediatek/clk-mt7629.c             |   2 +-
 drivers/clk/mediatek/clk-mt7981.c             |   2 +-
 drivers/clk/mediatek/clk-mt7986.c             |   2 +-
 drivers/clk/rockchip/clk_px30.c               |   6 +-
 drivers/clk/rockchip/clk_rk3036.c             |   2 +-
 drivers/clk/rockchip/clk_rk3066.c             |   8 +-
 drivers/clk/rockchip/clk_rk3188.c             |   8 +-
 drivers/clk/rockchip/clk_rk322x.c             |   2 +-
 drivers/clk/rockchip/clk_rk3288.c             |  10 +-
 drivers/clk/rockchip/clk_rk3308.c             |   6 +-
 drivers/clk/rockchip/clk_rk3328.c             |   2 +-
 drivers/clk/rockchip/clk_rk3368.c             |  22 +-
 drivers/clk/rockchip/clk_rk3399.c             |  24 +-
 drivers/clk/rockchip/clk_rk3568.c             |  10 +-
 drivers/clk/rockchip/clk_rv1108.c             |   2 +-
 drivers/clk/rockchip/clk_rv1126.c             |   8 +-
 drivers/clk/ti/Makefile                       |   4 +-
 drivers/core/Kconfig                          |  14 +
 drivers/core/Makefile                         |  14 +-
 drivers/core/device.c                         |  46 +-
 drivers/core/dump.c                           |   2 +-
 drivers/core/fdtaddr.c                        |  14 +-
 drivers/core/lists.c                          |   8 +-
 drivers/core/ofnode.c                         |  16 +-
 drivers/core/read.c                           |   2 +-
 drivers/core/regmap.c                         |   2 +-
 drivers/core/root.c                           |  24 +-
 drivers/core/simple-bus.c                     |   6 +-
 drivers/core/syscon-uclass.c                  |   4 +-
 drivers/core/uclass.c                         |  12 +-
 drivers/core/util.c                           |   2 +-
 drivers/crypto/aspeed/aspeed_hace.c           |   2 +-
 drivers/crypto/fsl/jr.c                       |  24 +-
 drivers/crypto/hash/hash_sw.c                 |   2 +-
 drivers/ddr/altera/Makefile                   |   2 +-
 drivers/ddr/fsl/main.c                        |   8 +-
 drivers/ddr/fsl/options.c                     |   4 +-
 drivers/dfu/Makefile                          |  16 +-
 drivers/dfu/dfu_sf.c                          |   8 +-
 drivers/dma/apbh_dma.c                        |   2 +-
 drivers/dma/dma-uclass.c                      |   2 +-
 drivers/fastboot/fb_command.c                 |  28 +-
 drivers/fastboot/fb_common.c                  |   4 +-
 drivers/fastboot/fb_mmc.c                     |   4 +-
 drivers/firmware/Makefile                     |   2 +-
 drivers/firmware/firmware-uclass.c            |   2 +-
 drivers/firmware/psci.c                       |   2 +-
 drivers/fpga/fpga.c                           |   4 +-
 drivers/fpga/xilinx.c                         |   2 +-
 drivers/fpga/zynqmppl.c                       |  12 +-
 drivers/gpio/Kconfig                          |   4 +
 drivers/gpio/Makefile                         |  10 +-
 drivers/gpio/at91_gpio.c                      |  12 +-
 drivers/gpio/atmel_pio4.c                     |   2 +-
 drivers/gpio/bcm2835_gpio.c                   |   2 +-
 drivers/gpio/da8xx_gpio.c                     |   4 +-
 drivers/gpio/da8xx_gpio.h                     |   2 +-
 drivers/gpio/gpio-uclass.c                    |  16 +-
 drivers/gpio/imx_rgpio2p.c                    |   2 +-
 drivers/gpio/intel_gpio.c                     |   6 +-
 drivers/gpio/mpc83xx_spisel_boot.c            |   4 +-
 drivers/gpio/mpc8xxx_gpio.c                   |   4 +-
 drivers/gpio/mvebu_gpio.c                     |   2 +-
 drivers/gpio/mxc_gpio.c                       |  12 +-
 drivers/gpio/mxs_gpio.c                       |  10 +-
 drivers/gpio/omap_gpio.c                      |  14 +-
 drivers/gpio/sandbox.c                        |  12 +-
 drivers/gpio/sunxi_gpio.c                     |   4 +-
 drivers/hwspinlock/Kconfig                    |   4 +
 drivers/i2c/Kconfig                           |  26 +
 drivers/i2c/Makefile                          |  14 +-
 drivers/i2c/designware_i2c.c                  |  12 +-
 drivers/i2c/designware_i2c.h                  |   2 +-
 drivers/i2c/fsl_i2c.c                         |   6 +-
 drivers/i2c/i2c-emul-uclass.c                 |   4 +-
 drivers/i2c/i2c-uclass.c                      |  18 +-
 drivers/i2c/lpc32xx_i2c.c                     |   4 +-
 drivers/i2c/muxes/pca954x.c                   |   4 +-
 drivers/i2c/mv_i2c.c                          |   2 +-
 drivers/i2c/mvtwsi.c                          |  16 +-
 drivers/i2c/mxc_i2c.c                         |   8 +-
 drivers/i2c/omap24xx_i2c.c                    |   8 +-
 drivers/i2c/sun6i_p2wi.c                      |   4 +-
 drivers/i2c/sun8i_rsb.c                       |   4 +-
 drivers/input/Makefile                        |   7 +-
 drivers/input/input.c                         |   2 +-
 drivers/input/twl6030.c                       |  47 --
 drivers/iommu/Kconfig                         |   4 +
 drivers/iommu/iommu-uclass.c                  |   6 +-
 drivers/led/Makefile                          |   2 +-
 drivers/mailbox/Makefile                      |   2 +-
 drivers/misc/Makefile                         |  22 +-
 drivers/misc/cros_ec.c                        |   2 +-
 drivers/misc/fs_loader.c                      |   2 +-
 drivers/misc/gsc.c                            |   2 +-
 drivers/misc/irq-uclass.c                     |   4 +-
 drivers/misc/irq_sandbox.c                    |   2 +-
 drivers/misc/misc-uclass.c                    |   2 +-
 drivers/misc/p2sb-uclass.c                    |   6 +-
 drivers/misc/qfw.c                            |   2 +-
 drivers/misc/test_drv.c                       |   2 +-
 drivers/mmc/Makefile                          |  10 +-
 drivers/mmc/davinci_mmc.c                     |  26 +-
 drivers/mmc/dw_mmc.c                          |   2 +-
 drivers/mmc/fsl_esdhc.c                       |  11 +-
 drivers/mmc/fsl_esdhc_imx.c                   |  52 +-
 drivers/mmc/ftsdc010_mci.c                    |   8 +-
 drivers/mmc/jz_mmc.c                          |   4 +-
 drivers/mmc/mmc-uclass.c                      |  24 +-
 drivers/mmc/mmc.c                             | 148 ++---
 drivers/mmc/mmc_legacy.c                      |   6 +-
 drivers/mmc/mmc_private.h                     |   8 +-
 drivers/mmc/mmc_write.c                       |   8 +-
 drivers/mmc/mtk-sd.c                          |   8 +-
 drivers/mmc/mv_sdhci.c                        |   4 +-
 drivers/mmc/mxsmmc.c                          |  32 +-
 drivers/mmc/octeontx_hsmmc.c                  |   2 +-
 drivers/mmc/omap_hsmmc.c                      |  60 +-
 drivers/mmc/pci_mmc.c                         |   2 +-
 drivers/mmc/renesas-sdhi.c                    |  40 +-
 drivers/mmc/rockchip_dw_mmc.c                 |   6 +-
 drivers/mmc/rockchip_sdhci.c                  |   2 +-
 drivers/mmc/sandbox_mmc.c                     |   2 +-
 drivers/mmc/sdhci.c                           |  24 +-
 drivers/mmc/socfpga_dw_mmc.c                  |   2 +-
 drivers/mmc/stm32_sdmmc2.c                    |   4 +-
 drivers/mmc/sunxi_mmc.c                       |   2 +-
 drivers/mmc/tmio-common.h                     |   2 +-
 drivers/mmc/uniphier-sd.c                     |   2 +-
 drivers/mmc/zynq_sdhci.c                      |   2 +-
 drivers/mtd/Makefile                          |   4 +-
 drivers/mtd/mtdcore.c                         |   2 +-
 drivers/mtd/mtdpart.c                         |   4 +-
 drivers/mtd/nand/Makefile                     |   2 +-
 drivers/mtd/nand/raw/Makefile                 |   3 +-
 drivers/mtd/nand/raw/davinci_nand.c           |   2 +-
 drivers/mtd/nand/raw/fsl_elbc_nand.c          |   2 +-
 drivers/mtd/nand/raw/kb9202_nand.c            | 134 ----
 drivers/mtd/nand/raw/mxs_nand.c               |   2 +-
 drivers/mtd/nand/raw/nand.c                   |   6 +-
 drivers/mtd/nand/raw/nand_base.c              |   4 +-
 drivers/mtd/nand/raw/omap_elm.c               |   2 +-
 drivers/mtd/nand/raw/omap_gpmc.c              |   2 +-
 drivers/mtd/spi/Kconfig                       |   4 +
 drivers/mtd/spi/Makefile                      |   8 +-
 drivers/mtd/spi/sf-uclass.c                   |   4 +-
 drivers/mtd/spi/sf_internal.h                 |   4 +-
 drivers/mtd/spi/sf_mtd.c                      |   6 +-
 drivers/mtd/spi/sf_probe.c                    |  14 +-
 drivers/mtd/spi/spi-nor-core.c                |  18 +-
 drivers/mtd/spi/spi-nor-ids.c                 |   2 +-
 drivers/mtd/spi/spi-nor-tiny.c                |   2 +-
 drivers/mux/Makefile                          |   4 +-
 drivers/net/designware.c                      |  14 +-
 drivers/net/designware.h                      |   4 +-
 drivers/net/eth-phy-uclass.c                  |   4 +-
 drivers/net/fec_mxc.c                         |  10 +-
 drivers/net/fec_mxc.h                         |   2 +-
 drivers/net/fm/fm.c                           |   6 +-
 drivers/net/mvneta.c                          |  10 +-
 drivers/net/mvpp2.c                           |   8 +-
 drivers/net/phy/Kconfig                       |   3 +
 drivers/net/rtl8169.c                         |   2 +-
 drivers/net/sh_eth.c                          |  10 +-
 drivers/net/smc911x.c                         |   2 +-
 drivers/net/sun8i_emac.c                      |  10 +-
 drivers/net/ti/cpsw.c                         |   4 +-
 drivers/pch/pch-uclass.c                      |   2 +-
 drivers/pci/pci-uclass.c                      |   2 +-
 drivers/pci/pci_rom.c                         |   2 +-
 drivers/pci/pcie_dw_mvebu.c                   |   2 +-
 drivers/pci/pcie_imx.c                        |   4 +-
 drivers/phy/Makefile                          |   6 +-
 drivers/phy/cadence/Makefile                  |   2 +-
 drivers/phy/meson-axg-mipi-dphy.c             |   4 +-
 drivers/phy/meson-g12a-usb2.c                 |  12 +-
 drivers/phy/meson-g12a-usb3-pcie.c            |   4 +-
 drivers/phy/meson-gxbb-usb2.c                 |   8 +-
 drivers/phy/meson-gxl-usb2.c                  |  12 +-
 drivers/phy/nop-phy.c                         |  16 +-
 drivers/phy/phy-imx8mq-usb.c                  |   8 +-
 drivers/phy/ti/Makefile                       |   2 +-
 drivers/pinctrl/Makefile                      |   6 +-
 drivers/pinctrl/intel/pinctrl_apl.c           |   6 +-
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c |  12 +-
 drivers/pinctrl/mediatek/pinctrl-mtk-common.h |   4 +-
 drivers/pinctrl/mtmips/pinctrl-mt7620.c       |  12 +-
 drivers/pinctrl/mtmips/pinctrl-mt7621.c       |  18 +-
 drivers/pinctrl/mtmips/pinctrl-mt7628.c       |  18 +-
 drivers/pinctrl/mvebu/Kconfig                 |   4 +
 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c     |   4 +-
 drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c     |   4 +-
 drivers/pinctrl/nxp/pinctrl-mxs.c             |   2 +-
 drivers/pinctrl/pinctrl-generic.c             |   4 +-
 drivers/pinctrl/pinctrl-qe-io.c               |   2 +-
 drivers/pinctrl/pinctrl-stmfx.c               |   4 +-
 drivers/pinctrl/pinctrl-uclass.c              |  10 +-
 drivers/pinctrl/pinctrl_stm32.c               |   4 +-
 drivers/pinctrl/renesas/pfc.c                 |   4 +-
 drivers/pinctrl/rockchip/pinctrl-px30.c       |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3036.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3066.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3128.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3188.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk322x.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3288.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3308.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3328.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3368.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rk3399.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rv1108.c     |   2 +-
 drivers/pinctrl/rockchip/pinctrl-rv1126.c     |   2 +-
 .../pinctrl/uniphier/pinctrl-uniphier-core.c  |   6 +-
 .../pinctrl/uniphier/pinctrl-uniphier-pro4.c  |   2 +-
 .../pinctrl/uniphier/pinctrl-uniphier-pro5.c  |   2 +-
 drivers/power/Makefile                        |   8 +-
 drivers/power/acpi_pmc/Makefile               |   2 +-
 drivers/power/axp305.c                        |   2 +-
 drivers/power/domain/Makefile                 |   2 +-
 drivers/power/domain/power-domain-uclass.c    |   2 +-
 drivers/power/exynos-tmu.c                    |   2 +-
 drivers/power/palmas.c                        |   2 +-
 drivers/power/pmic/Makefile                   |  30 +-
 drivers/power/pmic/as3722.c                   |   4 +-
 drivers/power/pmic/axp.c                      |   4 +-
 drivers/power/pmic/bd71837.c                  |   2 +-
 drivers/power/pmic/pca9450.c                  |   2 +-
 drivers/power/pmic/pmic-uclass.c              |   2 +-
 drivers/power/pmic/pmic_tps62362.c            |   6 +-
 drivers/power/pmic/pmic_tps65217.c            |  18 +-
 drivers/power/pmic/pmic_tps65218.c            |   4 +-
 drivers/power/pmic/pmic_tps65910.c            |   6 +-
 drivers/power/pmic/rk8xx.c                    |   8 +-
 drivers/power/pmic/stpmic1.c                  |   6 +-
 drivers/power/power_i2c.c                     |   8 +-
 drivers/power/regulator/Makefile              |  38 +-
 drivers/power/twl4030.c                       |   2 +-
 drivers/power/twl6030.c                       |   2 +-
 drivers/ram/Makefile                          |   2 +-
 drivers/ram/k3-am654-ddrss.c                  |   2 +-
 drivers/ram/rockchip/dmc-rk3368.c             |   8 +-
 drivers/ram/rockchip/sdram_rk3066.c           |   4 +-
 drivers/ram/rockchip/sdram_rk3188.c           |   8 +-
 drivers/ram/rockchip/sdram_rk322x.c           |   8 +-
 drivers/ram/rockchip/sdram_rk3288.c           |   8 +-
 drivers/ram/rockchip/sdram_rk3328.c           |   8 +-
 drivers/ram/rockchip/sdram_rk3399.c           |  10 +-
 drivers/reboot-mode/reboot-mode-gpio.c        |   8 +-
 drivers/reboot-mode/reboot-mode-rtc.c         |   4 +-
 drivers/reboot-mode/reboot-mode-uclass.c      |   2 +-
 drivers/remoteproc/Makefile                   |   2 +-
 drivers/remoteproc/rproc-uclass.c             |   2 +-
 drivers/reset/Kconfig                         |   8 +
 drivers/reset/reset-at91.c                    |   2 +-
 drivers/reset/reset-socfpga.c                 |   2 +-
 drivers/rtc/Kconfig                           |  18 +
 drivers/rtc/Makefile                          |   6 +-
 drivers/rtc/ds1337.c                          |   2 +-
 drivers/rtc/ds3231.c                          |   2 +-
 drivers/rtc/pcf8563.c                         |   2 +-
 drivers/rtc/pt7c4338.c                        |   2 +-
 drivers/rtc/rtc-uclass.c                      |   2 +-
 drivers/rtc/sandbox_rtc.c                     |   4 +-
 drivers/scsi/Makefile                         |   2 +-
 drivers/serial/Kconfig                        |   6 +
 drivers/serial/Makefile                       |   4 +-
 drivers/serial/altera_jtag_uart.c             |   2 +-
 drivers/serial/altera_uart.c                  |   4 +-
 drivers/serial/atmel_usart.c                  |  16 +-
 drivers/serial/ns16550.c                      |  31 +-
 drivers/serial/sandbox.c                      |   6 +-
 drivers/serial/serial-uclass.c                |  32 +-
 drivers/serial/serial_ar933x.c                |   4 +-
 drivers/serial/serial_arc.c                   |   4 +-
 drivers/serial/serial_bcm283x_mu.c            |   4 +-
 drivers/serial/serial_bcm283x_pl011.c         |   2 +-
 drivers/serial/serial_bcm6345.c               |   4 +-
 drivers/serial/serial_linflexuart.c           |   4 +-
 drivers/serial/serial_lpuart.c                |  10 +-
 drivers/serial/serial_meson.c                 |   2 +-
 drivers/serial/serial_msm_geni.c              |   6 +-
 drivers/serial/serial_mt7620.c                |  14 +-
 drivers/serial/serial_mtk.c                   |   7 +-
 drivers/serial/serial_mvebu_a3700.c           |   4 +-
 drivers/serial/serial_mxc.c                   |  12 +-
 drivers/serial/serial_ns16550.c               |   4 +-
 drivers/serial/serial_omap.c                  |  14 +-
 drivers/serial/serial_pic32.c                 |   4 +-
 drivers/serial/serial_pl01x.c                 |  10 +-
 drivers/serial/serial_pl01x_internal.h        |   2 +-
 drivers/serial/serial_rockchip.c              |   6 +-
 drivers/serial/serial_s5p.c                   |   4 +-
 drivers/serial/serial_sbi.c                   |   2 +-
 drivers/serial/serial_semihosting.c           |   2 +-
 drivers/serial/serial_sh.c                    |   6 +-
 drivers/serial/serial_sifive.c                |   4 +-
 drivers/serial/serial_stm32.c                 |   6 +-
 drivers/serial/serial_xen.c                   |   6 +-
 drivers/serial/serial_xuartlite.c             |   4 +-
 drivers/serial/serial_zynq.c                  |   4 +-
 drivers/spi/Makefile                          |   2 +-
 drivers/spi/atmel_spi.c                       |  10 +-
 drivers/spi/cf_spi.c                          |   4 +-
 drivers/spi/davinci_spi.c                     |   4 +-
 drivers/spi/designware_spi.c                  |   6 +-
 drivers/spi/fsl_espi.c                        |   6 +-
 drivers/spi/ich.c                             |   8 +-
 drivers/spi/ich.h                             |   2 +-
 drivers/spi/mvebu_a3700_spi.c                 |   6 +-
 drivers/spi/mxc_spi.c                         |   8 +-
 drivers/spi/mxs_spi.c                         |   8 +-
 drivers/spi/nxp_fspi.c                        |  10 +-
 drivers/spi/omap3_spi.c                       |   4 +-
 drivers/spi/pl022_spi.c                       |   4 +-
 drivers/spi/renesas_rpc_spi.c                 |   4 +-
 drivers/spi/rk_spi.c                          |   8 +-
 drivers/spi/rockchip_sfc.c                    |   8 +-
 drivers/spi/sh_qspi.c                         |   4 +-
 drivers/spi/spi-uclass.c                      |  12 +-
 drivers/spi/ti_qspi.c                         |   2 +-
 drivers/sysreset/Makefile                     |   6 +-
 drivers/sysreset/sysreset_mpc83xx.c           |   4 +-
 drivers/sysreset/sysreset_sandbox.c           |   2 +-
 drivers/timer/Makefile                        |   6 +-
 drivers/timer/andes_plmt_timer.c              |   2 +-
 drivers/timer/cadence-ttc.c                   |   2 +-
 drivers/timer/dw-apb-timer.c                  |   8 +-
 drivers/timer/omap-timer.c                    |   2 +-
 drivers/timer/ostm_timer.c                    |   2 +-
 drivers/timer/riscv_timer.c                   |   2 +-
 drivers/timer/rockchip_timer.c                |  12 +-
 drivers/timer/sandbox_timer.c                 |   2 +-
 drivers/timer/sifive_clint_timer.c            |   2 +-
 drivers/timer/timer-uclass.c                  |   6 +-
 drivers/timer/tsc_timer.c                     |   8 +-
 drivers/tpm/Makefile                          |   4 +-
 drivers/tpm/tpm-uclass.c                      |   2 +-
 drivers/tpm/tpm2_tis_spi.c                    |   2 +-
 drivers/usb/cdns3/Makefile                    |   4 +-
 drivers/usb/cdns3/core.c                      |   6 +-
 drivers/usb/common/Makefile                   |   2 +-
 drivers/usb/common/common.c                   |   2 +-
 drivers/usb/common/usb_urb.c                  |   2 +-
 drivers/usb/dwc3/Makefile                     |   2 +-
 drivers/usb/dwc3/core.c                       |   4 +-
 drivers/usb/dwc3/core.h                       |   2 +-
 drivers/usb/dwc3/dwc3-generic.c               |  12 +-
 drivers/usb/dwc3/dwc3-layerscape.c            |   6 +-
 drivers/usb/dwc3/dwc3-meson-g12a.c            |   8 +-
 drivers/usb/dwc3/dwc3-meson-gxl.c             |   8 +-
 drivers/usb/gadget/ci_udc.c                   |   4 +-
 drivers/usb/gadget/composite.c                |   2 +-
 drivers/usb/gadget/dwc2_udc_otg.c             |  16 +-
 drivers/usb/gadget/f_fastboot.c               |   2 +-
 drivers/usb/gadget/udc/Makefile               |   6 +-
 drivers/usb/gadget/udc/udc-uclass.c           |   4 +-
 drivers/usb/host/Makefile                     |   6 +-
 drivers/usb/host/dwc2.c                       |  14 +-
 drivers/usb/host/dwc3-of-simple.c             |   2 +-
 drivers/usb/host/ehci-atmel.c                 |   2 +-
 drivers/usb/host/ehci-hcd.c                   |  12 +-
 drivers/usb/host/ehci-marvell.c               |   4 +-
 drivers/usb/host/ehci-mx6.c                   |  18 +-
 drivers/usb/host/ehci-mxs.c                   |   4 +-
 drivers/usb/host/ehci-pci.c                   |   8 +-
 drivers/usb/host/ehci-vf.c                    |   2 +-
 drivers/usb/host/ohci-da8xx.c                 |   2 +-
 drivers/usb/host/ohci-hcd.c                   |  10 +-
 drivers/usb/host/ohci-lpc32xx.c               |   8 +-
 drivers/usb/host/ohci.h                       |   4 +-
 drivers/usb/host/r8a66597-hcd.c               |   4 +-
 drivers/usb/host/xhci-dwc3.c                  |   2 +-
 drivers/usb/host/xhci-mem.c                   |   6 +-
 drivers/usb/mtu3/mtu3_plat.c                  |   4 +-
 drivers/usb/musb-new/musb_uboot.c             |  16 +-
 drivers/usb/musb-new/omap2430.c               |   6 +-
 drivers/usb/musb-new/ti-musb.c                |  20 +-
 drivers/video/dw_hdmi.c                       |   2 +-
 drivers/video/meson/meson_dw_hdmi.c           |   4 +-
 drivers/video/mxsfb.c                         |   2 +-
 drivers/video/nexell_display.c                |   4 +-
 drivers/video/video-uclass.c                  |   6 +-
 drivers/virtio/Kconfig                        |   4 +
 drivers/w1-eeprom/w1-eeprom-uclass.c          |   2 +-
 drivers/w1/w1-uclass.c                        |   2 +-
 drivers/watchdog/Makefile                     |   2 +-
 drivers/watchdog/designware_wdt.c             |   8 +-
 drivers/watchdog/imx_watchdog.c               |   4 +-
 drivers/watchdog/omap_wdt.c                   |   4 +-
 drivers/watchdog/wdt-uclass.c                 |   2 +-
 dts/Kconfig                                   |   4 +
 env/Kconfig                                   |  10 +
 env/Makefile                                  |  22 +-
 env/env.c                                     |   4 +-
 env/mmc.c                                     |   4 +-
 env/sf.c                                      |   2 +-
 fs/fat/Makefile                               |   4 +-
 fs/fat/fat.c                                  |   6 +-
 fs/fs.c                                       |   8 +-
 fs/sandbox/Makefile                           |   2 +-
 fs/squashfs/Makefile                          |   2 +-
 include/_exports.h                            |   4 +-
 include/asm-generic/global_data.h             |  34 +-
 include/asm-generic/gpio.h                    |   2 +-
 include/atf_common.h                          |   2 +-
 include/binman_sym.h                          |   6 +-
 include/blk.h                                 |   8 +-
 include/bootdev.h                             |   2 +-
 include/bootstage.h                           |   4 +-
 include/cli.h                                 |   2 +-
 include/clk.h                                 |  10 +-
 include/command.h                             |   2 +-
 include/config_distro_bootcmd.h               |   4 +-
 include/configs/MCR3000.h                     |   2 +-
 include/configs/MPC837XERDB.h                 |  10 +-
 include/configs/MPC8548CDS.h                  |  12 +-
 include/configs/P2041RDB.h                    |   8 +-
 include/configs/T102xRDB.h                    |   4 +-
 include/configs/T104xRDB.h                    |   2 +-
 include/configs/T208xQDS.h                    |   4 +-
 include/configs/T208xRDB.h                    |   4 +-
 include/configs/T4240RDB.h                    |   2 +-
 include/configs/am335x_evm.h                  |   4 +-
 include/configs/am3517_evm.h                  |   2 +-
 include/configs/at91sam9260ek.h               |   2 +-
 include/configs/baltos.h                      |   2 +-
 include/configs/bcmstb.h                      |   2 +-
 include/configs/cgtqmx8.h                     |   2 +-
 include/configs/corvus.h                      |   6 +-
 include/configs/devkit3250.h                  |   6 +-
 include/configs/evb_ast2500.h                 |   2 +-
 include/configs/evb_ast2600.h                 |   2 +-
 .../configs/gardena-smart-gateway-at91sam.h   |   4 +-
 .../configs/gardena-smart-gateway-mt7688.h    |   2 +-
 include/configs/hikey.h                       |   2 +-
 include/configs/hikey960.h                    |   2 +-
 include/configs/imx6-engicam.h                |   2 +-
 include/configs/imx6_logic.h                  |   2 +-
 include/configs/imx8mm-cl-iot-gate.h          |   4 +-
 include/configs/imx8mp_rsb3720.h              |   4 +-
 include/configs/imx8qm_rom7720.h              |   2 +-
 include/configs/j721e_evm.h                   |   4 +-
 include/configs/kmcent2.h                     |   2 +-
 include/configs/kontron-sl-mx6ul.h            |   2 +-
 include/configs/linkit-smart-7688.h           |   2 +-
 include/configs/ls1021aqds.h                  |   6 +-
 include/configs/ls1043a_common.h              |   8 +-
 include/configs/ls1043aqds.h                  |   4 +-
 include/configs/ls1043ardb.h                  |   4 +-
 include/configs/ls1046a_common.h              |   6 +-
 include/configs/ls1046aqds.h                  |   6 +-
 include/configs/ls1088a_common.h              |   2 +-
 include/configs/ls2080a_common.h              |   4 +-
 include/configs/ls2080aqds.h                  |   2 +-
 include/configs/meesc.h                       |   2 +-
 include/configs/microblaze-generic.h          |   2 +-
 include/configs/mt7620.h                      |   2 +-
 include/configs/mt7622.h                      |   4 +-
 include/configs/mt7628.h                      |   2 +-
 include/configs/mt7981.h                      |   4 +-
 include/configs/mt7986.h                      |   4 +-
 include/configs/mt8512.h                      |   2 +-
 include/configs/mv-common.h                   |   4 +-
 include/configs/octeontx2_common.h            |   2 +-
 include/configs/octeontx_common.h             |   2 +-
 include/configs/p1_p2_rdb_pc.h                |  20 +-
 include/configs/pm9g45.h                      |   2 +-
 include/configs/rockchip-common.h             |   4 +-
 include/configs/rpi.h                         |   6 +-
 include/configs/siemens-am33x-common.h        |   2 +-
 include/configs/smartweb.h                    |   6 +-
 include/configs/sunxi-common.h                |   2 +-
 include/configs/taurus.h                      |   6 +-
 include/configs/ti_armv7_common.h             |   2 +-
 include/configs/ti_omap4_common.h             |   2 +-
 include/configs/vocore2.h                     |   2 +-
 include/configs/work_92105.h                  |   6 +-
 include/configs/x530.h                        |   2 +-
 include/configs/x86-common.h                  |   2 +-
 include/dfu.h                                 |  14 +-
 include/dm/acpi.h                             |   2 +-
 include/dm/device-internal.h                  |  14 +-
 include/dm/device.h                           |  30 +-
 include/dm/device_compat.h                    |   4 +-
 include/dm/devres.h                           |   2 +-
 include/dm/ofnode.h                           |   6 +-
 include/dm/pinctrl.h                          |   4 +-
 include/dm/platdata.h                         |   6 +-
 include/dm/read.h                             |   8 +-
 include/dm/root.h                             |   2 +-
 include/dm/uclass-internal.h                  |   4 +-
 include/dm/util.h                             |   4 +-
 include/dma.h                                 |   4 +-
 include/dt-structs.h                          |   2 +-
 include/dwc3-uboot.h                          |   2 +-
 include/efi_loader.h                          |   6 +-
 include/env_internal.h                        |   2 +-
 include/errno.h                               |   2 +-
 include/event.h                               |  10 +-
 include/exports.h                             |   4 +-
 include/fdt_support.h                         |   2 +-
 include/generic-phy.h                         |   2 +-
 include/handoff.h                             |   2 +-
 include/hash.h                                |   2 +-
 include/hwspinlock.h                          |   2 +-
 include/i2c.h                                 |   6 +-
 include/i2c_eeprom.h                          |   2 +-
 include/image.h                               |   6 +-
 include/init.h                                |   2 +-
 include/iommu.h                               |   4 +-
 include/irq.h                                 |   2 +-
 include/linux/compiler_types.h                |   2 +-
 include/linux/kconfig.h                       | 150 ++---
 include/linux/mtd/mtd.h                       |   4 +-
 include/linux/mtd/spi-nor.h                   |   2 +-
 include/linux/usb/gadget.h                    |   2 +-
 include/linux/usb/phy.h                       |   2 +-
 include/log.h                                 |  12 +-
 include/malloc.h                              |   2 +-
 include/mmc.h                                 |  36 +-
 include/mpc85xx.h                             |   2 +-
 include/mux.h                                 |   2 +-
 include/nand.h                                |   2 +-
 include/net.h                                 |   2 +-
 include/ns16550.h                             |   6 +-
 include/nvmem.h                               |   2 +-
 include/palmas.h                              |   2 +-
 include/part.h                                |  10 +-
 include/phys2bus.h                            |   2 +-
 include/power-domain.h                        |  16 +-
 include/power/max77686_pmic.h                 |   2 +-
 include/power/pmic.h                          |  15 +-
 include/power/regulator.h                     |   2 +-
 include/reboot-mode/reboot-mode-gpio.h        |   4 +-
 include/remoteproc.h                          |   2 +-
 include/reset.h                               |   2 +-
 include/rtc.h                                 |   2 +-
 include/sdhci.h                               |   2 +-
 include/semihosting.h                         |   4 +-
 include/serial.h                              |   2 +-
 include/spi.h                                 |   4 +-
 include/spi_flash.h                           |   2 +-
 include/spl.h                                 |   6 +-
 include/syscon.h                              |   2 +-
 include/sysinfo.h                             |   2 +-
 include/tlv_eeprom.h                          |   6 +-
 include/twl4030.h                             |   2 +-
 include/twl6030.h                             |   2 +-
 include/usb.h                                 |  12 +-
 include/usb/xhci.h                            |   8 +-
 include/watchdog.h                            |   2 +-
 include/xilinx.h                              |   2 +-
 include/zynqmppl.h                            |   2 +-
 lib/Kconfig                                   |  38 ++
 lib/Makefile                                  |  54 +-
 lib/acpi/Makefile                             |   8 +-
 lib/aes/Makefile                              |   2 +-
 lib/asm-offsets.c                             |   2 +-
 lib/crypto/Makefile                           |  14 +-
 lib/display_options.c                         |   2 +-
 lib/ecdsa/Makefile                            |   2 +-
 lib/efi/efi_app.c                             |   2 +-
 lib/efi/efi_stub.c                            |  10 +-
 lib/efi_loader/Kconfig                        |   8 +
 lib/efi_loader/efi_conformance.c              |   2 +-
 lib/efi_loader/efi_console.c                  |   4 +-
 lib/efi_loader/efi_device_path.c              |   2 +-
 lib/efi_loader/efi_disk.c                     |   2 +-
 lib/efi_loader/efi_root_node.c                |   4 +-
 lib/efi_loader/efi_runtime.c                  |   8 +-
 lib/efi_selftest/efi_selftest_ecpt.c          |   2 +-
 lib/fdtdec.c                                  |  28 +-
 lib/hang.c                                    |   4 +-
 lib/hashtable.c                               |   2 +-
 lib/hexdump.c                                 |   2 +-
 lib/image-sparse.c                            |   2 +-
 lib/libfdt/Makefile                           |   2 +-
 lib/lmb.c                                     |   4 +-
 lib/panic.c                                   |   2 +-
 lib/rsa/Makefile                              |   4 +-
 lib/rsa/rsa-sign.c                            |   2 +-
 lib/rsa/rsa-verify.c                          |  10 +-
 lib/semihosting.c                             |   2 +-
 lib/string.c                                  |   2 +-
 lib/time.c                                    |   2 +-
 lib/tiny-printf.c                             |   6 +-
 lib/trace.c                                   |   2 +-
 lib/vsprintf.c                                |   8 +-
 net/Kconfig                                   |   4 +
 net/Makefile                                  |   8 +-
 net/bootp.c                                   |   2 +-
 net/eth-uclass.c                              |   4 +-
 net/eth_common.c                              |   2 +-
 net/mdio-uclass.c                             |   4 +-
 net/tftp.c                                    |   3 +-
 scripts/Kbuild.include                        |  16 -
 scripts/Makefile.autoconf                     |   8 +-
 scripts/Makefile.build                        |  12 +-
 scripts/Makefile.dts                          |   2 +-
 scripts/Makefile.spl                          |  66 +-
 scripts/basic/fixdep.c                        | 151 +++--
 scripts/checkpatch.pl                         |  16 -
 scripts/conf_nospl                            | 113 ++++
 scripts/kconfig/Makefile                      |   5 +-
 scripts/kconfig/conf.c                        |   6 +-
 scripts/kconfig/confdata.c                    | 405 +++++++++++-
 scripts/kconfig/expr.h                        |  28 +
 scripts/kconfig/lkc.h                         |   9 +
 scripts/kconfig/lkc_proto.h                   |  18 +-
 test/Kconfig                                  |   3 +
 test/Makefile                                 |  20 +-
 test/cmd_ut.c                                 |   2 +-
 test/dm/Makefile                              |   2 +-
 test/dm/clk_ccf.c                             |   4 +-
 test/dm/core.c                                |   2 +-
 test/dm/fastboot.c                            |   2 +-
 test/dm/of_platdata.c                         |   4 +-
 test/dm/ofnode.c                              |   2 +-
 test/dm/part.c                                |   2 +-
 test/dm/spi.c                                 |   2 +-
 test/fuzz/Makefile                            |   2 +-
 test/lib/Kconfig                              |  20 +-
 test/lib/kconfig.c                            |  21 +-
 test/lib/kconfig_spl.c                        |  16 +-
 test/print_ut.c                               |   4 +-
 test/py/tests/test_kconfig.py                 |   6 +-
 test/test-main.c                              |  26 +-
 test/unicode_ut.c                             |   4 +-
 tools/binman/test/generated/autoconf.h        |   4 +-
 tools/moveconfig.py                           | 594 +++++++++++++-----
 tools/patman/test_checkpatch.py               |   6 -
 1130 files changed, 4867 insertions(+), 3948 deletions(-)
 delete mode 100644 drivers/input/twl6030.c
 delete mode 100644 drivers/mtd/nand/raw/kb9202_nand.c
 create mode 100644 scripts/conf_nospl
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#1 lore raw

PATCH v3 1/95 mtd: Drop unused kb9202_nand driver

This is not used since time out of mind.

Drop the driver and Kconfig option.

---

(no changes since v1)

 drivers/mtd/nand/raw/Makefile      |   1 -
 drivers/mtd/nand/raw/kb9202_nand.c | 134 -----------------------------
 2 files changed, 135 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/kb9202_nand.c
drivers/mtd/nand/raw/Makefile +0 -1
index 666323e2219..add2b4cf655 100644
@@ -56,7 +56,6 @@ obj-$(CONFIG_NAND_DENALI) += denali.o
 obj-$(CONFIG_NAND_DENALI_DT) += denali_dt.o
 obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
-obj-$(CONFIG_NAND_KB9202) += kb9202_nand.o
 obj-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
 obj-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o
 obj-$(CONFIG_NAND_LPC32XX_MLC) += lpc32xx_nand_mlc.o
drivers/mtd/nand/raw/kb9202_nand.c deleted +0 -134

134 lines not on this page · raw message

Signature · 1 line
2.39.1.581.gbfd45094c4-goog
Acked-by on v3 1/95
#2 lore raw

Re: [PATCH v3 01/95] mtd: Drop unused kb9202_nand driver

Hi Simon

Quoted 168 lines · Simon Glass

This is not used since time out of mind.

Drop the driver and Kconfig option.

---

(no changes since v1)

 drivers/mtd/nand/raw/Makefile      |   1 -
 drivers/mtd/nand/raw/kb9202_nand.c | 134 -----------------------------
 2 files changed, 135 deletions(-)
 delete mode 100644 drivers/mtd/nand/raw/kb9202_nand.c
drivers/mtd/nand/raw/Makefile +0 -1
index 666323e2219..add2b4cf655 100644
@@ -56,7 +56,6 @@ obj-$(CONFIG_NAND_DENALI) += denali.o
 obj-$(CONFIG_NAND_DENALI_DT) += denali_dt.o
 obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
-obj-$(CONFIG_NAND_KB9202) += kb9202_nand.o
 obj-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o
 obj-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o
 obj-$(CONFIG_NAND_LPC32XX_MLC) += lpc32xx_nand_mlc.o
drivers/mtd/nand/raw/kb9202_nand.c deleted +0 -135
deleted file mode 100644
index 9d26532c780..00000000000
@@ -1,134 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * (C) Copyright 2006
- * KwikByte <[email protected]>
- *
- * (C) Copyright 2009
- * Matthias Kaehlcke <[email protected]>
- */
-
-#include <common.h>
-#include <linux/mtd/rawnand.h>
-#include <asm/io.h>
-#include <asm/arch/AT91RM9200.h>
-#include <asm/arch/hardware.h>
-
-#include <nand.h>
-
-/*
- *      hardware specific access to control-lines
- */
-
-#define MASK_ALE        (1 << 22)       /* our ALE is A22 */
-#define MASK_CLE        (1 << 21)       /* our CLE is A21 */
-
-#define KB9202_NAND_NCE (1 << 28) /* EN* on D28 */
-#define KB9202_NAND_BUSY (1 << 29) /* RB* on D29 */
-
-#define KB9202_SMC2_NWS (1 << 2)
-#define KB9202_SMC2_TDF (1 << 8)
-#define KB9202_SMC2_RWSETUP (1 << 24)
-#define KB9202_SMC2_RWHOLD (1 << 29)
-
-/*
- *     Board-specific function to access device control signals
- */
-static void kb9202_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl)
-{
-       struct nand_chip *this = mtd_to_nand(mtd);
-
-       if (ctrl & NAND_CTRL_CHANGE) {
-               ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
-
-               /* clear ALE and CLE bits */
-               IO_ADDR_W &= ~(MASK_ALE | MASK_CLE);
-
-               if (ctrl & NAND_CLE)
-                       IO_ADDR_W |= MASK_CLE;
-
-               if (ctrl & NAND_ALE)
-                       IO_ADDR_W |= MASK_ALE;
-
-               this->IO_ADDR_W = (void *) IO_ADDR_W;
-
-               if (ctrl & NAND_NCE)
-                       writel(KB9202_NAND_NCE, AT91C_PIOC_CODR);
-               else
-                       writel(KB9202_NAND_NCE, AT91C_PIOC_SODR);
-       }
-
-       if (cmd != NAND_CMD_NONE)
-               writeb(cmd, this->IO_ADDR_W);
-}
-
-
-/*
- * Board-specific function to access the device ready signal.
- */
-static int kb9202_nand_ready(struct mtd_info *mtd)
-{
-       return readl(AT91C_PIOC_PDSR) & KB9202_NAND_BUSY;
-}
-
-
-/*
- * Board-specific NAND init.  Copied from include/linux/mtd/nand.h for reference.
- *
- * struct nand_chip - NAND Private Flash Chip Data
- * @IO_ADDR_R:         [BOARDSPECIFIC] address to read the 8 I/O lines of the flash device
- * @IO_ADDR_W:         [BOARDSPECIFIC] address to write the 8 I/O lines of the flash device
- * @hwcontrol:         [BOARDSPECIFIC] hardwarespecific function for accesing control-lines
- * @dev_ready:         [BOARDSPECIFIC] hardwarespecific function for accesing device ready/busy line
- *                     If set to NULL no access to ready/busy is available and the ready/busy information
- *                     is read from the chip status register
- * @enable_hwecc:      [BOARDSPECIFIC] function to enable (reset) hardware ecc generator. Must only
- *                     be provided if a hardware ECC is available
- * @eccmode:           [BOARDSPECIFIC] mode of ecc, see defines
- * @chip_delay:                [BOARDSPECIFIC] chip dependent delay for transfering data from array to read regs (tR)
- * @options:           [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about
- *                     special functionality. See the defines for further explanation
-*/
-/*
- * This routine initializes controller and GPIOs.
- */
-int board_nand_init(struct nand_chip *nand)
-{
-       unsigned int value;
-
-       nand->ecc.mode = NAND_ECC_SOFT;
-       nand->cmd_ctrl = kb9202_nand_hwcontrol;
-       nand->dev_ready = kb9202_nand_ready;
-
-       /* in case running outside of bootloader */
-       writel(1 << AT91C_ID_PIOC, AT91C_PMC_PCER);
-
-       /* setup nand flash access (allow ample margin) */
-       /* 4 wait states, 1 setup, 1 hold, 1 float for 8-bit device */
-       writel(AT91C_SMC2_WSEN | KB9202_SMC2_NWS | KB9202_SMC2_TDF |
-               AT91C_SMC2_DBW_8 | KB9202_SMC2_RWSETUP | KB9202_SMC2_RWHOLD,
-               AT91C_SMC_CSR3);
-
-       /* enable internal NAND controller */
-       value = readl(AT91C_EBI_CSA);
-       value |= AT91C_EBI_CS3A_SMC_SmartMedia;
-       writel(value, AT91C_EBI_CSA);
-
-       /* enable SMOE/SMWE */
-       writel(AT91C_PC1_BFRDY_SMOE | AT91C_PC3_BFBAA_SMWE, AT91C_PIOC_ASR);
-       writel(AT91C_PC1_BFRDY_SMOE | AT91C_PC3_BFBAA_SMWE, AT91C_PIOC_PDR);
-       writel(AT91C_PC1_BFRDY_SMOE | AT91C_PC3_BFBAA_SMWE, AT91C_PIOC_OER);
-
-       /* set NCE to high */
-       writel(KB9202_NAND_NCE, AT91C_PIOC_SODR);
-
-       /* disable output on pin connected to the busy line of the NAND */
-       writel(KB9202_NAND_BUSY, AT91C_PIOC_ODR);
-
-       /* enable the PIO to control NCE and BUSY */
-       writel(KB9202_NAND_NCE | KB9202_NAND_BUSY, AT91C_PIOC_PER);
-
-       /* enable output for NCE */
-       writel(KB9202_NAND_NCE, AT91C_PIOC_OER);
-
-       return (0);
-}
--
Quoted 2 lines

2.39.1.581.gbfd45094c4-goog

For the mtd changes

Michael

Signature · 11 lines
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
[email protected]
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
[email protected]
www.amarulasolutions.com
#3 lore raw

PATCH v3 2/95 mtd: Drop unused CONFIG_ONENAND_U_BOOT

In reply to Simon Glass

This option does not exist, so the Makefile rule does nothing. Drop it.

---

(no changes since v1)

 Makefile | 1 -
 1 file changed, 1 deletion(-)
Makefile +0 -1
index 86e0730f0cf..875cdda08f2 100644
@@ -956,7 +956,6 @@ endif
 # Always append INPUTS so that arch config.mk's can add custom ones
 INPUTS-y += u-boot.srec u-boot.bin u-boot.sym System.map binary_size_check
 
-INPUTS-$(CONFIG_ONENAND_U_BOOT) += u-boot-onenand.bin
 ifeq ($(CONFIG_SPL_FSL_PBL),y)
 INPUTS-$(CONFIG_RAMBOOT_PBL) += u-boot-with-spl-pbl.bin
 else
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#4 lore raw

PATCH v3 3/95 sh4: Drop unused twl6030 driver

In reply to Simon Glass

This is not used. Drop the driver and Kconfig option.

---

(no changes since v1)

 drivers/input/Makefile  |  1 -
 drivers/input/twl6030.c | 47 -----------------------------------------
 2 files changed, 48 deletions(-)
 delete mode 100644 drivers/input/twl6030.c
drivers/input/Makefile +0 -1
index 14c0ea73254..71f315adf6f 100644
@@ -14,5 +14,4 @@ obj-$(CONFIG_APPLE_SPI_KEYB) += apple_spi_kbd.o
 obj-$(CONFIG_I8042_KEYB) += i8042.o
 obj-$(CONFIG_TEGRA_KEYBOARD) += input.o tegra-kbc.o
 obj-$(CONFIG_TWL4030_INPUT) += twl4030.o
-obj-$(CONFIG_TWL6030_INPUT) += twl6030.o
 endif
drivers/input/twl6030.c deleted +0 -47

47 lines not on this page · raw message

Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#5 lore raw

PATCH v3 4/95 moveconfig: Update to detect / correct missing SPL Kconfigs

In reply to Simon Glass

This adds quite a few more features, all designed to detect problems with Kconfig options and their use. It can find options mentioned in the source code which are not in the Kconfig and vice versa. It can convert SPL usages of non-SPL Kconfig options (i.e. changing CONFIG_IS_ENABLED() to IS_ENABLED() and CONFIG_$(SPL)_FOO to CONFIG_FOO, creating commits automatically if requested.

These features are only useful for code clean-up, not for normal development.

---

(no changes since v2)

Changes in v2:
- Rebase to previous series

 tools/moveconfig.py | 599 +++++++++++++++++++++++++++++++++-----------
 1 file changed, 456 insertions(+), 143 deletions(-)
tools/moveconfig.py +456 -143
index c4d72ede368..b3ac2672737 100755
@@ -20,6 +20,7 @@ import doctest
 import filecmp
 import fnmatch
 import glob
+import io
 import multiprocessing
 import os
 import queue
@@ -118,6 +119,16 @@ def check_clean_directory():
         if os.path.exists(fname):
             sys.exit("source tree is not clean, please run 'make mrproper'")
 
+def write_commit(msg):
+    """Create a new commit with all modified files
+
+    Args:
+        msg (str): Commit message
+    """
+    subprocess.call(['git', 'add', '-u'])
+    rc = subprocess.call(['git', 'commit', '-s', '-m', msg])
+    return rc == 0
+
 def get_make_cmd():
     """Get the command name of GNU Make.
 
@@ -1606,30 +1617,59 @@ def prefix_config(cfg):
     return op + cfg
 
 
-RE_MK_CONFIGS = re.compile('CONFIG_(\$\(SPL_(?:TPL_)?\))?([A-Za-z0-9_]*)')
-RE_IFDEF = re.compile('(ifdef|ifndef)')
-RE_C_CONFIGS = re.compile('CONFIG_([A-Za-z0-9_]*)')
-RE_CONFIG_IS = re.compile('CONFIG_IS_ENABLED\(([A-Za-z0-9_]*)\)')
+RE_MK_CONFIGS = re.compile(r'CONFIG_(\$\(SPL_(?:TPL_)?\))?([A-Za-z0-9_]*)')
+
+# Makefile ifdefs: this only handles 'else' on its own line, so not
+# 'else ifeq ...', for example
+RE_IF = re.compile(r'^(ifdef|ifndef|endif|ifeq|ifneq|else)([^,]*,([^,]*)\))?.*$')
+
+# Normal CONFIG options in C
+RE_C_CONFIGS = re.compile(r'CONFIG_([A-Za-z0-9_]*)')
+
+# CONFIG_IS_ENABLED() construct
+RE_CONFIG_IS = re.compile(r'CONFIG_IS_ENABLED\(([A-Za-z0-9_]*)\)')
+
+# Preprocessor #if/#ifdef directives, etc.
+RE_IFDEF = re.compile(r'^\s*#\s*(ifdef|ifndef|endif|if|elif|else)\s*(?:#.*)?(.*)$')
 
 class ConfigUse:
-    def __init__(self, cfg, is_spl, fname, rest):
+    """Holds information about a use of a CONFIG option"""
+    def __init__(self, cfg, is_spl, conds, fname, rest, is_mk):
+        """Set up a new use of a CONFIG option
+
+        Args:
+            cfg (str): Config option, without the CONFIG_
+            is_spl (bool): True if it indicates an SPL option, i.e. has a
+                $(SPL_) or similar, False if not
+            conds (list of str): List of conditions for this use, e.g.
+                ['SPL_BUILD']
+            fname (str): Filename contining the use
+            rest (str): Entire line from the file
+            is_mk (bool): True if this is in a Makefile, False if not
+        """
         self.cfg = cfg
         self.is_spl = is_spl
+        self.conds = list(c for c in conds if '(NONE)' not in c)
         self.fname = fname
         self.rest = rest
+        self.is_mk = is_mk
 
     def __hash__(self):
         return hash((self.cfg, self.is_spl))
 
-def scan_makefiles(fnames):
+    def __str__(self):
+        return (f'ConfigUse({self.cfg}, is_spl={self.is_spl}, '
+                f'is_mk={self.is_mk}, fname={self.fname}, rest={self.rest}')
+
+def scan_makefiles(fname_dict):
     """Scan Makefiles looking for Kconfig options
 
     Looks for uses of CONFIG options in Makefiles
 
     Args:
-        fnames (list of tuple):
-            str: Makefile filename where the option was found
-            str: Line of the Makefile
+        fname_dict (dict lines):
+            key: Makefile filename where the option was found
+            value: List of str lines of the Makefile
 
     Returns:
         tuple:
@@ -1646,46 +1686,81 @@ def scan_makefiles(fnames):
     ('$(SPL_)', 'MARY')
     >>> RE_MK_CONFIGS.search('CONFIG_$(SPL_TPL_)MARY').groups()
     ('$(SPL_TPL_)', 'MARY')
+    >>> RE_IF.match('ifdef CONFIG_SPL_BUILD').groups()
+    ('ifdef', None, None)
+    >>> RE_IF.match('endif # CONFIG_SPL_BUILD').groups()
+    ('endif', None, None)
+    >>> RE_IF.match('endif').groups()
+    ('endif', None, None)
+    >>> RE_IF.match('else').groups()
+    ('else', None, None)
     """
     all_uses = collections.defaultdict(list)
     fname_uses = {}
-    for fname, rest in fnames:
-        m_iter = RE_MK_CONFIGS.finditer(rest)
-        found = False
-        for m in m_iter:
-            found = True
-            real_opt = m.group(2)
-            if real_opt == '':
-                continue
-            is_spl = False
-            if m.group(1):
-                is_spl = True
-            use = ConfigUse(real_opt, is_spl, fname, rest)
-            if fname not in fname_uses:
-                fname_uses[fname] = set()
-            fname_uses[fname].add(use)
-            all_uses[use].append(rest)
+    for fname, rest_list in fname_dict.items():
+        conds = []
+        for rest in rest_list:
+            m_iter = RE_MK_CONFIGS.finditer(rest)
+            m_cond = RE_IF.match(rest)
+            #print('line', conds, m_cond and m_cond.group(1) or '.', rest)
+            last_use = None
+            use = None
+            for m in m_iter:
+                real_opt = m.group(2)
+                if real_opt == '':
+                    continue
+                is_spl = False
+                if m.group(1):
+                    is_spl = True
+                use = ConfigUse(real_opt, is_spl, conds, fname, rest, True)
+                if fname not in fname_uses:
+                    fname_uses[fname] = set()
+                fname_uses[fname].add(use)
+                all_uses[use].append(rest)
+                last_use = use
+            if m_cond:
+                cfg = last_use.cfg if last_use else '(NONE)'
+                cond = m_cond.group(1)
+                if cond == 'ifdef':
+                    conds.append(cfg)
+                elif cond == 'ifndef':
+                    conds.append(f'~{cfg}')
+                elif cond == 'ifeq':
+                    #print('todo', fname, m_cond.group(3), fname, rest)
+                    conds.append(f'{m_cond.group(3)}={cfg}')
+                elif cond == 'ifneq':
+                    conds.append(f'{m_cond.group(3)}={cfg}')
+                    #print('todo', m_cond.group(3))
+                elif cond == 'endif':
+                    conds.pop()
+                elif cond == 'else':
+                    cond = conds.pop()
+                    if cond.startswith('~'):
+                        cond = cond[1:]
+                    else:
+                        cond = f'~{cond}'
+                    conds.append(cond)
+                else:
+                    print(f'unknown condition: {rest}')
+        if conds:
+            print(f'leftover {conds}')
     return all_uses, fname_uses
 
-
-def scan_src_files(fnames):
+def scan_src_files(fname_dict, all_uses, fname_uses):
     """Scan source files (other than Makefiles) looking for Kconfig options
 
     Looks for uses of CONFIG options
 
     Args:
-        fnames (list of tuple):
-            str: Makefile filename where the option was found
-            str: Line of the Makefile
-
-    Returns:
-        tuple:
-            dict: all_uses
-                key (ConfigUse): object
-                value (list of str): matching lines
-            dict: Uses by filename
-                key (str): filename
-                value (set of ConfigUse): uses in that filename
+        fname_dict (dict):
+            key (str): Filename
+            value (list of ConfigUse): List of uses in that filename
+        all_uses (dict): to add more uses to:
+            key (ConfigUse): object
+            value (list of str): matching lines
+        fname (dict): to add more uses-by-filename to
+            key (str): filename
+            value (set of ConfigUse): uses in that filename
 
     >>> RE_C_CONFIGS.search('CONFIG_FRED').groups()
     ('FRED',)
@@ -1693,39 +1768,78 @@ def scan_src_files(fnames):
     ('MARY',)
     >>> RE_CONFIG_IS.search('#if CONFIG_IS_ENABLED(OF_PLATDATA)').groups()
     ('OF_PLATDATA',)
+    >>> RE_IFDEF.match('#ifdef CONFIG_SPL_BUILD').groups()
+    ('ifdef', 'CONFIG_SPL_BUILD')
+    >>> RE_IFDEF.match('#endif # CONFIG_SPL_BUILD').groups()
+    ('endif', '')
+    >>> RE_IFDEF.match('#endif').groups()
+    ('endif', '')
+    >>> RE_IFDEF.match('#else').groups()
+    ('else', '')
+    >>> RE_IFDEF.match(' # if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)').groups()
+    ('if', 'defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)')
     """
     def add_uses(m_iter, is_spl):
+        last_use = None
         for m in m_iter:
             found = True
             real_opt = m.group(1)
             if real_opt == '':
                 continue
-            use = ConfigUse(real_opt, is_spl, fname, rest)
+            use = ConfigUse(real_opt, is_spl, conds, fname, rest, False)
             if fname not in fname_uses:
                 fname_uses[fname] = set()
             fname_uses[fname].add(use)
             all_uses[use].append(rest)
-
-    all_uses = collections.defaultdict(list)
-    fname_uses = {}
-    for fname, rest in fnames:
-        m_iter = RE_C_CONFIGS.finditer(rest)
-        add_uses(m_iter, False)
-
-        m_iter2 = RE_CONFIG_IS.finditer(rest)
-        add_uses(m_iter2, True)
-
-    return all_uses, fname_uses
+            last_use = use
+        return last_use
+
+    for fname, rest_list in fname_dict.items():
+        conds = []
+        for rest in rest_list:
+            m_iter = RE_C_CONFIGS.finditer(rest)
+            m_cond = RE_IFDEF.match(rest)
+            last_use1 = add_uses(m_iter, False)
+
+            m_iter2 = RE_CONFIG_IS.finditer(rest)
+            last_use2 = add_uses(m_iter2, True)
+            last_use = last_use1 or last_use2
+            if m_cond:
+                cfg = last_use.cfg if last_use else '(NONE)'
+                cond = m_cond.group(1)
+                #print(fname, rest, cond, conds)
+                if cond == 'ifdef':
+                    conds.append(cfg)
+                elif cond == 'ifndef':
+                    conds.append(f'~{cfg}')
+                elif cond == 'if':
+                    #print('todo', fname, m_cond.group(3), fname, rest)
+                    conds.append(f'{m_cond.group(2)}={cfg}')
+                elif cond == 'endif':
+                    conds.pop()
+                elif cond == 'else':
+                    cond = conds.pop()
+                    if cond.startswith('~'):
+                        cond = cond[1:]
+                    else:
+                        cond = f'~{cond}'
+                    conds.append(cond)
+                elif cond == 'elif':
+                    cond = conds.pop()
+                    conds.append(cfg)
+                else:
+                    print(f'{fname}: unknown condition: {rest}')
 
 
 MODE_NORMAL, MODE_SPL, MODE_PROPER = range(3)
 
-def do_scan_source(path, do_update):
+def do_scan_source(path, do_update, show_conflicts, do_commit):
     """Scan the source tree for Kconfig inconsistencies
 
     Args:
         path (str): Path to source tree
-        do_update (bool) : True to write to scripts/kconf_... files
+        do_update (bool): True to write to scripts/kconf_... files
+        show_conflicts (bool): True to show conflicts
     """
     def is_not_proper(name):
         for prefix in SPL_PREFIXES:
@@ -1754,7 +1868,7 @@ def do_scan_source(path, do_update):
         """
         # Make sure we know about all the options
         not_found = collections.defaultdict(list)
-        for use, rest in all_uses.items():
+        for use, _ in all_uses.items():
             name = use.cfg
             if name in IGNORE_SYMS:
                 continue
@@ -1766,7 +1880,6 @@ def do_scan_source(path, do_update):
                 # If it is an SPL symbol, try prepending all SPL_ prefixes to
                 # find at least one SPL symbol
                 if use.is_spl:
-                    add_to_dict = False
                     for prefix in SPL_PREFIXES:
                         try_name = prefix + name
                         sym = kconf.syms.get(try_name)
@@ -1784,7 +1897,6 @@ def do_scan_source(path, do_update):
                 elif not use.is_spl:
                     check = False
             else: # MODE_NORMAL
-                debug = False
                 sym = kconf.syms.get(name)
                 if not sym:
                     proper_name = is_not_proper(name)
@@ -1819,105 +1931,304 @@ def do_scan_source(path, do_update):
             for i, use in enumerate(uses[name]):
                 print(f'{"   " if i else ""}{use.fname}: {use.rest.strip()}')
 
+    def do_scan():
+        """Scan the source tree
 
-    print('Scanning Kconfig')
-    kconf = KconfigScanner().conf
-    print(f'Scanning source in {path}')
-    args = ['git', 'grep', '-E', r'IS_ENABLED|\bCONFIG']
-    with subprocess.Popen(args, stdout=subprocess.PIPE) as proc:
-        out, err = proc.communicate()
-    lines = out.splitlines()
-    re_fname = re.compile('^([^:]*):(.*)')
-    src_list = []
-    mk_list = []
-    for line in lines:
-        linestr = line.decode('utf-8')
-        m_fname = re_fname.search(linestr)
-        if not m_fname:
-            continue
-        fname, rest = m_fname.groups()
-        dirname, leaf = os.path.split(fname)
-        root, ext = os.path.splitext(leaf)
-        if ext == '.autoconf':
-            pass
-        elif ext in ['.c', '.h', '.S', '.lds', '.dts', '.dtsi', '.asl', '.cfg',
-                     '.env', '.tmpl']:
-            src_list.append([fname, rest])
-        elif 'Makefile' in root or ext == '.mk':
-            mk_list.append([fname, rest])
-        elif ext in ['.yml', '.sh', '.py', '.awk', '.pl', '.rst', '', '.sed']:
-            pass
-        elif 'Kconfig' in root or 'Kbuild' in root:
-            pass
-        elif 'README' in root:
-            pass
-        elif dirname in ['configs']:
-            pass
-        elif dirname.startswith('doc') or dirname.startswith('scripts/kconfig'):
-            pass
+        This runs a 'git grep' and then picks out uses of CONFIG options from
+        the resulting output
+
+        Returns: tuple
+            dict of uses of CONFIG in Makefiles:
+                key (str): Filename
+                value (list of ConfigUse): List of uses in that filename
+            dict of uses of CONFIG in source files:
+                key (str): Filename
+                value (list of ConfigUse): List of uses in that filename
+        """
+        def finish_file(last_fname, rest_list):
+            if is_mkfile:
+                mk_dict[last_fname] = rest_list
+            else:
+                src_dict[last_fname] = rest_list
+            rest_list = []
+
+        print(f'Scanning source in {path}')
+        args = ['git', 'grep', '-E',
+                r'IS_ENABLED|\bCONFIG|CONFIG_SPL_BUILD|if|else|endif']
+        with subprocess.Popen(args, stdout=subprocess.PIPE) as proc:
+            out, _ = proc.communicate()
+        lines = out.splitlines()
+        re_fname = re.compile('^([^:]*):(.*)')
+        src_dict = collections.OrderedDict()
+        mk_dict = collections.OrderedDict()
+        last_fname = None
+        rest_list = []
+        is_mkfile = None
+        for line in lines:
+            linestr = line.decode('utf-8')
+            m_fname = re_fname.search(linestr)
+            if not m_fname:
+                continue
+            fname, rest = m_fname.groups()
+            if fname != last_fname:
+                finish_file(last_fname, rest_list)
+                rest_list = []
+                last_fname = fname
+
+            dirname, leaf = os.path.split(fname)
+            root, ext = os.path.splitext(leaf)
+            #if dirname != '' or root != 'Makefile':
+                #continue
+            if (dirname.startswith('test') or
+                dirname.startswith('lib/efi_selftest')):
+                # Ignore test code since it is mostly only for sandbox
+                pass
+            elif ext == '.autoconf':
+                pass
+            elif ext in ['.c', '.h', '.S', '.lds', '.dts', '.dtsi', '.asl',
+                         '.cfg', '.env', '.tmpl']:
+                rest_list.append(rest)
+                is_mkfile = False
+            elif 'Makefile' in root or ext == '.mk':
+                rest_list.append(rest)
+                is_mkfile = True
+            elif ext in ['.yml', '.sh', '.py', '.awk', '.pl', '.rst', '', '.sed',
+                         '.src', '.inc', '.l', '.i_shipped', '.txt', '.cmd',
+                         '.cfg', '.y', '.cocci', '.ini', '.asn1', '.base',
+                         '.cnf', '.patch', '.mak', '.its', '.svg', '.tcl',
+                         '.css', '.config', '.conf']:
+                pass
+            elif 'Kconfig' in root or 'Kbuild' in root:
+                pass
+            elif 'README' in root:
+                pass
+            elif dirname in ['configs']:
+                pass
+            elif dirname.startswith('doc') or dirname.startswith('scripts/kconfig'):
+                pass
+            else:
+                print(f'Not sure how to handle file {fname}')
+        finish_file(last_fname, rest_list)
+        return mk_dict, src_dict
+
+    def check_mk_missing(all_uses, spl_not_found, proper_not_found):
+        # Make sure we know about all the options in Makefiles
+        print('\nCONFIG options present in Makefiles but not Kconfig:')
+        not_found = check_not_found(all_uses, MODE_NORMAL)
+        show_uses(not_found)
+
+        print('\nCONFIG options present in Makefiles but not Kconfig (SPL):')
+        not_found = check_not_found(all_uses, MODE_SPL)
+        show_uses(not_found)
+        spl_not_found |= set(is_not_proper(key) or key for key in not_found.keys())
+
+        print('\nCONFIG options used as Proper in Makefiles but without a non-SPL_ variant:')
+        not_found = check_not_found(all_uses, MODE_PROPER)
+        show_uses(not_found)
+        proper_not_found |= set(key for key in not_found.keys())
+
+    def check_src_missing(all_uses, spl_not_found, proper_not_found):
+        # Make sure we know about all the options in source files
+        print('\nCONFIG options present in source but not Kconfig:')
+        not_found = check_not_found(all_uses, MODE_NORMAL)
+        show_uses(not_found)
+
+        print('\nCONFIG options present in source but not Kconfig (SPL):')
+        not_found = check_not_found(all_uses, MODE_SPL)
+        show_uses(not_found)
+        spl_not_found |= set(is_not_proper(key) or key
+                             for key in not_found.keys())
+
+        print('\nCONFIG options used as Proper in source but without a non-SPL_ variant:')
+        not_found = check_not_found(all_uses, MODE_PROPER)
+        show_uses(not_found)
+        proper_not_found |= set(key for key in not_found.keys())
+
+    def show_summary(spl_not_found, proper_not_found):
+        print('\nCONFIG options used as SPL but without an SPL_ variant:')
+        for item in sorted(spl_not_found):
+            print(f'   {item}')
+
+        print('\nCONFIG options used as Proper but without a non-SPL_ variant:')
+        for item in sorted(proper_not_found):
+            print(f'   {item}')
+
+    def write_update(spl_not_found, proper_not_found):
+        with open(os.path.join(path, 'scripts', 'conf_nospl'),
+                  encoding='utf-8') as out:
+            print('# These options should not be enabled in SPL builds\n',
+                  file=out)
+            for item in sorted(spl_not_found):
+                print(item, file=out)
+        with open(os.path.join(path, 'scripts', 'conf_noproper'), 'w',
+                  encoding='utf-8') as out:
+            print('# These options should not be enabled in Proper builds\n',
+                  file=out)
+            for item in sorted(proper_not_found):
+                print(item, file=out)
+
+    def check_conflict(kconf, all_uses, show):
+        """Check conflicts between uses of CONFIG options in source
+
+        Sometimes an option is used in an SPL context in once place and not in
+        another. For example if we see CONFIG_SPL_FOO and CONFIG_FOO then we
+        don't know whether FOO should be enabled in SPL if CONFIG_FOO is
+        enabled, or only if CONFIG_SPL_FOO is enabled.,
+
+        This function detects such situations
+
+        Args:
+            kconf (Kconfiglib.Kconfig): Kconfig tree read from source
+            all_uses (dict): dict to add more uses to:
+                key (ConfigUse): object
+                value (list of str): matching lines
+            show (bool): True to show the problems
+
+        Returns:
+            dict of conflicts:
+                key: filename
+                value: list of ConfigUse objects
+        """
+        conflict_dict = collections.defaultdict(list)
+        cfg_dict = collections.defaultdict(list)
+
+        uses = collections.defaultdict(list)
+        for use in all_uses:
+            uses[use.cfg].append(use)
+
+        bad = 0
+        for cfg in sorted(uses):
+            use_list = uses[cfg]
+
+            # Check if
+            #  - there is no SPL_ version of the symbol, and
+            #  - some uses are SPL and some are not
+            is_spl = list(set(u.is_spl for u in use_list))
+            if len(is_spl) > 1 and f'SPL_{cfg}' not in kconf.syms:
+                if show:
+                    print(f'{cfg}: {is_spl}')
+                for use in use_list:
+                    if show:
+                        print(f'   spl={use.is_spl}: {use.conds} {use.fname} {use.rest}')
+                    if use.is_spl:
+                        conflict_dict[use.fname].append(use)
+                        cfg_dict[use.cfg].append(use)
+                bad += 1
+        print(f'total bad: {bad}')
+        return conflict_dict, cfg_dict
+
+    def replace_in_file(fname, use_or_uses):
+        """Replace a CONFIG pattern in a file
+
+        Args:
+            fname (str): Filename to replace in
+            use_or_uses (ConfigUse or list of ConfigUse): Uses to replace
+        """
+        with open(fname, encoding='utf-8') as inf:
+            data = inf.read()
+        out = io.StringIO()
+
+        if isinstance(use_or_uses, list):
+            uses = use_or_uses
         else:
-            print(f'Not sure how to handle file {fname}')
+            uses = [use_or_uses]
 
-    # Scan the Makefiles
-    all_uses, fname_uses = scan_makefiles(mk_list)
+        re_cfgs = []
+        for use in uses:
+            if use.is_mk:
+                expr = r'CONFIG_(?:\$\(SPL_(?:TPL_)?\))%s\b' % use.cfg
+            else:
+                expr = r'CONFIG_IS_ENABLED\(%s\)' % use.cfg
+            re_cfgs.append(re.compile(expr))
+
+        for line in data.splitlines():
+            new_line = line
+            if 'CONFIG_' in line:
+                todo = []
+                for i, re_cfg in enumerate(re_cfgs):
+                    if not re_cfg.search(line):
+                        todo.append(re_cfg)
+                    use = uses[i]
+                    if use.is_mk:
+                        new_line = re_cfg.sub(f'CONFIG_{use.cfg}', new_line)
+                    else:
+                        new = f'IS_ENABLED(CONFIG_{use.cfg})'
+                        new_line = re_cfg.sub(new, new_line)
+                re_cfgs = todo
+            out.write(new_line)
+            out.write('\n')
+        out_data = out.getvalue()
+        if out_data == data:
+            print(f'\n\nfailed with {fname}\n\n')
+        with open(fname, 'w', encoding='utf-8') as outf:
+            outf.write(out_data)
+
+    def update_source(conflicts):
+        """Replace any SPL constructs with plain non-SPL ones
+
+        CONFIG_IS_ENABLED(FOO) becomes IS_ENABLED(CONFIG_FOO)
+        CONFIG$_(SPL_TPL_)FOO becomes CONFIG_FOO
 
-    spl_not_found = set()
-    proper_not_found = set()
+        Args:
+            conflicts (dict): dict of conflicts:
+                key (str): filename
+                value (list of ConfigUse): uses within that file
+        """
+        print(f'Updating {len(conflicts)} files')
+        for fname, uses in conflicts.items():
+            replace_in_file(fname, uses)
 
-    # Make sure we know about all the options
-    print('\nCONFIG options present in Makefiles but not Kconfig:')
-    not_found = check_not_found(all_uses, MODE_NORMAL)
-    show_uses(not_found)
+    def create_commits(cfg_dict):
+        """Create a set of commits to fix SPL conflicts
 
-    print('\nCONFIG options present in Makefiles but not Kconfig (SPL):')
-    not_found = check_not_found(all_uses, MODE_SPL)
-    show_uses(not_found)
-    spl_not_found |= set([is_not_proper(key) or key for key in not_found.keys()])
+        """
+        print(f'Creating {len(cfg_dict)} commits')
+        for cfg, uses in cfg_dict.items():
+            print(f'Processing {cfg}')
+            for use in uses:
+                #print(f'   {use.fname}: {use}')
+                replace_in_file(use.fname, use)
+            plural = 's' if len(uses) > 1 else ''
+            msg = f'Correct SPL use{plural} of {cfg}'
+            msg += f'\n\nThis converts {len(uses)} usage{plural} '
+            msg += 'of this option to the non-SPL form, since there is\n'
+            msg += f'no SPL_{cfg} defined in Kconfig'
+            if not write_commit(msg):
+                print('failed\n', uses)
+                break
 
-    print('\nCONFIG options used as Proper in Makefiles but without a non-SPL_ variant:')
-    not_found = check_not_found(all_uses, MODE_PROPER)
-    show_uses(not_found)
-    proper_not_found |= set([key for key in not_found.keys()])
+    print('Scanning Kconfig')
+    kconf = KconfigScanner().conf
 
-    # Scan the source code
-    all_uses, fname_uses = scan_src_files(src_list)
+    all_uses = collections.defaultdict(list)
+    fname_uses = {}
+    mk_dict, src_dict = do_scan()
+
+    # Scan the Makefiles
+    all_uses, fname_uses = scan_makefiles(mk_dict)
+    scan_src_files(src_dict, all_uses, fname_uses)
 
-    # Make sure we know about all the options
-    print('\nCONFIG options present in source but not Kconfig:')
-    not_found = check_not_found(all_uses, MODE_NORMAL)
-    show_uses(not_found)
+    conflicts, cfg_dict = check_conflict(kconf, all_uses, show_conflicts)
 
-    print('\nCONFIG options present in source but not Kconfig (SPL):')
-    not_found = check_not_found(all_uses, MODE_SPL)
-    show_uses(not_found)
-    spl_not_found |= set([is_not_proper(key) or key for key in not_found.keys()])
+    if do_update:
+        update_source(conflicts)
+    if do_commit:
+        create_commits(cfg_dict)
 
-    print('\nCONFIG options used as Proper in source but without a non-SPL_ variant:')
-    not_found = check_not_found(all_uses, MODE_PROPER)
-    show_uses(not_found)
-    proper_not_found |= set([key for key in not_found.keys()])
+    # Look for CONFIG options that are not found
+    spl_not_found = set()
+    proper_not_found = set()
+    check_mk_missing(all_uses, spl_not_found, proper_not_found)
 
-    print('\nCONFIG options used as SPL but without an SPL_ variant:')
-    for item in sorted(spl_not_found):
-        print(f'   {item}')
+    # Scan the source code
+    scan_src_files(src_dict, all_uses, fname_uses)
+    check_src_missing(all_uses, spl_not_found, proper_not_found)
 
-    print('\nCONFIG options used as Proper but without a non-SPL_ variant:')
-    for item in sorted(proper_not_found):
-        print(f'   {item}')
+    show_summary(spl_not_found, proper_not_found)
 
     # Write out the updated information
     if do_update:
-        with open(os.path.join(path, 'scripts', 'conf_nospl'), 'w') as out:
-            print('# These options should not be enabled in SPL builds\n',
-                  file=out)
-            for item in sorted(spl_not_found):
-                print(item, file=out)
-        with open(os.path.join(path, 'scripts', 'conf_noproper'), 'w') as out:
-            print('# These options should not be enabled in Proper builds\n',
-                  file=out)
-            for item in sorted(proper_not_found):
-                print(item, file=out)
-
+        write_update(spl_not_found, proper_not_found)
 
 def main():
     try:
@@ -1957,9 +2268,11 @@ doc/develop/moveconfig.rst for documentation.'''
     parser.add_argument('-i', '--imply', action='store_true', default=False,
                       help='find options which imply others')
     parser.add_argument('-I', '--imply-flags', type=str, default='',
-                      help="control the -i option ('help' for help")
+                      help="control the -i option ('help' for help)")
     parser.add_argument('-j', '--jobs', type=int, default=cpu_count,
                       help='the number of jobs to run simultaneously')
+    parser.add_argument('-l', '--list-problems', action='store_true',
+                        help='list problems found with --scan-source')
     parser.add_argument('-n', '--dry-run', action='store_true', default=False,
                       help='perform a trial run (show log with no changes)')
     parser.add_argument('-r', '--git-ref', type=str,
@@ -1991,7 +2304,8 @@ doc/develop/moveconfig.rst for documentation.'''
         unittest.main()
 
     if args.scan_source:
-        do_scan_source(os.getcwd(), args.update)
+        do_scan_source(os.getcwd(), args.update, args.list_problems,
+                       args.commit)
         return
 
     if not any((len(configs), args.force_sync, args.build_db, args.imply,
@@ -2049,7 +2363,6 @@ doc/develop/moveconfig.rst for documentation.'''
         cleanup_readme(configs, args)
 
     if args.commit:
-        subprocess.call(['git', 'add', '-u'])
         if configs:
             msg = 'Convert %s %sto Kconfig' % (configs[0],
                     'et al ' if len(configs) > 1 else '')
@@ -2058,7 +2371,7 @@ doc/develop/moveconfig.rst for documentation.'''
         else:
             msg = 'configs: Resync with savedefconfig'
             msg += '\n\nRsync all defconfig files using moveconfig.py'
-        subprocess.call(['git', 'commit', '-s', '-m', msg])
+        write_commit(msg)
 
     if args.build_db:
         with open(CONFIG_DATABASE, 'w', encoding='utf-8') as fd:
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#6 lore raw

PATCH v3 5/95 bootstd: Disable QFW bootmeth in SPL

In reply to Simon Glass

Move this Makefile line into the non-SPL area so we don't have to reply on the SPL_TPL_ macro.

---

Changes in v3:
- Add new patch to disable QFW bootmeth in SPL

 boot/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/Makefile +1 -1
index 5424b6fafcc..b9a12236798 100644
@@ -11,6 +11,7 @@ obj-$(CONFIG_CMD_BOOTZ) += bootm.o bootm_os.o
 obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
 
 obj-$(CONFIG_PXE_UTILS) += pxe_utils.o
+obj-$(CONFIG_QFW) += bootmeth_qfw.o
 
 endif
 
@@ -26,7 +27,6 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootstd-uclass.o
 obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_DISTRO) += bootmeth_distro.o
 obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_DISTRO_PXE) += bootmeth_pxe.o
 obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_EFILOADER) += bootmeth_efi.o
-obj-$(CONFIG_$(SPL_TPL_)QFW) += bootmeth_qfw.o
 obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SANDBOX) += bootmeth_sandbox.o
 obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SCRIPT) += bootmeth_script.o
 ifdef CONFIG_$(SPL_TPL_)BOOTSTD_FULL
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#7 lore raw

PATCH v3 6/95 Correct SPL uses of ARCH_MVEBU

In reply to Simon Glass

This converts 2 usages of this option to the non-SPL form, since there is no SPL_ARCH_MVEBU defined in Kconfig

---

(no changes since v1)

 drivers/mmc/mv_sdhci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/mv_sdhci.c +2 -2
index 336ebf14102..20049981473 100644
@@ -64,7 +64,7 @@ int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks)
 	host->ops = &mv_ops;
 #endif
 
-	if (CONFIG_IS_ENABLED(ARCH_MVEBU)) {
+	if (IS_ENABLED(CONFIG_ARCH_MVEBU)) {
 		/* Configure SDHCI MBUS mbus bridge windows */
 		sdhci_mvebu_mbus_config((void __iomem *)regbase);
 	}
@@ -103,7 +103,7 @@ static int mv_sdhci_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
-	if (CONFIG_IS_ENABLED(ARCH_MVEBU)) {
+	if (IS_ENABLED(CONFIG_ARCH_MVEBU)) {
 		/* Configure SDHCI MBUS mbus bridge windows */
 		sdhci_mvebu_mbus_config(host->ioaddr);
 	}
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#8 lore raw

PATCH v3 7/95 Correct SPL uses of DISPLAY_AER_FULL

In reply to Simon Glass

This converts 2 usages of this option to the non-SPL form, since there is no SPL_DISPLAY_AER_FULL defined in Kconfig

---

(no changes since v1)

 drivers/sysreset/sysreset_mpc83xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/sysreset/sysreset_mpc83xx.c +2 -2
index c9a03266595..ca48328f7b5 100644
@@ -107,7 +107,7 @@ static int print_83xx_arb_event(bool force, char *buf, int size)
 	if (!force && !gd->arch.arbiter_event_address)
 		return 0;
 
-	if (CONFIG_IS_ENABLED(DISPLAY_AER_FULL)) {
+	if (IS_ENABLED(CONFIG_DISPLAY_AER_FULL)) {
 		res = snprintf(buf, size,
 			       "Arbiter Event Status:\n"
 			       "    %s: 0x%08lX\n"
@@ -184,7 +184,7 @@ static int mpc83xx_sysreset_get_status(struct udevice *dev, char *buf, int size)
 	 * TODO([email protected]): Move this into a dedicated
 	 *			     arbiter driver
 	 */
-	if (CONFIG_IS_ENABLED(DISPLAY_AER_FULL) ||
+	if (IS_ENABLED(CONFIG_DISPLAY_AER_FULL) ||
 	    IS_ENABLED(CONFIG_DISPLAY_AER_BRIEF)) {
 		/*
 		 * If there was a bus monitor reset event, we force the arbiter
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#9 lore raw

PATCH v3 8/95 Correct SPL uses of FSL_ISBC_KEY_EXT

In reply to Simon Glass

This converts 9 usages of this option to the non-SPL form, since there is no SPL_FSL_ISBC_KEY_EXT defined in Kconfig

---

(no changes since v1)

 board/freescale/common/fsl_validate.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
board/freescale/common/fsl_validate.c +9 -9
index bfe6357b0d6..78bed122466 100644
@@ -29,7 +29,7 @@
 #define CHECK_KEY_LEN(key_len)	(((key_len) == 2 * KEY_SIZE_BYTES / 4) || \
 				 ((key_len) == 2 * KEY_SIZE_BYTES / 2) || \
 				 ((key_len) == 2 * KEY_SIZE_BYTES))
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 /* Global data structure */
 static struct fsl_secboot_glb glb;
 #endif
@@ -63,7 +63,7 @@ self:
 	goto self;
 }
 
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 static u32 check_ie(struct fsl_secboot_img_priv *img)
 {
 	if (img->hdr.ie_flag & IE_FLAG_MASK)
@@ -188,7 +188,7 @@ static u32 check_srk(struct fsl_secboot_img_priv *img)
 {
 #ifdef CONFIG_ESBC_HDR_LS
 	/* In LS, No SRK Flag as SRK is always present if IE not present*/
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 	return !check_ie(img);
 #endif
 	return 1;
@@ -278,7 +278,7 @@ static u32 read_validate_single_key(struct fsl_secboot_img_priv *img)
 }
 #endif /* CONFIG_ESBC_HDR_LS */
 
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 
 static void install_ie_tbl(uintptr_t ie_tbl_addr,
 		struct fsl_secboot_img_priv *img)
@@ -434,7 +434,7 @@ void fsl_secboot_handle_error(int error)
 	case ERROR_ESBC_CLIENT_HEADER_INVALID_KEY_NUM:
 	case ERROR_ESBC_CLIENT_HEADER_INV_SRK_ENTRY_KEYLEN:
 #endif
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 	/*@fallthrough@*/
 	case ERROR_ESBC_CLIENT_HEADER_IE_KEY_REVOKED:
 	case ERROR_ESBC_CLIENT_HEADER_INVALID_IE_NUM_ENTRY:
@@ -571,7 +571,7 @@ static int calc_esbchdr_esbc_hash(struct fsl_secboot_img_priv *img)
 		key_hash = 1;
 	}
 #endif
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 	if (!key_hash && check_ie(img))
 		key_hash = 1;
 #endif
@@ -705,7 +705,7 @@ static int read_validate_esbc_client_header(struct fsl_secboot_img_priv *img)
 	}
 #endif
 
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 	if (!key_found && check_ie(img)) {
 		ret = read_validate_ie_tbl(img);
 		if (ret != 0)
@@ -851,7 +851,7 @@ static int secboot_init(struct fsl_secboot_img_priv **img_ptr)
 		return -ENOMEM;
 	memset(img, 0, sizeof(struct fsl_secboot_img_priv));
 
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 	if (glb.ie_addr)
 		img->ie_addr = glb.ie_addr;
 #endif
@@ -952,7 +952,7 @@ int fsl_secboot_validate(uintptr_t haddr, char *arg_hash_str,
 	else
 		ret = memcmp(srk_hash, img->img_key_hash, SHA256_BYTES);
 
-#if CONFIG_IS_ENABLED(FSL_ISBC_KEY_EXT)
+#if IS_ENABLED(CONFIG_FSL_ISBC_KEY_EXT)
 	if (!hash_cmd && check_ie(img))
 		ret = 0;
 #endif
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#10 lore raw

PATCH v3 9/95 Correct SPL uses of MULTIPLEXER

In reply to Simon Glass

This converts 3 usages of this option to the non-SPL form, since there is no SPL_MULTIPLEXER defined in Kconfig

---

Changes in v3:
- Move the option down to the non-SPL part of drivers/Makefile

 drivers/Makefile     | 2 +-
 drivers/mux/Makefile | 2 +-
 include/mux.h        | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/Makefile +1 -1
index 15d19d0c8a3..58be410135d 100644
@@ -18,7 +18,6 @@ obj-$(CONFIG_$(SPL_TPL_)INPUT) += input/
 obj-$(CONFIG_$(SPL_TPL_)LED) += led/
 obj-$(CONFIG_$(SPL_TPL_)MMC) += mmc/
 obj-y += mtd/
-obj-$(CONFIG_$(SPL_)MULTIPLEXER) += mux/
 obj-$(CONFIG_$(SPL_TPL_)ETH) += net/
 obj-$(CONFIG_$(SPL_TPL_)PCH) += pch/
 obj-$(CONFIG_$(SPL_TPL_)PCI) += pci/
@@ -87,6 +86,7 @@ obj-$(CONFIG_FASTBOOT) += fastboot/
 obj-$(CONFIG_FWU_MDATA) += fwu-mdata/
 obj-y += misc/
 obj-$(CONFIG_MMC) += mmc/
+obj-$(CONFIG_MULTIPLEXER) += mux/
 obj-$(CONFIG_NVME) += nvme/
 obj-$(CONFIG_PCI_ENDPOINT) += pci_endpoint/
 obj-y += dfu/
drivers/mux/Makefile +1 -1
index 78ebf04c7a9..d4e24789d33 100644
@@ -3,5 +3,5 @@
 # (C) Copyright 2019
 # Jean-Jacques Hiblot <[email protected]>
 
-obj-$(CONFIG_$(SPL_)MULTIPLEXER) += mux-uclass.o
+obj-$(CONFIG_MULTIPLEXER) += mux-uclass.o
 obj-$(CONFIG_$(SPL_)MUX_MMIO) += mmio.o
include/mux.h +1 -1
index 9f809912742..c92d887591e 100644
@@ -23,7 +23,7 @@
 struct udevice;
 struct mux_control;
 
-#if CONFIG_IS_ENABLED(MULTIPLEXER)
+#if IS_ENABLED(CONFIG_MULTIPLEXER)
 /**
  * mux_control_states() - Query the number of multiplexer states.
  * @mux: The mux-control to query.
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#12 lore raw

PATCH v3 10/95 Correct SPL use of PG_WCOM_UBOOT_UPDATE_SUPPORTED

In reply to Simon Glass

This converts 1 usage of this option to the non-SPL form, since there is no SPL_PG_WCOM_UBOOT_UPDATE_SUPPORTED defined in Kconfig

Aleksandar Gerasimovski <[email protected]>
---

(no changes since v1)

 board/keymile/common/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/keymile/common/common.c +1 -1
index 8c282f9952a..991022ac833 100644
@@ -78,7 +78,7 @@ int set_km_env(void)
 	return 0;
 }
 
-#if CONFIG_IS_ENABLED(PG_WCOM_UBOOT_UPDATE_SUPPORTED)
+#if IS_ENABLED(CONFIG_PG_WCOM_UBOOT_UPDATE_SUPPORTED)
 #if   ((!IS_ENABLED(CONFIG_PG_WCOM_UBOOT_BOOTPACKAGE) && \
 	!IS_ENABLED(CONFIG_PG_WCOM_UBOOT_UPDATE)) ||     \
 	(IS_ENABLED(CONFIG_PG_WCOM_UBOOT_BOOTPACKAGE) && \
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#13 lore raw

PATCH v3 11/95 Correct SPL use of PHY_CADENCE_SIERRA

In reply to Simon Glass

This converts 1 usage of this option to the non-SPL form, since there is no SPL_PHY_CADENCE_SIERRA defined in Kconfig

---

(no changes since v1)

 drivers/phy/cadence/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/cadence/Makefile +1 -1
index af63b32d9f5..c247feb8262 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA)	+= phy-cadence-sierra.o
+obj-$(CONFIG_PHY_CADENCE_SIERRA)	+= phy-cadence-sierra.o
 obj-$(CONFIG_$(SPL_)PHY_CADENCE_TORRENT) += phy-cadence-torrent.o
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#14 lore raw

Re: [PATCH v3 11/95] Correct SPL use of PHY_CADENCE_SIERRA

Quoted 16 lines · Simon Glass

This converts 1 usage of this option to the non-SPL form, since there is no SPL_PHY_CADENCE_SIERRA defined in Kconfig

---

(no changes since v1)

 drivers/phy/cadence/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/cadence/Makefile +0 -0
index af63b32d9f5..c247feb8262 100644

drivers/phy/cadence/Makefile line 2

Quoted 3 lines
drivers/phy/cadence/Makefile +1 -1
@@ -1,2 +1,2 @@
-obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA)	+= phy-cadence-sierra.o
+obj-$(CONFIG_PHY_CADENCE_SIERRA)	+= phy-cadence-sierra.o
 obj-$(CONFIG_$(SPL_)PHY_CADENCE_TORRENT) += phy-cadence-torrent.o

This, and then PHY_CADENCE_TORRENT take this the wrong direction, both symbols should be false for non-PPL builds.

Signature · 1 line
Tom
#15 lore raw

Re: [PATCH v3 11/95] Correct SPL use of PHY_CADENCE_SIERRA

Hi Tom,

Quoted 13 lines · Tom Rini
Quoted 11 lines · Simon Glass

This converts 1 usage of this option to the non-SPL form, since there is no SPL_PHY_CADENCE_SIERRA defined in Kconfig

---

(no changes since v1)

 drivers/phy/cadence/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

drivers/phy/cadence/Makefile line 2

Quoted 8 lines
drivers/phy/cadence/Makefile +1 -1
index af63b32d9f5..c247feb8262 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA)      += phy-cadence-sierra.o
+obj-$(CONFIG_PHY_CADENCE_SIERRA)     += phy-cadence-sierra.o
 obj-$(CONFIG_$(SPL_)PHY_CADENCE_TORRENT) += phy-cadence-torrent.o

This, and then PHY_CADENCE_TORRENT take this the wrong direction, both symbols should be false for non-PPL builds.

This one is odd, since the board defines SPL_PHY, presumably for a reason. It could always undefine that if needed.

I'll add some more notes in v5.

Regards,
SImon

#16 lore raw

Re: [PATCH v3 11/95] Correct SPL use of PHY_CADENCE_SIERRA

Quoted 28 lines · Simon Glass

Hi Tom,

Quoted 13 lines · Tom Rini
Quoted 11 lines · Simon Glass

This converts 1 usage of this option to the non-SPL form, since there is no SPL_PHY_CADENCE_SIERRA defined in Kconfig

---

(no changes since v1)

 drivers/phy/cadence/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

drivers/phy/cadence/Makefile line 2

Quoted 8 lines
drivers/phy/cadence/Makefile +1 -1
index af63b32d9f5..c247feb8262 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA)      += phy-cadence-sierra.o
+obj-$(CONFIG_PHY_CADENCE_SIERRA)     += phy-cadence-sierra.o
 obj-$(CONFIG_$(SPL_)PHY_CADENCE_TORRENT) += phy-cadence-torrent.o

This, and then PHY_CADENCE_TORRENT take this the wrong direction, both symbols should be false for non-PPL builds.

Quoted 4 lines

This one is odd, since the board defines SPL_PHY, presumably for a reason. It could always undefine that if needed.

I'll add some more notes in v5.

The platforms in question are fairly complex and I want to say it needs a PHY for USB in SPL, but not a PHY for networking, in SPL.

Signature · 1 line
Tom
#17 lore raw

Re: [PATCH v3 11/95] Correct SPL use of PHY_CADENCE_SIERRA

Hi Tom,

Quoted 30 lines · Tom Rini
Quoted 28 lines · Simon Glass

Hi Tom,

Quoted 24 lines · Tom Rini
Quoted 16 lines · Simon Glass

This converts 1 usage of this option to the non-SPL form, since there is no SPL_PHY_CADENCE_SIERRA defined in Kconfig

---

(no changes since v1)

 drivers/phy/cadence/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/cadence/Makefile +0 -0
index af63b32d9f5..c247feb8262 100644

drivers/phy/cadence/Makefile line 2

Quoted 3 lines
drivers/phy/cadence/Makefile +1 -1
@@ -1,2 +1,2 @@
-obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA)      += phy-cadence-sierra.o
+obj-$(CONFIG_PHY_CADENCE_SIERRA)     += phy-cadence-sierra.o
 obj-$(CONFIG_$(SPL_)PHY_CADENCE_TORRENT) += phy-cadence-torrent.o

This, and then PHY_CADENCE_TORRENT take this the wrong direction, both symbols should be false for non-PPL builds.

Quoted 7 lines
Quoted 4 lines

This one is odd, since the board defines SPL_PHY, presumably for a reason. It could always undefine that if needed.

I'll add some more notes in v5.

The platforms in question are fairly complex and I want to say it needs a PHY for USB in SPL, but not a PHY for networking, in SPL.

Ah that makes more sense. OK, will take yet another look.

Regards,
Simon

#18 lore raw

Re: [PATCH v3 11/95] Correct SPL use of PHY_CADENCE_SIERRA

Hi Tom,

Quoted 37 lines · Simon Glass

Hi Tom,

Quoted 33 lines · Tom Rini
Quoted 31 lines · Simon Glass

Hi Tom,

Quoted 13 lines · Tom Rini
Quoted 11 lines · Simon Glass

This converts 1 usage of this option to the non-SPL form, since there is no SPL_PHY_CADENCE_SIERRA defined in Kconfig

---

(no changes since v1)

 drivers/phy/cadence/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

drivers/phy/cadence/Makefile line 2

Quoted 8 lines
drivers/phy/cadence/Makefile +1 -1
index af63b32d9f5..c247feb8262 100644
@@ -1,2 +1,2 @@
-obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA)      += phy-cadence-sierra.o
+obj-$(CONFIG_PHY_CADENCE_SIERRA)     += phy-cadence-sierra.o
 obj-$(CONFIG_$(SPL_)PHY_CADENCE_TORRENT) += phy-cadence-torrent.o

This, and then PHY_CADENCE_TORRENT take this the wrong direction, both symbols should be false for non-PPL builds.

This one is odd, since the board defines SPL_PHY, presumably for a reason. It could always undefine that if needed.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

I'll add some more notes in v5.

The platforms in question are fairly complex and I want to say it needs a PHY for USB in SPL, but not a PHY for networking, in SPL.

Ah that makes more sense. OK, will take yet another look.

I'll just drop this patch.

Regards,
Simon

#19 lore raw

PATCH v3 12/95 Correct SPL uses of PHY_FIXED

In reply to Simon Glass

This converts 3 usages of this option to the non-SPL form, since there is no SPL_PHY_FIXED defined in Kconfig

---

(no changes since v1)

 drivers/net/mvneta.c | 4 ++--
 net/mdio-uclass.c    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/mvneta.c +2 -2
index 0fbfad11d45..24933473fa0 100644
@@ -815,7 +815,7 @@ static void mvneta_defaults_set(struct mvneta_port *pp)
 	mvreg_write(pp, MVNETA_SDMA_CONFIG, val);
 
 	/* Enable PHY polling in hardware if not in fixed-link mode */
-	if (!CONFIG_IS_ENABLED(PHY_FIXED) ||
+	if (!IS_ENABLED(CONFIG_PHY_FIXED) ||
 	    pp->phydev->phy_id != PHY_FIXED_ID) {
 		mvreg_write(pp, MVNETA_PHY_ADDR, pp->phydev->addr);
 
@@ -1176,7 +1176,7 @@ static void mvneta_adjust_link(struct udevice *dev)
 		 * be added). Also, why is ADVERT_FC enabled if we don't enable
 		 * inband AN at all?
 		 */
-		if (CONFIG_IS_ENABLED(PHY_FIXED) &&
+		if (IS_ENABLED(CONFIG_PHY_FIXED) &&
 		    pp->phydev->phy_id == PHY_FIXED_ID)
 			val = MVNETA_GMAC_IB_BYPASS_AN_EN |
 			      MVNETA_GMAC_SET_FC_EN |
net/mdio-uclass.c +1 -1
index d80037d0ac7..e758cc66d7e 100644
@@ -175,7 +175,7 @@ static struct phy_device *dm_eth_connect_phy_handle(struct udevice *ethdev,
 	struct phy_device *phy;
 	ofnode phynode;
 
-	if (CONFIG_IS_ENABLED(PHY_FIXED) &&
+	if (IS_ENABLED(CONFIG_PHY_FIXED) &&
 	    ofnode_phy_is_fixed_link(dev_ofnode(ethdev), &phynode)) {
 		phy = phy_connect(NULL, 0, ethdev, interface);
 		goto out;
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#20 lore raw

PATCH v3 13/95 boot: Add a Kconfig for SPL_FIT_CIPHER

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

Changes in v3:
- Add a bracket to (SPL

 boot/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
boot/Kconfig +4 -0
index 5f491625c82..91bdff6e332 100644
@@ -103,6 +103,10 @@ config FIT_CIPHER
 	  Enable the feature of data ciphering/unciphering in the tool mkimage
 	  and in the u-boot support of the FIT image.
 
+config SPL_FIT_CIPHER
+	def_bool n  # Enable ciphering data in a FIT uImages (SPL)
+	depends on SPL_DM && SPL_FIT
+
 config FIT_VERBOSE
 	bool "Show verbose messages when FIT images fail"
 	depends on FIT
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#21 lore raw

PATCH v3 14/95 boot: Add a Kconfig for SPL_BOOTSTD_FULL

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

Changes in v3:
- Add (SPL) to the end of the comment

 boot/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
boot/Kconfig +4 -0
index 91bdff6e332..5a595825f8f 100644
@@ -408,6 +408,10 @@ config VPL_BOOTSTD
 	  boot. It is enabled by default since the main purpose of VPL is to
 	  handle the firmware part of VBE.
 
+config SPL_BOOTSTD_FULL
+	def_bool n  # Enhanced features for standard boot (SPL)
+	depends on BOOTSTD && SPL
+
 if BOOTSTD
 
 config BOOTSTD_DEFAULTS
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#22 lore raw

PATCH v3 15/95 boot: Add Kconfigs for BOOTMETH_VBE_REQUEST

In reply to Simon Glass

Allow this to be enabled separately in U-Boot proper and in SPL, since it is not needed in SPL.

---

(no changes since v1)

 boot/Kconfig  | 13 +++++++++++++
 boot/Makefile |  3 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)
boot/Kconfig +13 -0
index 5a595825f8f..372be65e534 100644
@@ -536,6 +536,19 @@ config VPL_BOOTMETH_VBE
 
 if BOOTMETH_VBE
 
+config BOOTMETH_VBE_REQUEST
+	bool "Support for serving VBE OS requests"
+	default y
+	help
+	  Enables support for looking that the requests made by the
+	  Operating System being booted. These requests result in additions to
+	  the device tree /chosen node, added during the device tree fixup
+	  phase.
+
+config SPL_BOOTMETH_VBE_REQUEST
+	def_bool n  # Support for serving VBE OS requests (SPL)
+	depends on SPL
+
 config BOOTMETH_VBE_SIMPLE
 	bool "Bootdev support for VBE 'simple' method"
 	default y
boot/Makefile +2 -1
index b9a12236798..88193a1b60e 100644
@@ -52,7 +52,8 @@ endif
 
 obj-$(CONFIG_$(SPL_TPL_)EXPO) += expo.o scene.o scene_menu.o
 
-obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE) += vbe.o vbe_request.o
+obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE) += vbe.o
+obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_REQUEST) += vbe_request.o
 obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE) += vbe_simple.o
 obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE_FW) += vbe_simple_fw.o
 obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_VBE_SIMPLE_OS) += vbe_simple_os.o
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#23 lore raw

PATCH v3 16/95 Correct SPL use of DM_RNG

In reply to Simon Glass

This converts 1 usage of this option to the non-SPL form, since there is no SPL_DM_RNG defined in Kconfig

---

(no changes since v1)

 boot/vbe_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/vbe_request.c +1 -1
index 45f1d2b7e17..312edfa2bdb 100644
@@ -36,7 +36,7 @@ static int handle_random_req(ofnode node, int default_size,
 	u32 size;
 	int ret;
 
-	if (!CONFIG_IS_ENABLED(DM_RNG))
+	if (!IS_ENABLED(CONFIG_DM_RNG))
 		return -ENOTSUPP;
 
 	if (ofnode_read_u32(node, "vbe,size", &size)) {
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#24 lore raw

PATCH v3 17/95 boot: Add a Kconfig for SPL_BOOTDEV_SPI_FLASH

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/mtd/spi/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mtd/spi/Kconfig +4 -0
index a9617c6c58c..764a9393d7d 100644
@@ -88,6 +88,10 @@ config BOOTDEV_SPI_FLASH
 
 	  If unsure, say N
 
+config SPL_BOOTDEV_SPI_FLASH
+	def_bool n  # SPI Flash bootdev support (SPL)
+	depends on SPL_SPI_FLASH_SUPPORT
+
 config SPI_FLASH_SFDP_SUPPORT
 	bool "SFDP table parsing support for SPI NOR flashes"
 	depends on !SPI_FLASH_BAR
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#25 lore raw

PATCH v3 18/95 boot: Add a Kconfig for SPL_BOOTDEV_ETH

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

Changes in v3:
- Use a consistent format for the comment

 net/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
net/Kconfig +4 -0
index 4215889127c..88aecbbd8d9 100644
@@ -34,6 +34,10 @@ config BOOTDEV_ETH
 	  an operationg system over the network, using the PXE (Preboot
 	  Execution Environment) protocol.
 
+config SPL_BOOTDEV_ETH
+	def_bool n  # Enable bootdev for ethernet (SPL)
+	depends on SPL_BOOTSTD
+
 config BOOTP_SEND_HOSTNAME
 	bool "Send hostname to DNS server"
 	help
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#26 lore raw

PATCH v3 19/95 dm: Add a Kconfig for SPL_DEVRES

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/core/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/core/Kconfig +4 -0
index 6fc8854b574..22381500afe 100644
@@ -275,6 +275,10 @@ config DEVRES
 	  non-managed variants.  For example, devres_alloc() to kzalloc(),
 	  devm_kmalloc() to kmalloc(), etc.
 
+config SPL_DEVRES
+	def_bool n  # Managed device resources (SPL)
+	depends on SPL_DM
+
 config DEBUG_DEVRES
 	bool "Managed device resources debugging functions"
 	depends on DEVRES
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#27 lore raw

PATCH v3 20/95 dm: Add a Kconfig for SPL_DM_HWSPINLOCK

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/hwspinlock/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hwspinlock/Kconfig +4 -0
index 96d4f5d6ca3..56406da3d87 100644
@@ -5,6 +5,10 @@ config DM_HWSPINLOCK
 	help
 	  This option enables U-Boot hardware spinlock support
 
+config SPL_DM_HWSPINLOCK
+	def_bool n  # Enable U-Boot hardware spinlock support (SPL)
+	depends on SPL
+
 config HWSPINLOCK_SANDBOX
 	bool "Enable Hardware Spinlock support for Sandbox"
 	depends on SANDBOX && DM_HWSPINLOCK
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#28 lore raw

PATCH v3 21/95 boot: Add a Kconfig for SPL_OF_LIVE

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 dts/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
dts/Kconfig +4 -0
index 44cc6bf1f6f..bb63eda9c40 100644
@@ -85,6 +85,10 @@ config OF_LIVE
 	  enables a live tree which is available after relocation,
 	  and can be adjusted as needed.
 
+config SPL_OF_LIVE
+	def_bool n  # Enable use of a live tree (SPL)
+	depends on SPL_DM && SPL_OF_CONTROL
+
 choice
 	prompt "Provider of DTB for DT control"
 	depends on OF_CONTROL
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#29 lore raw

PATCH v3 22/95 cmd: Add a Kconfig for SPL_CRC32_VERIFY

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 cmd/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
cmd/Kconfig +4 -0
index 2caa4af71cb..c8792af883e 100644
@@ -686,6 +686,10 @@ config CRC32_VERIFY
 	help
 	  Add -v option to verify data against a crc32 checksum.
 
+config SPL_CRC32_VERIFY
+	def_bool n  # crc32 -v (SPL)
+	depends on SPL
+
 config CMD_EEPROM
 	bool "eeprom - EEPROM subsystem"
 	help
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#30 lore raw

PATCH v3 23/95 console: Add a Kconfig for SPL_CONSOLE_MUX et al

In reply to Simon Glass

This and SYS_CONSOLE_IS_IN_ENV are implicitly used in the source and seem useful, so add them.

---

(no changes since v1)

 common/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
common/Kconfig +8 -0
index e3a5e1be1e9..ea9bbd52128 100644
@@ -235,6 +235,10 @@ config CONSOLE_MUX
 	  adds a small amount of size to U-Boot.  Changes to the environment
 	  variables stdout, stdin and stderr will take effect immediately.
 
+config SPL_CONSOLE_MUX
+	def_bool n  # Enable console multiplexing (SPL)
+	depends on SPL
+
 config SYS_CONSOLE_IS_IN_ENV
 	bool "Select console devices from the environment"
 	default y if CONSOLE_MUX
@@ -245,6 +249,10 @@ config SYS_CONSOLE_IS_IN_ENV
 	  environment variables can be updated after boot to change the
 	  input/output devices.
 
+config SPL_SYS_CONSOLE_IS_IN_ENV
+	def_bool n  # Select console devices from the environment (SPL)
+	depends on SPL
+
 config SYS_CONSOLE_OVERWRITE_ROUTINE
 	bool "Allow board control over console overwriting"
 	help
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#31 lore raw

PATCH v3 24/95 button: Add a Kconfig for SPL_BUTTON

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/button/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/button/Kconfig +4 -0
index 8ce2de37d62..60645a7745a 100644
@@ -9,6 +9,10 @@ config BUTTON
 	  can provide access to board-specific buttons. Use of the device tree
 	  for configuration is encouraged.
 
+config SPL_BUTTON
+	def_bool n  # Enable button support (SPL)
+	depends on SPL
+
 config BUTTON_ADC
 	bool "Button adc"
 	depends on BUTTON
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#32 lore raw

PATCH v3 25/95 lib: Add a Kconfig for SPL_ERRNO_STR

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 lib/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
lib/Kconfig +4 -0
index 83e5edd73b0..1da5593f0a9 100644
@@ -782,6 +782,10 @@ config ERRNO_STR
 	  - if errno is null or positive number - a pointer to "Success" message
 	  - if errno is negative - a pointer to errno related message
 
+config SPL_ERRNO_STR
+	def_bool n  # Enable function for getting errno-related string message (SPL)
+	depends on SPL
+
 config HEXDUMP
 	bool "Enable hexdump"
 	help
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#33 lore raw

PATCH v3 26/95 lib: Add a Kconfig for SPL_FSP_VERSION2

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

Changes in v3:
- Add new patch with a Kconfig for SPL_FSP_VERSION2

 arch/x86/Kconfig | 7 +++++++
 1 file changed, 7 insertions(+)
arch/x86/Kconfig +7 -0
index 07be5cd05ec..cede5160480 100644
@@ -396,12 +396,19 @@ config FSP_VERSION1
 config FSP_VERSION2
 	bool "FSP version 2.x"
 	select DM_EVENT
+	select SPL_FSP_VERSION2
 	help
 	  This covers versions 2.0 and 2.1. See here for details:
 	  https://github.com/IntelFsp/fsp/wiki
 
 endchoice
 
+config SPL_FSP_VERSION2
+	bool   # FSP version 2.x (SPL)
+	help
+	  This covers versions 2.0 and 2.1. See here for details:
+	  https://github.com/IntelFsp/fsp/wiki
+
 config FSP_FILE
 	string "Firmware Support Package binary filename"
 	depends on FSP_VERSION1
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#34 lore raw

PATCH v3 27/95 iommu: Add a Kconfig for SPL_IOMMU

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/iommu/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/iommu/Kconfig +4 -0
index dabc1f900d5..bbacd14a56c 100644
@@ -14,6 +14,10 @@ config IOMMU
 	  memory if the IOMMU has been programmed to allow access to
 	  that memory.
 
+config SPL_IOMMU
+	def_bool n  # Enable Driver Model for IOMMU drivers (SPL)
+	depends on SPL_DM
+
 config APPLE_DART
 	bool "Apple DART support"
 	depends on IOMMU && ARCH_APPLE
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#35 lore raw

PATCH v3 28/95 pinctrl: Add a Kconfig for SPL_PINCTRL_ARMADA_38X

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v2)

Changes in v2:
- Correct the tag

 drivers/pinctrl/mvebu/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/pinctrl/mvebu/Kconfig +4 -0
index 7c51d138c8b..0b2be88e3a1 100644
@@ -7,6 +7,10 @@ config PINCTRL_ARMADA_38X
 	   Support pin multiplexing and pin configuration control on
 	   Marvell's Armada-38x SoC.
 
+config SPL_PINCTRL_ARMADA_38X
+	def_bool n  # Armada 38x pin control driver (SPL)
+	depends on SPL && ARMADA_38X && SPL_PINCTRL_FULL
+
 config PINCTRL_ARMADA_37XX
 	depends on ARMADA_3700 && PINCTRL_FULL
 	bool "Armada 37xx pin control driver"
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#36 lore raw

PATCH v3 29/95 virtio: Add a Kconfig for SPL_VIRTIO

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/virtio/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/virtio/Kconfig +4 -0
index 852f6735b60..410cdf39b67 100644
@@ -22,6 +22,10 @@ config VIRTIO
 	  This option is selected by any driver which implements the virtio
 	  transport, such as CONFIG_VIRTIO_MMIO or CONFIG_VIRTIO_PCI.
 
+config SPL_VIRTIO
+	def_bool n
+	depends on SPL
+
 config VIRTIO_MMIO
 	bool "Platform bus driver for memory mapped virtio devices"
 	select VIRTIO
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#37 lore raw

PATCH v3 30/95 lib: Add a Kconfig for SPL_BZIP2

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 lib/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
lib/Kconfig +6 -0
index 1da5593f0a9..1267fa63f14 100644
@@ -727,6 +727,12 @@ config ZSTD_LIB_MINIFY
 
 endif
 
+config SPL_BZIP2
+	bool "Enable bzip2 decompression support for SPL build"
+	depends on SPL
+	help
+	  This enables support for bzip2 compression algorithm for SPL boot.
+
 config SPL_LZ4
 	bool "Enable LZ4 decompression support in SPL"
 	depends on SPL
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#38 lore raw

PATCH v3 31/95 acpi: Add a Kconfig for SPL_ACPIGEN

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/core/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
drivers/core/Kconfig +3 -0
index 22381500afe..f1ef5cd35f3 100644
@@ -453,6 +453,9 @@ config ACPIGEN
 	  things like generating device-specific tables and returning the ACPI
 	  name of a device.
 
+config SPL_ACPIGEN
+	def_bool n
+
 config BOUNCE_BUFFER
 	bool "Include bounce buffer API"
 	help
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#39 lore raw

PATCH v3 32/95 rockchip: Add a Kconfig for SPL_RESET_ROCKCHIP

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/reset/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/reset/Kconfig +4 -0
index e4039d74744..e2affe20e34 100644
@@ -99,6 +99,10 @@ config RESET_ROCKCHIP
 	  though is that some reset signals, like I2C or MISC reset multiple
 	  devices.
 
+config SPL_RESET_ROCKCHIP
+	def_bool n  # Reset controller driver for Rockchip SoCs (SPL)
+	depends on SPL_DM_RESET && ARCH_ROCKCHIP && SPL_CLK
+
 config RESET_HSDK
 	bool "Synopsys HSDK Reset Driver"
 	depends on DM_RESET && TARGET_HSDK
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#40 lore raw

PATCH v3 33/95 mediatek: Add a Kconfig for SPL_RESET_MEDIATEK

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/reset/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/reset/Kconfig +4 -0
index e2affe20e34..64c3ea332b4 100644
@@ -132,6 +132,10 @@ config RESET_MEDIATEK
 	help
 	  Support for reset controller on MediaTek SoCs.
 
+config SPL_RESET_MEDIATEK
+	def_bool n  # Reset controller driver for MediaTek SoCs (SPL)
+	depends on SPL_DM_RESET && ARCH_MEDIATEK && SPL_CLK
+
 config RESET_MTMIPS
 	bool "Reset controller driver for MediaTek MIPS platform"
 	depends on DM_RESET && ARCH_MTMIPS
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#41 lore raw

PATCH v3 34/95 lib: Add a Kconfig for SPL_GENERATE_ACPI_TABLE

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

Changes in v3:
- Move SPL_GENERATE_ACPI_TABLE patch to this series

 lib/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
lib/Kconfig +4 -0
index 1267fa63f14..0a02f3e89ae 100644
@@ -287,6 +287,10 @@ config GENERATE_ACPI_TABLE
 	  by the operating system. It defines platform-independent interfaces
 	  for configuration and power management monitoring.
 
+config SPL_GENERATE_ACPI_TABLE
+	def_bool n  # Generate an ACPI table (SPL)
+	depends on SPL && SUPPORT_ACPI
+
 config SPL_TINY_MEMSET
 	bool "Use a very small memset() in SPL"
 	depends on SPL
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#42 lore raw

PATCH v3 35/95 efi: Add a Kconfig for SPL_EFI_LOADER et al

In reply to Simon Glass

This and EFI_DEVICE_PATH_TO_TEXT are implicitly used in the source and seem useful, so add them.

---

Changes in v3:
- Move SPL_EFI_LOADER patch to this series

 lib/efi_loader/Kconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/efi_loader/Kconfig +8 -0
index c56904afc2e..d4e5b65dd30 100644
@@ -32,6 +32,10 @@ config EFI_LOADER
 
 if EFI_LOADER
 
+config SPL_EFI_LOADER
+	def_bool n  # Support running UEFI applications (SPL)
+	depends on SPL
+
 config CMD_BOOTEFI_BOOTMGR
 	bool "UEFI Boot Manager"
 	default y
@@ -233,6 +237,10 @@ config EFI_DEVICE_PATH_TO_TEXT
 	  The device path to text protocol converts device nodes and paths to
 	  human readable strings.
 
+config SPL_EFI_DEVICE_PATH_TO_TEXT
+	def_bool n  # Device path to text protocol (SPL)
+	depends on SPL
+
 config EFI_DEVICE_PATH_UTIL
 	bool "Device path utilities protocol"
 	default y
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#43 lore raw

PATCH v3 36/95 moveconfig: Various minor improvements

In reply to Simon Glass

It turns out that the conf_noproper file is not neeed, since if an option does not appear in U-Boot proper we can just omit it from the autoconf for that build. Drop it.

Also add more control over what is output from the tool.

Add this in here. It should be added to the previous series (splb).

---

(no changes since v1)

 tools/moveconfig.py | 91 +++++++++++++++++++++------------------------
 1 file changed, 43 insertions(+), 48 deletions(-)
tools/moveconfig.py +43 -48
index b3ac2672737..ec2afa92e46 100755
@@ -1833,13 +1833,20 @@ def scan_src_files(fname_dict, all_uses, fname_uses):
 
 MODE_NORMAL, MODE_SPL, MODE_PROPER = range(3)
 
-def do_scan_source(path, do_update, show_conflicts, do_commit):
+def do_scan_source(path, do_update, do_update_source, show_conflicts,
+                   do_commit):
     """Scan the source tree for Kconfig inconsistencies
 
     Args:
         path (str): Path to source tree
-        do_update (bool): True to write to scripts/kconf_... files
-        show_conflicts (bool): True to show conflicts
+        do_update (bool): True to write to scripts/conf_nospl file
+        do_update_source (bool): True to update source to remove invalid use of
+           CONFIG_IS_ENABLED()
+        show_conflicts (bool): True to show conflicts between the source code
+           and the Kconfig (such as missing options, or options which imply an
+           SPL option that does not exist)
+        do_commit (bool): Create commits to remove use of SPL_TPL_ and
+           CONFIG_IS_ENABLED macros when there is no SPL symbol.
     """
     def is_not_proper(name):
         for prefix in SPL_PREFIXES:
@@ -1977,9 +1984,7 @@ def do_scan_source(path, do_update, show_conflicts, do_commit):
 
             dirname, leaf = os.path.split(fname)
             root, ext = os.path.splitext(leaf)
-            #if dirname != '' or root != 'Makefile':
-                #continue
-            if (dirname.startswith('test') or
+            if (dirname.startswith('test/') or
                 dirname.startswith('lib/efi_selftest')):
                 # Ignore test code since it is mostly only for sandbox
                 pass
@@ -2011,38 +2016,25 @@ def do_scan_source(path, do_update, show_conflicts, do_commit):
         finish_file(last_fname, rest_list)
         return mk_dict, src_dict
 
-    def check_mk_missing(all_uses, spl_not_found, proper_not_found):
+    def check_missing(all_uses, spl_not_found, proper_not_found,
+                      show_conflicts):
         # Make sure we know about all the options in Makefiles
-        print('\nCONFIG options present in Makefiles but not Kconfig:')
         not_found = check_not_found(all_uses, MODE_NORMAL)
-        show_uses(not_found)
+        if show_conflicts:
+            print('\nCONFIG options present in source but not Kconfig:')
+            show_uses(not_found)
 
-        print('\nCONFIG options present in Makefiles but not Kconfig (SPL):')
         not_found = check_not_found(all_uses, MODE_SPL)
-        show_uses(not_found)
         spl_not_found |= set(is_not_proper(key) or key for key in not_found.keys())
+        if show_conflicts:
+            print('\nCONFIG options present in source but not Kconfig (SPL):')
+            show_uses(not_found)
 
-        print('\nCONFIG options used as Proper in Makefiles but without a non-SPL_ variant:')
         not_found = check_not_found(all_uses, MODE_PROPER)
-        show_uses(not_found)
-        proper_not_found |= set(key for key in not_found.keys())
-
-    def check_src_missing(all_uses, spl_not_found, proper_not_found):
-        # Make sure we know about all the options in source files
-        print('\nCONFIG options present in source but not Kconfig:')
-        not_found = check_not_found(all_uses, MODE_NORMAL)
-        show_uses(not_found)
-
-        print('\nCONFIG options present in source but not Kconfig (SPL):')
-        not_found = check_not_found(all_uses, MODE_SPL)
-        show_uses(not_found)
-        spl_not_found |= set(is_not_proper(key) or key
-                             for key in not_found.keys())
-
-        print('\nCONFIG options used as Proper in source but without a non-SPL_ variant:')
-        not_found = check_not_found(all_uses, MODE_PROPER)
-        show_uses(not_found)
         proper_not_found |= set(key for key in not_found.keys())
+        if show_conflicts:
+            print('\nCONFIG options used as Proper in source but without a non-SPL_ variant:')
+            show_uses(not_found)
 
     def show_summary(spl_not_found, proper_not_found):
         print('\nCONFIG options used as SPL but without an SPL_ variant:')
@@ -2053,19 +2045,24 @@ def do_scan_source(path, do_update, show_conflicts, do_commit):
         for item in sorted(proper_not_found):
             print(f'   {item}')
 
-    def write_update(spl_not_found, proper_not_found):
-        with open(os.path.join(path, 'scripts', 'conf_nospl'),
+    def write_update(spl_not_found):
+        with open(os.path.join(path, 'scripts', 'conf_nospl'), 'w',
                   encoding='utf-8') as out:
-            print('# These options should not be enabled in SPL builds\n',
+            print('''# Options which are never enabled in SPL.
+
+Generally, options which have no SPL_ prefix (e.g. CONFIG_FOO) apply to all
+SPL build phases. This allows things like ARCH_ARM to propagate to all builds
+without the hassle of generating a separate SPL version fo each phase. But in
+some cases this is not wanted.
+
+This file lists options which don't have an SPL equivalent, but still should not
+be enabled in SPL builds. It is necessary since kconfig cannot tell (just by
+looking at the Kconfig description) whether it applies to Proper builds only,
+or to all builds.
+''',
                   file=out)
             for item in sorted(spl_not_found):
                 print(item, file=out)
-        with open(os.path.join(path, 'scripts', 'conf_noproper'), 'w',
-                  encoding='utf-8') as out:
-            print('# These options should not be enabled in Proper builds\n',
-                  file=out)
-            for item in sorted(proper_not_found):
-                print(item, file=out)
 
     def check_conflict(kconf, all_uses, show):
         """Check conflicts between uses of CONFIG options in source
@@ -2210,7 +2207,7 @@ def do_scan_source(path, do_update, show_conflicts, do_commit):
 
     conflicts, cfg_dict = check_conflict(kconf, all_uses, show_conflicts)
 
-    if do_update:
+    if do_update_source:
         update_source(conflicts)
     if do_commit:
         create_commits(cfg_dict)
@@ -2218,17 +2215,13 @@ def do_scan_source(path, do_update, show_conflicts, do_commit):
     # Look for CONFIG options that are not found
     spl_not_found = set()
     proper_not_found = set()
-    check_mk_missing(all_uses, spl_not_found, proper_not_found)
-
-    # Scan the source code
-    scan_src_files(src_dict, all_uses, fname_uses)
-    check_src_missing(all_uses, spl_not_found, proper_not_found)
+    check_missing(all_uses, spl_not_found, proper_not_found, show_conflicts)
 
     show_summary(spl_not_found, proper_not_found)
 
     # Write out the updated information
     if do_update:
-        write_update(spl_not_found, proper_not_found)
+        write_update(spl_not_found)
 
 def main():
     try:
@@ -2289,6 +2282,8 @@ doc/develop/moveconfig.rst for documentation.'''
                       help="respond 'yes' to any prompts")
     parser.add_argument('-u', '--update', action='store_true', default=False,
                       help="update scripts/ files (use with --scan-source)")
+    parser.add_argument('-U', '--update-source', action='store_true',
+                      help="update source code (use with --scan-source)")
     parser.add_argument('-v', '--verbose', action='store_true', default=False,
                       help='show any build errors as boards are built')
     parser.add_argument('configs', nargs='*')
@@ -2304,8 +2299,8 @@ doc/develop/moveconfig.rst for documentation.'''
         unittest.main()
 
     if args.scan_source:
-        do_scan_source(os.getcwd(), args.update, args.list_problems,
-                       args.commit)
+        do_scan_source(os.getcwd(), args.update, args.update_source,
+                       args.list_problems, args.commit)
         return
 
     if not any((len(configs), args.force_sync, args.build_db, args.imply,
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#44 lore raw

PATCH v3 37/95 sandbox: Expand size for VPL image

In reply to Simon Glass

Allow this to get larger to accommodate more test code with LTO disabled.

---

(no changes since v1)

 arch/sandbox/dts/sandbox_vpl.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/sandbox/dts/sandbox_vpl.dtsi +2 -2
index 1fba537f135..c7dc00a8d2d 100644
@@ -17,8 +17,8 @@
 		 * provide plenty of space for ELF files with debug info so that
 		 * gdb can be used
 		 */
-		offset = <0x400000>;
-		size = <0xdffc00>;
+		offset = <0x800000>;
+		size = <0x2000000>;
 
 		fit {
 			fit,external-offset = <0>;
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#45 lore raw

PATCH v3 38/95 event: Add Kconfig options for SPL

In reply to Simon Glass

Add options to enable events in SPL. This is mostly so the code can be excluded from SPL builds.

---

(no changes since v1)

 common/Kconfig | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
common/Kconfig +16 -0
index ea9bbd52128..14a40d8b4ea 100644
@@ -622,6 +622,22 @@ config EVENT
 
 	  See doc/develop/event.rst for more information.
 
+config SPL_EVENT
+	bool  # General-purpose event-handling mechanism in SPL
+	depends on EVENT && SPL
+	help
+	  This adds a framework for general purpose sending and processing of
+	  events, to allow interested parties to be alerted when something
+	  happens. This is an attempt to stem the flow of weak functions,
+	  hooks, functions in board_f.c and board_r.c and the Kconfig options
+	  below.
+
+	  See doc/develop/event.rst for more information.
+
+config SPL_EVENT_DYNAMIC
+	def_bool n  # Support event registration at runtime (SPL)
+	depends on SPL_EVENT
+
 if EVENT
 
 config EVENT_DYNAMIC
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#46 lore raw

PATCH v3 39/95 bootstd: Add Kconfig options for SPL

In reply to Simon Glass

Create new SPL options so that standard boot can be excluded for SPL. Correct a 'VPL' typo while we are here.

---

Changes in v3:
- Correct 'VPL' typo
- Use a consistent format for the comment

 boot/Kconfig | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
boot/Kconfig +23 -1
index 372be65e534..83c821e38be 100644
@@ -354,6 +354,9 @@ config PXE_UTILS
 	help
 	  Utilities for parsing PXE file formats.
 
+config SPL_PXE_UTILS
+	def_bool n  # Utilities for parsing PXE file formats (SPL)
+
 config BOOTSTD
 	bool "Standard boot support"
 	default y
@@ -389,7 +392,7 @@ config BOOTSTD_FULL
 	    as well as the "boot_targets" environment variable
 
 config SPL_BOOTSTD
-	bool "Standard boot support in VPL"
+	bool "Standard boot support in SPL"
 	depends on SPL && SPL_DM && SPL_OF_CONTROL && SPL_BLK
 	default y if VPL
 	help
@@ -472,6 +475,9 @@ config BOOTMETH_DISTRO
 
 	  This provides a way to try out standard boot on an existing boot flow.
 
+config SPL_BOOTMETH_DISTRO
+	def_bool n  # Bootdev support for distro boot (SPL)
+
 config BOOTMETH_DISTRO_PXE
 	bool "Bootdev support for distro boot over network"
 	depends on CMD_PXE && CMD_NET && DM_ETH
@@ -482,6 +488,9 @@ config BOOTMETH_DISTRO_PXE
 
 	  This provides a way to try out standard boot on an existing boot flow.
 
+config SPL_BOOTMETH_DISTRO_PXE
+	def_bool n  # Bootdev support for distro boot over network (SPL)
+
 config BOOTMETH_EFILOADER
 	bool "Bootdev support for EFI boot"
 	depends on CMD_BOOTEFI
@@ -503,6 +512,9 @@ config BOOTMETH_EFILOADER
 
 	  This provides a way to try out standard boot on an existing boot flow.
 
+config SPL_BOOTMETH_EFILOADER
+	def_bool n  # Bootdev support for EFI boot (SPL)
+
 config BOOTMETH_VBE
 	bool "Bootdev support for Verified Boot for Embedded"
 	depends on FIT
@@ -566,6 +578,9 @@ config BOOTMETH_VBE_SIMPLE_OS
 	  for booting into the OS. This option is only enabled for U-Boot
 	  proper, since it is the phase where device tree fixups happen.
 
+config SPL_BOOTMETH_VBE_SIMPLE_OS
+	def_bool n  # Bootdev support for VBE 'simple' method OS phase (SPL)
+
 config SPL_BOOTMETH_VBE_SIMPLE
 	bool "Bootdev support for VBE 'simple' method (SPL)"
 	depends on SPL
@@ -627,6 +642,10 @@ config BOOTMETH_SANDBOX
 	  This is a sandbox bootmeth driver used for testing. It always returns
 	  -ENOTSUPP when attempting to boot.
 
+config SPL_BOOTMETH_SANDBOX
+	def_bool n  # sandbox bootmeth driver used for testing (SPL)
+	depends on SANDBOX
+
 config BOOTMETH_SCRIPT
 	bool "Bootdev support for U-Boot scripts"
 	default y if BOOTSTD_FULL
@@ -638,6 +657,9 @@ config BOOTMETH_SCRIPT
 	  This provides a way to try out standard boot on an existing boot flow.
 	  It is not enabled by default to save space.
 
+config SPL_BOOTMETH_SCRIPT
+	def_bool n  # Bootdev support for U-Boot scripts (SPL)
+
 endif
 
 config LEGACY_IMAGE_FORMAT
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#47 lore raw

PATCH v3 40/95 cmd: Add SPL Kconfigs for CMDLINE and HUSH

In reply to Simon Glass

At present we rely on this not existing to avoid building various command-line features.

But with the new split configs this does not work. Add separates Kconfigs instead.

---

Changes in v3:
- Rework commit submit
- Use a consistent format for the comment

 cmd/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
cmd/Kconfig +6 -0
index c8792af883e..12b4dc7946f 100644
@@ -23,6 +23,12 @@ config HUSH_PARSER
 	  If disabled, you get the old, much simpler behaviour with a somewhat
 	  smaller memory footprint.
 
+config SPL_CMDLINE
+	def_bool n  # Ensure that the command line is not enabled (SPL)
+
+config SPL_HUSH_PARSER
+	def_bool n  # Eensure that the hush parser is not enabled (SPL)
+
 config CMDLINE_EDITING
 	bool "Enable command line editing"
 	depends on CMDLINE
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#48 lore raw

PATCH v3 41/95 boot: Add a Kconfig for SPL_QCOM_PMIC_GPIO

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 drivers/gpio/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpio/Kconfig +4 -0
index 365615a53f7..8a4787f4195 100644
@@ -316,6 +316,10 @@ config QCOM_PMIC_GPIO
 	  Power and reset buttons are placed in "pwkey_qcom" bank and
           have gpio numbers 0 and 1 respectively.
 
+config SPL_QCOM_PMIC_GPIO
+	def_bool n  # Qualcomm generic PMIC GPIO/keypad driver (SPL)
+	depends on SPL_DM_GPIO && SPL_PMIC_QCOM
+
 config PCF8575_GPIO
 	bool "PCF8575 I2C GPIO Expander driver"
 	depends on DM_GPIO && DM_I2C
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#49 lore raw

PATCH v3 42/95 cros_ec: Add SPL Kconfigs for cros_ec features

In reply to Simon Glass

At present we rely on this not existing to avoid building various EC features.

But with the new split configs this does not work. Add separates Kconfigs instead.

---

Changes in v3:
- Use a consistent format for the comment

 drivers/i2c/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/i2c/Kconfig +6 -0
index 427074bff83..ec533f31b1a 100644
@@ -97,6 +97,9 @@ config I2C_CROS_EC_TUNNEL
 	  I2C or LPC). Some Chromebooks use this when the hardware design
 	  does not allow direct access to the main PMIC from the AP.
 
+config SPL_I2C_CROS_EC_TUNNEL
+	def_bool n  # Chrome OS EC tunnel I2C bus (SPL)
+
 config I2C_CROS_EC_LDO
 	bool "Provide access to LDOs on the Chrome OS EC"
 	depends on CROS_EC
@@ -111,6 +114,9 @@ config I2C_CROS_EC_LDO
 	avoid duplicating the logic in the TPS65090 regulator driver for
 	enabling/disabling an LDO.
 
+config SPL_I2C_CROS_EC_LDO
+	def_bool n  # Provide access to LDOs on the Chrome OS EC (SPL)
+
 config I2C_SET_DEFAULT_BUS_NUM
 	bool "Set default I2C bus number"
 	depends on DM_I2C
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#50 lore raw

PATCH v3 43/95 boot: Add a Kconfig for SPL_UT_COMPRESSION

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

Changes in v3:
- Use a consistent format for the comment

 test/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
test/Kconfig +3 -0
index 465028265b2..5cce519670c 100644
@@ -75,6 +75,9 @@ config UT_COMPRESSION
 	  Enables tests for compression and decompression routines for simple
 	  sanity and for buffer overflow conditions.
 
+config SPL_UT_COMPRESSION
+	def_bool n  # Unit test for compression (SPL)
+
 config UT_LOG
 	bool "Unit tests for logging functions"
 	depends on UNIT_TEST
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#51 lore raw

PATCH v3 44/95 env: Avoid checking ENV_IS_IN when env disabled

In reply to Simon Glass

This check is not needed when the environment is not enabled, e.g. in SPL. Add a condition to handle this.

---

(no changes since v1)

 cmd/nvedit.c | 2 ++
 1 file changed, 2 insertions(+)
cmd/nvedit.c +2 -0
index 7cbc3fd573a..277293679df 100644
@@ -59,11 +59,13 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #endif
 
+#if CONFIG_IS_ENABLED(ENV_SUPPORT)
 #if	!defined(ENV_IS_IN_DEVICE)		&& \
 	!defined(CONFIG_ENV_IS_NOWHERE)
 # error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|MMC|FAT|EXT4|\
 NAND|NVRAM|ONENAND|SATA|SPI_FLASH|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
 #endif
+#endif /* ENV_SUPPORT */
 
 /*
  * Maximum expected input data size for import command
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#52 lore raw

PATCH v3 45/95 boot: Add a Kconfig for SPL_AVB_VERIFY

In reply to Simon Glass

This is implicitly used in the source and seems useful, so add it.

---

(no changes since v1)

 common/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
common/Kconfig +4 -0
index 14a40d8b4ea..58008321d53 100644
@@ -818,6 +818,10 @@ config AVB_VERIFY
 	    * Helpers to access MMC, similar to drivers/fastboot/fb_mmc.c.
 	    * Helpers to alloc/init/free avb ops.
 
+config SPL_AVB_VERIFY
+	def_bool n  # Build Android Verified Boot operations (SPL)
+	depends on SPL
+
 if AVB_VERIFY
 
 config AVB_BUF_ADDR
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#53 lore raw

PATCH v3 46/95 env: Allow VPL environment to be nowhere

In reply to Simon Glass

Add an option to put the VPL environment nowhere (not in storage).

---

(no changes since v1)

 env/Kconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
env/Kconfig +10 -0
index 6e24eee55f2..2bbe4c466a6 100644
@@ -860,6 +860,16 @@ config TPL_ENV_IS_IN_FLASH
 
 endif
 
+if VPL_ENV_SUPPORT
+
+config VPL_ENV_IS_NOWHERE
+	bool "VPL Environment is not stored"
+	default y if ENV_IS_NOWHERE
+	help
+	  Similar to ENV_IS_NOWHERE, used for VPL environment.
+
+endif  # VPL_ENV_SUPPORT
+
 config USE_BOOTFILE
 	bool "Add a 'bootfile' environment variable"
 	help
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#54 lore raw

PATCH v3 47/95 lib: Add VPL options for SHA1 and SHA256

In reply to Simon Glass

Add these options so these algorithms can be used in VPL.

---

(no changes since v1)

 lib/Kconfig | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
lib/Kconfig +20 -0
index 0a02f3e89ae..21a43effe49 100644
@@ -583,6 +583,26 @@ config SPL_SHA_PROG_HW_ACCEL
 
 endif
 
+config VPL_SHA1
+	bool "Enable SHA1 support in VPL"
+	depends on VPL
+	default y if SHA1
+	help
+	  This option enables support of hashing using SHA1 algorithm.
+	  The hash is calculated in software.
+	  The SHA1 algorithm produces a 160-bit (20-byte) hash value
+	  (digest).
+
+config VPL_SHA256
+	bool "Enable SHA256 support in VPL"
+	depends on VPL
+	default y if SHA256
+	help
+	  This option enables support of hashing using SHA256 algorithm.
+	  The hash is calculated in software.
+	  The SHA256 algorithm produces a 256-bit (32-byte) hash value
+	  (digest).
+
 if SHA_HW_ACCEL
 
 config SHA512_HW_ACCEL
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#55 lore raw

PATCH v3 48/95 x86: Use string functions for all 32-bit builds

In reply to Simon Glass

At present these are not included in SPL. They do add to code size but are a bit faster, so adjust the setting to add them.

---

(no changes since v1)

 arch/x86/include/asm/string.h | 2 +-
 arch/x86/lib/Makefile         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/include/asm/string.h +1 -1
index c15b264a5c0..0254a022160 100644
@@ -14,7 +14,7 @@ extern char *strrchr(const char *s, int c);
 #undef __HAVE_ARCH_STRCHR
 extern char *strchr(const char *s, int c);
 
-#ifdef CONFIG_X86_64
+#if CONFIG_IS_ENABLED(X86_64)
 
 #undef __HAVE_ARCH_MEMCPY
 extern void *memcpy(void *, const void *, __kernel_size_t);
arch/x86/lib/Makefile +1 -1
index a6f22441474..ea7ff2bcf38 100644
@@ -4,7 +4,7 @@
 # Wolfgang Denk, DENX Software Engineering, [email protected].
 
 obj-y	+= bdinfo.o
-ifndef CONFIG_X86_64
+ifndef CONFIG_$(SPL_TPL_)X86_64
 ifndef CONFIG_TPL_BUILD
 obj-y += bios.o
 obj-y += bios_asm.o
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#56 lore raw

PATCH v3 49/95 lib: Fix build condition for tiny-printf

In reply to Simon Glass

This should be checking for any SPL build. Drop the use of SPL_TPL_ since it is not necessary and will not work with split config.

---

(no changes since v1)

 lib/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Makefile +1 -1
index a282e40258c..10aa7ac0298 100644
@@ -127,7 +127,7 @@ obj-$(CONFIG_LIB_UUID) += uuid.o
 obj-$(CONFIG_LIB_RAND) += rand.o
 obj-y += panic.o
 
-ifeq ($(CONFIG_$(SPL_TPL_)BUILD),y)
+ifeq ($(CONFIG_SPL_BUILD),y)
 # SPL U-Boot may use full-printf, tiny-printf or none at all
 ifdef CONFIG_$(SPL_TPL_)USE_TINY_PRINTF
 obj-$(CONFIG_$(SPL_TPL_)SPRINTF) += tiny-printf.o
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#57 lore raw

PATCH v3 50/95 sandbox: Tidy up RTC options

In reply to Simon Glass

At present we enable the sandbox RTC driver for all builds. Add a separate Kconfig option to control this, so that it can be disabled in TPL, where it is not needed.

---

Changes in v3:
- Fix a transitory build error with sandbox_spl

 arch/sandbox/dts/sandbox.dts   |  2 +-
 arch/sandbox/dts/sandbox.dtsi  |  6 +++---
 arch/sandbox/include/asm/rtc.h |  2 +-
 drivers/rtc/Kconfig            | 18 ++++++++++++++++++
 drivers/rtc/Makefile           |  4 ++--
 5 files changed, 25 insertions(+), 7 deletions(-)
arch/sandbox/dts/sandbox.dts +1 -1
index 88b57bfb7e5..1dd880ebd58 100644
@@ -76,7 +76,7 @@
 		clock-frequency = <400000>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_i2c0>;
-		u-boot,dm-pre-reloc;
+		u-boot,dm-spl;
 	};
 
 	pcic: pci@0 {
arch/sandbox/dts/sandbox.dtsi +3 -3
index 7e7fcff6d28..ebf3bee716a 100644
@@ -115,7 +115,7 @@
 			reg = <0x43>;
 			compatible = "sandbox-rtc";
 			sandbox,emul = <&emul0>;
-			u-boot,dm-pre-reloc;
+			u-boot,dm-spl;
 		};
 		sandbox_pmic: sandbox_pmic {
 			reg = <0x40>;
@@ -126,7 +126,7 @@
 		};
 
 		i2c_emul: emul {
-			u-boot,dm-pre-reloc;
+			u-boot,dm-spl;
 			reg = <0xff>;
 			compatible = "sandbox,i2c-emul-parent";
 			emul_eeprom: emul-eeprom {
@@ -136,7 +136,7 @@
 				#emul-cells = <0>;
 			};
 			emul0: emul0 {
-				u-boot,dm-pre-reloc;
+				u-boot,dm-spl;
 				compatible = "sandbox,i2c-rtc-emul";
 				#emul-cells = <0>;
 			};
arch/sandbox/include/asm/rtc.h +1 -1
index 025cd6c67cf..bf3ac5ea1ec 100644
@@ -40,7 +40,7 @@ enum {
  * @reg:		Register values
  */
 struct sandbox_i2c_rtc_plat_data {
-#if CONFIG_IS_ENABLED(OF_PLATDATA)
+#if CONFIG_IS_ENABLED(OF_PLATDATA) && IS_ENABLED(CONFIG_RTC_SANDBOX)
 	struct dtd_sandbox_i2c_rtc_emul dtplat;
 #endif
 	long base_time;
drivers/rtc/Kconfig +18 -0
index 35b6ed4d7c7..fcfda2847c8 100644
@@ -231,6 +231,24 @@ config RTC_M41T62
 	  Enable driver for ST's M41T62 compatible RTC devices (like RV-4162).
 	  It is a serial (I2C) real-time clock (RTC) with alarm.
 
+config RTC_SANDBOX
+	bool "Enable sandbox RTC driver"
+	depends on SANDBOX && DM_RTC
+	default y
+	help
+	  Enable the sandbox RTC driver. This driver connects to the RTC
+	  emulator and is used to test the RTC uclasses and associated code,
+	  as well as the I2C subsystem.
+
+config SPL_RTC_SANDBOX
+	bool "Enable sandbox RTC driver (SPL)"
+	depends on SANDBOX && SPL_DM_RTC
+	default y
+	help
+	  Enable the sandbox RTC driver. This driver connects to the RTC
+	  emulator and is used to test the RTC uclasses and associated code,
+	  as well as the I2C subsystem.
+
 config RTC_STM32
 	bool "Enable STM32 RTC driver"
 	depends on DM_RTC
drivers/rtc/Makefile +2 -2
index 447551e15aa..b6c9029c8f0 100644
@@ -16,7 +16,7 @@ obj-$(CONFIG_RTC_DS3231) += ds3231.o
 obj-$(CONFIG_RTC_DS3232) += ds3232.o
 obj-$(CONFIG_RTC_EMULATION) += emul_rtc.o
 obj-$(CONFIG_RTC_HT1380) += ht1380.o
-obj-$(CONFIG_SANDBOX) += i2c_rtc_emul.o
+obj-$(CONFIG_$(SPL_TPL_)RTC_SANDBOX) += i2c_rtc_emul.o
 obj-$(CONFIG_RTC_ISL1208) += isl1208.o
 obj-$(CONFIG_RTC_M41T62) += m41t62.o
 obj-$(CONFIG_RTC_MC13XXX) += mc13xxx-rtc.o
@@ -35,6 +35,6 @@ obj-$(CONFIG_RTC_RX8025) += rx8025.o
 obj-$(CONFIG_RTC_RX8010SJ) += rx8010sj.o
 obj-$(CONFIG_RTC_S35392A) += s35392a.o
 obj-$(CONFIG_RTC_STM32) += stm32_rtc.o
-obj-$(CONFIG_SANDBOX) += sandbox_rtc.o
+obj-$(CONFIG_$(SPL_TPL_)RTC_SANDBOX) += sandbox_rtc.o
 obj-$(CONFIG_RTC_ABX80X) += abx80x.o
 obj-$(CONFIG_RTC_ZYNQMP) += zynqmp_rtc.o
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#58 lore raw

PATCH v3 51/95 sandbox: Use the generic VPL option to enable VPL

In reply to Simon Glass

Avoid using CONFIG_SANDBOX_VPL since we have a generic option which works just as well.

---

(no changes since v1)

 arch/sandbox/dts/sandbox.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sandbox/dts/sandbox.dts +1 -1
index 1dd880ebd58..28c21f232a2 100644
@@ -103,6 +103,6 @@
 #include "cros-ec-keyboard.dtsi"
 #include "sandbox_pmic.dtsi"
 
-#ifdef CONFIG_SANDBOX_VPL
+#if IS_ENABLED(CONFIG_SUPPORT_VPL)
 #include "sandbox_vpl.dtsi"
 #endif
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#59 lore raw

PATCH v3 52/95 sandbox: Tidy up I2C options

In reply to Simon Glass

At present we enable the sandbox I2C driver for all builds. Add a separate Kconfig option to control this, so that it can be disabled in TPL, where it is not needed.

---

(no changes since v1)

 drivers/i2c/Kconfig | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/i2c/Kconfig +20 -0
index ec533f31b1a..b1b846da05f 100644
@@ -47,6 +47,16 @@ config SPL_DM_I2C
 	  device (bus child) info is kept as parent platdata. The interface
 	  is defined in include/i2c.h.
 
+config TPL_DM_I2C
+	bool "Enable Driver Model for I2C drivers in TPL"
+	depends on TPL_DM && DM_I2C
+	help
+	  Enable driver model for I2C. The I2C uclass interface: probe, read,
+	  write and speed, is implemented with the bus drivers operations,
+	  which provide methods for bus setting and data transfer. Each chip
+	  device (bus child) info is kept as parent platdata. The interface
+	  is defined in include/i2c.h.
+
 config VPL_DM_I2C
 	bool "Enable Driver Model for I2C drivers in VPL"
 	depends on VPL_DM && DM_I2C
@@ -504,6 +514,16 @@ config SYS_I2C_ROCKCHIP
 config SYS_I2C_SANDBOX
 	bool "Sandbox I2C driver"
 	depends on SANDBOX && DM_I2C
+	default y
+	help
+	  Enable I2C support for sandbox. This is an emulation of a real I2C
+	  bus. Devices can be attached to the bus using the device tree
+	  which specifies the driver to use.  See sandbox.dts as an example.
+
+config SPL_SYS_I2C_SANDBOX
+	bool "Sandbox I2C driver (SPL)"
+	depends on SPL && SANDBOX && DM_I2C
+	default y
 	help
 	  Enable I2C support for sandbox. This is an emulation of a real I2C
 	  bus. Devices can be attached to the bus using the device tree
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#60 lore raw

PATCH v3 53/95 fixdep: Add support for VPL

In reply to Simon Glass

Add VPL files into the mix so that we can fix up the dependencies there.

---

(no changes since v1)

 scripts/basic/fixdep.c | 2 ++
 1 file changed, 2 insertions(+)
scripts/basic/fixdep.c +2 -0
index 5ced0f6b069..3d40bd7ee25 100644
@@ -421,6 +421,8 @@ int main(int argc, char *argv[])
 		strcpy(tmp_buf, "SPL_");
 	else if (!strncmp(target, "tpl/", 4))
 		strcpy(tmp_buf, "TPL_");
+	else if (!strncmp(target, "vpl/", 4))
+		strcpy(tmp_buf, "VPL_");
 	/* end U-Boot hack */
 
 	xprintf("cmd_%s := %s\n\n", target, cmdline);
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#61 lore raw

PATCH v3 54/95 fixdep: Refactor to make testing easier

In reply to Simon Glass

Move the config parsing into a separate function so that it is possible to write tests for the function.

---

(no changes since v1)

 scripts/basic/fixdep.c | 87 ++++++++++++++++++++++++++----------------
 1 file changed, 54 insertions(+), 33 deletions(-)
scripts/basic/fixdep.c +54 -33
index 3d40bd7ee25..a49d35ba5f6 100644
@@ -236,47 +236,68 @@ static int str_ends_with(const char *s, int slen, const char *sub)
 	return !memcmp(s + slen - sublen, sub, sublen);
 }
 
-static void parse_config_file(const char *p)
+static const char *parse_config_line(const char *p, const char **endp)
 {
 	const char *q, *r;
-	const char *start = p;
 
-	while ((p = strstr(p, "CONFIG_"))) {
-		if (p > start && (isalnum(p[-1]) || p[-1] == '_')) {
-			p += 7;
-			continue;
-		}
-		p += 7;
+	p = strstr(p, "CONFIG_");
+	if (!p) {
+		*endp = NULL;
+		return NULL;
+	}
+	if ((isalnum(p[-1]) || p[-1] == '_')) {
+		*endp = p + 7;
+		return NULL;
+	}
+	p += 7;
+	q = p;
+	while (isalnum(*q) || *q == '_')
+		q++;
+	if (str_ends_with(p, q - p, "_MODULE"))
+		r = q - 7;
+	else
+		r = q;
+	/*
+	 * U-Boot also handles
+	 *   CONFIG_IS_ENABLED(...)
+	 *   CONFIG_VAL(...)
+	 */
+	if ((q - p == 10 && !memcmp(p, "IS_ENABLED(", 11)) ||
+	    (q - p == 3 && !memcmp(p, "VAL(", 4))) {
+		p = q + 1;
 		q = p;
 		while (isalnum(*q) || *q == '_')
 			q++;
-		if (str_ends_with(p, q - p, "_MODULE"))
-			r = q - 7;
-		else
-			r = q;
-		/*
-		 * U-Boot also handles
-		 *   CONFIG_IS_ENABLED(...)
-		 *   CONFIG_VAL(...)
-		 */
-		if ((q - p == 10 && !memcmp(p, "IS_ENABLED(", 11)) ||
-		    (q - p == 3 && !memcmp(p, "VAL(", 4))) {
-			p = q + 1;
-			q = p;
-			while (isalnum(*q) || *q == '_')
-				q++;
-			r = q;
-			if (r > p && tmp_buf[0]) {
-				memcpy(tmp_buf + 4, p, r - p);
-				r = tmp_buf + 4 + (r - p);
-				p = tmp_buf;
-			}
+		r = q;
+		if (r > p && tmp_buf[0]) {
+			memcpy(tmp_buf + 4, p, r - p);
+			r = tmp_buf + 4 + (r - p);
+			p = tmp_buf;
 		}
-		/* end U-Boot hack */
+	}
+	/* end U-Boot hack */
+	*endp = r;
+
+	if (r > p)
+		return p;
 
-		if (r > p)
-			use_config(p, r - p);
-		p = q;
+	return NULL;
+}
+
+static void parse_config_file(const char *base)
+{
+	const char *p;
+
+	if (!*base)
+		return;
+	p = base + 1;
+	while (p) {
+		const char *out, *end;
+
+		out = parse_config_line(p, &end);
+		if (out)
+			use_config(out, end - out);
+		p = end;
 	}
 }
 
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#62 lore raw

PATCH v3 55/95 fixdep: Add some tests for parse_config_line()

In reply to Simon Glass

Add tests for this code to cover the basic cases.

---

(no changes since v1)

 scripts/basic/fixdep.c | 73 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 73 insertions(+)
scripts/basic/fixdep.c +73 -0
index a49d35ba5f6..fe8180ab4e7 100644
@@ -425,11 +425,84 @@ static void parse_dep_file(char *m, const char *target)
 	xprintf("$(deps_%s):\n", target);
 }
 
+#define CHECKP(expect, got)	\
+	if (expect != got) { \
+		fprintf(stderr, "Test failed at line %d: expect %ld, got %ld\n", \
+			__LINE__, expect - buf, got - buf); \
+		return 1; \
+	}
+
+#define CHECK(expect, got)	\
+	if (expect != got) { \
+		fprintf(stderr, "Test failed at line %d: expect %p, got %p\n", \
+			__LINE__, expect, got); \
+		return 1; \
+	}
+
+static int run_tests(void)
+{
+	const char *out, *end;
+	char buf_s[40], *buf = buf_s + 1;
+
+	/* make sure the previous char doesn't look like part of the CONFIG */
+	buf_s[0] = ' ';
+
+	strcpy(buf, "");
+	out = parse_config_line(buf, &end);
+	CHECK(NULL, out);
+	CHECK(NULL, end);
+
+	strcpy(buf, "nothing");
+	out = parse_config_line(buf, &end);
+	CHECK(NULL, out);
+	CHECK(NULL, end);
+
+	strcpy(buf, "CONFIG_OPTION_MORE");
+	out = parse_config_line(buf, &end);
+	CHECKP(buf + 7, out);
+	CHECKP(buf + 18, end);
+
+	strcpy(buf, "some CONFIG_OPTION_MORE");
+	out = parse_config_line(buf, &end);
+	CHECKP(buf + 12, out);
+	CHECKP(buf + 23, end);
+
+	strcpy(buf, "some CONFIG_OPTION_MORE here");
+	out = parse_config_line(buf, &end);
+	CHECKP(buf + 12, out);
+	CHECKP(buf + 23, end);
+
+	strcpy(buf, "CONFIG_OPTION_MODULE");
+	out = parse_config_line(buf, &end);
+	CHECKP(buf + 7, out);
+	CHECKP(buf + 13, end);
+
+	strcpy(buf, "CONFIG_IS_ENABLED(FRED)");
+	out = parse_config_line(buf, &end);
+	CHECKP(buf + 18, out);
+	CHECKP(buf + 22, end);
+
+	strcpy(buf, "CONFIG_VAL(MARY)");
+	out = parse_config_line(buf, &end);
+	CHECKP(buf + 11, out);
+	CHECKP(buf + 15, end);
+
+	return 0;
+}
+
 int main(int argc, char *argv[])
 {
 	const char *depfile, *target, *cmdline;
 	void *buf;
 
+	if (argc == 2 && !strcmp("-t", argv[1])) {
+		if (run_tests()) {
+			fprintf(stderr, "Tests failed\n");
+			return 1;
+		}
+		printf("Tests passed\n");
+		return 0;
+	}
 	if (argc != 4)
 		usage();
 
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#63 lore raw

PATCH v3 56/95 test: Add SPL versions of the TEST_KCONFIG options

In reply to Simon Glass

These are needed since we need a separate value in SPL and Proper.

---

(no changes since v1)

 test/lib/Kconfig | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
test/lib/Kconfig +19 -1
index dbb03e4a36f..134cbb85b83 100644
@@ -18,6 +18,24 @@ config TEST_KCONFIG_VALUE
 	int "Value associated with the option"
 	depends on TEST_KCONFIG_ENABLE
 	help
-	  This is the value whgch is present if TEST_KCONFIG_ENABLE is enabled.
+	  This is the value which is present if TEST_KCONFIG_ENABLE is enabled.
+
+config SPL_TEST_KCONFIG
+	bool "Enable detection of Kconfig macro errors (SPL)"
+	help
+	  This is used to test that the IF_ENABLED_INT() macro causes a build error
+	  if the value is used when the CONFIG Is not enabled.
+
+config SPL_TEST_KCONFIG_ENABLE
+	bool "Option to enable (SPL)"
+	help
+	  This is the option that controls whether the value is present.
+
+config SPL_TEST_KCONFIG_VALUE
+	int "Value associated with the option (SPL"
+	depends on SPL_TEST_KCONFIG_ENABLE
+	help
+	  This is the value which is present if SPL_TEST_KCONFIG_ENABLE is
+	  enabled.
 
 endif # SANDBOX
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#64 lore raw

PATCH v3 57/95 lib: Add an SPL config for LIB_UUID

In reply to Simon Glass

This is selected by PARTITION_UUIDS which has a separate option for SPL. Add an SPL option for LIB_UUID also, so that we can keep them consistent.

Also add one for PARTITION_TYPE_GUID to avoid a build error in part_efi.c which wants to call a uuid function in SPL.

---

(no changes since v1)

 disk/Kconfig | 8 ++++++++
 lib/Kconfig  | 4 ++++
 2 files changed, 12 insertions(+)
disk/Kconfig +8 -0
index c9b9dbaf1a6..817b7c8c76d 100644
@@ -149,6 +149,7 @@ config SPL_PARTITION_UUIDS
 	bool "Enable support of UUID for partition in SPL"
 	depends on SPL_PARTITIONS
 	default y if SPL_EFI_PARTITION
+	select SPL_LIB_UUID
 
 config PARTITION_TYPE_GUID
 	bool "Enable support of GUID for partition type"
@@ -157,4 +158,11 @@ config PARTITION_TYPE_GUID
 	  Activate the configuration of GUID type
 	  for EFI partition
 
+config SPL_PARTITION_TYPE_GUID
+	bool "Enable support of GUID for partition type (SPL)"
+	depends on SPL_EFI_PARTITION
+	help
+	  Activate the configuration of GUID type
+	  for EFI partition
+
 endmenu
lib/Kconfig +4 -0
index 21a43effe49..8ba66cb864d 100644
@@ -74,6 +74,10 @@ config HAVE_PRIVATE_LIBGCC
 config LIB_UUID
 	bool
 
+config SPL_LIB_UUID
+	depends on SPL
+	bool
+
 config SEMIHOSTING
 	bool "Support semihosting"
 	depends on ARM || RISCV
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#65 lore raw

PATCH v3 58/95 test: Tidy up sandbox handling in test-main

In reply to Simon Glass

This is pretty messy at present since it relies on a SPL_SANDBOX option that does not exist. Use the normal options instead, so that it will work with split config.

---

(no changes since v1)

 test/test-main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
test/test-main.c +5 -5
index ea959f4e859..b3c30d92937 100644
@@ -46,14 +46,14 @@ enum fdtchk_t {
  */
 static enum fdtchk_t fdt_action(void)
 {
-	/* Do a copy for sandbox (but only the U-Boot build, not SPL) */
-	if (CONFIG_IS_ENABLED(SANDBOX))
-		return FDTCHK_COPY;
-
 	/* For sandbox SPL builds, do nothing */
-	if (IS_ENABLED(CONFIG_SANDBOX))
+	if (IS_ENABLED(CONFIG_SANDBOX) && IS_ENABLED(CONFIG_SPL_BUILD))
 		return FDTCHK_NONE;
 
+	/* Do a copy for sandbox (but only the U-Boot build, not SPL) */
+	if (IS_ENABLED(CONFIG_SANDBOX))
+		return FDTCHK_COPY;
+
 	/* For all other boards, do a checksum */
 	return FDTCHK_CHECKSUM;
 }
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#66 lore raw

PATCH v3 59/95 kconfig: Add a configuration file for nospl

In reply to Simon Glass

This file indicates which options are not for use in U-Boot SPL. It allows the kconfig tool to correctly generate its output.

It was generated with

   ./tools/moveconfig.py --scan-source -u

Note that this only produces sensible results when used with the current source code, as of this patch. Following patches adjust the code, e.g. to drop use of CONFIG_IS_ENABLED(), so the program will not produce anything useful when run on that version of the code.

---

Changes in v3:
- Add DFU_VIRT FSL_ISBC_KEY_EXT GENERATE_SMBIOS_TABLE GMAC_ROCKCHIP I8259_PIC IMX_RDC NXP_FSPI PCI_PNP PHY_CADENCE_TORRENT QFW_PIO SEC_FIRMWARE_ARMV8_PSCI SPI_FLASH_BAR SPI_FLASH_MACRONIX
- Add CMD_BOOTEFI_BOOTMGR CMD_EFICONFIG CMD_PXE
- Fix move_config typo
- Add ARCH_VERSAL_NET CMD_DHCP ENV_WRITEABLE_LIST EXPO
- Add TARGET_KMCOGE5NE TARGET_KMETER1

 scripts/conf_nospl | 113 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)
 create mode 100644 scripts/conf_nospl
scripts/conf_nospl new file +113 -0
new file mode 100644
index 00000000000..fc9e5a93422
@@ -0,0 +1,113 @@
+# Options which are never enabled in SPL.
+
+Generally, options which have no SPL_ prefix (e.g. CONFIG_FOO) apply to all
+SPL build phases. This allows things like ARCH_ARM to propagate to all builds
+without the hassle of generating a separate SPL version fo each phase. But in
+some cases this is not wanted.
+
+This file lists options which don't have an SPL equivalent, but still should not
+be enabled in SPL builds. It is necessary since kconfig cannot tell (just by
+looking at the Kconfig description) whether it applies to Proper builds only,
+or to all builds.
+
+ACPI_PMC_SANDBOX
+ARCH_VERSAL_NET
+BINMAN_FDT
+CLK_INTEL
+CMD_BOOTEFI_BOOTMGR
+CMD_DHCP
+CMD_EFICONFIG
+CMD_MMC_RPMB
+CMD_MMC_SWRITE
+CMD_PXE
+DFU_MMC
+DFU_MTD
+DFU_NAND
+DFU_SF
+DFU_SF_PART
+DFU_VIRT
+DFU_WRITE_ALT
+DMA_LEGACY
+DM_DMA
+DM_EVENT
+DM_REGULATOR_ANATOP
+DM_REGULATOR_PBIAS
+DM_REGULATOR_STM32_VREFBUF
+DM_STDIO
+DWC_AHSATA_AHCI
+EFI_DT_FIXUP
+EFI_EBBR_2_1_CONFORMANCE
+EFI_SCROLL_ON_CLEAR_SCREEN
+EFI_UNICODE_CAPITALIZATION
+ENV_APPEND
+ENV_WRITEABLE_LIST
+EVENT_DEBUG
+EXPO
+EXYNOS7870
+EXYNOS7880
+FASTBOOT_UUU_SUPPORT
+FRED
+FRU_SC
+FSL_ISBC_KEY_EXT
+GENERATE_SMBIOS_TABLE
+GMAC_ROCKCHIP
+I8259_PIC
+IMX_RDC
+INTEL_GENERIC_WIFI
+LOG_SYSLOG
+LS2_SFP
+MALTA
+MEMSIZE_IN_BYTES
+MIPS_BOOT_CMDLINE_LEGACY
+MIPS_BOOT_ENV_LEGACY
+MIPS_BOOT_FDT
+MMC_HW_PARTITIONING
+MMC_VERBOSE
+MSCODE_PARSER
+MUX_MMIO
+NAND_CS_INIT
+NO_FB_CLEAR
+NXP_FSPI
+OFNODE_MULTI_TREE
+PCF8575_GPIO
+PCI_PNP
+PHY_CADENCE_TORRENT
+PHY_J721E_WIZ
+PKCS7_MESSAGE_PARSER
+PKCS7_VERIFY
+PLATDATA
+PRE_CONSOLE_BUFFER
+QFW_PIO
+REGULATOR_RK8XX
+RESTORE_EXCEPTION_VECTOR_BASE
+ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON
+SEC_FIRMWARE_ARMV8_PSCI
+SERIAL_PUTS
+SERIAL_RX_BUFFER
+SHA512_HW_ACCEL
+SILENT_CONSOLE_UPDATE_ON_RELOC
+SILENT_CONSOLE_UPDATE_ON_SET
+SIMPLE_BUS_CORRECT_RANGE
+SMC911X_32_BIT
+SPI_DIRMAP
+SPI_FLASH_BAR
+SPI_FLASH_MACRONIX
+SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT
+STM32_ETZPC
+SYSRESET_AT91
+SYSRESET_X86
+SYS_DEVICE_NULLDEV
+SYS_WHITE_ON_BLACK
+TARGET_DENEB
+TARGET_EVB_RK3399
+TARGET_GIEDI
+TARGET_KMCOGE5NE
+TARGET_KMETER1
+TARGET_ST_STM32MP15X
+TURRIS_OMNIA_MCU
+USB_GADGET_OS_DESCRIPTORS
+UT_DM
+UT_UNICODE
+X509_CERTIFICATE_PARSER
+XILINX_MICROBLAZE0_DELAY_SLOT_EXCEP
+XILINX_MICROBLAZE0_USR_EXCEP
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#67 lore raw

PATCH v3 60/95 kconfig: Refactor code into separate writer functions

In reply to Simon Glass

Separate out the code that writes the Makefile and headers so we can reuse these functions when writing out SPL files.

This makes no functional change.

---

Changes in v3:
- Drop header-file changes not needed in this patch

 scripts/kconfig/confdata.c | 65 ++++++++++++++++++++++----------------
 1 file changed, 38 insertions(+), 27 deletions(-)
scripts/kconfig/confdata.c +38 -27
index d587b10d7f8..73bf43bcb95 100644
@@ -509,27 +509,18 @@ int conf_read(const char *name)
 	return 0;
 }
 
-/*
- * Kconfig configuration printer
- *
- * This printer is used when generating the resulting configuration after
- * kconfig invocation and `defconfig' files. Unset symbol might be omitted by
- * passing a non-NULL argument to the printer.
- *
- */
-static void
-kconfig_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
+/* Print a symbol for a Makefile */
+static void print_makefile_sym(FILE *fp, const char *name,
+			       enum symbol_type type, const char *value,
+			       bool skip_unset)
 {
-
-	switch (sym->type) {
+	switch (type) {
 	case S_BOOLEAN:
 	case S_TRISTATE:
 		if (*value == 'n') {
-			bool skip_unset = (arg != NULL);
-
 			if (!skip_unset)
 				fprintf(fp, "# %s%s is not set\n",
-				    CONFIG_, sym->name);
+					CONFIG_, name);
 			return;
 		}
 		break;
@@ -537,7 +528,21 @@ kconfig_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
 		break;
 	}
 
-	fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, value);
+	fprintf(fp, "%s%s=%s\n", CONFIG_, name, value);
+}
+
+/*
+ * Kconfig configuration printer
+ *
+ * This printer is used when generating the resulting configuration after
+ * kconfig invocation and `defconfig' files. Unset symbol might be omitted by
+ * passing a non-NULL argument to the printer.
+ *
+ */
+static void
+kconfig_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
+{
+	print_makefile_sym(fp, sym->name, sym->type, value, arg != NULL);
 }
 
 static void
@@ -566,16 +571,12 @@ static struct conf_printer kconfig_printer_cb =
 	.print_comment = kconfig_print_comment,
 };
 
-/*
- * Header printer
- *
- * This printer is used when generating the `include/generated/autoconf.h' file.
- */
-static void
-header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
+/* Print a symbol for a header file */
+static void print_header_sym(FILE *fp, const char *name, enum symbol_type type,
+			     const char *value)
 {
 
-	switch (sym->type) {
+	switch (type) {
 	case S_BOOLEAN:
 	case S_TRISTATE: {
 		const char *suffix = "";
@@ -588,7 +589,7 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
 			/* fall through */
 		default:
 			fprintf(fp, "#define %s%s%s 1\n",
-			    CONFIG_, sym->name, suffix);
+			    CONFIG_, name, suffix);
 		}
 		break;
 	}
@@ -598,18 +599,28 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
 		if (value[0] != '0' || (value[1] != 'x' && value[1] != 'X'))
 			prefix = "0x";
 		fprintf(fp, "#define %s%s %s%s\n",
-		    CONFIG_, sym->name, prefix, value);
+		    CONFIG_, name, prefix, value);
 		break;
 	}
 	case S_STRING:
 	case S_INT:
 		fprintf(fp, "#define %s%s %s\n",
-		    CONFIG_, sym->name, value);
+		    CONFIG_, name, value);
 		break;
 	default:
 		break;
 	}
+}
 
+/*
+ * Header printer
+ *
+ * This printer is used when generating the `include/generated/autoconf.h' file.
+ */
+static void
+header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
+{
+	print_header_sym(fp, sym->name, sym->type, value);
 }
 
 static void
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#68 lore raw

PATCH v3 61/95 kconfig: Support writing separate SPL files

In reply to Simon Glass

At present kconfig writes out several files, including:

auto.conf - CONFIG settings used by make
autoconf.h - header file used by C code

This works well but is a bit ugly in places, for example requiring the use of a SPL_TPL_ macro in Makefiles to distinguish between options intended for SPL and U-Boot proper.

Update the kconfig tool to also output separate files for each phase: e.g. auto_spl.conf and autoconf_spl.h

These are similar to the existing files, but drop the SPL_ prefix so that SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro to be simplified, in a later patch, eventually replacing it with IS_ENABLED().

When CONFIG_FOO is used within SPL, it means that FOO is enabled in that SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, that means that CONFIG_FOO will be enabled in the SPL phase. So the SPL builds can just use CONFIG_FOO to check it. There is no need to use CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore.

This of course means that if there is a need to access a PPL symbol from an SPL build, there is no way to do it. To copy with that, we need a CONFIG_PPL_FOO to be visibilty to all SPL builds.

So this change also adds new PPL_ output for U-Boot proper (Primary Program Loader). So every CONFIG_FOO that is enabled in PPL also has a CONFIG_PPL_FOO

This allows SPL to access the TEXT_BASE for U-Boot proper, for example, so it knows where to load it. There are about 30 places where this is needed, in addition to TEXT_BASE. The environment has the same problem, adding another dozen or so caes in include/config_distro_bootcmd.h but it has been decided to ignore that for now.

The feature is controlled by an environment variable, since it seems to be bad form to add flags to the conf tool.

Rebuild the autoconf files if the split config is not present. This allows building this commit as part of a chain, without generating build errors.

These changes may benefit from some reworking to send upstream, e.g. to use a struct for the 'arg' parameter.

---

Changes in v3:
- Make sure that the config is rebuilt with this change
- Move header-file changes into this patch

Changes in v2:
- Redo commit message
- Introduce CONFIG_PPL approach

 Makefile                    |   6 +
 scripts/kconfig/Makefile    |   5 +-
 scripts/kconfig/conf.c      |   6 +-
 scripts/kconfig/confdata.c  | 348 +++++++++++++++++++++++++++++++++++-
 scripts/kconfig/expr.h      |  28 +++
 scripts/kconfig/lkc.h       |   9 +
 scripts/kconfig/lkc_proto.h |  18 +-
 7 files changed, 415 insertions(+), 5 deletions(-)
Makefile +6 -0
index 875cdda08f2..bc101e67588 100644
@@ -597,6 +597,12 @@ ifeq ($(dot-config),1)
 # To avoid any implicit rule to kick in, define an empty command
 $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
 
+# Make sure this uses the split config
+has_split_config = $(shell grep CONFIG_PPL_LOCALVERSION include/config/auto.conf 2>/dev/null)
+ifeq ($(has_split_config),)
+include/config/auto.conf: FORCE
+endif
+
 # If .config is newer than include/config/auto.conf, someone tinkered
 # with it and forgot to run make oldconfig.
 # if auto.conf.cmd is missing then we are probably in a cleaned tree so
scripts/kconfig/Makefile +4 -1
index 12e525ee31f..b539054645f 100644
@@ -25,6 +25,8 @@ endif
 # We need this, in case the user has it in its environment
 unexport CONFIG_
 
+$(obj)/conf: $(srctree)/scripts/conf_nospl
+
 xconfig: $(obj)/qconf
 	$< $(silent) $(Kconfig)
 
@@ -71,8 +73,9 @@ simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
 	alldefconfig randconfig listnewconfig olddefconfig syncconfig
 PHONY += $(simple-targets)
 
+# Pass --u-boot to get SPL behaviour
 $(simple-targets): $(obj)/conf
-	$< $(silent) --$@ $(Kconfig)
+	KCONFIG_SPL=1 $< $(silent) --$@ $(Kconfig)
 
 PHONY += savedefconfig defconfig
 
scripts/kconfig/conf.c +5 -1
index 376f796f674..c4463d252c1 100644
@@ -490,9 +490,13 @@ int main(int ac, char **av)
 	const char *name, *defconfig_file = NULL /* gcc uninit */;
 	struct stat tmpstat;
 	int no_conf_write = 0;
+	bool support_spl;
 
 	tty_stdio = isatty(0) && isatty(1);
 
+	/* Special handling of SPL phases for U-Boot */
+	support_spl = getenv("KCONFIG_SPL");
+
 	while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
 		if (opt == 's') {
 			conf_set_message_callback(NULL);
@@ -692,7 +696,7 @@ int main(int ac, char **av)
 			fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
 			exit(1);
 		}
-		if (conf_write_autoconf()) {
+		if (conf_write_autoconf(support_spl)) {
 			fprintf(stderr, "\n*** Error during update of the configuration.\n\n");
 			return 1;
 		}
scripts/kconfig/confdata.c +346 -2

428 lines not on this page · raw message

scripts/kconfig/expr.h +28 -0
index 7c329e17900..934f4b10b25 100644
@@ -158,6 +158,34 @@ struct symbol {
 /* Set symbol to y if allnoconfig; used for symbols that hide others */
 #define SYMBOL_ALLNOCONFIG_Y 0x200000
 
+/*
+ * U-Boot: Marks an SPL symbol, i.e. one that starts with one of the strings in
+ * spl_name[]
+ */
+#define SYMBOL_SPL		0x400000
+
+/*
+ * U-Boot: Marks a non-SPL symbol that also has an SPL version. This flag is
+ * added to symbols like FOO if there is also an SPL_FOO (or TPL_FOO, etc.)
+ */
+#define SYMBOL_HAS_SPL		0x800000
+
+/*
+ * U-Boot: Marks a symbol with no SPL version. These symbols cannot be computed
+ * by looking at the Kconfig, so there is a conf_nospl file which holds s list.
+ *
+ * Generally, options which have no SPL_ prefix (e.g. CONFIG_FOO) apply to all
+ * SPL build phases. This allows things like ARCH_ARM to propagate to all builds
+ * without the hassle of generating a separate SPL version fo each phase. But in
+ * some cases this is not wanted.
+ *
+ * This file lists options which don't have an SPL equivalent, but still should
+ * not be enabled in SPL builds. It is necessary since kconfig cannot tell (just
+ * by looking at the Kconfig description) whether it applies to Proper builds
+ * only, or to all builds.
+ */
+#define SYMBOL_NO_SPL		0x1000000
+
 #define SYMBOL_MAXLENGTH	256
 #define SYMBOL_HASHSIZE		9973
 
scripts/kconfig/lkc.h +9 -0
index 9eb7c837cd8..592610483f0 100644
@@ -71,6 +71,15 @@ void sym_add_change_count(int count);
 bool conf_set_all_new_symbols(enum conf_def_mode mode);
 void set_all_choice_values(struct symbol *csym);
 
+/**
+ * conf_mark_symbols() - Mark symbols with U-Boot flags
+ *
+ * Symbols which don't have an SPL symbol are marked with SYMBOL_PROPER_ONLY and
+ * those with only SPL symbols are marked withSYMBOL_SPL_ONLY, so we know to
+ * avoid writing them to the wrong autoconf.h files.
+ */
+int conf_mark_symbols(void);
+
 /* confdata.c and expr.c */
 static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
 {
scripts/kconfig/lkc_proto.h +17 -1
index cf4510a2bdc..4707a9155f7 100644
@@ -7,7 +7,23 @@ int conf_read(const char *name);
 int conf_read_simple(const char *name, int);
 int conf_write_defconfig(const char *name);
 int conf_write(const char *name);
-int conf_write_autoconf(void);
+
+/**
+ * conf_write_autoconf() - Write out the autoconf files
+ *
+ * @support_spl: Support generation of files for additional secondary
+ *	program-loader builds, as used by U-Boot
+ *
+ * Writes out:
+ *    auto.conf which contains CONFIG definitions for inclusion by make
+ *    autoconf.h which contains CONFIG definitions for inclusion by C code
+ *
+ * if @support_spl then separate files are also created for SPL builds (spl,
+ * tpl, vpl, tools), with symbols like SPL_FOO being written to the SPL file
+ * as just FOO
+ */
+int conf_write_autoconf(bool support_spl);
+
 bool conf_get_changed(void);
 void conf_set_changed_callback(void (*fn)(void));
 void conf_set_message_callback(void (*fn)(const char *s));
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#69 lore raw

Re: [PATCH v3 61/95] kconfig: Support writing separate SPL files

Quoted 39 lines · Simon Glass

At present kconfig writes out several files, including:

auto.conf - CONFIG settings used by make
autoconf.h - header file used by C code

This works well but is a bit ugly in places, for example requiring the use of a SPL_TPL_ macro in Makefiles to distinguish between options intended for SPL and U-Boot proper.

Update the kconfig tool to also output separate files for each phase: e.g. auto_spl.conf and autoconf_spl.h

These are similar to the existing files, but drop the SPL_ prefix so that SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro to be simplified, in a later patch, eventually replacing it with IS_ENABLED().

When CONFIG_FOO is used within SPL, it means that FOO is enabled in that SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, that means that CONFIG_FOO will be enabled in the SPL phase. So the SPL builds can just use CONFIG_FOO to check it. There is no need to use CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore.

This of course means that if there is a need to access a PPL symbol from an SPL build, there is no way to do it. To copy with that, we need a CONFIG_PPL_FOO to be visibilty to all SPL builds.

So this change also adds new PPL_ output for U-Boot proper (Primary Program Loader). So every CONFIG_FOO that is enabled in PPL also has a CONFIG_PPL_FOO

This allows SPL to access the TEXT_BASE for U-Boot proper, for example, so it knows where to load it. There are about 30 places where this is needed, in addition to TEXT_BASE. The environment has the same problem, adding another dozen or so caes in include/config_distro_bootcmd.h but it has been decided to ignore that for now.

The feature is controlled by an environment variable, since it seems to be bad form to add flags to the conf tool.

Quoted 7 lines

Rebuild the autoconf files if the split config is not present. This allows building this commit as part of a chain, without generating build errors.

These changes may benefit from some reworking to send upstream, e.g. to use a struct for the 'arg' parameter.

This patch, I think, is where my largest problem is. We go from being able to say "if CONFIG_SPL_FOO is undefined, it is false" to "we must define CONFIG_SPL_FOO to false". There's around 150 cases of this, with the series. Why can we not extend the PPL logic (which I'm not super happy with, but, I understand and I think an audit of everything not-TEXT_BASE should be fairly straight forward), to say that if CONFIG_FOO exists and CONFIG_SPL_FOO does not exist, say CONFIG_SPL_FOO is now false.

Signature · 1 line
Tom
#70 lore raw

Re: [PATCH v3 61/95] kconfig: Support writing separate SPL files

Hi Tom,

Quoted 50 lines · Tom Rini
Quoted 39 lines · Simon Glass

At present kconfig writes out several files, including:

auto.conf - CONFIG settings used by make
autoconf.h - header file used by C code

This works well but is a bit ugly in places, for example requiring the use of a SPL_TPL_ macro in Makefiles to distinguish between options intended for SPL and U-Boot proper.

Update the kconfig tool to also output separate files for each phase: e.g. auto_spl.conf and autoconf_spl.h

These are similar to the existing files, but drop the SPL_ prefix so that SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro to be simplified, in a later patch, eventually replacing it with IS_ENABLED().

When CONFIG_FOO is used within SPL, it means that FOO is enabled in that SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, that means that CONFIG_FOO will be enabled in the SPL phase. So the SPL builds can just use CONFIG_FOO to check it. There is no need to use CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore.

This of course means that if there is a need to access a PPL symbol from an SPL build, there is no way to do it. To copy with that, we need a CONFIG_PPL_FOO to be visibilty to all SPL builds.

So this change also adds new PPL_ output for U-Boot proper (Primary Program Loader). So every CONFIG_FOO that is enabled in PPL also has a CONFIG_PPL_FOO

This allows SPL to access the TEXT_BASE for U-Boot proper, for example, so it knows where to load it. There are about 30 places where this is needed, in addition to TEXT_BASE. The environment has the same problem, adding another dozen or so caes in include/config_distro_bootcmd.h but it has been decided to ignore that for now.

The feature is controlled by an environment variable, since it seems to be bad form to add flags to the conf tool.

Quoted 7 lines

Rebuild the autoconf files if the split config is not present. This allows building this commit as part of a chain, without generating build errors.

These changes may benefit from some reworking to send upstream, e.g. to use a struct for the 'arg' parameter.

Quoted 8 lines

This patch, I think, is where my largest problem is. We go from being able to say "if CONFIG_SPL_FOO is undefined, it is false" to "we must define CONFIG_SPL_FOO to false". There's around 150 cases of this, with the series. Why can we not extend the PPL logic (which I'm not super happy with, but, I understand and I think an audit of everything not-TEXT_BASE should be fairly straight forward), to say that if CONFIG_FOO exists and CONFIG_SPL_FOO does not exist, say CONFIG_SPL_FOO is now false.

Well it is all about choices.

We don't have to add a CONFIG_SPL_xxx to tell Kconfig that the PPL symbol controls all phases. We can use the conf_nospl file instead. But then the entire description is not in Kconfig. Of course, we might expect that some of those things in conf_nospl might end up needing to be controlled in SPL, so perhaps that file would shrink? Not sure about that, though.

It isn't just SPL , BTW. We might have any xPL symbol defined.

I suppose you are thinking of something like:

#define CONFIG_IS_ENABLED(x) IS_ENABLED(CONFIG_ ## xpl_prefix ## x) ||
( IS_ENABLED(CONFIG_ ## x) && !IS_ENABLED(CONFIG_ SPL_ ## x) &&
!IS_ENABLED(CONFIG_TPL_ ##x) ..)

But how do we deal with Makefiles? We still end up with the SPL_TPL_ stuff.

Yes, adding PPL moves a step forward and reduces the audit to only uses of PPL, instead of the whole Kconfig.

This series does get us closer to separate configs (it is really easy to see what is enabled in each build just by looking at the auto_xpl.conf files) and I think those 150 exceptions are not a big price to pay.

Ultimately I am coming to the view that we should extend the Kconfig language to support multiple build phases, using a 'phase' property. Zephyr is going to need it too, fairly soon[1].

Regards,
Simon

[1] https://github.com/zephyrproject-rtos/zephyr/issues/54534

#71 lore raw

Re: [PATCH v3 61/95] kconfig: Support writing separate SPL files

Quoted 73 lines · Simon Glass

Hi Tom,

Quoted 50 lines · Tom Rini
Quoted 39 lines · Simon Glass

At present kconfig writes out several files, including:

auto.conf - CONFIG settings used by make
autoconf.h - header file used by C code

This works well but is a bit ugly in places, for example requiring the use of a SPL_TPL_ macro in Makefiles to distinguish between options intended for SPL and U-Boot proper.

Update the kconfig tool to also output separate files for each phase: e.g. auto_spl.conf and autoconf_spl.h

These are similar to the existing files, but drop the SPL_ prefix so that SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro to be simplified, in a later patch, eventually replacing it with IS_ENABLED().

When CONFIG_FOO is used within SPL, it means that FOO is enabled in that SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, that means that CONFIG_FOO will be enabled in the SPL phase. So the SPL builds can just use CONFIG_FOO to check it. There is no need to use CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore.

This of course means that if there is a need to access a PPL symbol from an SPL build, there is no way to do it. To copy with that, we need a CONFIG_PPL_FOO to be visibilty to all SPL builds.

So this change also adds new PPL_ output for U-Boot proper (Primary Program Loader). So every CONFIG_FOO that is enabled in PPL also has a CONFIG_PPL_FOO

This allows SPL to access the TEXT_BASE for U-Boot proper, for example, so it knows where to load it. There are about 30 places where this is needed, in addition to TEXT_BASE. The environment has the same problem, adding another dozen or so caes in include/config_distro_bootcmd.h but it has been decided to ignore that for now.

The feature is controlled by an environment variable, since it seems to be bad form to add flags to the conf tool.

Quoted 7 lines

Rebuild the autoconf files if the split config is not present. This allows building this commit as part of a chain, without generating build errors.

These changes may benefit from some reworking to send upstream, e.g. to use a struct for the 'arg' parameter.

Quoted 8 lines

This patch, I think, is where my largest problem is. We go from being able to say "if CONFIG_SPL_FOO is undefined, it is false" to "we must define CONFIG_SPL_FOO to false". There's around 150 cases of this, with the series. Why can we not extend the PPL logic (which I'm not super happy with, but, I understand and I think an audit of everything not-TEXT_BASE should be fairly straight forward), to say that if CONFIG_FOO exists and CONFIG_SPL_FOO does not exist, say CONFIG_SPL_FOO is now false.

Well it is all about choices.

We don't have to add a CONFIG_SPL_xxx to tell Kconfig that the PPL symbol controls all phases. We can use the conf_nospl file instead. But then the entire description is not in Kconfig. Of course, we might expect that some of those things in conf_nospl might end up needing to be controlled in SPL, so perhaps that file would shrink? Not sure about that, though.

It isn't just SPL , BTW. We might have any xPL symbol defined.

Quoted 7 lines

I suppose you are thinking of something like:

#define CONFIG_IS_ENABLED(x)  IS_ENABLED(CONFIG_ ## xpl_prefix ## x) ||
   ( IS_ENABLED(CONFIG_ ## x) && !IS_ENABLED(CONFIG_ SPL_ ## x) &&

!IS_ENABLED(CONFIG_TPL_ ##x) ..)

But how do we deal with Makefiles? We still end up with the SPL_TPL_ stuff.

I see it as a very useful feature that today if we don't set CONFIG_xPL_FOO, it evaluates to false, anywhere we need it to. In all of the prep work for split config, I think we've seen one case where we got things wrong (in that it lead to failure). Split config build is doing a whole bunch of things to then remove this feature. And the series intentionally ignores the Makefile design issue / feature of wrapping large chunks with a check for being/not-being in an xPL_BUILD phase.

Quoted 8 lines

Yes, adding PPL moves a step forward and reduces the audit to only uses of PPL, instead of the whole Kconfig.

This series does get us closer to separate configs (it is really easy to see what is enabled in each build just by looking at the auto_xpl.conf files) and I think those 150 exceptions are not a big price to pay.

Quoted 8 lines

Ultimately I am coming to the view that we should extend the Kconfig language to support multiple build phases, using a 'phase' property. Zephyr is going to need it too, fairly soon[1].

Regards,
Simon

[1] https://github.com/zephyrproject-rtos/zephyr/issues/54534

Yes, if the Kconfig language moves in a new direction, it would be good to follow and use that.

Signature · 1 line
Tom
#72 lore raw

Re: [PATCH v3 61/95] kconfig: Support writing separate SPL files

Hi Tom,

Quoted 83 lines · Tom Rini
Quoted 73 lines · Simon Glass

Hi Tom,

Quoted 50 lines · Tom Rini
Quoted 39 lines · Simon Glass

At present kconfig writes out several files, including:

auto.conf - CONFIG settings used by make
autoconf.h - header file used by C code

This works well but is a bit ugly in places, for example requiring the use of a SPL_TPL_ macro in Makefiles to distinguish between options intended for SPL and U-Boot proper.

Update the kconfig tool to also output separate files for each phase: e.g. auto_spl.conf and autoconf_spl.h

These are similar to the existing files, but drop the SPL_ prefix so that SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro to be simplified, in a later patch, eventually replacing it with IS_ENABLED().

When CONFIG_FOO is used within SPL, it means that FOO is enabled in that SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, that means that CONFIG_FOO will be enabled in the SPL phase. So the SPL builds can just use CONFIG_FOO to check it. There is no need to use CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore.

This of course means that if there is a need to access a PPL symbol from an SPL build, there is no way to do it. To copy with that, we need a CONFIG_PPL_FOO to be visibilty to all SPL builds.

So this change also adds new PPL_ output for U-Boot proper (Primary Program Loader). So every CONFIG_FOO that is enabled in PPL also has a CONFIG_PPL_FOO

This allows SPL to access the TEXT_BASE for U-Boot proper, for example, so it knows where to load it. There are about 30 places where this is needed, in addition to TEXT_BASE. The environment has the same problem, adding another dozen or so caes in include/config_distro_bootcmd.h but it has been decided to ignore that for now.

The feature is controlled by an environment variable, since it seems to be bad form to add flags to the conf tool.

Quoted 7 lines

Rebuild the autoconf files if the split config is not present. This allows building this commit as part of a chain, without generating build errors.

These changes may benefit from some reworking to send upstream, e.g. to use a struct for the 'arg' parameter.

Quoted 8 lines

This patch, I think, is where my largest problem is. We go from being able to say "if CONFIG_SPL_FOO is undefined, it is false" to "we must define CONFIG_SPL_FOO to false". There's around 150 cases of this, with the series. Why can we not extend the PPL logic (which I'm not super happy with, but, I understand and I think an audit of everything not-TEXT_BASE should be fairly straight forward), to say that if CONFIG_FOO exists and CONFIG_SPL_FOO does not exist, say CONFIG_SPL_FOO is now false.

Well it is all about choices.

We don't have to add a CONFIG_SPL_xxx to tell Kconfig that the PPL symbol controls all phases. We can use the conf_nospl file instead. But then the entire description is not in Kconfig. Of course, we might expect that some of those things in conf_nospl might end up needing to be controlled in SPL, so perhaps that file would shrink? Not sure about that, though.

It isn't just SPL , BTW. We might have any xPL symbol defined.

Quoted 7 lines

I suppose you are thinking of something like:

#define CONFIG_IS_ENABLED(x)  IS_ENABLED(CONFIG_ ## xpl_prefix ## x) ||
   ( IS_ENABLED(CONFIG_ ## x) && !IS_ENABLED(CONFIG_ SPL_ ## x) &&

!IS_ENABLED(CONFIG_TPL_ ##x) ..)

But how do we deal with Makefiles? We still end up with the SPL_TPL_ stuff.

Quoted 7 lines

I see it as a very useful feature that today if we don't set CONFIG_xPL_FOO, it evaluates to false, anywhere we need it to. In all of the prep work for split config, I think we've seen one case where we got things wrong (in that it lead to failure). Split config build is doing a whole bunch of things to then remove this feature. And the series intentionally ignores the Makefile design issue / feature of wrapping large chunks with a check for being/not-being in an xPL_BUILD phase.

In another thread you suggested moving to separate defconfig files for each phase (I think). Presumably that would operate the same way as this series, in that you would not be able to handle the special case you mention. So I see this series as the best of both worlds - a unified Kconfig (and .config) but with separate auto.conf files for each phase. Plus we can drop the SPL_TPL_ stuff.

We can add things to conf_nospl and then the behaviour is as you want it, isn't it?

For the Makefile xPL ifdefs, is it essential to do anything there? We could remove them, using the same techniques in this series. I would quite like to, but we don't have to, if you like them. My reason for wanting to remove them is that we end up refactoring things to enable features in xPL, instead of just adding an xPL option.

Finally, with the series I have, it is quite easy to add a new phase if we want to.

Quoted 13 lines
Quoted 13 lines

Yes, adding PPL moves a step forward and reduces the audit to only uses of PPL, instead of the whole Kconfig.

This series does get us closer to separate configs (it is really easy to see what is enabled in each build just by looking at the auto_xpl.conf files) and I think those 150 exceptions are not a big price to pay.

Ultimately I am coming to the view that we should extend the Kconfig language to support multiple build phases, using a 'phase' property. Zephyr is going to need it too, fairly soon[1].

Quoted 7 lines
Quoted 4 lines

Regards,
Simon

[1] https://github.com/zephyrproject-rtos/zephyr/issues/54534

Yes, if the Kconfig language moves in a new direction, it would be good to follow and use that.

Well I am thinking of moving it there...but would need to start by upstreaming the two patches in this series.

Regards,
Simon

#73 lore raw

Re: [PATCH v3 61/95] kconfig: Support writing separate SPL files

Quoted 94 lines · Simon Glass

Hi Tom,

Quoted 83 lines · Tom Rini
Quoted 73 lines · Simon Glass

Hi Tom,

Quoted 50 lines · Tom Rini
Quoted 39 lines · Simon Glass

At present kconfig writes out several files, including:

auto.conf - CONFIG settings used by make
autoconf.h - header file used by C code

This works well but is a bit ugly in places, for example requiring the use of a SPL_TPL_ macro in Makefiles to distinguish between options intended for SPL and U-Boot proper.

Update the kconfig tool to also output separate files for each phase: e.g. auto_spl.conf and autoconf_spl.h

These are similar to the existing files, but drop the SPL_ prefix so that SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro to be simplified, in a later patch, eventually replacing it with IS_ENABLED().

When CONFIG_FOO is used within SPL, it means that FOO is enabled in that SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, that means that CONFIG_FOO will be enabled in the SPL phase. So the SPL builds can just use CONFIG_FOO to check it. There is no need to use CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore.

This of course means that if there is a need to access a PPL symbol from an SPL build, there is no way to do it. To copy with that, we need a CONFIG_PPL_FOO to be visibilty to all SPL builds.

So this change also adds new PPL_ output for U-Boot proper (Primary Program Loader). So every CONFIG_FOO that is enabled in PPL also has a CONFIG_PPL_FOO

This allows SPL to access the TEXT_BASE for U-Boot proper, for example, so it knows where to load it. There are about 30 places where this is needed, in addition to TEXT_BASE. The environment has the same problem, adding another dozen or so caes in include/config_distro_bootcmd.h but it has been decided to ignore that for now.

The feature is controlled by an environment variable, since it seems to be bad form to add flags to the conf tool.

Quoted 7 lines

Rebuild the autoconf files if the split config is not present. This allows building this commit as part of a chain, without generating build errors.

These changes may benefit from some reworking to send upstream, e.g. to use a struct for the 'arg' parameter.

Quoted 8 lines

This patch, I think, is where my largest problem is. We go from being able to say "if CONFIG_SPL_FOO is undefined, it is false" to "we must define CONFIG_SPL_FOO to false". There's around 150 cases of this, with the series. Why can we not extend the PPL logic (which I'm not super happy with, but, I understand and I think an audit of everything not-TEXT_BASE should be fairly straight forward), to say that if CONFIG_FOO exists and CONFIG_SPL_FOO does not exist, say CONFIG_SPL_FOO is now false.

Well it is all about choices.

We don't have to add a CONFIG_SPL_xxx to tell Kconfig that the PPL symbol controls all phases. We can use the conf_nospl file instead. But then the entire description is not in Kconfig. Of course, we might expect that some of those things in conf_nospl might end up needing to be controlled in SPL, so perhaps that file would shrink? Not sure about that, though.

It isn't just SPL , BTW. We might have any xPL symbol defined.

Quoted 7 lines

I suppose you are thinking of something like:

#define CONFIG_IS_ENABLED(x)  IS_ENABLED(CONFIG_ ## xpl_prefix ## x) ||
   ( IS_ENABLED(CONFIG_ ## x) && !IS_ENABLED(CONFIG_ SPL_ ## x) &&

!IS_ENABLED(CONFIG_TPL_ ##x) ..)

But how do we deal with Makefiles? We still end up with the SPL_TPL_ stuff.

Quoted 7 lines

I see it as a very useful feature that today if we don't set CONFIG_xPL_FOO, it evaluates to false, anywhere we need it to. In all of the prep work for split config, I think we've seen one case where we got things wrong (in that it lead to failure). Split config build is doing a whole bunch of things to then remove this feature. And the series intentionally ignores the Makefile design issue / feature of wrapping large chunks with a check for being/not-being in an xPL_BUILD phase.

Quoted 6 lines

In another thread you suggested moving to separate defconfig files for each phase (I think). Presumably that would operate the same way as this series, in that you would not be able to handle the special case you mention. So I see this series as the best of both worlds - a unified Kconfig (and .config) but with separate auto.conf files for each phase. Plus we can drop the SPL_TPL_ stuff.

What I keep thinking of is that we would end up with separate configs. So while yes, we might need CONFIG_PPL_TEXT_BASE, we would not need CONFIG_SPL_DM_GPIO for example, because fooboard_spl_defconfig would set CONFIG_SPL=y and CONFIG_DM_GPIO=y. I don't know how workable this ends up being as we have about 7k symbols for full U-Boot and about 450 for SPL.

And I really don't see the problem with SPL_TPL_ stuff.

Quoted 2 lines

We can add things to conf_nospl and then the behaviour is as you want it, isn't it?

I'd also rather not have a file that's going to get conflicted on, even if all of the comments started with "#" and so we could pass it through sort. But yes, that's better than adding unselectable options.

Quoted 5 lines

For the Makefile xPL ifdefs, is it essential to do anything there? We could remove them, using the same techniques in this series. I would quite like to, but we don't have to, if you like them. My reason for wanting to remove them is that we end up refactoring things to enable features in xPL, instead of just adding an xPL option.

My point with the xPL ifdefs is that a number of config_nospl/def_bool n options could be resolved the same way. To me, the problem isn't that we have lines like:
obj-$(CONFIG_$(SPL_TPL_)FOO += foo.o
as I've encouraged people to add them, in the case of the MULTIPLEXER case I'm pretty sure, rather than finding the existing block of:
ifneq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),y)
...
endif
for the cases where we need to have something not built in SPL/TPL. Removing those guards would lead to a big increase in config_nospl lines, I suspect.

Quoted 19 lines

Finally, with the series I have, it is quite easy to add a new phase if we want to.

Quoted 16 lines
Quoted 16 lines

Yes, adding PPL moves a step forward and reduces the audit to only uses of PPL, instead of the whole Kconfig.

This series does get us closer to separate configs (it is really easy to see what is enabled in each build just by looking at the auto_xpl.conf files) and I think those 150 exceptions are not a big price to pay.

Ultimately I am coming to the view that we should extend the Kconfig language to support multiple build phases, using a 'phase' property. Zephyr is going to need it too, fairly soon[1].

Regards,
Simon

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

[1] https://github.com/zephyrproject-rtos/zephyr/issues/54534

Yes, if the Kconfig language moves in a new direction, it would be good to follow and use that.

Well I am thinking of moving it there...but would need to start by upstreaming the two patches in this series.

Well, honestly, I suspect if you can work with upstreams on Kconfig the language supporting the concepts of phases, natively, my concerns will be addressed, one way or another. Because something like:
config DM_GPIO
bool "DM GPIO support"
phases PPL SPL TPL

config ODDBALL_THING

	# phases PPL is implied when it's only valid there
	bool "Do this one weird trick in PPL"

Means that we can yes/no options like DM_GPIO for each phase, and get xPL_ODDBALL_THING=n for free is much cleaner.

Signature · 1 line
Tom
#74 lore raw

Re: [PATCH v3 61/95] kconfig: Support writing separate SPL files

Hi Tom,

Quoted 103 lines · Tom Rini
Quoted 94 lines · Simon Glass

Hi Tom,

Quoted 83 lines · Tom Rini
Quoted 73 lines · Simon Glass

Hi Tom,

Quoted 50 lines · Tom Rini
Quoted 39 lines · Simon Glass

At present kconfig writes out several files, including:

auto.conf - CONFIG settings used by make
autoconf.h - header file used by C code

This works well but is a bit ugly in places, for example requiring the use of a SPL_TPL_ macro in Makefiles to distinguish between options intended for SPL and U-Boot proper.

Update the kconfig tool to also output separate files for each phase: e.g. auto_spl.conf and autoconf_spl.h

These are similar to the existing files, but drop the SPL_ prefix so that SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro to be simplified, in a later patch, eventually replacing it with IS_ENABLED().

When CONFIG_FOO is used within SPL, it means that FOO is enabled in that SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, that means that CONFIG_FOO will be enabled in the SPL phase. So the SPL builds can just use CONFIG_FOO to check it. There is no need to use CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore.

This of course means that if there is a need to access a PPL symbol from an SPL build, there is no way to do it. To copy with that, we need a CONFIG_PPL_FOO to be visibilty to all SPL builds.

So this change also adds new PPL_ output for U-Boot proper (Primary Program Loader). So every CONFIG_FOO that is enabled in PPL also has a CONFIG_PPL_FOO

This allows SPL to access the TEXT_BASE for U-Boot proper, for example, so it knows where to load it. There are about 30 places where this is needed, in addition to TEXT_BASE. The environment has the same problem, adding another dozen or so caes in include/config_distro_bootcmd.h but it has been decided to ignore that for now.

The feature is controlled by an environment variable, since it seems to be bad form to add flags to the conf tool.

Quoted 7 lines

Rebuild the autoconf files if the split config is not present. This allows building this commit as part of a chain, without generating build errors.

These changes may benefit from some reworking to send upstream, e.g. to use a struct for the 'arg' parameter.

Quoted 8 lines

This patch, I think, is where my largest problem is. We go from being able to say "if CONFIG_SPL_FOO is undefined, it is false" to "we must define CONFIG_SPL_FOO to false". There's around 150 cases of this, with the series. Why can we not extend the PPL logic (which I'm not super happy with, but, I understand and I think an audit of everything not-TEXT_BASE should be fairly straight forward), to say that if CONFIG_FOO exists and CONFIG_SPL_FOO does not exist, say CONFIG_SPL_FOO is now false.

Well it is all about choices.

We don't have to add a CONFIG_SPL_xxx to tell Kconfig that the PPL symbol controls all phases. We can use the conf_nospl file instead. But then the entire description is not in Kconfig. Of course, we might expect that some of those things in conf_nospl might end up needing to be controlled in SPL, so perhaps that file would shrink? Not sure about that, though.

It isn't just SPL , BTW. We might have any xPL symbol defined.

Quoted 7 lines

I suppose you are thinking of something like:

#define CONFIG_IS_ENABLED(x)  IS_ENABLED(CONFIG_ ## xpl_prefix ## x) ||
   ( IS_ENABLED(CONFIG_ ## x) && !IS_ENABLED(CONFIG_ SPL_ ## x) &&

!IS_ENABLED(CONFIG_TPL_ ##x) ..)

But how do we deal with Makefiles? We still end up with the SPL_TPL_ stuff.

Quoted 7 lines

I see it as a very useful feature that today if we don't set CONFIG_xPL_FOO, it evaluates to false, anywhere we need it to. In all of the prep work for split config, I think we've seen one case where we got things wrong (in that it lead to failure). Split config build is doing a whole bunch of things to then remove this feature. And the series intentionally ignores the Makefile design issue / feature of wrapping large chunks with a check for being/not-being in an xPL_BUILD phase.

Quoted 6 lines

In another thread you suggested moving to separate defconfig files for each phase (I think). Presumably that would operate the same way as this series, in that you would not be able to handle the special case you mention. So I see this series as the best of both worlds - a unified Kconfig (and .config) but with separate auto.conf files for each phase. Plus we can drop the SPL_TPL_ stuff.

Quoted 6 lines

What I keep thinking of is that we would end up with separate configs. So while yes, we might need CONFIG_PPL_TEXT_BASE, we would not need CONFIG_SPL_DM_GPIO for example, because fooboard_spl_defconfig would set CONFIG_SPL=y and CONFIG_DM_GPIO=y. I don't know how workable this ends up being as we have about 7k symbols for full U-Boot and about 450 for SPL.

I'm not sure it would be very nice. We end up having to edit three files to change a board. It would be hard to compare them. We would set an option in SPL that cannot be set because it is not actually supported in SPL...

Quoted 2 lines

And I really don't see the problem with SPL_TPL_ stuff.

It is ugly!

Quoted 7 lines
Quoted 3 lines

We can add things to conf_nospl and then the behaviour is as you want it, isn't it?

I'd also rather not have a file that's going to get conflicted on, even if all of the comments started with "#" and so we could pass it through sort. But yes, that's better than adding unselectable options.

OK. I would hope that conflicts would be small as it is sorted. Actually that is my mistake leaving out the # lines. Ooops.

Quoted 7 lines
Quoted 6 lines

For the Makefile xPL ifdefs, is it essential to do anything there? We could remove them, using the same techniques in this series. I would quite like to, but we don't have to, if you like them. My reason for wanting to remove them is that we end up refactoring things to enable features in xPL, instead of just adding an xPL option.

Quoted 12 lines

My point with the xPL ifdefs is that a number of config_nospl/def_bool n options could be resolved the same way. To me, the problem isn't that we have lines like:
obj-$(CONFIG_$(SPL_TPL_)FOO += foo.o
as I've encouraged people to add them, in the case of the MULTIPLEXER case I'm pretty sure, rather than finding the existing block of:
ifneq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),y)
...
endif
for the cases where we need to have something not built in SPL/TPL. Removing those guards would lead to a big increase in config_nospl lines, I suspect.

Probably. If we didn't rely on CONFIG_CMD_USB and the like we could use a wildcard and get rid of the CONFIG_CMD ones that way. But really a Kconfig annotation would be better.

If you are saying that we should have Makefiles without ifdefs, I think I agree...or at least it is worth trying out. It means that we don't have to trawl around to figure out why enabling X in SPL does not in fact compile the code!

Quoted 35 lines
Quoted 20 lines

Finally, with the series I have, it is quite easy to add a new phase if we want to.

Quoted 16 lines
Quoted 16 lines

Yes, adding PPL moves a step forward and reduces the audit to only uses of PPL, instead of the whole Kconfig.

This series does get us closer to separate configs (it is really easy to see what is enabled in each build just by looking at the auto_xpl.conf files) and I think those 150 exceptions are not a big price to pay.

Ultimately I am coming to the view that we should extend the Kconfig language to support multiple build phases, using a 'phase' property. Zephyr is going to need it too, fairly soon[1].

Regards,
Simon

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

[1] https://github.com/zephyrproject-rtos/zephyr/issues/54534

Yes, if the Kconfig language moves in a new direction, it would be good to follow and use that.

Well I am thinking of moving it there...but would need to start by upstreaming the two patches in this series.

Well, honestly, I suspect if you can work with upstreams on Kconfig the language supporting the concepts of phases, natively, my concerns will be addressed, one way or another. Because something like:
config DM_GPIO
bool "DM GPIO support"
phases PPL SPL TPL

Quoted 6 lines

config ODDBALL_THING

        # phases PPL is implied when it's only valid there
        bool "Do this one weird trick in PPL"

Means that we can yes/no options like DM_GPIO for each phase, and get xPL_ODDBALL_THING=n for free is much cleaner.

Yes...that is what I'd like to see. The only complication is that sometimes you want SPL_DM_GPIO to default y if DM_GPIO, iwc you may want to spell out the options separately anyway?

Regards,
Simon

#75 lore raw

Re: [PATCH v3 61/95] kconfig: Support writing separate SPL files

Quoted 113 lines · Simon Glass

Hi Tom,

Quoted 103 lines · Tom Rini
Quoted 94 lines · Simon Glass

Hi Tom,

Quoted 83 lines · Tom Rini
Quoted 73 lines · Simon Glass

Hi Tom,

Quoted 50 lines · Tom Rini
Quoted 39 lines · Simon Glass

At present kconfig writes out several files, including:

auto.conf - CONFIG settings used by make
autoconf.h - header file used by C code

This works well but is a bit ugly in places, for example requiring the use of a SPL_TPL_ macro in Makefiles to distinguish between options intended for SPL and U-Boot proper.

Update the kconfig tool to also output separate files for each phase: e.g. auto_spl.conf and autoconf_spl.h

These are similar to the existing files, but drop the SPL_ prefix so that SPL_TPL_ is not needed. It also allows the CONFIG_IS_ENABLED() macro to be simplified, in a later patch, eventually replacing it with IS_ENABLED().

When CONFIG_FOO is used within SPL, it means that FOO is enabled in that SPL phase. For example if CONFIG_SPL_FOO is enabled in the Kconfig, that means that CONFIG_FOO will be enabled in the SPL phase. So the SPL builds can just use CONFIG_FOO to check it. There is no need to use CONFIG_SPL_FOO or CONFIG_IS_ENABLED() anymore.

This of course means that if there is a need to access a PPL symbol from an SPL build, there is no way to do it. To copy with that, we need a CONFIG_PPL_FOO to be visibilty to all SPL builds.

So this change also adds new PPL_ output for U-Boot proper (Primary Program Loader). So every CONFIG_FOO that is enabled in PPL also has a CONFIG_PPL_FOO

This allows SPL to access the TEXT_BASE for U-Boot proper, for example, so it knows where to load it. There are about 30 places where this is needed, in addition to TEXT_BASE. The environment has the same problem, adding another dozen or so caes in include/config_distro_bootcmd.h but it has been decided to ignore that for now.

The feature is controlled by an environment variable, since it seems to be bad form to add flags to the conf tool.

Quoted 7 lines

Rebuild the autoconf files if the split config is not present. This allows building this commit as part of a chain, without generating build errors.

These changes may benefit from some reworking to send upstream, e.g. to use a struct for the 'arg' parameter.

Quoted 8 lines

This patch, I think, is where my largest problem is. We go from being able to say "if CONFIG_SPL_FOO is undefined, it is false" to "we must define CONFIG_SPL_FOO to false". There's around 150 cases of this, with the series. Why can we not extend the PPL logic (which I'm not super happy with, but, I understand and I think an audit of everything not-TEXT_BASE should be fairly straight forward), to say that if CONFIG_FOO exists and CONFIG_SPL_FOO does not exist, say CONFIG_SPL_FOO is now false.

Well it is all about choices.

We don't have to add a CONFIG_SPL_xxx to tell Kconfig that the PPL symbol controls all phases. We can use the conf_nospl file instead. But then the entire description is not in Kconfig. Of course, we might expect that some of those things in conf_nospl might end up needing to be controlled in SPL, so perhaps that file would shrink? Not sure about that, though.

It isn't just SPL , BTW. We might have any xPL symbol defined.

Quoted 7 lines

I suppose you are thinking of something like:

#define CONFIG_IS_ENABLED(x)  IS_ENABLED(CONFIG_ ## xpl_prefix ## x) ||
   ( IS_ENABLED(CONFIG_ ## x) && !IS_ENABLED(CONFIG_ SPL_ ## x) &&

!IS_ENABLED(CONFIG_TPL_ ##x) ..)

But how do we deal with Makefiles? We still end up with the SPL_TPL_ stuff.

Quoted 7 lines

I see it as a very useful feature that today if we don't set CONFIG_xPL_FOO, it evaluates to false, anywhere we need it to. In all of the prep work for split config, I think we've seen one case where we got things wrong (in that it lead to failure). Split config build is doing a whole bunch of things to then remove this feature. And the series intentionally ignores the Makefile design issue / feature of wrapping large chunks with a check for being/not-being in an xPL_BUILD phase.

Quoted 6 lines

In another thread you suggested moving to separate defconfig files for each phase (I think). Presumably that would operate the same way as this series, in that you would not be able to handle the special case you mention. So I see this series as the best of both worlds - a unified Kconfig (and .config) but with separate auto.conf files for each phase. Plus we can drop the SPL_TPL_ stuff.

Quoted 6 lines

What I keep thinking of is that we would end up with separate configs. So while yes, we might need CONFIG_PPL_TEXT_BASE, we would not need CONFIG_SPL_DM_GPIO for example, because fooboard_spl_defconfig would set CONFIG_SPL=y and CONFIG_DM_GPIO=y. I don't know how workable this ends up being as we have about 7k symbols for full U-Boot and about 450 for SPL.

Quoted 4 lines

I'm not sure it would be very nice. We end up having to edit three files to change a board. It would be hard to compare them. We would set an option in SPL that cannot be set because it is not actually supported in SPL...

I'm not sure how it would work out, exactly, no. But I think having a file for the boards SPL, and for its TPL, and for its VPL would make it easier to edit and maintain, not harder.

A bigger problem is we have a ton of options that shouldn't ever really be asked of the user/developer, but instead, we do. Making it easier for the developer to say that for fooboard here are all of the frameworks you need (like ARCH_EARLY_INIT_R, sure you can say no, but then the platform won't work...) would be a bigger help. If you're only really prompted about 100 options, instead of 1000 options, it's a lot easier to work with. Especially when it's either "enable X or don't function".

Quoted 3 lines
Quoted 1 line

And I really don't see the problem with SPL_TPL_ stuff.

It is ugly!

I think it's elegant, not ugly. I'm willing to change, but "it's ugly" isn't a good reason in and of itself.

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

We can add things to conf_nospl and then the behaviour is as you want it, isn't it?

I'd also rather not have a file that's going to get conflicted on, even if all of the comments started with "#" and so we could pass it through sort. But yes, that's better than adding unselectable options.

OK. I would hope that conflicts would be small as it is sorted. Actually that is my mistake leaving out the # lines. Ooops.

It probably won't be too bad in the end, but if it's avoidable, that's even better.

Quoted 19 lines
Quoted 6 lines
Quoted 5 lines

For the Makefile xPL ifdefs, is it essential to do anything there? We could remove them, using the same techniques in this series. I would quite like to, but we don't have to, if you like them. My reason for wanting to remove them is that we end up refactoring things to enable features in xPL, instead of just adding an xPL option.

Quoted 12 lines

My point with the xPL ifdefs is that a number of config_nospl/def_bool n options could be resolved the same way. To me, the problem isn't that we have lines like:
obj-$(CONFIG_$(SPL_TPL_)FOO += foo.o
as I've encouraged people to add them, in the case of the MULTIPLEXER case I'm pretty sure, rather than finding the existing block of:
ifneq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),y)
...
endif
for the cases where we need to have something not built in SPL/TPL. Removing those guards would lead to a big increase in config_nospl lines, I suspect.

Quoted 3 lines

Probably. If we didn't rely on CONFIG_CMD_USB and the like we could use a wildcard and get rid of the CONFIG_CMD ones that way. But really a Kconfig annotation would be better.

We already get rid of the CMD ones that way, the issue is the environment, which I suggested you handle by generating it once for PPL and including for everyone verbatim. That will increase a few platforms a little, but I think is a reasonable trade-off. And if there's some case for needing a trivially tiny, or non-existent default environment really, that's another and different problem we can solve.

But the environment and/or cmds are not the common use case of the CONFIG_xPL_BUILD checks in Makefiles.

Quoted 4 lines

If you are saying that we should have Makefiles without ifdefs, I think I agree...or at least it is worth trying out. It means that we don't have to trawl around to figure out why enabling X in SPL does not in fact compile the code!

Or how to ensure that X doesn't end up in xPL. Which is why I think having a load more
obj-$(CONFIG_$(SPL_TPL_)FOO) += bar.o (and the same for dirs) lines would make the Makefiles a lot more elegant, rather than ugly.

I don't object to removing all of those SPL_TPL_ lines, but I object to removing the feature where when xPL_FOO is not a symbol it defaults to false. To repeat myself, why can't we know that if we have FOO, SPL_FOO but neither TPL_FOO nor VPL_FOO are valid symbols, go and generate auto.conf for each stage and have TPL_FOO=false because we knew we had FOO and knew we did not have TPL_FOO already?

Quoted 38 lines
Quoted 38 lines
Quoted 19 lines

Finally, with the series I have, it is quite easy to add a new phase if we want to.

Quoted 16 lines
Quoted 16 lines

Yes, adding PPL moves a step forward and reduces the audit to only uses of PPL, instead of the whole Kconfig.

This series does get us closer to separate configs (it is really easy to see what is enabled in each build just by looking at the auto_xpl.conf files) and I think those 150 exceptions are not a big price to pay.

Ultimately I am coming to the view that we should extend the Kconfig language to support multiple build phases, using a 'phase' property. Zephyr is going to need it too, fairly soon[1].

Regards,
Simon

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

[1] https://github.com/zephyrproject-rtos/zephyr/issues/54534

Yes, if the Kconfig language moves in a new direction, it would be good to follow and use that.

Well I am thinking of moving it there...but would need to start by upstreaming the two patches in this series.

Well, honestly, I suspect if you can work with upstreams on Kconfig the language supporting the concepts of phases, natively, my concerns will be addressed, one way or another. Because something like:
config DM_GPIO
bool "DM GPIO support"
phases PPL SPL TPL

config ODDBALL_THING

        # phases PPL is implied when it's only valid there
        bool "Do this one weird trick in PPL"
Quoted 6 lines
Quoted 2 lines

Means that we can yes/no options like DM_GPIO for each phase, and get xPL_ODDBALL_THING=n for free is much cleaner.

Yes...that is what I'd like to see. The only complication is that sometimes you want SPL_DM_GPIO to default y if DM_GPIO, iwc you may want to spell out the options separately anyway?

There would need to be some logic around defining phases, and then how to present for each phase, each relevant option. It wouldn't be yes/no to "DM_GPIO" and then all phases are set the same, but it would be that's how you describe an option.

Signature · 1 line
Tom
#76 lore raw

PATCH v3 62/95 Rename CONFIG_TEXT_BASE

In reply to Simon Glass

This means the text base for U-Boot proper. With split config it will mean something different in SPL (CONFIG_SPL_TEXT_BASE), so use the PPL prefix to avoid any problems.

This is only needed in source files built by both U-Boot Proper and xPL, so we don't change device tree, etc.

---

Changes in v3:
- Add more explanation to the commit message

 Makefile                                      | 26 +++++++++----------
 arch/arm/cpu/arm1176/start.S                  |  2 +-
 arch/arm/cpu/arm926ejs/mxs/Makefile           |  4 +--
 arch/arm/cpu/armv7/ls102xa/fdt.c              |  2 +-
 .../armv8/linux-kernel-image-header-vars.h    |  2 +-
 arch/arm/cpu/armv8/start.S                    |  2 +-
 arch/arm/include/asm/arch-mxs/sys_proto.h     |  2 +-
 arch/arm/include/asm/arch-sunxi/boot0.h       |  2 +-
 arch/arm/lib/crt0.S                           |  2 +-
 arch/arm/lib/relocate_64.S                    |  2 +-
 arch/arm/mach-at91/arm920t/lowlevel_init.S    |  4 +--
 arch/arm/mach-at91/arm926ejs/lowlevel_init.S  |  2 +-
 arch/arm/mach-exynos/spl_boot.c               | 10 +++----
 arch/arm/mach-imx/Makefile                    | 10 +++----
 arch/arm/mach-imx/imx8/cpu.c                  |  4 +--
 arch/arm/mach-imx/spl.c                       |  2 +-
 arch/arm/mach-k3/sysfw-loader.c               |  2 +-
 arch/arm/mach-nexell/include/mach/boot0.h     |  6 ++---
 arch/arm/mach-octeontx/cpu.c                  |  2 +-
 arch/arm/mach-octeontx2/cpu.c                 |  2 +-
 arch/arm/mach-sunxi/board.c                   |  2 +-
 arch/arm/mach-sunxi/spl_spi_sunxi.c           |  2 +-
 arch/m68k/cpu/mcf52x2/start.S                 | 12 ++++-----
 arch/m68k/cpu/mcf530x/start.S                 |  4 +--
 arch/m68k/cpu/mcf5445x/start.S                | 16 ++++++------
 arch/microblaze/cpu/relocate.c                |  6 ++---
 arch/microblaze/cpu/start.S                   |  8 +++---
 arch/mips/mach-jz47xx/jz4780/jz4780.c         |  4 +--
 arch/mips/mach-mscc/lowlevel_init.S           |  2 +-
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c     |  4 +--
 arch/x86/cpu/apollolake/spl.c                 |  2 +-
 arch/x86/cpu/quark/quark.c                    |  2 +-
 arch/x86/cpu/start.S                          |  6 ++---
 arch/x86/lib/relocate.c                       |  6 ++---
 arch/x86/lib/spl.c                            |  6 ++---
 board/BuS/eb_cpu5282/eb_cpu5282.c             |  2 +-
 board/beacon/beacon-rzg2m/beacon-rzg2m.c      |  2 +-
 board/broadcom/bcmstb/bcmstb.c                |  4 +--
 board/congatec/cgtqmx8/cgtqmx8.c              |  2 +-
 board/freescale/ls1021atsn/ls1021atsn.c       |  2 +-
 board/freescale/ls1021atwr/ls1021atwr.c       |  2 +-
 board/hoperun/hihope-rzg2/hihope-rzg2.c       |  2 +-
 board/keymile/common/common.c                 |  4 +--
 board/nokia/rx51/lowlevel_init.S              |  6 ++---
 board/qualcomm/dragonboard820c/head.S         |  2 +-
 board/renesas/falcon/falcon.c                 |  2 +-
 board/silinux/ek874/ek874.c                   |  2 +-
 board/ti/ks2_evm/board.c                      |  2 +-
 boot/Makefile                                 |  1 -
 cmd/sf.c                                      |  2 +-
 common/autoboot.c                             |  8 +++---
 common/board_f.c                              | 10 +++----
 common/board_r.c                              |  2 +-
 common/spl/spl.c                              |  8 +++---
 common/spl/spl_atf.c                          |  2 +-
 common/spl/spl_nand.c                         |  6 ++---
 common/spl/spl_optee.S                        |  2 +-
 include/configs/MCR3000.h                     |  2 +-
 include/configs/MPC837XERDB.h                 | 10 +++----
 include/configs/MPC8548CDS.h                  | 10 +++----
 include/configs/P2041RDB.h                    |  8 +++---
 include/configs/T102xRDB.h                    |  4 +--
 include/configs/T104xRDB.h                    |  2 +-
 include/configs/T208xQDS.h                    |  4 +--
 include/configs/T208xRDB.h                    |  4 +--
 include/configs/T4240RDB.h                    |  2 +-
 include/configs/am3517_evm.h                  |  2 +-
 include/configs/at91sam9260ek.h               |  2 +-
 include/configs/baltos.h                      |  2 +-
 include/configs/bcmstb.h                      |  2 +-
 include/configs/corvus.h                      |  6 ++---
 include/configs/devkit3250.h                  |  6 ++---
 include/configs/evb_ast2500.h                 |  2 +-
 include/configs/evb_ast2600.h                 |  2 +-
 .../configs/gardena-smart-gateway-at91sam.h   |  4 +--
 .../configs/gardena-smart-gateway-mt7688.h    |  2 +-
 include/configs/hikey.h                       |  2 +-
 include/configs/hikey960.h                    |  2 +-
 include/configs/imx6-engicam.h                |  2 +-
 include/configs/imx6_logic.h                  |  2 +-
 include/configs/kontron-sl-mx6ul.h            |  2 +-
 include/configs/linkit-smart-7688.h           |  2 +-
 include/configs/ls1021aqds.h                  |  4 +--
 include/configs/ls1043a_common.h              |  6 ++---
 include/configs/ls1046a_common.h              |  4 +--
 include/configs/ls1046aqds.h                  |  2 +-
 include/configs/ls1088a_common.h              |  2 +-
 include/configs/ls2080a_common.h              |  2 +-
 include/configs/meesc.h                       |  2 +-
 include/configs/microblaze-generic.h          |  2 +-
 include/configs/mt7620.h                      |  2 +-
 include/configs/mt7622.h                      |  4 +--
 include/configs/mt7628.h                      |  2 +-
 include/configs/mt7981.h                      |  4 +--
 include/configs/mt7986.h                      |  4 +--
 include/configs/mt8512.h                      |  2 +-
 include/configs/mv-common.h                   |  2 +-
 include/configs/octeontx2_common.h            |  2 +-
 include/configs/octeontx_common.h             |  2 +-
 include/configs/p1_p2_rdb_pc.h                | 18 ++++++-------
 include/configs/rpi.h                         |  2 +-
 include/configs/siemens-am33x-common.h        |  2 +-
 include/configs/smartweb.h                    |  6 ++---
 include/configs/taurus.h                      |  6 ++---
 include/configs/ti_armv7_common.h             |  2 +-
 include/configs/vocore2.h                     |  2 +-
 include/configs/work_92105.h                  |  6 ++---
 include/spl.h                                 |  4 +--
 lib/efi/efi_stub.c                            | 10 +++----
 lib/efi_loader/efi_runtime.c                  |  8 +++---
 lib/trace.c                                   |  2 +-
 111 files changed, 225 insertions(+), 226 deletions(-)
Makefile +13 -13
index bc101e67588..28bec3fa415 100644
@@ -1030,7 +1030,7 @@ LDFLAGS_u-boot += -z notext $(call ld-option,--apply-dynamic-relocs)
 LDFLAGS_u-boot += --build-id=none
 
 ifeq ($(CONFIG_ARC)$(CONFIG_NIOS2)$(CONFIG_X86)$(CONFIG_XTENSA),)
-LDFLAGS_u-boot += -Ttext $(CONFIG_TEXT_BASE)
+LDFLAGS_u-boot += -Ttext $(CONFIG_PPL_TEXT_BASE)
 endif
 
 # insure the checker run with the right endianness
@@ -1305,7 +1305,7 @@ shell_cmd = { $(call echo-cmd,$(1)) $(cmd_$(1)); }
 
 quiet_cmd_objcopy_uboot = OBJCOPY $@
 ifdef cmd_static_rela
-cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_TEXT_BASE)) || { rm -f $@; false; }
+cmd_objcopy_uboot = $(cmd_objcopy) && $(call shell_cmd,static_rela,$<,$@,$(CONFIG_PPL_TEXT_BASE)) || { rm -f $@; false; }
 else
 cmd_objcopy_uboot = $(cmd_objcopy)
 endif
@@ -1359,7 +1359,7 @@ u-boot.ldr.hex u-boot.ldr.srec: u-boot.ldr FORCE
 # from the SPL U-Boot version.
 #
 ifndef CFG_SYS_UBOOT_START
-CFG_SYS_UBOOT_START := $(CONFIG_TEXT_BASE)
+CFG_SYS_UBOOT_START := $(CONFIG_PPL_TEXT_BASE)
 endif
 
 # Boards with more complex image requirements can provide an .its source file
@@ -1381,7 +1381,7 @@ endif
 
 ifdef CONFIG_SPL_LOAD_FIT
 MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
-	-a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+	-a $(CONFIG_PPL_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
 	-p $(CONFIG_FIT_EXTERNAL_OFFSET) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
 	$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(DEVICE_TREE))) \
@@ -1389,10 +1389,10 @@ MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
 	$(patsubst %,-b arch/$(ARCH)/dts/%.dtbo,$(subst ",,$(CONFIG_OF_OVERLAY_LIST)))
 else
 MKIMAGEFLAGS_u-boot.img = -A $(ARCH) -T firmware -C none -O u-boot \
-	-a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+	-a $(CONFIG_PPL_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 MKIMAGEFLAGS_u-boot-ivt.img = -A $(ARCH) -T firmware_ivt -C none -O u-boot \
-	-a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+	-a $(CONFIG_PPL_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 u-boot-ivt.img: MKIMAGEOUTPUT = u-boot-ivt.img.log
 endif
@@ -1411,10 +1411,10 @@ KWD_CONFIG_FILE = $(shell \
 	fi)
 
 MKIMAGEFLAGS_u-boot.kwb = -n $(KWD_CONFIG_FILE) \
-	-T kwbimage -a $(CONFIG_TEXT_BASE) -e $(CONFIG_TEXT_BASE)
+	-T kwbimage -a $(CONFIG_PPL_TEXT_BASE) -e $(CONFIG_PPL_TEXT_BASE)
 
 MKIMAGEFLAGS_u-boot-with-spl.kwb = -n $(KWD_CONFIG_FILE) \
-	-T kwbimage -a $(CONFIG_TEXT_BASE) -e $(CONFIG_TEXT_BASE) \
+	-T kwbimage -a $(CONFIG_PPL_TEXT_BASE) -e $(CONFIG_PPL_TEXT_BASE) \
 	$(if $(KEYDIR),-k $(KEYDIR))
 
 MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
@@ -1423,7 +1423,7 @@ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \
 UBOOT_BIN := u-boot.bin
 
 MKIMAGEFLAGS_u-boot-lzma.img = -A $(ARCH) -T standalone -C lzma -O u-boot \
-	-a $(CONFIG_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
+	-a $(CONFIG_PPL_TEXT_BASE) -e $(CFG_SYS_UBOOT_START) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board"
 
 u-boot.bin.lzma: u-boot.bin FORCE
@@ -1528,7 +1528,7 @@ u-boot.uim: u-boot.bin FORCE
 u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL $(if $(CONFIG_OF_SEPARATE),u-boot.img,u-boot.uim) FORCE
 	$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
 
-MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_TEXT_BASE)
+MKIMAGEFLAGS_u-boot.ubl = -n $(UBL_CONFIG) -T ublimage -e $(CONFIG_PPL_TEXT_BASE)
 
 u-boot.ubl: u-boot-with-spl.bin FORCE
 	$(call if_changed,mkimage)
@@ -1660,8 +1660,8 @@ u-boot-with-spl-pbl.bin: spl/u-boot-spl.pbl $(UBOOT_BINLOAD) FORCE
 quiet_cmd_u-boot-elf ?= LD      $@
 	cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \
 	$(if $(CONFIG_SYS_BIG_ENDIAN),-EB,-EL) \
-	-T u-boot-elf.lds --defsym=$(CONFIG_PLATFORM_ELFENTRY)=$(CONFIG_TEXT_BASE) \
-	-Ttext=$(CONFIG_TEXT_BASE)
+	-T u-boot-elf.lds --defsym=$(CONFIG_PLATFORM_ELFENTRY)=$(CONFIG_PPL_TEXT_BASE) \
+	-Ttext=$(CONFIG_PPL_TEXT_BASE)
 u-boot.elf: u-boot.bin u-boot-elf.lds
 	$(Q)$(OBJCOPY) -I binary $(PLATFORM_ELFFLAGS) $< u-boot-elf.o
 	$(call if_changed,u-boot-elf)
@@ -1682,7 +1682,7 @@ u-boot-mtk.bin: u-boot-with-spl.bin
 	$(call if_changed,copy)
 else
 MKIMAGEFLAGS_u-boot-mtk.bin = -T mtk_image \
-	-a $(CONFIG_TEXT_BASE) -e $(CONFIG_TEXT_BASE) \
+	-a $(CONFIG_PPL_TEXT_BASE) -e $(CONFIG_PPL_TEXT_BASE) \
 	-n "$(patsubst "%",%,$(CONFIG_MTK_BROM_HEADER_INFO))"
 
 u-boot-mtk.bin: u-boot.bin FORCE
arch/arm/cpu/arm1176/start.S +1 -1
index 78a9cc173a3..4f275be05b8 100644
@@ -84,7 +84,7 @@ cpu_init_crit:
 
 	/* Prepare to disable the MMU */
 	adr	r2, mmu_disable_phys
-	sub	r2, r2, #(CFG_SYS_UBOOT_BASE - CONFIG_TEXT_BASE)
+	sub	r2, r2, #(CFG_SYS_UBOOT_BASE - CONFIG_PPL_TEXT_BASE)
 	b	mmu_disable
 
 	.align 5
arch/arm/cpu/arm926ejs/mxs/Makefile +2 -2
index 1638ef8fd8d..8ac7439c18d 100644
@@ -60,14 +60,14 @@ spl/u-boot-spl.ivt: spl/u-boot-spl.bin
 
 u-boot.ivt: u-boot.bin
 	$(call if_changed,mkalign_mxs)
-	$(call if_changed,mkivt_mxs,$(CONFIG_TEXT_BASE),\
+	$(call if_changed,mkivt_mxs,$(CONFIG_PPL_TEXT_BASE),\
 		0x40001000,0x40001040)
 
 spl/u-boot-spl.csf: spl/u-boot-spl.ivt spl/u-boot-spl.bin board/$(VENDOR)/$(BOARD)/sign/u-boot-spl.csf
 	$(call if_changed,mkcsfreq_mxs,$(CONFIG_SPL_TEXT_BASE),0x8000)
 
 u-boot.csf: u-boot.ivt u-boot.bin board/$(VENDOR)/$(BOARD)/sign/u-boot.csf
-	$(call if_changed,mkcsfreq_mxs,$(CONFIG_TEXT_BASE),0x40001000)
+	$(call if_changed,mkcsfreq_mxs,$(CONFIG_PPL_TEXT_BASE),0x40001000)
 
 %.sig: %.csf
 	$(call if_changed,mkcst_mxs)
arch/arm/cpu/armv7/ls102xa/fdt.c +1 -1
index 599b7e18ef3..1871acdce44 100644
@@ -146,7 +146,7 @@ void ft_cpu_setup(void *blob, struct bd_info *bd)
 	 * Since second uboot binary has a head, that space need to be
 	 * reserved either(assuming its size is less than 0x1000).
 	 */
-	off = fdt_add_mem_rsv(blob, CONFIG_TEXT_BASE - UBOOT_HEAD_LEN,
+	off = fdt_add_mem_rsv(blob, CONFIG_PPL_TEXT_BASE - UBOOT_HEAD_LEN,
 			      CONFIG_SYS_MONITOR_LEN +
 			      CONFIG_SYS_SPL_MALLOC_SIZE + UBOOT_HEAD_LEN);
 	if (off < 0)
arch/arm/cpu/armv8/linux-kernel-image-header-vars.h +1 -1
index b6394aee165..92dcde5cc36 100644
@@ -69,7 +69,7 @@
 				 (__HEAD_FLAG_PAGE_SIZE << 1) |	\
 				 (__HEAD_FLAG_PHYS_BASE << 3))
 
-#define TEXT_OFFSET (CONFIG_TEXT_BASE - \
+#define TEXT_OFFSET (CONFIG_PPL_TEXT_BASE - \
 			CONFIG_LNX_KRNL_IMG_TEXT_OFFSET_BASE)
 
 /*
arch/arm/cpu/armv8/start.S +1 -1
index f3ea8585770..94cbf96a6e5 100644
@@ -35,7 +35,7 @@ _start:
 
 .globl	_TEXT_BASE
 _TEXT_BASE:
-	.quad	CONFIG_TEXT_BASE
+	.quad	CONFIG_PPL_TEXT_BASE
 
 /*
  * These are defined in the linker script.
arch/arm/include/asm/arch-mxs/sys_proto.h +1 -1
index 17afd1b29e4..5af8e3732a7 100644
@@ -85,7 +85,7 @@ static const struct mxs_pair mxs_boot_modes[] = {
 #define MXS_BM_SDMMC1_3V3		0x0a
 #define MXS_BM_SDMMC1_1V8		0x1a
 
-#define MXS_SPL_DATA ((struct mxs_spl_data *)(CONFIG_TEXT_BASE - 0x200))
+#define MXS_SPL_DATA ((struct mxs_spl_data *)(CONFIG_PPL_TEXT_BASE - 0x200))
 
 struct mxs_spl_data {
 	uint8_t		boot_mode_idx;
arch/arm/include/asm/arch-sunxi/boot0.h +1 -1
index 46b7e073b59..ec2ae77184b 100644
@@ -47,7 +47,7 @@
 #ifdef CONFIG_SPL_BUILD
 	.word	CONFIG_SPL_TEXT_BASE
 #else
-	.word   CONFIG_TEXT_BASE
+	.word   CONFIG_PPL_TEXT_BASE
 #endif
 	.word	fel_stash - .
 #else
arch/arm/lib/crt0.S +1 -1
index a0311438b45..85435b66d07 100644
@@ -144,7 +144,7 @@ ENTRY(_main)
 	adr	r0, _main
 	ldr	r1, _start_ofs
 	add	r0, r1
-	ldr	r1, =CONFIG_TEXT_BASE
+	ldr	r1, =CONFIG_PPL_TEXT_BASE
 	sub	r1, r0
 	add	lr, r1
 #if defined(CONFIG_SYS_RELOC_GD_ENV_ADDR)
arch/arm/lib/relocate_64.S +1 -1
index 495a5f03ba7..11f3265171c 100644
@@ -37,7 +37,7 @@ ENTRY(relocate_code)
 	 * correctly apply relocations, we need to know the linked value.
 	 *
 	 * Linked &__image_copy_start, which we know was at
-	 * CONFIG_TEXT_BASE, which is stored in _TEXT_BASE, as a non-
+	 * CONFIG_PPL_TEXT_BASE, which is stored in _TEXT_BASE, as a non-
 	 * relocated value, since it isn't a symbol reference.
 	 */
 	ldr	x1, _TEXT_BASE		/* x1 <- Linked &__image_copy_start */
arch/arm/mach-at91/arm920t/lowlevel_init.S +2 -2
index 6b7d3cbc710..ee977be0304 100644
@@ -22,9 +22,9 @@
 _MTEXT_BASE:
 #undef START_FROM_MEM
 #ifdef START_FROM_MEM
-	.word	CONFIG_TEXT_BASE-PHYS_FLASH_1
+	.word	CONFIG_PPL_TEXT_BASE-PHYS_FLASH_1
 #else
-	.word	CONFIG_TEXT_BASE
+	.word	CONFIG_PPL_TEXT_BASE
 #endif
 
 .globl lowlevel_init
arch/arm/mach-at91/arm926ejs/lowlevel_init.S +1 -1
index e159a74eeac..5bd30757fd9 100644
@@ -32,7 +32,7 @@ lowlevel_init:
 POS1:
 	adr	r5, POS1	/* r5 = POS1 run time */
 	ldr	r0, =POS1	/* r0 = POS1 compile */
-	sub	r5, r5, r0	/* r0 = CONFIG_TEXT_BASE-1 */
+	sub	r5, r5, r0	/* r0 = CONFIG_PPL_TEXT_BASE-1 */
 
 	/* memory control configuration 1 */
 	ldr	r0, =SMRDATA
arch/arm/mach-exynos/spl_boot.c +5 -5
index 553dac75b61..f959994d9a9 100644
@@ -251,7 +251,7 @@ void copy_uboot_to_ram(void)
 #ifdef CONFIG_SPI_BOOTING
 	case BOOT_MODE_SERIAL:
 		/* Customised function to copy u-boot from SF */
-		exynos_spi_copy(param->uboot_size, CONFIG_TEXT_BASE);
+		exynos_spi_copy(param->uboot_size, CONFIG_PPL_TEXT_BASE);
 		break;
 #endif
 	case BOOT_MODE_SD:
@@ -267,7 +267,7 @@ void copy_uboot_to_ram(void)
 		copy_bl2_from_emmc = get_irom_func(EMMC44_INDEX);
 		end_bootop_from_emmc = get_irom_func(EMMC44_END_INDEX);
 
-		copy_bl2_from_emmc(BL2_SIZE_BLOC_COUNT, CONFIG_TEXT_BASE);
+		copy_bl2_from_emmc(BL2_SIZE_BLOC_COUNT, CONFIG_PPL_TEXT_BASE);
 		end_bootop_from_emmc();
 		break;
 #endif
@@ -279,7 +279,7 @@ void copy_uboot_to_ram(void)
 		 */
 		is_cr_z_set = config_branch_prediction(0);
 		usb_copy = get_irom_func(USB_INDEX);
-		usb_copy(0, (u32 *)CONFIG_TEXT_BASE);
+		usb_copy(0, (u32 *)CONFIG_PPL_TEXT_BASE);
 		config_branch_prediction(is_cr_z_set);
 		break;
 #endif
@@ -288,7 +288,7 @@ void copy_uboot_to_ram(void)
 	}
 
 	if (copy_bl2)
-		copy_bl2(offset, size, CONFIG_TEXT_BASE);
+		copy_bl2(offset, size, CONFIG_PPL_TEXT_BASE);
 }
 
 void memzero(void *s, size_t n)
@@ -329,7 +329,7 @@ void board_init_f(unsigned long bootflag)
 	copy_uboot_to_ram();
 
 	/* Jump to U-Boot image */
-	uboot = (void *)CONFIG_TEXT_BASE;
+	uboot = (void *)CONFIG_PPL_TEXT_BASE;
 	(*uboot)();
 	/* Never returns Here */
 }
arch/arm/mach-imx/Makefile +5 -5
index 4dfc60eedc4..d3b7bddc837 100644
@@ -126,7 +126,7 @@ DEPFILE_EXISTS := 0
 endif
 
 MKIMAGEFLAGS_u-boot.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
-	-T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
+	-T $(IMAGE_TYPE) -e $(CONFIG_PPL_TEXT_BASE)
 u-boot.imx: MKIMAGEOUTPUT = u-boot.imx.log
 
 u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
@@ -134,7 +134,7 @@ u-boot.imx: u-boot.bin u-boot.cfgout $(PLUGIN).bin FORCE
 
 ifeq ($(CONFIG_MULTI_DTB_FIT),y)
 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
-	-T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
+	-T $(IMAGE_TYPE) -e $(CONFIG_PPL_TEXT_BASE)
 u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
 
 u-boot-dtb.imx: u-boot-fit-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
@@ -143,7 +143,7 @@ ifeq ($(DEPFILE_EXISTS),0)
 endif
 else ifeq ($(CONFIG_OF_SEPARATE),y)
 MKIMAGEFLAGS_u-boot-dtb.imx = -n $(filter-out $(PLUGIN).bin $< $(PHONY),$^) \
-	-T $(IMAGE_TYPE) -e $(CONFIG_TEXT_BASE)
+	-T $(IMAGE_TYPE) -e $(CONFIG_PPL_TEXT_BASE)
 u-boot-dtb.imx: MKIMAGEOUTPUT = u-boot-dtb.imx.log
 
 u-boot-dtb.imx: u-boot-dtb.bin u-boot-dtb.cfgout $(PLUGIN).bin FORCE
@@ -207,8 +207,8 @@ SPL: MKIMAGEOUTPUT = SPL.log
 SPL: spl/u-boot-spl.bin spl/u-boot-spl.cfgout $(PLUGIN).bin FORCE
 	$(call if_changed,mkimage)
 
-MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_TEXT_BASE) \
-		-e $(CONFIG_TEXT_BASE) -C none -T firmware
+MKIMAGEFLAGS_u-boot.uim = -A arm -O U-Boot -a $(CONFIG_PPL_TEXT_BASE) \
+		-e $(CONFIG_PPL_TEXT_BASE) -C none -T firmware
 
 u-boot.uim: u-boot.bin FORCE
 	$(call if_changed,mkimage)
arch/arm/mach-imx/imx8/cpu.c +2 -2
index be1f4edded1..318bfc590b7 100644
@@ -313,8 +313,8 @@ phys_size_t get_effective_memsize(void)
 
 			/* Find the memory region runs the U-Boot */
 			if (start >= phys_sdram_1_start && start <= end1 &&
-			    (start <= CONFIG_TEXT_BASE &&
-			    end >= CONFIG_TEXT_BASE)) {
+			    (start <= CONFIG_PPL_TEXT_BASE &&
+			    end >= CONFIG_PPL_TEXT_BASE)) {
 				if ((end + 1) <=
 				    ((sc_faddr_t)phys_sdram_1_start +
 				    phys_sdram_1_size))
arch/arm/mach-imx/spl.c +1 -1
index cb9801b7a13..45c84245551 100644
@@ -341,7 +341,7 @@ void *board_spl_fit_buffer_addr(ulong fit_size, int sectors, int bl_len)
 	if (bl_len < 512)
 		bl_len = 512;
 
-	return  (void *)((CONFIG_TEXT_BASE - fit_size - bl_len -
+	return  (void *)((CONFIG_PPL_TEXT_BASE - fit_size - bl_len -
 			align_len) & ~align_len);
 }
 #endif
arch/arm/mach-k3/sysfw-loader.c +1 -1
index c4c5c371100..cd50a2ae9f0 100644
@@ -91,7 +91,7 @@ static void *sysfw_load_address;
 struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
 {
 	if (sysfw_loaded)
-		return (struct legacy_img_hdr *)(CONFIG_TEXT_BASE + offset);
+		return (struct legacy_img_hdr *)(CONFIG_PPL_TEXT_BASE + offset);
 	else if (sysfw_load_address)
 		return sysfw_load_address;
 	else
arch/arm/mach-nexell/include/mach/boot0.h +3 -3
index 29f37d3ba4c..936f007bdc3 100644
@@ -5,7 +5,7 @@
  * The NSIH (first 512 Bytes of u-boot.bin) is necessary for the
  * 2nd-Bootloader to get information like load address of U-Boot.
  *
- * 0x400 must be added to CONFIG_TEXT_BASE to have the actual load and
+ * 0x400 must be added to CONFIG_PPL_TEXT_BASE to have the actual load and
  * start address because 2nd-Bootloader loads with an offset of 0x400
  * (NSIH + 0x200 bytes are not loaded into RAM).
  *
@@ -23,9 +23,9 @@
 	.word	(_end - _start) + 20 * 1024	/* 0x50: load size
 						 *       (bin + 20k for DTB) */
 	.space	0x4
-	.word	CONFIG_TEXT_BASE + 0x400	/* 0x58: load address */
+	.word	CONFIG_PPL_TEXT_BASE + 0x400	/* 0x58: load address */
 	.word	0x00000000
-	.word	CONFIG_TEXT_BASE + 0x400	/* 0x60: start address */
+	.word	CONFIG_PPL_TEXT_BASE + 0x400	/* 0x60: start address */
 	.space	0x198
 	.byte	'N'				/* 0x1FC: "NSIH" signature */
 	.byte	'S'
arch/arm/mach-octeontx/cpu.c +1 -1
index aa5f4585c6f..4df46907981 100644
@@ -46,7 +46,7 @@ struct mm_region *mem_map = otx_mem_map;
 void mem_map_fill(void)
 {
 	int banks = OTX_MEM_MAP_USED;
-	u32 dram_start = CONFIG_TEXT_BASE;
+	u32 dram_start = CONFIG_PPL_TEXT_BASE;
 
 	if (otx_is_soc(CN83XX)) {
 		otx_mem_map[banks].virt = 0x8c0000000000UL;
arch/arm/mach-octeontx2/cpu.c +1 -1
index 723deef719b..46acb94a3c0 100644
@@ -51,7 +51,7 @@ struct mm_region *mem_map = otx2_mem_map;
 void mem_map_fill(void)
 {
 	int banks = OTX2_MEM_MAP_USED;
-	u32 dram_start = CONFIG_TEXT_BASE;
+	u32 dram_start = CONFIG_PPL_TEXT_BASE;
 
 	for (int i = 0; i < CONFIG_NR_DRAM_BANKS; i++) {
 		otx2_mem_map[banks].virt = dram_start;
arch/arm/mach-sunxi/board.c +1 -1
index 391a65a5495..1f31aac607c 100644
@@ -362,7 +362,7 @@ __weak void sunxi_sram_init(void)
 static bool sunxi_valid_emmc_boot(struct mmc *mmc)
 {
 	struct blk_desc *bd = mmc_get_blk_desc(mmc);
-	u32 *buffer = (void *)(uintptr_t)CONFIG_TEXT_BASE;
+	u32 *buffer = (void *)(uintptr_t)CONFIG_PPL_TEXT_BASE;
 	struct boot_file_head *egon_head = (void *)buffer;
 	struct toc0_main_info *toc0_info = (void *)buffer;
 	int bootpart = EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config);
arch/arm/mach-sunxi/spl_spi_sunxi.c +1 -1
index 81159cfee61..f31cfe748a9 100644
@@ -341,7 +341,7 @@ static int spl_spi_load_image(struct spl_image_info *spl_image,
 	struct legacy_img_hdr *header;
 	uint32_t load_offset = sunxi_get_spl_size();
 
-	header = (struct legacy_img_hdr *)CONFIG_TEXT_BASE;
+	header = (struct legacy_img_hdr *)CONFIG_PPL_TEXT_BASE;
 	load_offset = max_t(uint32_t, load_offset, CONFIG_SYS_SPI_U_BOOT_OFFS);
 
 	spi0_init();
arch/m68k/cpu/mcf52x2/start.S +6 -6
index d48d0192eea..c35341c37cc 100644
@@ -35,8 +35,8 @@
  */
 _vectors:
 .long	0x00000000		/* Flash offset is 0 until we setup CS0 */
-#if defined(CONFIG_M5282) && (CONFIG_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
-.long	_start - CONFIG_TEXT_BASE
+#if defined(CONFIG_M5282) && (CONFIG_PPL_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
+.long	_start - CONFIG_PPL_TEXT_BASE
 #else
 .long	_START
 #endif
@@ -83,7 +83,7 @@ _vectors:
 
 #if defined(CFG_SYS_INT_FLASH_BASE) && \
     (defined(CONFIG_M5282) || defined(CONFIG_M5281))
-#if (CONFIG_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
+#if (CONFIG_PPL_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
 .long	0x55AA55AA,0xAA55AA55		/* CFM Backdoorkey */
 .long	0xFFFFFFFF			/* all sectors protected */
 .long	0x00000000			/* supervisor/User restriction */
@@ -130,7 +130,7 @@ _start:
 	movec	%d0, %RAMBAR1
 
 #if defined(CONFIG_M5282)
-#if (CONFIG_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
+#if (CONFIG_PPL_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
 	/*
 	 * Setup code in SRAM to initialize FLASHBAR,
 	 * if start from internal Flash
@@ -156,7 +156,7 @@ _after_flashbar_copy:
 	/* Setup code to initialize FLASHBAR, if start from external Memory */
 	move.l	#(CFG_SYS_INT_FLASH_BASE + CFG_SYS_INT_FLASH_ENABLE), %d0
 	movec	%d0, %FLASHBAR
-#endif /* (CONFIG_TEXT_BASE == CFG_SYS_INT_FLASH_BASE) */
+#endif /* (CONFIG_PPL_TEXT_BASE == CFG_SYS_INT_FLASH_BASE) */
 
 #endif
 #endif
@@ -165,7 +165,7 @@ _after_flashbar_copy:
 	 * therefore no VBR to set
 	 */
 #if !defined(CONFIG_MONITOR_IS_IN_RAM)
-#if defined(CONFIG_M5282) && (CONFIG_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
+#if defined(CONFIG_M5282) && (CONFIG_PPL_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
 	move.l	#CFG_SYS_INT_FLASH_BASE, %d0
 #else
 	move.l	#CFG_SYS_FLASH_BASE, %d0
arch/m68k/cpu/mcf530x/start.S +2 -2
index dbe2b54e410..ef67941940a 100644
@@ -39,8 +39,8 @@ _vectors:
 /* Flash offset is 0 until we setup CS0 */
 .long	0x00000000
 #if defined(CONFIG_M5307) && \
-	   (CONFIG_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
-.long	_start - CONFIG_TEXT_BASE
+	   (CONFIG_PPL_TEXT_BASE == CFG_SYS_INT_FLASH_BASE)
+.long	_start - CONFIG_PPL_TEXT_BASE
 #else
 .long	_START
 #endif
arch/m68k/cpu/mcf5445x/start.S +8 -8
index a083c3d45d2..3c5d01db938 100644
@@ -26,10 +26,10 @@
 	rte;
 
 #if defined(CONFIG_SERIAL_BOOT)
-#define ASM_DRAMINIT	(asm_dram_init - CONFIG_TEXT_BASE + \
+#define ASM_DRAMINIT	(asm_dram_init - CONFIG_PPL_TEXT_BASE + \
 	CFG_SYS_INIT_RAM_ADDR)
-#define ASM_DRAMINIT_N	(asm_dram_init - CONFIG_TEXT_BASE)
-#define ASM_SBF_IMG_HDR	(asm_sbf_img_hdr - CONFIG_TEXT_BASE + \
+#define ASM_DRAMINIT_N	(asm_dram_init - CONFIG_PPL_TEXT_BASE)
+#define ASM_SBF_IMG_HDR	(asm_sbf_img_hdr - CONFIG_PPL_TEXT_BASE + \
 	CFG_SYS_INIT_RAM_ADDR)
 #endif
 
@@ -116,7 +116,7 @@ vector192_255:
 asm_sbf_img_hdr:
 	.long	0x00000000		/* checksum, not yet implemented */
 	.long	0x00040000		/* image length */
-	.long	CONFIG_TEXT_BASE	/* image to be relocated at */
+	.long	CONFIG_PPL_TEXT_BASE	/* image to be relocated at */
 
 asm_dram_init:
 	move.w	#0x2700,%sr		/* Mask off Interrupt */
@@ -271,7 +271,7 @@ asm_dspi_rd_loop2:
 	jsr	asm_dspi_rd_status
 
 	/* jump to memory and execute */
-	move.l	#(CONFIG_TEXT_BASE + 0x400), %a0
+	move.l	#(CONFIG_PPL_TEXT_BASE + 0x400), %a0
 	jmp	(%a0)
 
 asm_dspi_wr_status:
@@ -298,7 +298,7 @@ asm_dspi_rd_status:
 	/* copy 4 boot pages to dram as soon as possible */
 	/* each page is 996 bytes (1056 total with 60 ECC bytes */
 	move.l  #0x00000000, %a1	/* src */
-	move.l	#CONFIG_TEXT_BASE, %a2		/* dst */
+	move.l	#CONFIG_PPL_TEXT_BASE, %a2		/* dst */
 	move.l	#0x3E0, %d0		/* sz in long */
 
 asm_boot_nand_copy:
@@ -381,7 +381,7 @@ asm_nand_init:
 	move.l	#4, %d2			/* start at 4 */
 	move.l  #0xFC0FFF04, %a0	/* cmd2 */
 	move.l  #0xFC0FFF0C, %a1	/* rar */
-	move.l	#(CONFIG_TEXT_BASE + 0xF80), %a2
+	move.l	#(CONFIG_PPL_TEXT_BASE + 0xF80), %a2
 
 asm_nand_read:
 	move.l	#0x11000000, %d0	/* rar */
@@ -419,7 +419,7 @@ asm_nand_copy:
 	bgt	asm_nand_read
 
 	/* jump to memory and execute */
-	move.l	#(CONFIG_TEXT_BASE + 0x400), %a0
+	move.l	#(CONFIG_PPL_TEXT_BASE + 0x400), %a0
 	jmp	(%a0)
 
 #endif			/* CONFIG_SYS_NAND_BOOT */
arch/microblaze/cpu/relocate.c +3 -3
index 7a15fb2ec39..e2198762272 100644
@@ -19,7 +19,7 @@
  * @rela_start: rela section start
  * @rela_end: rela section end
  * @dyn_start: dynamic section start
- * @origin_addr: address where u-boot starts(doesn't need to be CONFIG_TEXT_BASE)
+ * @origin_addr: address where u-boot starts(doesn't need to be CONFIG_PPL_TEXT_BASE)
  */
 void mb_fix_rela(u32 reloc_addr, u32 verbose, u32 rela_start,
 		 u32 rela_end, u32 dyn_start, u32 origin_addr)
@@ -29,9 +29,9 @@ void mb_fix_rela(u32 reloc_addr, u32 verbose, u32 rela_start,
 	/*
 	 * Return in case u-boot.elf is used directly.
 	 * Skip it when u-boot.bin is loaded to different address than
-	 * CONFIG_TEXT_BASE. In this case relocation is necessary to run.
+	 * CONFIG_PPL_TEXT_BASE. In this case relocation is necessary to run.
 	 */
-	if (reloc_addr == CONFIG_TEXT_BASE) {
+	if (reloc_addr == CONFIG_PPL_TEXT_BASE) {
 		debug_cond(verbose,
 			   "Relocation address is the same - skip relocation\n");
 		return;
arch/microblaze/cpu/start.S +4 -4
index 7079d9e1704..a620e0b207c 100644
@@ -55,15 +55,15 @@ uboot_sym_start:
 	add	r6, r0, r0
 
 	lwi	r7, r20, ALIGNMENT_ADDR
-	addi	r7, r7, -CONFIG_TEXT_BASE
+	addi	r7, r7, -CONFIG_PPL_TEXT_BASE
 	add	r7, r7, r5
 	lwi	r8, r20, ALIGNMENT_ADDR + 0x4
-	addi	r8, r8, -CONFIG_TEXT_BASE
+	addi	r8, r8, -CONFIG_PPL_TEXT_BASE
 	add	r8, r8, r5
 	lwi	r9, r20, ALIGNMENT_ADDR + 0x8
-	addi	r9, r9, -CONFIG_TEXT_BASE
+	addi	r9, r9, -CONFIG_PPL_TEXT_BASE
 	add	r9, r9, r5
-	addi	r10, r0, CONFIG_TEXT_BASE
+	addi	r10, r0, CONFIG_PPL_TEXT_BASE
 
 	brlid	r15, mb_fix_rela
 	nop
arch/mips/mach-jz47xx/jz4780/jz4780.c +2 -2
index 15d1eff2ba7..71f3eecacf1 100644
@@ -58,7 +58,7 @@ void board_init_f(ulong dummy)
 	if (ret)
 		hang();
 
-	header = (struct legacy_img_hdr *)(CONFIG_TEXT_BASE -
+	header = (struct legacy_img_hdr *)(CONFIG_PPL_TEXT_BASE -
 					 sizeof(struct legacy_img_hdr));
 
 	count = blk_dread(mmc_get_blk_desc(mmc),
@@ -68,7 +68,7 @@ void board_init_f(ulong dummy)
 		hang();
 
 	image_entry_noargs_t image_entry =
-		(image_entry_noargs_t)CONFIG_TEXT_BASE;
+		(image_entry_noargs_t)CONFIG_PPL_TEXT_BASE;
 
 	image_entry();
 
arch/mips/mach-mscc/lowlevel_init.S +1 -1
index 0c24cb5f22d..9d98d01090e 100644
@@ -21,7 +21,7 @@ LEAF(lowlevel_init)
 
 	/* Modify ra/s0 such we return to physical NOR location */
 	li	t0, 0x0fffffff
-	li	t1, CONFIG_TEXT_BASE
+	li	t1, CONFIG_PPL_TEXT_BASE
 	and	s0, ra, t0
 	add	s0, s0, t1
 
arch/powerpc/cpu/mpc85xx/cpu_init_early.c +2 -2
index a67f37e3af9..66f5106659f 100644
@@ -30,7 +30,7 @@ void setup_ifc(void)
 	_mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(15);
 	_mas1 = MAS1_VALID | MAS1_TID(0) | MAS1_TS | MAS1_IPROT |
 			MAS1_TSIZE(BOOKE_PAGESZ_4M);
-	_mas2 = FSL_BOOKE_MAS2(CONFIG_TEXT_BASE, MAS2_I | MAS2_G);
+	_mas2 = FSL_BOOKE_MAS2(CONFIG_PPL_TEXT_BASE, MAS2_I | MAS2_G);
 	_mas3 = FSL_BOOKE_MAS3(flash_phys, 0, MAS3_SW|MAS3_SR|MAS3_SX);
 	_mas7 = FSL_BOOKE_MAS7(flash_phys);
 
@@ -58,7 +58,7 @@ void setup_ifc(void)
 			MAS0_ESEL(CONFIG_SYS_PPC_E500_DEBUG_TLB);
 	_mas1 = MAS1_VALID | MAS1_TID(0) | MAS1_IPROT |
 			MAS1_TSIZE(BOOKE_PAGESZ_4M);
-	_mas2 = FSL_BOOKE_MAS2(CONFIG_TEXT_BASE, MAS2_I | MAS2_G);
+	_mas2 = FSL_BOOKE_MAS2(CONFIG_PPL_TEXT_BASE, MAS2_I | MAS2_G);
 	_mas3 = FSL_BOOKE_MAS3(flash_phys, 0, MAS3_SW|MAS3_SR|MAS3_SX);
 	_mas7 = FSL_BOOKE_MAS7(flash_phys);
 
arch/x86/cpu/apollolake/spl.c +1 -1
index 6078d5a200e..7ec27dcc2af 100644
@@ -118,7 +118,7 @@ static int spl_fast_spi_load_image(struct spl_image_info *spl_image,
 
 	spl_image->size = CONFIG_SYS_MONITOR_LEN;  /* We don't know SPL size */
 	spl_image->entry_point = spl_phase() == PHASE_TPL ?
-		CONFIG_SPL_TEXT_BASE : CONFIG_TEXT_BASE;
+		CONFIG_SPL_TEXT_BASE : CONFIG_PPL_TEXT_BASE;
 	spl_image->load_addr = spl_image->entry_point;
 	spl_image->os = IH_OS_U_BOOT;
 	spl_image->name = "U-Boot";
arch/x86/cpu/quark/quark.c +1 -1
index 0a1fbb34d40..332786de5d4 100644
@@ -49,7 +49,7 @@ static void quark_setup_mtrr(void)
 
 	/* variable range MTRR#0: ROM area */
 	mask = ~(CONFIG_SYS_MONITOR_LEN - 1);
-	base = CONFIG_TEXT_BASE & mask;
+	base = CONFIG_PPL_TEXT_BASE & mask;
 	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_VAR_PHYBASE(MTRR_VAR_ROM),
 		       base | MTRR_TYPE_WRBACK);
 	msg_port_write(MSG_PORT_HOST_BRIDGE, MTRR_VAR_PHYMASK(MTRR_VAR_ROM),
arch/x86/cpu/start.S +3 -3
index 0ef27cc5a00..5401b34eb31 100644
@@ -237,15 +237,15 @@ multiboot_header:
 	/* checksum */
 	.long	-0x1BADB002 - (1 << 16)
 	/* header addr */
-	.long	multiboot_header - _x86boot_start + CONFIG_TEXT_BASE
+	.long	multiboot_header - _x86boot_start + CONFIG_PPL_TEXT_BASE
 	/* load addr */
-	.long	CONFIG_TEXT_BASE
+	.long	CONFIG_PPL_TEXT_BASE
 	/* load end addr */
 	.long	0
 	/* bss end addr */
 	.long	0
 	/* entry addr */
-	.long	CONFIG_TEXT_BASE
+	.long	CONFIG_PPL_TEXT_BASE
 
 #ifdef CONFIG_X86_LOAD_FROM_32_BIT
 	/*
arch/x86/lib/relocate.c +3 -3
index 5b1b420a643..c97f2db6d03 100644
@@ -162,10 +162,10 @@ int do_elf_reloc_fixups(void)
 	if (re_src == re_end)
 		panic("No relocation data");
 
-#ifdef CONFIG_TEXT_BASE
-	text_base = CONFIG_TEXT_BASE;
+#ifdef CONFIG_PPL_TEXT_BASE
+	text_base = CONFIG_PPL_TEXT_BASE;
 #else
-	panic("No CONFIG_TEXT_BASE");
+	panic("No CONFIG_PPL_TEXT_BASE");
 #endif
 #if CONFIG_IS_ENABLED(X86_64)
 	do_elf_reloc_fixups64(text_base, size, re_src, re_end);
arch/x86/lib/spl.c +3 -3
index bdf57ef7b5b..c91fc49ac6a 100644
@@ -66,7 +66,7 @@ static int x86_spl_init(void)
 	 * TODO([email protected]): We use this area of RAM for the stack
 	 * and global_data in SPL. Once U-Boot starts up and releocates it
 	 * is not needed. We could make this a CONFIG option or perhaps
-	 * place it immediately below CONFIG_TEXT_BASE.
+	 * place it immediately below CONFIG_PPL_TEXT_BASE.
 	 */
 	__maybe_unused char *ptr = (char *)0x110000;
 #else
@@ -209,8 +209,8 @@ static int spl_board_load_image(struct spl_image_info *spl_image,
 				struct spl_boot_device *bootdev)
 {
 	spl_image->size = CONFIG_SYS_MONITOR_LEN;
-	spl_image->entry_point = CONFIG_TEXT_BASE;
-	spl_image->load_addr = CONFIG_TEXT_BASE;
+	spl_image->entry_point = CONFIG_PPL_TEXT_BASE;
+	spl_image->load_addr = CONFIG_PPL_TEXT_BASE;
 	spl_image->os = IH_OS_U_BOOT;
 	spl_image->name = "U-Boot";
 
board/BuS/eb_cpu5282/eb_cpu5282.c +1 -1
index ea49c7a99c0..8be4249d178 100644
@@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR;
 int checkboard (void)
 {
 	puts("Board: EB+CPU5282 (BuS Elektronik GmbH & Co. KG)\n");
-#if (CONFIG_TEXT_BASE ==  CFG_SYS_INT_FLASH_BASE)
+#if (CONFIG_PPL_TEXT_BASE ==  CFG_SYS_INT_FLASH_BASE)
 	puts("       Boot from Internal FLASH\n");
 #endif
 	return 0;
board/beacon/beacon-rzg2m/beacon-rzg2m.c +1 -1
index 99fe1edfb33..a8236813e7f 100644
@@ -12,7 +12,7 @@ DECLARE_GLOBAL_DATA_PTR;
 int board_init(void)
 {
 	/* address of boot parameters */
-	gd->bd->bi_boot_params = CONFIG_TEXT_BASE + 0x50000;
+	gd->bd->bi_boot_params = CONFIG_PPL_TEXT_BASE + 0x50000;
 
 	return 0;
 }
board/broadcom/bcmstb/bcmstb.c +2 -2
index aead6f099e8..448ae4fdcd5 100644
@@ -61,13 +61,13 @@ int dram_init_banksize(void)
 
 	/*
 	 * On this SoC, U-Boot is running as an ELF file.  Change the
-	 * relocation address to CONFIG_TEXT_BASE, so that in
+	 * relocation address to CONFIG_PPL_TEXT_BASE, so that in
 	 * setup_reloc, gd->reloc_off works out to 0, effectively
 	 * disabling relocation.  Otherwise U-Boot hangs in the setup
 	 * instructions just before relocate_code in
 	 * arch/arm/lib/crt0.S.
 	 */
-	gd->relocaddr = CONFIG_TEXT_BASE;
+	gd->relocaddr = CONFIG_PPL_TEXT_BASE;
 
 	return 0;
 }
board/congatec/cgtqmx8/cgtqmx8.c +1 -1
index c0a8a497c7b..cc79c739bcf 100644
@@ -425,7 +425,7 @@ int board_late_init(void)
 	char *end_of_uboot;
 	char command[256];
 
-	end_of_uboot = (char *)(ulong)(CONFIG_TEXT_BASE + _end_ofs
+	end_of_uboot = (char *)(ulong)(CONFIG_PPL_TEXT_BASE + _end_ofs
 			+ fdt_totalsize(gd->fdt_blob));
 	end_of_uboot += 9;
 
board/freescale/ls1021atsn/ls1021atsn.c +1 -1
index d144f25c623..9d7e68978dc 100644
@@ -188,7 +188,7 @@ void board_init_f(ulong dummy)
 	 * in last boot.
 	 */
 	if (is_warm_boot()) {
-		second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
+		second_uboot = (void (*)(void))CONFIG_PPL_TEXT_BASE;
 		second_uboot();
 	}
 
board/freescale/ls1021atwr/ls1021atwr.c +1 -1
index 4f5834347db..cf5f9f219b0 100644
@@ -439,7 +439,7 @@ void board_init_f(ulong dummy)
 	 * in last boot.
 	 */
 	if (is_warm_boot()) {
-		second_uboot = (void (*)(void))CONFIG_TEXT_BASE;
+		second_uboot = (void (*)(void))CONFIG_PPL_TEXT_BASE;
 		second_uboot();
 	}
 
board/hoperun/hihope-rzg2/hihope-rzg2.c +1 -1
index 3372290120b..27df2c9bb45 100644
@@ -39,7 +39,7 @@ int board_init(void)
 	u32 i;
 
 	/* address of boot parameters */
-	gd->bd->bi_boot_params = CONFIG_TEXT_BASE + 0x50000;
+	gd->bd->bi_boot_params = CONFIG_PPL_TEXT_BASE + 0x50000;
 
 	/* Configure the HSUSB block */
 	mstp_clrbits_le32(SMSTPCR7, SMSTPCR7, HSUSB_MSTP704);
board/keymile/common/common.c +2 -2
index 991022ac833..29c201dc1e6 100644
@@ -116,7 +116,7 @@ void check_for_uboot_update(void)
 			}
 		}
 		printf("Check update: starting factory image @%08x ...\n",
-		       CONFIG_TEXT_BASE);
+		       CONFIG_PPL_TEXT_BASE);
 	} else if (IS_ENABLED(CONFIG_PG_WCOM_UBOOT_UPDATE)) {
 		/*
 		 * When running in field updated u-boot, make sure that
@@ -124,7 +124,7 @@ void check_for_uboot_update(void)
 		 */
 		WARN_ON(bootcount > CONFIG_BOOTCOUNT_BOOTLIMIT);
 		printf("Check update: updated u-boot starting @%08x ...\n",
-		       CONFIG_TEXT_BASE);
+		       CONFIG_PPL_TEXT_BASE);
 	}
 }
 #endif
board/nokia/rx51/lowlevel_init.S +3 -3
index 44f32f114e7..31d681e4896 100644
@@ -8,7 +8,7 @@
 #include <linux/linkage.h>
 
 kernoffs:		/* offset of kernel image from this address */
-	.word . - CONFIG_TEXT_BASE - KERNEL_OFFSET
+	.word . - CONFIG_PPL_TEXT_BASE - KERNEL_OFFSET
 
 kernaddr:		/* address of kernel after copying */
 	.word KERNEL_ADDRESS
@@ -37,13 +37,13 @@ ENTRY(save_boot_params)
  *
  * Nokia X-Loader is loading secondary image to address 0x80400000.
  * NOLO is loading boot image to random place, so it doesn't really
- * matter what is set in CONFIG_TEXT_BASE. We have to detect
+ * matter what is set in CONFIG_PPL_TEXT_BASE. We have to detect
  * KERNEL_OFFSET from the current execution address and copy it to
  * absolute address KERNEL_ADDRESS.
  *
  * Note that U-Boot has to be compiled with CONFIG_POSITION_INDEPENDENT
  * because it is loaded at random address and not to the fixed address
- * (CONFIG_TEXT_BASE).
+ * (CONFIG_PPL_TEXT_BASE).
  */
 
 	/* r0 - start of kernel before */
board/qualcomm/dragonboard820c/head.S +1 -1
index b052a858fd3..1af01994a44 100644
@@ -20,7 +20,7 @@
 _arm64_header:
 	b _start
 	.word 0
-	.quad   CONFIG_TEXT_BASE-PHYS_SDRAM_1 /* Image load offset, LE */
+	.quad   CONFIG_PPL_TEXT_BASE-PHYS_SDRAM_1 /* Image load offset, LE */
 	.quad   0    /* Effective size of kernel image, little-endian */
 	.quad   0    /* kernel flags, little-endian */
 	.quad   0    /* reserved */
board/renesas/falcon/falcon.c +1 -1
index b0cb4e747b6..466e3cd9d77 100644
@@ -84,7 +84,7 @@ int board_early_init_f(void)
 int board_init(void)
 {
 	/* address of boot parameters */
-	gd->bd->bi_boot_params = CONFIG_TEXT_BASE + 0x50000;
+	gd->bd->bi_boot_params = CONFIG_PPL_TEXT_BASE + 0x50000;
 
 	init_gic_v3();
 
board/silinux/ek874/ek874.c +1 -1
index 6dc804a0c06..80c8648af58 100644
@@ -19,7 +19,7 @@ DECLARE_GLOBAL_DATA_PTR;
 int board_init(void)
 {
 	/* address of boot parameters */
-	gd->bd->bi_boot_params = CONFIG_TEXT_BASE + 0x50000;
+	gd->bd->bi_boot_params = CONFIG_PPL_TEXT_BASE + 0x50000;
 
 	return 0;
 }
board/ti/ks2_evm/board.c +1 -1
index 5dcda12105b..ca1df0d65d9 100644
@@ -66,7 +66,7 @@ int dram_init(void)
 
 struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
 {
-	return (struct legacy_img_hdr *)(CONFIG_TEXT_BASE);
+	return (struct legacy_img_hdr *)(CONFIG_PPL_TEXT_BASE);
 }
 
 int board_init(void)
boot/Makefile +0 -1
index 88193a1b60e..3b22d25ce2a 100644
@@ -32,7 +32,6 @@ obj-$(CONFIG_$(SPL_TPL_)BOOTMETH_SCRIPT) += bootmeth_script.o
 ifdef CONFIG_$(SPL_TPL_)BOOTSTD_FULL
 obj-$(CONFIG_CMD_BOOTEFI_BOOTMGR) += bootmeth_efi_mgr.o
 obj-$(CONFIG_$(SPL_TPL_)EXPO) += bootflow_menu.o
-obj-$(CONFIG_$(SPL_TPL_)BOOTSTD) += bootflow_menu.o
 endif
 
 obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += image-fdt.o
cmd/sf.c +1 -1
index 11b9c25896a..73a890b8ff5 100644
@@ -558,7 +558,7 @@ static int do_spi_flash_test(int argc, char *const argv[])
 		return 1;
 	}
 
-	from = map_sysmem(CONFIG_TEXT_BASE, 0);
+	from = map_sysmem(CONFIG_PPL_TEXT_BASE, 0);
 	memcpy(buf, from, len);
 	ret = spi_flash_test(flash, buf, len, offset, vbuf);
 	free(vbuf);
common/autoboot.c +4 -4
index 5d331991c19..7bc6363e7de 100644
@@ -428,19 +428,19 @@ static int abortboot(int bootdelay)
 
 static void process_fdt_options(void)
 {
-#ifdef CONFIG_TEXT_BASE
+#ifdef CONFIG_PPL_TEXT_BASE
 	ulong addr;
 
 	/* Add an env variable to point to a kernel payload, if available */
 	addr = ofnode_conf_read_int("kernel-offset", 0);
 	if (addr)
-		env_set_addr("kernaddr", (void *)(CONFIG_TEXT_BASE + addr));
+		env_set_addr("kernaddr", (void *)(CONFIG_PPL_TEXT_BASE + addr));
 
 	/* Add an env variable to point to a root disk, if available */
 	addr = ofnode_conf_read_int("rootdisk-offset", 0);
 	if (addr)
-		env_set_addr("rootaddr", (void *)(CONFIG_TEXT_BASE + addr));
-#endif /* CONFIG_TEXT_BASE */
+		env_set_addr("rootaddr", (void *)(CONFIG_PPL_TEXT_BASE + addr));
+#endif /* CONFIG_PPL_TEXT_BASE */
 }
 
 const char *bootdelay_process(void)
common/board_f.c +5 -5
index f3c1ab53b1c..50833400f81 100644
@@ -127,8 +127,8 @@ static int display_text_info(void)
 	bss_start = (ulong)&__bss_start;
 	bss_end = (ulong)&__bss_end;
 
-#ifdef CONFIG_TEXT_BASE
-	text_base = CONFIG_TEXT_BASE;
+#ifdef CONFIG_PPL_TEXT_BASE
+	text_base = CONFIG_PPL_TEXT_BASE;
 #else
 	text_base = CONFIG_SYS_MONITOR_BASE;
 #endif
@@ -692,7 +692,7 @@ static int reloc_bloblist(void)
 static int setup_reloc(void)
 {
 	if (!(gd->flags & GD_FLG_SKIP_RELOC)) {
-#ifdef CONFIG_TEXT_BASE
+#ifdef CONFIG_PPL_TEXT_BASE
 #ifdef ARM
 		gd->reloc_off = gd->relocaddr - (unsigned long)__image_copy_start;
 #elif defined(CONFIG_MICROBLAZE)
@@ -702,9 +702,9 @@ static int setup_reloc(void)
 		 * On all ColdFire arch cpu, monitor code starts always
 		 * just after the default vector table location, so at 0x400
 		 */
-		gd->reloc_off = gd->relocaddr - (CONFIG_TEXT_BASE + 0x400);
+		gd->reloc_off = gd->relocaddr - (CONFIG_PPL_TEXT_BASE + 0x400);
 #elif !defined(CONFIG_SANDBOX)
-		gd->reloc_off = gd->relocaddr - CONFIG_TEXT_BASE;
+		gd->reloc_off = gd->relocaddr - CONFIG_PPL_TEXT_BASE;
 #endif
 #endif
 	}
common/board_r.c +1 -1
index e45003353f7..771b2c1a032 100644
@@ -369,7 +369,7 @@ static int initr_flash(void)
 
 #if defined(CONFIG_OXC) || defined(CONFIG_RMU)
 	/* flash mapped at end of memory map */
-	bd->bi_flashoffset = CONFIG_TEXT_BASE + flash_size;
+	bd->bi_flashoffset = CONFIG_PPL_TEXT_BASE + flash_size;
 #elif CONFIG_SYS_MONITOR_BASE == CFG_SYS_FLASH_BASE
 	bd->bi_flashoffset = monitor_flash_len;	/* reserved area for monitor */
 #endif
common/spl/spl.c +4 -4
index a630e798661..27a5488307d 100644
@@ -44,7 +44,7 @@ DECLARE_GLOBAL_DATA_PTR;
 DECLARE_BINMAN_MAGIC_SYM;
 
 #ifndef CFG_SYS_UBOOT_START
-#define CFG_SYS_UBOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START	CONFIG_PPL_TEXT_BASE
 #endif
 
 u32 *boot_params_ptr = NULL;
@@ -188,7 +188,7 @@ ulong spl_get_image_text_base(void)
 		return CONFIG_VPL_TEXT_BASE;
 #endif
 	return spl_next_phase() == PHASE_SPL ? CONFIG_SPL_TEXT_BASE :
-		CONFIG_TEXT_BASE;
+		CONFIG_PPL_TEXT_BASE;
 }
 
 /*
@@ -225,7 +225,7 @@ __weak void spl_board_prepare_for_boot(void)
 
 __weak struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
 {
-	return map_sysmem(CONFIG_TEXT_BASE + offset, 0);
+	return map_sysmem(CONFIG_PPL_TEXT_BASE + offset, 0);
 }
 
 #ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT
@@ -251,7 +251,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
 		spl_image->load_addr = u_boot_pos;
 	} else {
 		spl_image->entry_point = CFG_SYS_UBOOT_START;
-		spl_image->load_addr = CONFIG_TEXT_BASE;
+		spl_image->load_addr = CONFIG_PPL_TEXT_BASE;
 	}
 	spl_image->os = IH_OS_U_BOOT;
 	spl_image->name = "U-Boot";
common/spl/spl_atf.c +1 -1
index 2c10252834f..63fa9b720b2 100644
@@ -254,7 +254,7 @@ uintptr_t spl_fit_images_get_entry(void *blob, int node)
 void spl_invoke_atf(struct spl_image_info *spl_image)
 {
 	uintptr_t  bl32_entry = 0;
-	uintptr_t  bl33_entry = CONFIG_TEXT_BASE;
+	uintptr_t  bl33_entry = CONFIG_PPL_TEXT_BASE;
 	void *blob = spl_image->fdt_addr;
 	uintptr_t platform_param = (uintptr_t)blob;
 	int node;
common/spl/spl_nand.c +3 -3
index dc45204fc0e..73e4d96e843 100644
@@ -157,11 +157,11 @@ static int spl_nand_load_image(struct spl_image_info *spl_image,
 		 */
 		nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS,
 			CONFIG_CMD_SPL_WRITE_SIZE,
-			(void *)CONFIG_TEXT_BASE);
+			(void *)CONFIG_PPL_TEXT_BASE);
 		/* copy to destintion */
 		for (dst = (int *)CONFIG_SYS_SPL_ARGS_ADDR,
-				src = (int *)CONFIG_TEXT_BASE;
-				src < (int *)(CONFIG_TEXT_BASE +
+				src = (int *)CONFIG_PPL_TEXT_BASE;
+				src < (int *)(CONFIG_PPL_TEXT_BASE +
 				CONFIG_CMD_SPL_WRITE_SIZE);
 				src++, dst++) {
 			writel(readl(src), dst);
common/spl/spl_optee.S +1 -1
index a269904d386..934f234494f 100644
@@ -7,6 +7,6 @@
 #include <asm/assembler.h>
 
 ENTRY(spl_optee_entry)
-	ldr lr, =CONFIG_TEXT_BASE
+	ldr lr, =CONFIG_PPL_TEXT_BASE
 	mov pc, r3
 ENDPROC(spl_optee_entry)
include/configs/MCR3000.h +1 -1
index c6929c1b987..ec8fd56de43 100644
@@ -62,7 +62,7 @@
 #define	CFG_SYS_SDRAM_BASE		0x00000000
 
 /* FLASH organization */
-#define CFG_SYS_FLASH_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_FLASH_BASE		CONFIG_PPL_TEXT_BASE
 
 /*
  * For booting Linux, the board info and command line data
include/configs/MPC837XERDB.h +5 -5
index 70b1c399241..100d35fc64c 100644
@@ -199,15 +199,15 @@
 	"netdev=eth1\0"				\
 	"uboot=" CONFIG_UBOOTPATH "\0"					\
 	"tftpflash=tftp $loadaddr $uboot;"				\
-		"protect off " __stringify(CONFIG_TEXT_BASE)	\
+		"protect off " __stringify(CONFIG_PPL_TEXT_BASE)	\
 			" +$filesize; "	\
-		"erase " __stringify(CONFIG_TEXT_BASE)		\
+		"erase " __stringify(CONFIG_PPL_TEXT_BASE)		\
 			" +$filesize; "	\
-		"cp.b $loadaddr " __stringify(CONFIG_TEXT_BASE)	\
+		"cp.b $loadaddr " __stringify(CONFIG_PPL_TEXT_BASE)	\
 			" $filesize; "	\
-		"protect on " __stringify(CONFIG_TEXT_BASE)		\
+		"protect on " __stringify(CONFIG_PPL_TEXT_BASE)		\
 			" +$filesize; "	\
-		"cmp.b $loadaddr " __stringify(CONFIG_TEXT_BASE)	\
+		"cmp.b $loadaddr " __stringify(CONFIG_PPL_TEXT_BASE)	\
 			" $filesize\0"	\
 	"fdtaddr=780000\0"						\
 	"fdtfile=" FDTFILE "\0"					\
include/configs/MPC8548CDS.h +5 -5
index 6f3e298a249..b3673147dc2 100644
@@ -296,15 +296,15 @@
 	"netdev=eth0\0"				\
 	"uboot=" CONFIG_UBOOTPATH "\0"	\
 	"tftpflash=tftpboot $loadaddr $uboot; "	\
-		"protect off " __stringify(CONFIG_TEXT_BASE)	\
+		"protect off " __stringify(CONFIG_PPL_TEXT_BASE)	\
 			" +$filesize; "	\
-		"erase " __stringify(CONFIG_TEXT_BASE)		\
+		"erase " __stringify(CONFIG_PPL_TEXT_BASE)		\
 			" +$filesize; "	\
-		"cp.b $loadaddr " __stringify(CONFIG_TEXT_BASE)	\
+		"cp.b $loadaddr " __stringify(CONFIG_PPL_TEXT_BASE)	\
 			" $filesize; "	\
-		"protect on " __stringify(CONFIG_TEXT_BASE)		\
+		"protect on " __stringify(CONFIG_PPL_TEXT_BASE)		\
 			" +$filesize; "	\
-		"cmp.b $loadaddr " __stringify(CONFIG_TEXT_BASE)	\
+		"cmp.b $loadaddr " __stringify(CONFIG_PPL_TEXT_BASE)	\
 			" $filesize\0"	\
 	"consoledev=ttyS1\0"			\
 	"ramdiskaddr=2000000\0"			\
include/configs/P2041RDB.h +4 -4
index 28f53ae78a1..3a00ca67a03 100644
@@ -17,7 +17,7 @@
 
 #ifdef CONFIG_SRIO_PCIE_BOOT_SLAVE
 /* Set 1M boot space */
-#define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_TEXT_BASE & 0xfff00000)
+#define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_PPL_TEXT_BASE & 0xfff00000)
 #define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS \
 		(0x300000000ull | CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR)
 #define CFG_RESET_VECTOR_ADDRESS 0xfffffffc
@@ -45,9 +45,9 @@
 /*
  *  Config the L3 Cache as L3 SRAM
  */
-#define CFG_SYS_INIT_L3_ADDR		CONFIG_TEXT_BASE
+#define CFG_SYS_INIT_L3_ADDR		CONFIG_PPL_TEXT_BASE
 #ifdef CONFIG_PHYS_64BIT
-#define CFG_SYS_INIT_L3_ADDR_PHYS	(0xf00000000ull | CONFIG_TEXT_BASE)
+#define CFG_SYS_INIT_L3_ADDR_PHYS	(0xf00000000ull | CONFIG_PPL_TEXT_BASE)
 #else
 #define CFG_SYS_INIT_L3_ADDR_PHYS	CFG_SYS_INIT_L3_ADDR
 #endif
@@ -309,7 +309,7 @@
 	"bank_intlv=cs0_cs1\0"					\
 	"netdev=eth0\0"						\
 	"uboot=" CONFIG_UBOOTPATH "\0"			\
-	"ubootaddr=" __stringify(CONFIG_TEXT_BASE) "\0"		\
+	"ubootaddr=" __stringify(CONFIG_PPL_TEXT_BASE) "\0"		\
 	"tftpflash=tftpboot $loadaddr $uboot && "		\
 	"protect off $ubootaddr +$filesize && "			\
 	"erase $ubootaddr +$filesize && "			\
include/configs/T102xRDB.h +2 -2
index 7ee46abffdb..1b867e616cc 100644
@@ -84,7 +84,7 @@
 #define CFG_SYS_SRIO_PCIE_BOOT_UCODE_ENV_ADDR_PHYS \
 		(0x300000000ull | CFG_SYS_SRIO_PCIE_BOOT_UCODE_ENV_ADDR)
 /* Set 1M boot space for PCIe boot */
-#define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_TEXT_BASE & 0xfff00000)
+#define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_PPL_TEXT_BASE & 0xfff00000)
 #define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS	\
 		(0x300000000ull | CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR)
 #define CFG_RESET_VECTOR_ADDRESS 0xfffffffc
@@ -435,7 +435,7 @@
 	"hwconfig=fsl_ddr:ctlr_intlv=cacheline,"		\
 	"usb1:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) "\0"  \
 	"uboot=" CONFIG_UBOOTPATH "\0"		\
-	"ubootaddr=" __stringify(CONFIG_TEXT_BASE) "\0"	\
+	"ubootaddr=" __stringify(CONFIG_PPL_TEXT_BASE) "\0"	\
 	"bootargs=root=/dev/ram rw console=ttyS0,115200\0" \
 	"netdev=eth0\0"						\
 	"tftpflash=tftpboot $loadaddr $uboot && "		\
include/configs/T104xRDB.h +1 -1
index f196bd76e6e..b1ddcf5bd46 100644
@@ -376,7 +376,7 @@
 	"usb2:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) "\0"\
 	"netdev=eth0\0"						\
 	"uboot=" CONFIG_UBOOTPATH "\0"		\
-	"ubootaddr=" __stringify(CONFIG_TEXT_BASE) "\0"	\
+	"ubootaddr=" __stringify(CONFIG_PPL_TEXT_BASE) "\0"	\
 	"tftpflash=tftpboot $loadaddr $uboot && "		\
 	"protect off $ubootaddr +$filesize && "			\
 	"erase $ubootaddr +$filesize && "			\
include/configs/T208xQDS.h +2 -2
index 2023d7497f6..e0dfe6cbeca 100644
@@ -49,7 +49,7 @@
 
 #ifdef CONFIG_SRIO_PCIE_BOOT_SLAVE
 /* Set 1M boot space */
-#define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_TEXT_BASE & 0xfff00000)
+#define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_PPL_TEXT_BASE & 0xfff00000)
 #define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS \
 		(0x300000000ull | CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR)
 #define CFG_RESET_VECTOR_ADDRESS 0xfffffffc
@@ -420,7 +420,7 @@
 	"usb1:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) "\0"\
 	"netdev=eth0\0"						\
 	"uboot=" CONFIG_UBOOTPATH "\0"		\
-	"ubootaddr=" __stringify(CONFIG_TEXT_BASE) "\0"	\
+	"ubootaddr=" __stringify(CONFIG_PPL_TEXT_BASE) "\0"	\
 	"tftpflash=tftpboot $loadaddr $uboot && "		\
 	"protect off $ubootaddr +$filesize && "			\
 	"erase $ubootaddr +$filesize && "			\
include/configs/T208xRDB.h +2 -2
index f213d2de770..04635a6c14b 100644
@@ -49,7 +49,7 @@
 
 #ifdef CONFIG_SRIO_PCIE_BOOT_SLAVE
 /* Set 1M boot space */
-#define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_TEXT_BASE & 0xfff00000)
+#define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR (CONFIG_PPL_TEXT_BASE & 0xfff00000)
 #define CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR_PHYS \
 		(0x300000000ull | CFG_SYS_SRIO_PCIE_BOOT_SLAVE_ADDR)
 #define CFG_RESET_VECTOR_ADDRESS 0xfffffffc
@@ -386,7 +386,7 @@
 	"usb1:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) "\0"\
 	"netdev=eth0\0"						\
 	"uboot=" CONFIG_UBOOTPATH "\0"		\
-	"ubootaddr=" __stringify(CONFIG_TEXT_BASE) "\0"	\
+	"ubootaddr=" __stringify(CONFIG_PPL_TEXT_BASE) "\0"	\
 	"tftpflash=tftpboot $loadaddr $uboot && "		\
 	"protect off $ubootaddr +$filesize && "			\
 	"erase $ubootaddr +$filesize && "			\
include/configs/T4240RDB.h +1 -1
index 506f1b7e268..fa1da4dd8a2 100644
@@ -375,7 +375,7 @@
 	"usb1:dr_mode=host,phy_type=" __stringify(__USB_PHY_TYPE) "\0"\
 	"netdev=eth0\0"						\
 	"uboot=" CONFIG_UBOOTPATH "\0"		\
-	"ubootaddr=" __stringify(CONFIG_TEXT_BASE) "\0"	\
+	"ubootaddr=" __stringify(CONFIG_PPL_TEXT_BASE) "\0"	\
 	"tftpflash=tftpboot $loadaddr $uboot && "		\
 	"protect off $ubootaddr +$filesize && "			\
 	"erase $ubootaddr +$filesize && "			\
include/configs/am3517_evm.h +1 -1
index b75c6483883..96154da42b9 100644
@@ -25,7 +25,7 @@
 
 #define CFG_SYS_NAND_ECCSIZE		512
 #define CFG_SYS_NAND_ECCBYTES	13
-#define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 /* NAND block size is 128 KiB.  Synchronize these values with
  * corresponding Device Tree entries in Linux:
  *  MLO(SPL)             4 * NAND_BLOCK_SIZE = 512 KiB  @ 0x000000
include/configs/at91sam9260ek.h +1 -1
index b9cc7ba974d..3453fcba0a9 100644
@@ -17,7 +17,7 @@
 #include <asm/hardware.h>
 
 /*
- * Warning: changing CONFIG_TEXT_BASE requires
+ * Warning: changing CONFIG_PPL_TEXT_BASE requires
  * adapting the initial boot program.
  * Since the linker has to swallow that define, we must use a pure
  * hex number here!
include/configs/baltos.h +1 -1
index e7946389eff..1b535eabb08 100644
@@ -202,7 +202,7 @@
 
 #define CFG_SYS_NAND_ECCSIZE		512
 #define CFG_SYS_NAND_ECCBYTES	14
-#define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 #endif
 #endif
 
include/configs/bcmstb.h +1 -1
index c9280927b3c..d7e1bbf7f84 100644
@@ -65,7 +65,7 @@ extern phys_addr_t prior_stage_fdt_address;
  *	       :	[~500 KiB in size, stripped]
  *	 0xc000 0000	Top of RAM
  *
- * Setting gd->relocaddr to CONFIG_TEXT_BASE in dram_init_banksize
+ * Setting gd->relocaddr to CONFIG_PPL_TEXT_BASE in dram_init_banksize
  * prevents U-Boot from relocating itself when it is run as an ELF
  * program by the prior stage bootloader.
  *
include/configs/corvus.h +3 -3
index f2675e0ec86..985cd9cab1d 100644
@@ -17,7 +17,7 @@
 #include <linux/sizes.h>
 
 /*
- * Warning: changing CONFIG_TEXT_BASE requires
+ * Warning: changing CONFIG_PPL_TEXT_BASE requires
  * adapting the initial boot program.
  * Since the linker has to swallow that define, we must use a pure
  * hex number here!
@@ -54,8 +54,8 @@
 /* Defines for SPL */
 
 #define CFG_SYS_NAND_U_BOOT_SIZE	0x80000
-#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_TEXT_BASE
+#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
 
 #define CFG_SYS_NAND_ECCSIZE		256
 #define CFG_SYS_NAND_ECCBYTES	3
include/configs/devkit3250.h +3 -3
index d85aeaafe51..cbf5661e236 100644
@@ -78,11 +78,11 @@
  * U-Boot Commands
  */
 
-/* U-Boot will be 0x60000 bytes, loaded and run at CONFIG_TEXT_BASE */
+/* U-Boot will be 0x60000 bytes, loaded and run at CONFIG_PPL_TEXT_BASE */
 #define CFG_SYS_NAND_U_BOOT_SIZE	0x60000
 
-#define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
 
 /* See common/spl/spl.c  spl_set_header_raw_uboot() */
 
include/configs/evb_ast2500.h +1 -1
index f304929263e..203fe9c63b9 100644
@@ -11,7 +11,7 @@
 
 #include <configs/aspeed-common.h>
 
-#define CFG_SYS_UBOOT_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_BASE		CONFIG_PPL_TEXT_BASE
 
 /* Misc */
 #define CFG_EXTRA_ENV_SETTINGS \
include/configs/evb_ast2600.h +1 -1
index e1cce58fa93..ee94bba7632 100644
@@ -8,7 +8,7 @@
 
 #include <configs/aspeed-common.h>
 
-#define CFG_SYS_UBOOT_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_BASE		CONFIG_PPL_TEXT_BASE
 
 /* Misc */
 #define STR_HELPER(s)	#s
include/configs/gardena-smart-gateway-at91sam.h +2 -2
index 89e531649a6..3e00d2e47c1 100644
@@ -38,7 +38,7 @@
 #define CFG_SYS_MCKR_CSS		0x1302
 
 #define CFG_SYS_NAND_U_BOOT_SIZE	0xa0000
-#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_TEXT_BASE
+#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
 
 #endif
include/configs/gardena-smart-gateway-mt7688.h +1 -1
index 0ba4efe67ac..d910eaa280b 100644
@@ -13,7 +13,7 @@
 
 /* SPL */
 
-#define CFG_SYS_UBOOT_START		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START		CONFIG_PPL_TEXT_BASE
 
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE		0
include/configs/hikey.h +1 -1
index 36bf22b1870..a473e8a63ca 100644
@@ -15,7 +15,7 @@
 
 /* Physical Memory Map */
 
-/* CONFIG_TEXT_BASE needs to align with where ATF loads bl33.bin */
+/* CONFIG_PPL_TEXT_BASE needs to align with where ATF loads bl33.bin */
 
 #define PHYS_SDRAM_1			0x00000000
 
include/configs/hikey960.h +1 -1
index 40d5e653c3f..34daca7a14c 100644
@@ -11,7 +11,7 @@
 
 /* Physical Memory Map */
 
-/* CONFIG_TEXT_BASE needs to align with where ATF loads bl33.bin */
+/* CONFIG_PPL_TEXT_BASE needs to align with where ATF loads bl33.bin */
 
 #define PHYS_SDRAM_1			0x00000000
 #define PHYS_SDRAM_1_SIZE		0xC0000000
include/configs/imx6-engicam.h +1 -1
index 786b70fe064..8079771c84d 100644
@@ -127,7 +127,7 @@
 /* NAND */
 #ifdef CONFIG_NAND_MXS
 # define CFG_SYS_NAND_BASE		0x40000000
-# define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+# define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 
 /* MTD device */
 #endif
include/configs/imx6_logic.h +1 -1
index 85c054451f3..dc2c67bde6c 100644
@@ -113,7 +113,7 @@
 
 /* NAND stuff */
 #define CFG_SYS_NAND_BASE           0x40000000
-#define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 
 /* USB Configs */
 #ifdef CONFIG_CMD_USB
include/configs/kontron-sl-mx6ul.h +1 -1
index 1c92cd78767..a39753c9056 100644
@@ -19,7 +19,7 @@
 #define CFG_SYS_INIT_RAM_ADDR	IRAM_BASE_ADDR
 #define CFG_SYS_INIT_RAM_SIZE	IRAM_SIZE
 
-#define CFG_SYS_UBOOT_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_BASE		CONFIG_PPL_TEXT_BASE
 
 /* Board and environment settings */
 #define CFG_MXC_UART_BASE		UART4_BASE
include/configs/linkit-smart-7688.h +1 -1
index f16c7e91221..ea2562aae9c 100644
@@ -13,7 +13,7 @@
 
 /* SPL */
 
-#define CFG_SYS_UBOOT_START		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START		CONFIG_PPL_TEXT_BASE
 
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE		0
include/configs/ls1021aqds.h +2 -2
index e4e5522a238..451913e8fa6 100644
@@ -12,8 +12,8 @@
 
 #ifdef CONFIG_NAND_BOOT
 #define CFG_SYS_NAND_U_BOOT_SIZE	(400 << 10)
-#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 
 #endif
 
include/configs/ls1043a_common.h +3 -3
index ac2319c1b42..dcdd99cf714 100644
@@ -43,8 +43,8 @@
 
 /* NAND SPL */
 #ifdef CONFIG_NAND_BOOT
-#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 #endif
 
 /* GPIO */
@@ -57,7 +57,7 @@
  * CFG_SYS_FLASH_BASE has the final address (core view)
  * CFG_SYS_FLASH_BASE_PHYS has the final address (IFC view)
  * CFG_SYS_FLASH_BASE_PHYS_EARLY has the temporary IFC address
- * CONFIG_TEXT_BASE is linked to 0x60000000 for booting
+ * CONFIG_PPL_TEXT_BASE is linked to 0x60000000 for booting
  */
 #define CFG_SYS_FLASH_BASE			0x60000000
 #define CFG_SYS_FLASH_BASE_PHYS		CFG_SYS_FLASH_BASE
include/configs/ls1046a_common.h +2 -2
index 38fb1d45bcb..fb04531cb85 100644
@@ -43,8 +43,8 @@
 
 /* NAND SPL */
 #ifdef CONFIG_NAND_BOOT
-#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 #endif
 
 /* GPIO */
include/configs/ls1046aqds.h +1 -1
index 4b4bd7cbe48..57c439bc562 100644
@@ -32,7 +32,7 @@
  * CFG_SYS_FLASH_BASE has the final address (core view)
  * CFG_SYS_FLASH_BASE_PHYS has the final address (IFC view)
  * CFG_SYS_FLASH_BASE_PHYS_EARLY has the temporary IFC address
- * CONFIG_TEXT_BASE is linked to 0x60000000 for booting
+ * CONFIG_PPL_TEXT_BASE is linked to 0x60000000 for booting
  */
 #define CFG_SYS_FLASH_BASE			0x60000000
 #define CFG_SYS_FLASH_BASE_PHYS		CFG_SYS_FLASH_BASE
include/configs/ls1088a_common.h +1 -1
index 720a95d2f53..4e58db27c6c 100644
@@ -66,7 +66,7 @@
  * CFG_SYS_FLASH_BASE has the final address (core view)
  * CFG_SYS_FLASH_BASE_PHYS has the final address (IFC view)
  * CFG_SYS_FLASH_BASE_PHYS_EARLY has the temporary IFC address
- * CONFIG_TEXT_BASE is linked to 0x30000000 for booting
+ * CONFIG_PPL_TEXT_BASE is linked to 0x30000000 for booting
  */
 
 #define CFG_SYS_FLASH_BASE			0x580000000ULL
include/configs/ls2080a_common.h +1 -1
index f51eb31ed06..f086b3b7bb7 100644
@@ -58,7 +58,7 @@
  * CFG_SYS_FLASH_BASE has the final address (core view)
  * CFG_SYS_FLASH_BASE_PHYS has the final address (IFC view)
  * CFG_SYS_FLASH_BASE_PHYS_EARLY has the temporary IFC address
- * CONFIG_TEXT_BASE is linked to 0x30000000 for booting
+ * CONFIG_PPL_TEXT_BASE is linked to 0x30000000 for booting
  */
 
 #define CFG_SYS_FLASH_BASE			0x580000000ULL
include/configs/meesc.h +1 -1
index 38da55c70bf..d1f53f9215b 100644
@@ -21,7 +21,7 @@
 #include <asm/hardware.h>
 
 /*
- * Warning: changing CONFIG_TEXT_BASE requires
+ * Warning: changing CONFIG_PPL_TEXT_BASE requires
  * adapting the initial boot program.
  * Since the linker has to swallow that define, we must use a pure
  * hex number here!
include/configs/microblaze-generic.h +1 -1
index 6740ab2be3e..feb71ecddd2 100644
@@ -93,6 +93,6 @@
 
 /* SPL part */
 
-#define CFG_SYS_UBOOT_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_BASE		CONFIG_PPL_TEXT_BASE
 
 #endif	/* __CONFIG_H */
include/configs/mt7620.h +1 -1
index d5bd4926348..2dee5a513e5 100644
@@ -14,7 +14,7 @@
 
 /* SPL */
 
-#define CFG_SYS_UBOOT_START		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START		CONFIG_PPL_TEXT_BASE
 
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE		0
include/configs/mt7622.h +2 -2
index 65415129534..be8febb514c 100644
@@ -10,10 +10,10 @@
 #define __MT7622_H
 
 /* Uboot definition */
-#define CFG_SYS_UBOOT_BASE                   CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_BASE                   CONFIG_PPL_TEXT_BASE
 
 /* SPL -> Uboot */
-#define CFG_SYS_UBOOT_START		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START		CONFIG_PPL_TEXT_BASE
 /* DRAM */
 #define CFG_SYS_SDRAM_BASE		0x40000000
 
include/configs/mt7628.h +1 -1
index 9df2715fc7d..5e3c039bd65 100644
@@ -24,7 +24,7 @@
 
 /* SPL */
 
-#define CFG_SYS_UBOOT_START		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START		CONFIG_PPL_TEXT_BASE
 
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE		0
include/configs/mt7981.h +2 -2
index 14c885ec55c..2dbbeb7b85e 100644
@@ -10,10 +10,10 @@
 #define __MT7981_H
 
 /* Uboot definition */
-#define CFG_SYS_UBOOT_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_BASE		CONFIG_PPL_TEXT_BASE
 
 /* SPL -> Uboot */
-#define CFG_SYS_UBOOT_START		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START		CONFIG_PPL_TEXT_BASE
 
 /* DRAM */
 #define CFG_SYS_SDRAM_BASE		0x40000000
include/configs/mt7986.h +2 -2
index 0c41af1fc32..229c019afb8 100644
@@ -10,10 +10,10 @@
 #define __MT7986_H
 
 /* Uboot definition */
-#define CFG_SYS_UBOOT_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_BASE		CONFIG_PPL_TEXT_BASE
 
 /* SPL -> Uboot */
-#define CFG_SYS_UBOOT_START		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START		CONFIG_PPL_TEXT_BASE
 
 /* DRAM */
 #define CFG_SYS_SDRAM_BASE		0x40000000
include/configs/mt8512.h +1 -1
index c0fc8688ca6..b210a728548 100644
@@ -10,7 +10,7 @@
 #define __MT8512_H
 
 /* Uboot definition */
-#define CFG_SYS_UBOOT_START			CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START			CONFIG_PPL_TEXT_BASE
 
 #define ENV_BOOT_READ_IMAGE \
 	"boot_rd_img=mmc dev 0" \
include/configs/mv-common.h +1 -1
index 3dfcb138b49..669303091d6 100644
@@ -23,7 +23,7 @@
  */
 
 /*
- * Custom CONFIG_TEXT_BASE can be done in <board>.h
+ * Custom CONFIG_PPL_TEXT_BASE can be done in <board>.h
  */
 
 /* additions for new ARM relocation support */
include/configs/octeontx2_common.h +1 -1
index c4db38562d8..c11146eef51 100644
@@ -10,7 +10,7 @@
 /** Maximum size of image supported for bootm (and bootable FIT images) */
 
 /** Memory base address */
-#define CFG_SYS_SDRAM_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_SDRAM_BASE		CONFIG_PPL_TEXT_BASE
 
 /** Stack starting address */
 
include/configs/octeontx_common.h +1 -1
index 0be26ef3287..5c60de850b4 100644
@@ -36,7 +36,7 @@
 /** Maximum size of image supported for bootm (and bootable FIT images) */
 
 /** Memory base address */
-#define CFG_SYS_SDRAM_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_SDRAM_BASE		CONFIG_PPL_TEXT_BASE
 
 /** Stack starting address */
 
include/configs/p1_p2_rdb_pc.h +9 -9
index f5bd0913449..590117d1034 100644
@@ -81,8 +81,8 @@
 
 #ifdef CONFIG_SDCARD
 #define CFG_SYS_MMC_U_BOOT_SIZE	(768 << 10)
-#define CFG_SYS_MMC_U_BOOT_DST	CONFIG_TEXT_BASE
-#define CFG_SYS_MMC_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_MMC_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_MMC_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 #ifdef CONFIG_FSL_PREPBL_ESDHC_BOOT_SECTOR
 #define CFG_SYS_MMC_U_BOOT_OFFS	(CONFIG_SPL_PAD_TO - CONFIG_FSL_PREPBL_ESDHC_BOOT_SECTOR_DATA*512)
 #else
@@ -90,8 +90,8 @@
 #endif
 #elif defined(CONFIG_SPIFLASH)
 #define CFG_SYS_SPI_FLASH_U_BOOT_SIZE	(768 << 10)
-#define CFG_SYS_SPI_FLASH_U_BOOT_DST		CONFIG_TEXT_BASE
-#define CFG_SYS_SPI_FLASH_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_SPI_FLASH_U_BOOT_DST		CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_SPI_FLASH_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 #define CFG_SYS_SPI_FLASH_U_BOOT_OFFS	CONFIG_SPL_PAD_TO
 #elif defined(CONFIG_MTD_RAW_NAND)
 #ifdef CONFIG_TPL_BUILD
@@ -399,11 +399,11 @@
 "loadaddr=1000000\0"	\
 "bootfile=uImage\0"	\
 "tftpflash=tftpboot $loadaddr $uboot; "	\
-	"protect off " __stringify(CONFIG_TEXT_BASE) " +$filesize; " \
-	"erase " __stringify(CONFIG_TEXT_BASE) " +$filesize; "	\
-	"cp.b $loadaddr " __stringify(CONFIG_TEXT_BASE) " $filesize; " \
-	"protect on " __stringify(CONFIG_TEXT_BASE) " +$filesize; "	\
-	"cmp.b $loadaddr " __stringify(CONFIG_TEXT_BASE) " $filesize\0" \
+	"protect off " __stringify(CONFIG_PPL_TEXT_BASE) " +$filesize; " \
+	"erase " __stringify(CONFIG_PPL_TEXT_BASE) " +$filesize; "	\
+	"cp.b $loadaddr " __stringify(CONFIG_PPL_TEXT_BASE) " $filesize; " \
+	"protect on " __stringify(CONFIG_PPL_TEXT_BASE) " +$filesize; "	\
+	"cmp.b $loadaddr " __stringify(CONFIG_PPL_TEXT_BASE) " $filesize\0" \
 "hwconfig=usb1:dr_mode=host,phy_type=ulpi\0"    \
 "consoledev=ttyS0\0"	\
 "ramdiskaddr=2000000\0"	\
include/configs/rpi.h +1 -1
index 4da982f7357..10e318a12bb 100644
@@ -24,7 +24,7 @@
 
 /* Memory layout */
 #define CFG_SYS_SDRAM_BASE		0x00000000
-#define CFG_SYS_UBOOT_BASE		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_BASE		CONFIG_PPL_TEXT_BASE
 /*
  * The board really has 256M. However, the VC (VideoCore co-processor) shares
  * the RAM, and uses a configurable portion at the top. We tell U-Boot that a
include/configs/siemens-am33x-common.h +1 -1
index 7def657bcd1..39bb0e67eaa 100644
@@ -56,7 +56,7 @@
 #define CFG_SYS_NAND_ECCSIZE		512
 #define CFG_SYS_NAND_ECCBYTES	14
 
-#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 
 /*
  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
include/configs/smartweb.h +3 -3
index 75a1670e331..06ac6510de3 100644
@@ -30,7 +30,7 @@
 #include <linux/sizes.h>
 
 /*
- * Warning: changing CONFIG_TEXT_BASE requires adapting the initial boot
+ * Warning: changing CONFIG_PPL_TEXT_BASE requires adapting the initial boot
  * program. Since the linker has to swallow that define, we must use a pure
  * hex number here!
  */
@@ -89,8 +89,8 @@
 /* Defines for SPL */
 
 #define CFG_SYS_NAND_U_BOOT_SIZE	SZ_512K
-#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_TEXT_BASE
+#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
 
 #define CFG_SYS_NAND_ECCSIZE		256
 #define CFG_SYS_NAND_ECCBYTES	3
include/configs/taurus.h +3 -3
index 174b848e259..1cb2ee6b2c8 100644
@@ -22,7 +22,7 @@
 #include <linux/sizes.h>
 
 /*
- * Warning: changing CONFIG_TEXT_BASE requires
+ * Warning: changing CONFIG_PPL_TEXT_BASE requires
  * adapting the initial boot program.
  * Since the linker has to swallow that define, we must use a pure
  * hex number here!
@@ -123,8 +123,8 @@
 /* Defines for SPL */
 
 #define CFG_SYS_NAND_U_BOOT_SIZE	SZ_512K
-#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_TEXT_BASE
+#define	CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
 
 #define CFG_SYS_NAND_ECCSIZE		256
 #define CFG_SYS_NAND_ECCBYTES	3
include/configs/ti_armv7_common.h +1 -1
index d54c208ef66..55ca934c0c9 100644
@@ -123,7 +123,7 @@
 /* General parts of the framework, required. */
 
 #ifdef CONFIG_MTD_RAW_NAND
-#define CFG_SYS_NAND_U_BOOT_START	CONFIG_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 #endif
 #endif /* !CONFIG_NOR_BOOT */
 
include/configs/vocore2.h +1 -1
index 43050d61c37..9011fb0fa89 100644
@@ -13,7 +13,7 @@
 
 /* SPL */
 
-#define CFG_SYS_UBOOT_START		CONFIG_TEXT_BASE
+#define CFG_SYS_UBOOT_START		CONFIG_PPL_TEXT_BASE
 
 /* Dummy value */
 #define CFG_SYS_UBOOT_BASE		0
include/configs/work_92105.h +3 -3
index f1a7853a80e..20092f1b5e2 100644
@@ -60,9 +60,9 @@
 /* Use the framework and generic lib */
 /* SPL will use serial */
 /* SPL will load U-Boot from NAND offset 0x40000 */
-/* U-Boot will be 0x40000 bytes, loaded and run at CONFIG_TEXT_BASE */
-#define CFG_SYS_NAND_U_BOOT_START CONFIG_TEXT_BASE
-#define CFG_SYS_NAND_U_BOOT_DST   CONFIG_TEXT_BASE
+/* U-Boot will be 0x40000 bytes, loaded and run at CONFIG_PPL_TEXT_BASE */
+#define CFG_SYS_NAND_U_BOOT_START CONFIG_PPL_TEXT_BASE
+#define CFG_SYS_NAND_U_BOOT_DST   CONFIG_PPL_TEXT_BASE
 
 /*
  * Include SoC specific configuration
include/spl.h +2 -2
index 827bd25c883..17d6fd59d4d 100644
@@ -323,7 +323,7 @@ ulong spl_get_image_size(void);
  * spl_get_image_text_base() - get the text base of the next phase
  *
  * This returns the address that the next stage is linked to run at, i.e.
- * CONFIG_SPL_TEXT_BASE or CONFIG_TEXT_BASE
+ * CONFIG_SPL_TEXT_BASE or CONFIG_PPL_TEXT_BASE
  *
  * Return: text-base address
  */
@@ -471,7 +471,7 @@ void spl_set_bd(void);
  *
  * This sets up the given spl_image which the standard values obtained from
  * config options: CONFIG_SYS_MONITOR_LEN, CFG_SYS_UBOOT_START,
- * CONFIG_TEXT_BASE.
+ * CONFIG_PPL_TEXT_BASE.
  *
  * @spl_image: Image description to set up
  */
lib/efi/efi_stub.c +5 -5
index c9eb32ec104..f5a76c39f6f 100644
@@ -126,7 +126,7 @@ static void jump_to_uboot(ulong cs32, ulong addr, ulong info)
 
 	((func_t)addr)(0, 0, info);
 #else
-	cpu_call32(cs32, CONFIG_TEXT_BASE, info);
+	cpu_call32(cs32, CONFIG_PPL_TEXT_BASE, info);
 #endif
 }
 
@@ -184,8 +184,8 @@ static int get_codeseg32(void)
 		if ((desc & GDT_PRESENT) && (desc & GDT_NOTSYS) &&
 		    !(desc & GDT_LONG) && (desc & GDT_4KB) &&
 		    (desc & GDT_32BIT) && (desc & GDT_CODE) &&
-		    CONFIG_TEXT_BASE > base &&
-		    CONFIG_TEXT_BASE + CONFIG_SYS_MONITOR_LEN < limit
+		    CONFIG_PPL_TEXT_BASE > base &&
+		    CONFIG_PPL_TEXT_BASE + CONFIG_SYS_MONITOR_LEN < limit
 		) {
 			cs32 = i;
 			break;
@@ -360,7 +360,7 @@ efi_status_t EFIAPI efi_main(efi_handle_t image,
 		       priv->memmap_desc, priv->memmap_size);
 	add_entry_addr(priv, EFIET_END, NULL, 0, 0, 0);
 
-	memcpy((void *)CONFIG_TEXT_BASE, _binary_u_boot_bin_start,
+	memcpy((void *)CONFIG_PPL_TEXT_BASE, _binary_u_boot_bin_start,
 	       (ulong)_binary_u_boot_bin_end -
 	       (ulong)_binary_u_boot_bin_start);
 
@@ -371,7 +371,7 @@ efi_status_t EFIAPI efi_main(efi_handle_t image,
 	printhex8(priv->info->total_size);
 #endif
 	putc('\n');
-	jump_to_uboot(cs32, CONFIG_TEXT_BASE, (ulong)priv->info);
+	jump_to_uboot(cs32, CONFIG_PPL_TEXT_BASE, (ulong)priv->info);
 
 	return EFI_LOAD_ERROR;
 }
lib/efi_loader/efi_runtime.c +4 -4
index cee96bfc7fc..68abc8f4d4a 100644
@@ -672,12 +672,12 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
 	struct elf_rela *rel = (void*)&__efi_runtime_rel_start;
 #else
 	struct elf_rel *rel = (void*)&__efi_runtime_rel_start;
-	static ulong lastoff = CONFIG_TEXT_BASE;
+	static ulong lastoff = CONFIG_PPL_TEXT_BASE;
 #endif
 
 	debug("%s: Relocating to offset=%lx\n", __func__, offset);
 	for (; (ulong)rel < (ulong)&__efi_runtime_rel_stop; rel++) {
-		ulong base = CONFIG_TEXT_BASE;
+		ulong base = CONFIG_PPL_TEXT_BASE;
 		ulong *p;
 		ulong newaddr;
 
@@ -696,7 +696,7 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
 		switch (rel->info & R_MASK) {
 		case R_RELATIVE:
 #ifdef IS_RELA
-		newaddr = rel->addend + offset - CONFIG_TEXT_BASE;
+		newaddr = rel->addend + offset - CONFIG_PPL_TEXT_BASE;
 #else
 		newaddr = *p - lastoff + offset;
 #endif
@@ -707,7 +707,7 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
 			extern struct dyn_sym __dyn_sym_start[];
 			newaddr = __dyn_sym_start[symidx].addr + offset;
 #ifdef IS_RELA
-			newaddr -= CONFIG_TEXT_BASE;
+			newaddr -= CONFIG_PPL_TEXT_BASE;
 #endif
 			break;
 		}
lib/trace.c +1 -1
index 1091a5793a1..b8d818ae707 100644
@@ -56,7 +56,7 @@ static inline uintptr_t __attribute__((no_instrument_function))
 	if (gd->flags & GD_FLG_RELOC)
 		offset -= gd->relocaddr;
 	else
-		offset -= CONFIG_TEXT_BASE;
+		offset -= CONFIG_PPL_TEXT_BASE;
 #endif
 	return offset / FUNC_SITE_SIZE;
 }
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#77 lore raw

PATCH v3 63/95 x86: Fix up some Kconfig options

In reply to Simon Glass

There are a few inconsistencies in various options on x86. Fix these up so that conversion to a split config is possible:

- use Proper config in irq, timer and environment
- drop the invalid SPL_ in a CONFIG_IS_ENABLED() usage
- use the correct X86_64 option in msr.h

---

(no changes since v1)

 arch/x86/cpu/irq.c           | 4 ++--
 arch/x86/cpu/qemu/qemu.c     | 2 +-
 arch/x86/include/asm/msr.h   | 2 +-
 drivers/timer/tsc_timer.c    | 2 +-
 include/configs/x86-common.h | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
arch/x86/cpu/irq.c +2 -2
index 766b2451a2c..43ffbfeab54 100644
@@ -217,7 +217,7 @@ static int create_pirq_routing_table(struct udevice *dev)
 	priv->irq_mask = fdtdec_get_int(blob, node,
 					"intel,pirq-mask", PIRQ_BITMAP);
 
-	if (IS_ENABLED(CONFIG_GENERATE_ACPI_TABLE)) {
+	if (IS_ENABLED(CONFIG_PPL_GENERATE_ACPI_TABLE)) {
 		/* Reserve IRQ9 for SCI */
 		priv->irq_mask &= ~(1 << 9);
 	}
@@ -347,7 +347,7 @@ int irq_router_probe(struct udevice *dev)
 	pirq_route_irqs(dev, gd->arch.pirq_routing_table->slots,
 			get_irq_slot_count(gd->arch.pirq_routing_table));
 
-	if (IS_ENABLED(CONFIG_GENERATE_ACPI_TABLE))
+	if (IS_ENABLED(CONFIG_PPL_GENERATE_ACPI_TABLE))
 		irq_enable_sci(dev);
 
 	return 0;
arch/x86/cpu/qemu/qemu.c +1 -1
index e54082df7f9..274978c023b 100644
@@ -97,7 +97,7 @@ static void qemu_chipset_init(void)
 	}
 }
 
-#if !CONFIG_IS_ENABLED(SPL_X86_32BIT_INIT)
+#if CONFIG_IS_ENABLED(X86_32BIT_INIT)
 int arch_cpu_init(void)
 {
 	post_code(POST_CPU_INIT);
arch/x86/include/asm/msr.h +1 -1
index 27764fc56cb..eb3ddde8c07 100644
@@ -59,7 +59,7 @@ static inline unsigned long long native_read_tscp(unsigned int *aux)
  * edx:eax, while for x86_64 it doesn't mean rdx:rax or edx:eax. Instead,
  * it means rax *or* rdx.
  */
-#ifdef CONFIG_X86_64
+#if CONFIG_IS_ENABLED(X86_64)
 #define DECLARE_ARGS(val, low, high)	unsigned low, high
 #define EAX_EDX_VAL(val, low, high)	((low) | ((u64)(high) << 32))
 #define EAX_EDX_ARGS(val, low, high)	"a" (low), "d" (high)
drivers/timer/tsc_timer.c +1 -1
index 192c7b71a5a..84cb4ee1593 100644
@@ -376,7 +376,7 @@ void __udelay(unsigned long usec)
 	stop = now + (u64)usec * get_tbclk_mhz();
 
 	while ((int64_t)(stop - get_ticks()) > 0)
-#if defined(CONFIG_QEMU) && defined(CONFIG_SMP)
+#if defined(CONFIG_QEMU) && defined(CONFIG_PPL_SMP)
 		/*
 		 * Add a 'pause' instruction on qemu target,
 		 * to give other VCPUs a chance to run.
include/configs/x86-common.h +1 -1
index c1c5a09a35c..38453e8b74d 100644
@@ -26,7 +26,7 @@
 
 /* Default environment */
 #define CFG_RAMDISK_ADDR	0x4000000
-#if defined(CONFIG_GENERATE_ACPI_TABLE) || defined(CONFIG_EFI_STUB)
+#if defined(CONFIG_PPL_GENERATE_ACPI_TABLE) || defined(CONFIG_EFI_STUB)
 #define CFG_OTHBOOTARGS	"othbootargs=\0"
 #else
 #define CFG_OTHBOOTARGS	"othbootargs=acpi=off\0"
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#78 lore raw

PATCH v3 64/95 Add VPL options for BLOBLIST

In reply to Simon Glass

We can use this feature in VPL, so add some options for it. Also fix a typo in the SPL help while we are here.

---

(no changes since v1)

 common/Kconfig | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)
common/Kconfig +30 -1
index 58008321d53..7d98976416b 100644
@@ -1071,7 +1071,7 @@ choice
 	prompt "Bloblist location in TPL"
 	help
 	  Select the location of the bloblist, via various means. Typically
-	  you should use the same value for SPL as for U-Boot, since they need
+	  you should use the same value for TPL as for U-Boot, since they need
 	  to look in the same place. But if BLOBLIST_ALLOC is used, then a
 	  fresh bloblist will be created each time, since there is no shared
 	  address (between phases) for the bloblist.
@@ -1094,6 +1094,35 @@ endchoice
 
 endif # TPL_BLOBLIST
 
+if VPL_BLOBLIST
+
+choice
+	prompt "Bloblist location in VPL"
+	help
+	  Select the location of the bloblist, via various means. Typically
+	  you should use the same value for VPL as for U-Boot, since they need
+	  to look in the same place. But if BLOBLIST_ALLOC is used, then a
+	  fresh bloblist will be created each time, since there is no shared
+	  address (between phases) for the bloblist.
+
+config VPL_BLOBLIST_FIXED
+	bool "Place bloblist at a fixed address in memory"
+	help
+	  Select this to used a fixed memory address for the bloblist. If the
+	  bloblist exists at this address from a previous phase, it used as is.
+	  If not it is created at this address in VPL.
+
+config VPL_BLOBLIST_ALLOC
+	bool "Allocate bloblist"
+	help
+	  Allocate the bloblist using malloc(). This avoids the need to
+	  specify a fixed address on systems where this is unknown or can
+	  change at runtime.
+
+endchoice
+
+endif # VPL_BLOBLIST
+
 endmenu
 
 source "common/spl/Kconfig"
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#79 lore raw

PATCH v3 65/95 omap: Correct an SPL build error with watchdog

In reply to Simon Glass

The logic here is strange since the call to hw_watchdog_init() depends on CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG but the code it calls is only enabled if !CONFIG_IS_ENABLED(WDT). This seems to work, but with split config we get a build error in SPL with CONFIG_WATCHDOG, since it is interpreted as CONFIG_SPL_WATCHDOG.

To mimic the behaviour before split config takes effect, use the PPL_WATCHDOG symbol.

---

(no changes since v1)

 arch/arm/mach-omap2/boot-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/boot-common.c +1 -1
index 9a342a1bf95..401d12c6ca3 100644
@@ -302,7 +302,7 @@ void spl_board_init(void)
 #if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW)
 	arch_misc_init();
 #endif
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_PPL_WATCHDOG)
 	hw_watchdog_init();
 #endif
 #ifdef CONFIG_AM33XX
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#80 lore raw

Re: [PATCH v3 65/95] omap: Correct an SPL build error with watchdog

Quoted 22 lines · Simon Glass

The logic here is strange since the call to hw_watchdog_init() depends on CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG but the code it calls is only enabled if !CONFIG_IS_ENABLED(WDT). This seems to work, but with split config we get a build error in SPL with CONFIG_WATCHDOG, since it is interpreted as CONFIG_SPL_WATCHDOG.

To mimic the behaviour before split config takes effect, use the PPL_WATCHDOG symbol.

---

(no changes since v1)

 arch/arm/mach-omap2/boot-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/boot-common.c +0 -0
index 9a342a1bf95..401d12c6ca3 100644

arch/arm/mach-omap2/boot-common.c void spl_board_init(void) · line 308

Quoted 8 lines
arch/arm/mach-omap2/boot-common.c +1 -1
@@ -302,7 +302,7 @@ void spl_board_init(void)
 #if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW)
 	arch_misc_init();
 #endif
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_PPL_WATCHDOG)
 	hw_watchdog_init();
 #endif
 #ifdef CONFIG_AM33XX

No, we want watchdog enabled in SPL.

Signature · 1 line
Tom
#81 lore raw

Re: [PATCH v3 65/95] omap: Correct an SPL build error with watchdog

Quoted 18 lines · Tom Rini
Quoted 17 lines · Simon Glass

The logic here is strange since the call to hw_watchdog_init() depends on CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG but the code it calls is only enabled if !CONFIG_IS_ENABLED(WDT). This seems to work, but with split config we get a build error in SPL with CONFIG_WATCHDOG, since it is interpreted as CONFIG_SPL_WATCHDOG.

To mimic the behaviour before split config takes effect, use the PPL_WATCHDOG symbol.

---

(no changes since v1)

 arch/arm/mach-omap2/boot-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

arch/arm/mach-omap2/boot-common.c void spl_board_init(void) · line 308

Quoted 13 lines
arch/arm/mach-omap2/boot-common.c +1 -1
index 9a342a1bf95..401d12c6ca3 100644
@@ -302,7 +302,7 @@ void spl_board_init(void)
 #if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW)
 	arch_misc_init();
 #endif
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_PPL_WATCHDOG)
 	hw_watchdog_init();
 #endif
 #ifdef CONFIG_AM33XX

No, we want watchdog enabled in SPL.

Or perhaps, the same question as in the socfpga patch also applies here.

Signature · 1 line
Tom
#82 lore raw

Re: [PATCH v3 65/95] omap: Correct an SPL build error with watchdog

Hi Tom,

Quoted 36 lines · Tom Rini
Quoted 18 lines · Tom Rini
Quoted 17 lines · Simon Glass

The logic here is strange since the call to hw_watchdog_init() depends on CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG but the code it calls is only enabled if !CONFIG_IS_ENABLED(WDT). This seems to work, but with split config we get a build error in SPL with CONFIG_WATCHDOG, since it is interpreted as CONFIG_SPL_WATCHDOG.

To mimic the behaviour before split config takes effect, use the PPL_WATCHDOG symbol.

---

(no changes since v1)

 arch/arm/mach-omap2/boot-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

arch/arm/mach-omap2/boot-common.c void spl_board_init(void) · line 308

Quoted 13 lines
arch/arm/mach-omap2/boot-common.c +1 -1
index 9a342a1bf95..401d12c6ca3 100644
@@ -302,7 +302,7 @@ void spl_board_init(void)
 #if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW)
    arch_misc_init();
 #endif
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_PPL_WATCHDOG)
    hw_watchdog_init();
 #endif
 #ifdef CONFIG_AM33XX

No, we want watchdog enabled in SPL.

Quoted 1 line

Or perhaps, the same question as in the socfpga patch also applies here.

Yes and with a similar answer. By using PPL_WATCHDOG we ensure that the code is enabled in SPL as well as PPL.

I am not sure what the plan is for getting rid of the old watchdog stuff.

+Stefan Roese for that

Regards,
Simon

#83 lore raw

Re: [PATCH v3 65/95] omap: Correct an SPL build error with watchdog

Hi Simon & Tom,

Quoted 39 lines · Simon Glass

Hi Tom,

Quoted 36 lines · Tom Rini
Quoted 33 lines · Tom Rini
Quoted 22 lines · Simon Glass

The logic here is strange since the call to hw_watchdog_init() depends on CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG but the code it calls is only enabled if !CONFIG_IS_ENABLED(WDT). This seems to work, but with split config we get a build error in SPL with CONFIG_WATCHDOG, since it is interpreted as CONFIG_SPL_WATCHDOG.

To mimic the behaviour before split config takes effect, use the PPL_WATCHDOG symbol.

---

(no changes since v1)

  arch/arm/mach-omap2/boot-common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-omap2/boot-common.c +0 -0
index 9a342a1bf95..401d12c6ca3 100644

arch/arm/mach-omap2/boot-common.c void spl_board_init(void) · line 308

Quoted 8 lines
arch/arm/mach-omap2/boot-common.c +1 -1
@@ -302,7 +302,7 @@ void spl_board_init(void)
  #if defined(CONFIG_AM33XX) && defined(CONFIG_SPL_MUSB_NEW)
     arch_misc_init();
  #endif
-#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
+#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_PPL_WATCHDOG)
     hw_watchdog_init();
  #endif
  #ifdef CONFIG_AM33XX

No, we want watchdog enabled in SPL.

Quoted 8 lines
Quoted 1 line

Or perhaps, the same question as in the socfpga patch also applies here.

Yes and with a similar answer. By using PPL_WATCHDOG we ensure that the code is enabled in SPL as well as PPL.

I am not sure what the plan is for getting rid of the old watchdog stuff.

+Stefan Roese for that

Frankly, I don't know what PPL_WATCHDOG is. Searching the current code base shows nothing.

As to the plans of getting rid of the old watchdog stuff (HW_WATCHDOG):

My understanding is that this can't easily be removed. HW_WATCHDOG mostly addresses platforms which use (need to use) a very early watchdog driver. This can't be solved (easily) with the normal WDT UCLASS driver. This problem is similar to the early timer functionality AFAIU.

Perhaps it makes sense to at least rename all this HW_WATCHDOG stuff to some "early" names instead. I'm not 100% sure here though.

Ideas and comments are welcome.

Thanks,
Stefan

#84 lore raw

PATCH v3 66/95 freescale: pm9g45: Fix problems with ls1021aqds_nand et al

In reply to Simon Glass

These boards need to access the 'proper' symbol for NAND_BOOT, to avoid build errors in SPL. Fix this up.

Also fix pm9g45 which has the same problem.

Drop the unnecessary condition in fdt_support.h to avoid needing to do something clever there too.

---

(no changes since v1)

 board/freescale/ls1021aqds/ls1021aqds.c | 2 +-
 include/configs/cgtqmx8.h               | 2 +-
 include/configs/imx8qm_rom7720.h        | 2 +-
 include/configs/ls1021aqds.h            | 2 +-
 include/configs/ls1043a_common.h        | 2 +-
 include/configs/ls1043aqds.h            | 4 ++--
 include/configs/ls1043ardb.h            | 4 ++--
 include/configs/ls1046a_common.h        | 2 +-
 include/configs/ls1046aqds.h            | 4 ++--
 include/configs/ls2080a_common.h        | 2 +-
 include/configs/ls2080aqds.h            | 2 +-
 include/configs/pm9g45.h                | 2 +-
 include/fdt_support.h                   | 2 +-
 13 files changed, 16 insertions(+), 16 deletions(-)
board/freescale/ls1021aqds/ls1021aqds.c +1 -1
index d5cb7312095..4336285e288 100644
@@ -184,7 +184,7 @@ int board_early_init_f(void)
 #ifdef CONFIG_SPL_BUILD
 void board_init_f(ulong dummy)
 {
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 	struct ccsr_gur __iomem *gur = (void *)CFG_SYS_FSL_GUTS_ADDR;
 	u32 porsr1, pinctl;
 
include/configs/cgtqmx8.h +1 -1
index 98d4d8cf4bd..64bd5f6d3b6 100644
@@ -33,7 +33,7 @@
 	"m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0\0" \
 	"m4boot_1=run loadm4image_1; dcache flush; bootaux ${loadaddr} 1\0" \
 
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define MFG_NAND_PARTITION "mtdparts=gpmi-nand:128m(boot),32m(kernel),16m(dtb),8m(misc),-(rootfs) "
 #else
 #define MFG_NAND_PARTITION ""
include/configs/imx8qm_rom7720.h +1 -1
index df2cb8d9ced..df77adf7739 100644
@@ -27,7 +27,7 @@
 	"m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0\0" \
 	"m4boot_1=run loadm4image_1; dcache flush; bootaux ${loadaddr} 1\0" \
 
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define MFG_NAND_PARTITION "mtdparts=gpmi-nand:128m(boot),32m(kernel),16m(dtb),8m(misc),-(rootfs) "
 #else
 #define MFG_NAND_PARTITION ""
include/configs/ls1021aqds.h +1 -1
index 451913e8fa6..58baa95d709 100644
@@ -10,7 +10,7 @@
 #define CFG_SYS_INIT_RAM_ADDR	OCRAM_BASE_ADDR
 #define CFG_SYS_INIT_RAM_SIZE	OCRAM_SIZE
 
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_NAND_U_BOOT_SIZE	(400 << 10)
 #define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
 #define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
include/configs/ls1043a_common.h +1 -1
index dcdd99cf714..40dbf477ecd 100644
@@ -42,7 +42,7 @@
 #define CFG_SYS_NS16550_CLK          (get_serial_clock())
 
 /* NAND SPL */
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
 #define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 #endif
include/configs/ls1043aqds.h +2 -2
index 7ccbb20bf2e..0b95970bbb9 100644
@@ -105,7 +105,7 @@
 #define CFG_SYS_NAND_BASE_LIST	{ CFG_SYS_NAND_BASE }
 #endif
 
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_NAND_U_BOOT_SIZE	(640 << 10)
 #endif
 
@@ -196,7 +196,7 @@
 #define CFG_SYS_CS3_FTIM2		CFG_SYS_FPGA_FTIM2
 #define CFG_SYS_CS3_FTIM3		CFG_SYS_FPGA_FTIM3
 #else
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_CSPR0_EXT		CFG_SYS_NAND_CSPR_EXT
 #define CFG_SYS_CSPR0		CFG_SYS_NAND_CSPR
 #define CFG_SYS_AMASK0		CFG_SYS_NAND_AMASK
include/configs/ls1043ardb.h +2 -2
index 60362b6a4d0..611fa510c17 100644
@@ -77,7 +77,7 @@
 
 #define CFG_SYS_NAND_BASE_LIST	{ CFG_SYS_NAND_BASE }
 
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_NAND_U_BOOT_SIZE	(1024 << 10)
 #endif
 
@@ -128,7 +128,7 @@
 #define CFG_SYS_CS1_FTIM2		CFG_SYS_NAND_FTIM2
 #define CFG_SYS_CS1_FTIM3		CFG_SYS_NAND_FTIM3
 #else
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_CSPR0_EXT		CFG_SYS_NAND_CSPR_EXT
 #define CFG_SYS_CSPR0		CFG_SYS_NAND_CSPR
 #define CFG_SYS_AMASK0		CFG_SYS_NAND_AMASK
include/configs/ls1046a_common.h +1 -1
index fb04531cb85..3f1e845fa5a 100644
@@ -42,7 +42,7 @@
 #define CFG_SYS_NS16550_CLK          (get_serial_clock())
 
 /* NAND SPL */
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_NAND_U_BOOT_DST	CONFIG_PPL_TEXT_BASE
 #define CFG_SYS_NAND_U_BOOT_START	CONFIG_PPL_TEXT_BASE
 #endif
include/configs/ls1046aqds.h +2 -2
index 57c439bc562..23aac2ad92f 100644
@@ -121,7 +121,7 @@
 #define CFG_SYS_NAND_BASE_LIST	{ CFG_SYS_NAND_BASE }
 #endif
 
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_NAND_U_BOOT_SIZE	(768 << 10)
 #endif
 
@@ -212,7 +212,7 @@
 #define CFG_SYS_CS3_FTIM2		CFG_SYS_FPGA_FTIM2
 #define CFG_SYS_CS3_FTIM3		CFG_SYS_FPGA_FTIM3
 #else
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_CSPR0_EXT		CFG_SYS_NAND_CSPR_EXT
 #define CFG_SYS_CSPR0		CFG_SYS_NAND_CSPR
 #define CFG_SYS_AMASK0		CFG_SYS_NAND_AMASK
include/configs/ls2080a_common.h +1 -1
index f086b3b7bb7..b63d191b6e9 100644
@@ -124,7 +124,7 @@ unsigned long long get_qixis_addr(void);
 	"mcinitcmd=fsl_mc start mc 0x580a00000"	\
 	" 0x580e00000 \0"
 
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 #define CFG_SYS_NAND_U_BOOT_DST	0x80400000
 #define CFG_SYS_NAND_U_BOOT_START	CFG_SYS_NAND_U_BOOT_DST
 #endif
include/configs/ls2080aqds.h +1 -1
index 7ad2432a775..6ea791c79ef 100644
@@ -139,7 +139,7 @@
 #define CFG_SYS_CS3_FTIM3		0x0
 
 #if defined(CONFIG_SPL)
-#if defined(CONFIG_NAND_BOOT)
+#if defined(CONFIG_PPL_NAND_BOOT)
 #define CFG_SYS_CSPR1_EXT		CFG_SYS_NOR0_CSPR_EXT
 #define CFG_SYS_CSPR1		CFG_SYS_NOR0_CSPR_EARLY
 #define CFG_SYS_CSPR1_FINAL		CFG_SYS_NOR0_CSPR
include/configs/pm9g45.h +1 -1
index 686411eee2e..c177eafd74e 100644
@@ -34,7 +34,7 @@
 #define CFG_SYS_NAND_READY_PIN		AT91_PIN_PD3
 #endif
 
-#ifdef CONFIG_NAND_BOOT
+#ifdef CONFIG_PPL_NAND_BOOT
 /* bootstrap + u-boot + env in nandflash */
 #elif CONFIG_SD_BOOT
 /* bootstrap + u-boot + env + linux in mmc */
include/fdt_support.h +1 -1
index 5638bd4f165..ba79f47d004 100644
@@ -7,7 +7,7 @@
 #ifndef __FDT_SUPPORT_H
 #define __FDT_SUPPORT_H
 
-#if defined(CONFIG_OF_LIBFDT) && !defined(USE_HOSTCC)
+#if !defined(USE_HOSTCC)
 
 #include <asm/u-boot.h>
 #include <linux/libfdt.h>
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#85 lore raw

PATCH v3 67/95 imx: watchdog: Correct watchdog error condition

In reply to Simon Glass

This is intended to make sure that one of the conditions is met, but causes a build error with imx6qdl_icore_mmc.

Fix it by using the PPL condition instead, so that nothing changes when building for SPL with split config.

In fact we should drop the old watchdog code and just use the new watchdog uclass.

---

(no changes since v1)

 include/watchdog.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/watchdog.h +1 -1
index ac5f11e376f..f000bdfae80 100644
@@ -28,7 +28,7 @@ int init_func_watchdog_reset(void);
 #define INIT_FUNC_WATCHDOG_RESET
 #endif
 
-#if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_WATCHDOG)
+#if defined(CONFIG_HW_WATCHDOG) && defined(CONFIG_PPL_WATCHDOG)
 #  error "Configuration error: CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG can't be used together."
 #endif
 
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#86 lore raw

PATCH v3 68/95 socfpga: Use the correct condition for SYS_L2_PL310

In reply to Simon Glass

Update this to use the PPL condition instead, so that nothing changes when building for SPL with split config.

---

(no changes since v1)

 arch/arm/mach-socfpga/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/misc.c +2 -2
index 5b5a81a255d..b09b898051b 100644
@@ -32,7 +32,7 @@ phys_addr_t socfpga_clkmgr_base __section(".data");
 phys_addr_t socfpga_rstmgr_base __section(".data");
 phys_addr_t socfpga_sysmgr_base __section(".data");
 
-#ifdef CONFIG_SYS_L2_PL310
+#ifdef CONFIG_PPL_SYS_L2_PL310
 static const struct pl310_regs *const pl310 =
 	(struct pl310_regs *)CFG_SYS_PL310_BASE;
 #endif
@@ -66,7 +66,7 @@ void enable_caches(void)
 #endif
 }
 
-#ifdef CONFIG_SYS_L2_PL310
+#ifdef CONFIG_PPL_SYS_L2_PL310
 void v7_outer_cache_enable(void)
 {
 	struct udevice *dev;
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#87 lore raw

Re: [PATCH v3 68/95] socfpga: Use the correct condition for SYS_L2_PL310

Quoted 25 lines · Simon Glass

Update this to use the PPL condition instead, so that nothing changes when building for SPL with split config.

---

(no changes since v1)

 arch/arm/mach-socfpga/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/misc.c +1 -1
index 5b5a81a255d..b09b898051b 100644
@@ -32,7 +32,7 @@ phys_addr_t socfpga_clkmgr_base __section(".data");
 phys_addr_t socfpga_rstmgr_base __section(".data");
 phys_addr_t socfpga_sysmgr_base __section(".data");
 
-#ifdef CONFIG_SYS_L2_PL310
+#ifdef CONFIG_PPL_SYS_L2_PL310
 static const struct pl310_regs *const pl310 =
 	(struct pl310_regs *)CFG_SYS_PL310_BASE;
 #endif

arch/arm/mach-socfpga/misc.c void enable_caches(void) · line 72

Quoted 8 lines
arch/arm/mach-socfpga/misc.c +1 -1
@@ -66,7 +66,7 @@ void enable_caches(void)
 #endif
 }
 
-#ifdef CONFIG_SYS_L2_PL310
+#ifdef CONFIG_PPL_SYS_L2_PL310
 void v7_outer_cache_enable(void)
 {
 	struct udevice *dev;

Why can we not continue to use CONFIG_SYS_L2_PL310 in this case?

Signature · 1 line
Tom
#88 lore raw

Re: [PATCH v3 68/95] socfpga: Use the correct condition for SYS_L2_PL310

Hi Tom,

Quoted 31 lines · Tom Rini
Quoted 28 lines · Simon Glass

Update this to use the PPL condition instead, so that nothing changes when building for SPL with split config.

---

(no changes since v1)

 arch/arm/mach-socfpga/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/misc.c +1 -1
index 5b5a81a255d..b09b898051b 100644
@@ -32,7 +32,7 @@ phys_addr_t socfpga_clkmgr_base __section(".data");
 phys_addr_t socfpga_rstmgr_base __section(".data");
 phys_addr_t socfpga_sysmgr_base __section(".data");
 
-#ifdef CONFIG_SYS_L2_PL310
+#ifdef CONFIG_PPL_SYS_L2_PL310
 static const struct pl310_regs *const pl310 =
      (struct pl310_regs *)CFG_SYS_PL310_BASE;
 #endif
@@ -66,7 +66,7 @@ void enable_caches(void)
 #endif
 }
 
Quoted 7 lines

arch/arm/mach-socfpga/misc.c void enable_caches(void) · line 72

Quoted 5 lines
arch/arm/mach-socfpga/misc.c +1 -1
-#ifdef CONFIG_SYS_L2_PL310
+#ifdef CONFIG_PPL_SYS_L2_PL310
 void v7_outer_cache_enable(void)
 {
      struct udevice *dev;

Why can we not continue to use CONFIG_SYS_L2_PL310 in this case?

This is because the code is compiled for SPL too, iwc that option is not enabled with split config.

For now I'll move it to the mythical 'splg' series (that actually does split config)

Regards,
Simon

#89 lore raw

Re: [PATCH v3 68/95] socfpga: Use the correct condition for SYS_L2_PL310

Quoted 42 lines · Simon Glass

Hi Tom,

Quoted 31 lines · Tom Rini
Quoted 28 lines · Simon Glass

Update this to use the PPL condition instead, so that nothing changes when building for SPL with split config.

---

(no changes since v1)

 arch/arm/mach-socfpga/misc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/misc.c +1 -1
index 5b5a81a255d..b09b898051b 100644
@@ -32,7 +32,7 @@ phys_addr_t socfpga_clkmgr_base __section(".data");
 phys_addr_t socfpga_rstmgr_base __section(".data");
 phys_addr_t socfpga_sysmgr_base __section(".data");
 
-#ifdef CONFIG_SYS_L2_PL310
+#ifdef CONFIG_PPL_SYS_L2_PL310
 static const struct pl310_regs *const pl310 =
      (struct pl310_regs *)CFG_SYS_PL310_BASE;
 #endif
@@ -66,7 +66,7 @@ void enable_caches(void)
 #endif
 }
 
Quoted 7 lines

arch/arm/mach-socfpga/misc.c void enable_caches(void) · line 72

Quoted 5 lines
arch/arm/mach-socfpga/misc.c +1 -1
-#ifdef CONFIG_SYS_L2_PL310
+#ifdef CONFIG_PPL_SYS_L2_PL310
 void v7_outer_cache_enable(void)
 {
      struct udevice *dev;

Why can we not continue to use CONFIG_SYS_L2_PL310 in this case?

Quoted 5 lines

This is because the code is compiled for SPL too, iwc that option is not enabled with split config.

For now I'll move it to the mythical 'splg' series (that actually does split config)

That this is discarded normally, today, as seems intentional:

$ make socfpga_socrates_defconfig
#
# configuration written to .config
#
$ grep PL310 .config
CONFIG_SYS_L2_PL310=y
# CONFIG_SPL_SYS_L2_PL310 is not set
$

But needs changes like this with split config is worrisome.

Signature · 1 line
Tom
#90 lore raw

PATCH v3 69/95 rockchip: Avoid checking environment without ENV_SUPPORT

In reply to Simon Glass

With split config, this causes a build error in SPL where the environment may not be enabled. It affects two rk3399 boards. Add a condition.

---

(no changes since v1)

 board/theobroma-systems/puma_rk3399/puma-rk3399.c     | 2 +-
 board/theobroma-systems/ringneck_px30/ringneck-px30.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
board/theobroma-systems/puma_rk3399/puma-rk3399.c +1 -1
index 97f398bd754..34839dcb9f1 100644
@@ -136,7 +136,7 @@ int mmc_get_env_dev(void)
 	return CONFIG_SYS_MMC_ENV_DEV;
 }
 
-#if !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
+#if IS_ENABLED(CONFIG_ENV_SUPPORT) && !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
 #error Please enable CONFIG_ENV_IS_NOWHERE
 #endif
 
board/theobroma-systems/ringneck_px30/ringneck-px30.c +1 -1
index 47d1a40ef7c..9eb2fcfc48f 100644
@@ -118,7 +118,7 @@ int mmc_get_env_dev(void)
 	return CONFIG_SYS_MMC_ENV_DEV;
 }
 
-#if !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
+#if IS_ENABLED(CONFIG_ENV_SUPPORT) && !IS_ENABLED(CONFIG_ENV_IS_NOWHERE)
 #error Please enable CONFIG_ENV_IS_NOWHERE
 #endif
 
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#91 lore raw

PATCH v3 70/95 freescale: Drop old pre-DM_ETH code

In reply to Simon Glass

This is used by ls1021atwr_sdcard_ifc_SECURE_BOOT with split config, but is not needed anymore, since Ethernet migration is complete. Drop it.

---

(no changes since v1)

 arch/arm/cpu/armv7/ls102xa/fdt.c | 12 ------------
 1 file changed, 12 deletions(-)
arch/arm/cpu/armv7/ls102xa/fdt.c +0 -12
index 1871acdce44..7189c7d4423 100644
@@ -25,11 +25,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void ft_fixup_enet_phy_connect_type(void *fdt)
 {
-#ifdef CONFIG_DM_ETH
 	struct udevice *dev;
-#else
-	struct eth_device *dev;
-#endif
 	struct tsec_private *priv;
 	const char *enet_path, *phy_path;
 	char enet[16];
@@ -37,12 +33,8 @@ void ft_fixup_enet_phy_connect_type(void *fdt)
 	int phy_node;
 	int i = 0;
 	uint32_t ph;
-#ifdef CONFIG_DM_ETH
 	char *name[3] = { "ethernet@2d10000", "ethernet@2d50000",
 			  "ethernet@2d90000" };
-#else
-	char *name[3] = { "eTSEC1", "eTSEC2", "eTSEC3" };
-#endif
 
 	for (; i < ARRAY_SIZE(name); i++) {
 		dev = eth_get_dev_by_name(name[i]);
@@ -53,11 +45,7 @@ void ft_fixup_enet_phy_connect_type(void *fdt)
 			continue;
 		}
 
-#ifdef CONFIG_DM_ETH
 		priv = dev_get_priv(dev);
-#else
-		priv = dev->priv;
-#endif
 		if (priv->flags & TSEC_SGMII)
 			continue;
 
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#92 lore raw

PATCH v3 71/95 imx: Use SATA instead of CMD_SATA

In reply to Simon Glass

This causes a build failure on mx6cuboxi with split config, since CMD_SATA shows up as enabled in SPl (because there is no SPL_CMD_SATA).

The condition is wrong anyway, so change it to use SATA instead.

---

(no changes since v1)

 board/solidrun/mx6cuboxi/mx6cuboxi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/solidrun/mx6cuboxi/mx6cuboxi.c +1 -1
index 7c44379ec4a..cb14c2f30c9 100644
@@ -275,7 +275,7 @@ int board_early_init_f(void)
 {
 	setup_iomux_uart();
 
-#ifdef CONFIG_CMD_SATA
+#ifdef CONFIG_SATA
 	setup_sata();
 #endif
 	setup_fec();
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#93 lore raw

PATCH v3 72/95 net: Add an SPL config for atheros

In reply to Simon Glass

Add a new SPL_PHY_ATHEROS to avoid a build error on am335x_evm with split config.

---

(no changes since v1)

 drivers/net/phy/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/Kconfig +3 -0
index 5eaff053a09..6806e3c0903 100644
@@ -106,6 +106,9 @@ config PHY_AQUANTIA_FW_NAME
 config PHY_ATHEROS
 	bool "Atheros Ethernet PHYs support"
 
+config SPL_PHY_ATHEROS
+	bool "Atheros Ethernet PHYs support (SPL)"
+
 config PHY_BROADCOM
 	bool "Broadcom Ethernet PHYs support"
 
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
Reviewed-by on v3 72/95
#94 lore raw

Re: [PATCH v3 72/95] net: Add an SPL config for atheros

Quoted 27 lines · Simon Glass

Add a new SPL_PHY_ATHEROS to avoid a build error on am335x_evm with split config.

---

(no changes since v1)

 drivers/net/phy/Kconfig | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/phy/Kconfig +3 -1
index 5eaff053a09..6806e3c0903 100644
@@ -106,6 +106,9 @@ config PHY_AQUANTIA_FW_NAME
 config PHY_ATHEROS
        bool "Atheros Ethernet PHYs support"
 
+config SPL_PHY_ATHEROS
+       bool "Atheros Ethernet PHYs support (SPL)"
+
 config PHY_BROADCOM
        bool "Broadcom Ethernet PHYs support"
 
--
Quoted 2 lines

2.39.1.581.gbfd45094c4-goog

#95 lore raw

PATCH v3 73/95 freescale: Fix odd use of ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE

In reply to Simon Glass

This is not a CONFIG option so we should not be using IS_ENABLED() on it, particularly not when it is not defined to anything, so shows up as calling IS_ENABLED() with no arguments.

Just check it normally.

This fixes a build error with split config on T2080QDS.

---

(no changes since v1)

 drivers/mmc/fsl_esdhc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/fsl_esdhc.c +3 -2
index d5066666698..7215f61f468 100644
@@ -325,8 +325,9 @@ static int esdhc_setup_data(struct fsl_esdhc_priv *priv, struct mmc *mmc,
 	    (timeout == 4 || timeout == 8 || timeout == 12))
 		timeout++;
 
-	if (IS_ENABLED(ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE))
-		timeout = 0xE;
+#ifdef ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE
+	timeout = 0xE;
+#endif
 
 	esdhc_clrsetbits32(&regs->sysctl, SYSCTL_TIMEOUT_MASK, timeout << 16);
 
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#96 lore raw

PATCH v3 74/95 serial: Support ns16550 driver in TPL

In reply to Simon Glass

Add options for this since they are needed by P1020RDB-PC_NAND.

---

(no changes since v1)

 drivers/serial/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/serial/Kconfig +6 -0
index bb5083201b3..6f40c051604 100644
@@ -731,6 +731,12 @@ config SPL_SYS_NS16550_SERIAL
 	default y if SYS_NS16550_SERIAL || ARCH_SUNXI || ARCH_OMAP2PLUS
 	select SYS_NS16550
 
+config TPL_SYS_NS16550_SERIAL
+	bool "NS16550 UART or compatible legacy driver in TPL"
+	depends on TPL && !TPL_DM_SERIAL
+	default y if SYS_NS16550_SERIAL || ARCH_SUNXI || ARCH_OMAP2PLUS
+	select SYS_NS16550
+
 config SYS_NS16550
 	bool "NS16550 UART or compatible"
 	help
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#97 lore raw

PATCH v3 75/95 pci: Use the correct symbol to enable struct members

In reply to Simon Glass

This ends up being quite complicated since we have various pieces of code assuming that it can access the members and the conditions may not line up with SPL_PCI and serial SPL_ configs.

Fix it by using a PPL condition, so that the condition does not change when split config is enabled.

---

(no changes since v1)

 include/asm-generic/global_data.h | 2 +-
 include/ns16550.h                 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/asm-generic/global_data.h +1 -1
index da17ac8cbc8..7856d8cc33e 100644
@@ -315,7 +315,7 @@ struct global_data {
 	 */
 	unsigned long malloc_ptr;
 #endif
-#ifdef CONFIG_PCI
+#ifdef CONFIG_PPL_PCI
 	/**
 	 * @hose: PCI hose for early use
 	 */
include/ns16550.h +1 -1
index e7e68663d03..552db4da2ad 100644
@@ -74,7 +74,7 @@ struct ns16550_plat {
 	int clock;
 	u32 fcr;
 	int flags;
-#if defined(CONFIG_PCI) && defined(CONFIG_SPL)
+#if defined(CONFIG_PPL_PCI) && defined(CONFIG_SPL)
 	int bdf;
 #endif
 };
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#98 lore raw

PATCH v3 76/95 x86: Fix monitor base for split config

In reply to Simon Glass

This currently makes SPL refer to its own address. Use the PPL symbol to avoid this.

---

(no changes since v1)

 arch/x86/cpu/intel_common/car2.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/cpu/intel_common/car2.S +2 -2
index f8cf78586d0..c4f64b17694 100644
@@ -443,6 +443,6 @@ ucode_base:	/* Declared in microcode.h */
 .globl ucode_size
 ucode_size:	/* Declared in microcode.h */
 	.long	0			/* microcode size */
-	.long	CONFIG_SYS_MONITOR_BASE	/* code region base */
-	.long	CONFIG_SYS_MONITOR_LEN	/* code region size */
+	.long	CONFIG_PPL_SYS_MONITOR_BASE	/* code region base */
+	.long	CONFIG_PPL_SYS_MONITOR_LEN	/* code region size */
 #endif
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#99 lore raw

PATCH v3 77/95 dm: Add a TPL symbol for simple-bus

In reply to Simon Glass

This is used in some x86 code, so add a symbol for it.

---

(no changes since v1)

 drivers/core/Kconfig | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/core/Kconfig +7 -0
index f1ef5cd35f3..ae4f184b93f 100644
@@ -305,6 +305,13 @@ config SPL_SIMPLE_BUS
 	  Supports the 'simple-bus' driver, which is used on some systems
 	  in SPL.
 
+config TPL_SIMPLE_BUS
+	bool "Support simple-bus driver in TPL"
+	depends on TPL_DM && TPL_OF_CONTROL
+	help
+	  Supports the 'simple-bus' driver, which is used on some systems
+	  in TPL.
+
 config SIMPLE_BUS_CORRECT_RANGE
 	bool "Decode the 'simple-bus' <range> by honoring the #address-cells and #size-cells"
 	depends on SIMPLE_BUS
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#100 lore raw

PATCH v3 78/95 x86: coral: Avoid build errors with missing SPL symbols

In reply to Simon Glass

With split config this does not build due to the missing symbols. Add them and fix the PCI condition.

---

(no changes since v1)

 arch/x86/cpu/Makefile              | 2 +-
 configs/chromebook_coral_defconfig | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/x86/cpu/Makefile +1 -1
index 16e67e3da24..6f36281c970 100644
@@ -63,7 +63,7 @@ ifndef CONFIG_$(SPL_)X86_64
 obj-$(CONFIG_$(SPL_)SMP) += mp_init.o
 endif
 obj-y += mtrr.o
-obj-$(CONFIG_PCI) += pci.o
+obj-$(CONFIG_PPL_PCI) += pci.o
 ifndef CONFIG_$(SPL_)X86_64
 obj-$(CONFIG_SMP) += sipi_vector.o
 endif
configs/chromebook_coral_defconfig +3 -0
index 401506e2193..f5995f22004 100644
@@ -87,6 +87,7 @@ CONFIG_TFTP_TSIZE=y
 CONFIG_USE_ROOTPATH=y
 CONFIG_REGMAP=y
 CONFIG_SYSCON=y
+CONFIG_TPL_SIMPLE_BUS=y
 CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_LBA48=y
 CONFIG_SYS_64BIT_LBA=y
@@ -96,6 +97,8 @@ CONFIG_SYS_I2C_DW=y
 CONFIG_MISC=y
 CONFIG_CROS_EC=y
 CONFIG_CROS_EC_LPC=y
+CONFIG_SPL_P2SB=y
+CONFIG_TPL_P2SB=y
 CONFIG_SPI_FLASH_WINBOND=y
 # CONFIG_X86_PCH7 is not set
 # CONFIG_X86_PCH9 is not set
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#101 lore raw

PATCH v3 79/95 power: wanderboard: Correct conditions for split config

In reply to Simon Glass

This currently causes a build error with wanderboard. Fix it by adding a missing CONFIG and correcting the build condition so that it does not change when building SPL.

---

(no changes since v1)

 configs/wandboard_defconfig | 1 +
 include/power/pmic.h        | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)
configs/wandboard_defconfig +1 -0
index a6baff1e24c..05383f6e47b 100644
@@ -71,6 +71,7 @@ CONFIG_MII=y
 CONFIG_PINCTRL=y
 CONFIG_PINCTRL_IMX6=y
 CONFIG_DM_PMIC=y
+CONFIG_SPL_DM_PMIC=y
 CONFIG_DM_PMIC_PFUZE100=y
 CONFIG_DM_SCSI=y
 CONFIG_DM_SERIAL=y
include/power/pmic.h +1 -2
index 70f2709bd0b..f3045f82ad7 100644
@@ -85,8 +85,7 @@ struct pmic {
 };
 #endif /* CONFIG_IS_ENABLED(POWER_LEGACY) */
 
-/* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */
-#ifdef CONFIG_DM_PMIC
+#ifdef CONFIG_PPL_DM_PMIC
 /**
  * U-Boot PMIC Framework
  * =====================
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
maintainer
#102 lore raw

Re: [PATCH v3 79/95] power: wanderboard: Correct conditions for split config

Quoted 2 lines · Simon Glass

This currently causes a build error with wanderboard. Fix it by adding a

A typo here and in the Subject, it is "wandboard".

#103 lore raw

PATCH v3 81/95 Allow distroboot environment to be the same in SPL

In reply to Simon Glass

With the split config, we find that CONFIG_CMD_DHCP is not enabled in SPL. While this is normally correct, it causes a build error with BOOT_TARGET_DEVICES_references_PXE_without_CONFIG_CMD_DHCP_or_PXE

This is because some boards include PXE and DHXP in their BOOT_TARGET_DEVICES #define. Before split config CONFIG_CMD_DHCP is enabled in SPL, but with split config it is not, since we don't support any commands in SPL.

The easiest way to fix this seems to be to use the CONFIG_PPL_... form. This retains the existing behaviour.

---

Changes in v3:
- Add new patch to allow distroboot environment to be the same in SPL

 include/config_distro_bootcmd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/config_distro_bootcmd.h +2 -2
index 9d2a225e7eb..801c481f432 100644
@@ -328,7 +328,7 @@
 	BOOT_TARGET_DEVICES_references_VIRTIO_without_CONFIG_CMD_VIRTIO
 #endif
 
-#if defined(CONFIG_CMD_DHCP)
+#if defined(CONFIG_PPL_CMD_DHCP)
 #if defined(CONFIG_EFI_LOADER)
 /* http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xml */
 #if defined(CONFIG_ARM64) || defined(__aarch64__)
@@ -402,7 +402,7 @@
 	BOOT_TARGET_DEVICES_references_DHCP_without_CONFIG_CMD_DHCP
 #endif
 
-#if defined(CONFIG_CMD_DHCP) && defined(CONFIG_CMD_PXE)
+#if defined(CONFIG_PPL_CMD_DHCP) && defined(CONFIG_PPL_CMD_PXE)
 #define BOOTENV_DEV_PXE(devtypeu, devtypel, instance) \
 	"bootcmd_pxe=" \
 		BOOTENV_RUN_NET_USB_START \
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#104 lore raw

PATCH v3 82/95 command: Don't allow commands in SPL

In reply to Simon Glass

At present we compile commands into U-Boot SPL even though they cannot be used. This wastes space. Adjust the condition to avoid this.

---

Changes in v3:
- Add a new patch to disallow commands in SPL

 include/command.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/command.h +1 -1
index 0db48980624..1b018cb98e7 100644
@@ -376,7 +376,7 @@ int cmd_source_script(ulong addr, const char *fit_uname, const char *confname);
 	U_BOOT_SUBCMDS_DO_CMD(_cmdname)					\
 	U_BOOT_SUBCMDS_COMPLETE(_cmdname)
 
-#ifdef CONFIG_CMDLINE
+#if CONFIG_IS_ENABLED(CMDLINE)
 #define U_BOOT_CMDREP_MKENT_COMPLETE(_name, _maxargs, _cmd_rep,		\
 				     _usage, _help, _comp)		\
 		{ #_name, _maxargs, _cmd_rep, cmd_discard_repeatable,	\
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#105 lore raw

PATCH v3 83/95 Makefile: Include the config for the phase being built

In reply to Simon Glass

At present there is only a single auto.conf file used within the makefiles. Update them to use the correct one for each phase.

Also update kconfig.h to include the correct autoconf.h or autoconf_spl.h file for each phase. This allows the macros to be simplified.

With this, CONFIG_IS_ENABLED() is the same as IS_ENABLED() apart from a migration detail.

Both changes are made in the same patch to avoid build errors.

---

(no changes since v2)

Changes in v2:
- Include code from 'Update CONFIG_IS_ENABLED() for split files' too

 Makefile                               | 11 +++-
 include/linux/kconfig.h                | 74 +++++++++-----------------
 scripts/Makefile.build                 | 12 ++++-
 scripts/Makefile.spl                   | 10 +++-
 tools/binman/test/generated/autoconf.h |  4 +-
 5 files changed, 58 insertions(+), 53 deletions(-)
Makefile +10 -1
index 28bec3fa415..3dc99041391 100644
@@ -587,8 +587,17 @@ scripts: scripts_basic scripts_dtc include/config/auto.conf
 	$(Q)$(MAKE) $(build)=$(@)
 
 ifeq ($(dot-config),1)
-# Read in config
+
+# Read in the config for this phase
+ifdef CONFIG_TPL_BUILD
+-include include/config/auto_tpl.conf
+else ifdef CONFIG_VPL_BUILD
+-include include/config/auto_vpl.conf
+else ifdef CONFIG_SPL_BUILD
+-include include/config/auto_spl.conf
+else
 -include include/config/auto.conf
+endif
 
 # Read in dependencies to all Kconfig* files, make sure to run
 # oldconfig if changes are detected.
include/linux/kconfig.h +25 -49

106 lines not on this page · raw message

scripts/Makefile.build +11 -1
index 97dd4a64f6e..093392b430f 100644
@@ -44,9 +44,19 @@ ldflags-y  :=
 subdir-asflags-y :=
 subdir-ccflags-y :=
 
-# Read auto.conf if it exists, otherwise ignore
+# Read appropriate auto.conf if it exists, otherwise ignore
 # Modified for U-Boot
+
+ifeq ($(SPL_NAME),tpl)
+-include include/config/auto_tpl.conf
+else ifeq ($(SPL_NAME),vpl)
+-include include/config/auto_vpl.conf
+else ifeq ($(SPL_NAME),spl)
+-include include/config/auto_spl.conf
+else
 -include include/config/auto.conf
+endif
+
 -include $(prefix)/include/autoconf.mk
 
 include scripts/Kbuild.include
scripts/Makefile.spl +9 -1
index 15ac87286d5..41528f32307 100644
@@ -19,9 +19,17 @@ _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
 
 include $(srctree)/scripts/Kbuild.include
 
--include include/config/auto.conf
 -include $(obj)/include/autoconf.mk
 
+# Read in the config for this SPL phase
+ifdef CONFIG_TPL_BUILD
+-include include/config/auto_tpl.conf
+else ifdef CONFIG_VPL_BUILD
+-include include/config/auto_vpl.conf
+else
+-include include/config/auto_spl.conf
+endif
+
 UBOOTINCLUDE := -I$(obj)/include $(UBOOTINCLUDE)
 
 KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD
tools/binman/test/generated/autoconf.h +3 -1
index 6a23039f469..88dc762c423 100644
@@ -1,3 +1,5 @@
 #define CONFIG_BINMAN 1
 #define CONFIG_SPL_BUILD 1
-#define CONFIG_SPL_BINMAN_SYMBOLS 1
+
+/* Don't include the SPL_ here since we are using separate autoconf files */
+#define CONFIG_BINMAN_SYMBOLS 1
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
#106 lore raw

PATCH v3 84/95 Makefile: Use empty SPL_ and SPL_TPL_ vars

In reply to Simon Glass

Now that we include an auto.conf file specific to the phase being built we can make these variables empty.

With this done, we can also remove them from U-Boot entirely, dropping them from all Makefiles. That is left for a future clean-up since we cannot apply this series until CONFIG migration is complete.

---

(no changes since v1)

 scripts/Kbuild.include | 15 ++-------------
 scripts/Makefile.spl   | 19 +++----------------
 2 files changed, 5 insertions(+), 29 deletions(-)
scripts/Kbuild.include +2 -13
index 62e0207f91b..b7668694101 100644
@@ -320,18 +320,7 @@ endif
 # do not delete intermediate files automatically
 .SECONDARY:
 
-ifdef CONFIG_SPL_BUILD
-SPL_ := SPL_
-ifeq ($(CONFIG_VPL_BUILD),y)
-SPL_TPL_ := VPL_
-else
-ifeq ($(CONFIG_TPL_BUILD),y)
-SPL_TPL_ := TPL_
-else
-SPL_TPL_ := SPL_
-endif
-endif
-else
+# The SPL_ and SPL_TPL_ vars resolve to nothing so they can be used in
+# Makefiles
 SPL_ :=
 SPL_TPL_ :=
-endif
scripts/Makefile.spl +3 -16
index 41528f32307..3009a8b0d4b 100644
@@ -35,11 +35,9 @@ UBOOTINCLUDE := -I$(obj)/include $(UBOOTINCLUDE)
 KBUILD_CPPFLAGS += -DCONFIG_SPL_BUILD
 ifeq ($(CONFIG_TPL_BUILD),y)
 KBUILD_CPPFLAGS += -DCONFIG_TPL_BUILD
-else
-ifeq ($(CONFIG_VPL_BUILD),y)
+else ifeq ($(CONFIG_VPL_BUILD),y)
 KBUILD_CPPFLAGS += -DCONFIG_VPL_BUILD
 endif
-endif
 
 ifeq ($(CONFIG_VPL_BUILD),y)
 SPL_BIN := u-boot-vpl
@@ -56,21 +54,10 @@ endif
 
 export SPL_NAME
 
-ifdef CONFIG_SPL_BUILD
-SPL_ := SPL_
-ifeq ($(CONFIG_VPL_BUILD),y)
-SPL_TPL_ := VPL_
-else
-ifeq ($(CONFIG_TPL_BUILD),y)
-SPL_TPL_ := TPL_
-else
-SPL_TPL_ := SPL_
-endif
-endif
-else
+# The SPL_ and SPL_TPL_ vars resolve to nothing so they can be used in
+# Makefiles
 SPL_ :=
 SPL_TPL_ :=
-endif
 
 ifeq ($(obj)$(CONFIG_SUPPORT_SPL),spl)
 $(error You cannot build SPL without enabling CONFIG_SUPPORT_SPL)
Signature · 1 line
2.39.1.581.gbfd45094c4-goog