All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues
@ 2026-07-08 22:05 Jonas Karlman
  2026-07-08 22:05 ` [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
                   ` (10 more replies)
  0 siblings, 11 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Jonas Karlman

This series drop redundant TPL_BUILD checks to cleanup from the old SPL
to XPL symbol rename and fixes a few depends on xPL issues discovered
while working on a future Rockchip TPL cleanup series.

Patch 1-4 drops redundant TPL_BUILD checks.
Patch 5 updates a xPL_BUILD conditional guard example.
Patch 7-9 fixes a few depends on xPL issues.
Patch 10-11 changes to use CONFIG_IS_ENABLED() for a few symbols.

This series has no intended functional change besides changing to guard
symbols for the intended xPL phase and trying to remove some xPL_
symbols in .config when the related xPL phase is disabled.

Jonas Karlman (11):
  Makefile: Drop redundant CONFIG_TPL_BUILD checks
  dm: core: Drop redundant CONFIG_TPL_BUILD check
  rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks
  x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
  spl: Simplify xPL_BUILD conditional guard example
  Kconfig: Add missing depends on xPL to xPL_ symbols
  Kconfig: Depend on correct xPL symbol
  Kconfig: i2c: Depend on correct xPL symbol
  Kconfig: serial: Depend on correct xPL symbol
  console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE
  spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks

 arch/Kconfig                           |  2 +-
 arch/arm/mach-rockchip/Makefile        |  2 +-
 arch/x86/cpu/apollolake/fsp_bindings.c |  2 +-
 board/friendlyarm/nanopi2/board.c      |  4 ++--
 boot/bootm.c                           |  4 ++--
 boot/common_fit.c                      |  2 +-
 common/Kconfig                         |  2 ++
 common/autoboot.c                      |  2 +-
 common/console.c                       | 12 ++++++------
 common/spl/Kconfig                     |  2 +-
 common/spl/spl_usb.c                   |  2 +-
 drivers/Makefile                       |  2 +-
 drivers/bus/Makefile                   |  2 +-
 drivers/clk/rockchip/clk_rk3368.c      |  8 ++++----
 drivers/core/Kconfig                   |  4 ++--
 drivers/core/ofnode.c                  |  4 ++--
 drivers/i2c/Kconfig                    |  4 ++--
 drivers/mmc/mmc-uclass.c               |  4 ++--
 drivers/mmc/mmc.c                      | 16 ++++++++--------
 drivers/mmc/mmc_legacy.c               |  4 ++--
 drivers/mtd/Makefile                   |  2 +-
 drivers/mtd/nand/Makefile              |  2 +-
 drivers/serial/Kconfig                 |  6 +++---
 include/env_callback.h                 |  2 +-
 include/spl.h                          |  8 ++++----
 lib/Kconfig                            |  7 ++++++-
 lib/hang.c                             |  2 +-
 27 files changed, 60 insertions(+), 53 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:23   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini, Ilias Apalodimas, Simon Glass, Quentin Schulz,
	Kever Yang
  Cc: u-boot, Jonas Karlman

The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
are therefore redundant.

Drop the redundant TPL_BUILD symbol check from conditional guards that
also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
symbol rename.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 arch/arm/mach-rockchip/Makefile | 2 +-
 drivers/Makefile                | 2 +-
 drivers/bus/Makefile            | 2 +-
 drivers/mtd/Makefile            | 2 +-
 drivers/mtd/nand/Makefile       | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index d3bc0689f893..8148816c48c8 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -15,7 +15,7 @@ obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o spl_common.o
 
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o spl_common.o
 
-ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
+ifeq ($(CONFIG_XPL_BUILD),)
 
 # Always include boot_mode.o, as we bypass it (i.e. turn it off)
 # inside of boot_mode.c when CONFIG_ROCKCHIP_BOOT_MODE_REG is 0.  This way,
diff --git a/drivers/Makefile b/drivers/Makefile
index 43d0ba332818..76d6d45d40e1 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -85,7 +85,7 @@ obj-$(CONFIG_TPL_MPC8XXX_INIT_DDR) += ddr/fsl/
 
 endif
 
-ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
+ifeq ($(CONFIG_XPL_BUILD),)
 
 obj-y += ata/
 obj-$(CONFIG_DM_DEMO) += demo/
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile
index 2d242bc2886b..239d9a35fe49 100644
--- a/drivers/bus/Makefile
+++ b/drivers/bus/Makefile
@@ -3,7 +3,7 @@
 # Makefile for the bus drivers.
 #
 
-ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
+ifeq ($(CONFIG_XPL_BUILD),)
 obj-$(CONFIG_TI_PWMSS)	+= ti-pwmss.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o
 endif
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index ce05e206073d..e204f19ff8be 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -16,7 +16,7 @@ mtd-$(CONFIG_RENESAS_RPC_HF) += renesas_rpc_hf.o
 mtd-$(CONFIG_HBMC_AM654) += hbmc-am654.o
 
 # U-Boot build
-ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
+ifeq ($(CONFIG_XPL_BUILD),)
 
 ifneq ($(mtd-y),)
 obj-y += mtd.o
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index c8169cf73902..cf53c5f601ea 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0+
 
-ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
+ifeq ($(CONFIG_XPL_BUILD),)
 nandcore-objs := core.o bbt.o
 obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
 obj-$(CONFIG_MTD_RAW_NAND) += raw/
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
  2026-07-08 22:05 ` [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:23   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
                   ` (8 subsequent siblings)
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini, Simon Glass; +Cc: u-boot, Jonas Karlman

The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
are therefore redundant.

Drop the redundant TPL_BUILD symbol check from conditional guards that
also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
symbol rename.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 drivers/core/ofnode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 1388b4810317..75cae0d36b5b 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -1665,8 +1665,8 @@ int ofnode_read_simple_size_cells(ofnode node)
 
 bool ofnode_pre_reloc(ofnode node)
 {
-#if defined(CONFIG_XPL_BUILD) || defined(CONFIG_TPL_BUILD)
-	/* for SPL and TPL the remaining nodes after the fdtgrep 1st pass
+#if defined(CONFIG_XPL_BUILD)
+	/* for xPL the remaining nodes after the fdtgrep 1st pass
 	 * had property bootph-all or bootph-pre-sram/bootph-pre-ram.
 	 * They are removed in final dtb (fdtgrep 2nd pass)
 	 */
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
  2026-07-08 22:05 ` [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
  2026-07-08 22:05 ` [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:23   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
                   ` (7 subsequent siblings)
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini, Lukasz Majewski, Simon Glass, Quentin Schulz,
	Kever Yang
  Cc: u-boot, Jonas Karlman

The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
are therefore redundant.

Drop the redundant TPL_BUILD symbol check from conditional guards that
also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
symbol rename.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 drivers/clk/rockchip/clk_rk3368.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/rockchip/clk_rk3368.c b/drivers/clk/rockchip/clk_rk3368.c
index 630253fbb1df..5ba19bce7b24 100644
--- a/drivers/clk/rockchip/clk_rk3368.c
+++ b/drivers/clk/rockchip/clk_rk3368.c
@@ -50,7 +50,7 @@ struct pll_div {
 		       (_nr * _no) == hz, #hz "Hz cannot be hit with PLL " \
 		       "divisors on line " __stringify(__LINE__));
 
-#if IS_ENABLED(CONFIG_XPL_BUILD) || IS_ENABLED(CONFIG_TPL_BUILD)
+#if IS_ENABLED(CONFIG_XPL_BUILD)
 static const struct pll_div apll_l_init_cfg = PLL_DIVISORS(APLL_L_HZ, 12, 2);
 static const struct pll_div apll_b_init_cfg = PLL_DIVISORS(APLL_B_HZ, 1, 2);
 #if !defined(CONFIG_TPL_BUILD)
@@ -88,7 +88,7 @@ static uint32_t rkclk_pll_get_rate(struct rk3368_cru *cru,
 	}
 }
 
-#if IS_ENABLED(CONFIG_XPL_BUILD) || IS_ENABLED(CONFIG_TPL_BUILD)
+#if IS_ENABLED(CONFIG_XPL_BUILD)
 static int rkclk_set_pll(struct rk3368_cru *cru, enum rk3368_pll_id pll_id,
 			 const struct pll_div *div)
 {
@@ -130,7 +130,7 @@ static int rkclk_set_pll(struct rk3368_cru *cru, enum rk3368_pll_id pll_id,
 }
 #endif
 
-#if IS_ENABLED(CONFIG_XPL_BUILD) || IS_ENABLED(CONFIG_TPL_BUILD)
+#if IS_ENABLED(CONFIG_XPL_BUILD)
 static void rkclk_init(struct rk3368_cru *cru)
 {
 	u32 apllb, aplll, dpll, cpll, gpll;
@@ -586,7 +586,7 @@ static int rk3368_clk_probe(struct udevice *dev)
 
 	priv->cru = map_sysmem(plat->dtd.reg[0], plat->dtd.reg[1]);
 #endif
-#if IS_ENABLED(CONFIG_XPL_BUILD) || IS_ENABLED(CONFIG_TPL_BUILD)
+#if IS_ENABLED(CONFIG_XPL_BUILD)
 	rkclk_init(priv->cru);
 #endif
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
                   ` (2 preceding siblings ...)
  2026-07-08 22:05 ` [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:23   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example Jonas Karlman
                   ` (6 subsequent siblings)
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini, Simon Glass, Bin Meng; +Cc: u-boot, Jonas Karlman

The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
are therefore redundant.

Drop the redundant TPL_BUILD symbol check from conditional guards that
also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
symbol rename.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 arch/x86/cpu/apollolake/fsp_bindings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/cpu/apollolake/fsp_bindings.c b/arch/x86/cpu/apollolake/fsp_bindings.c
index b4bb677f5cde..4b85fddbc8ad 100644
--- a/arch/x86/cpu/apollolake/fsp_bindings.c
+++ b/arch/x86/cpu/apollolake/fsp_bindings.c
@@ -653,7 +653,7 @@ int fsp_m_update_config_from_dtb(ofnode node, struct fsp_m_config *cfg)
 }
 #endif
 
-#if !defined(CONFIG_XPL_BUILD) && !defined(CONFIG_TPL_BUILD)
+#if !defined(CONFIG_XPL_BUILD)
 const struct fsp_binding fsp_s_bindings[] = {
 	{
 	.type = FSP_UINT8,
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
                   ` (3 preceding siblings ...)
  2026-07-08 22:05 ` [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:24   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols Jonas Karlman
                   ` (5 subsequent siblings)
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Jonas Karlman

The old meaning of the SPL_BUILD symbol has been transfered to a new
XPL_BUILD symbol, leaving the SPL_BUILD symbol only to be defined for
SPL builds, and not all xPL builds.

Change to only use the SPL_BUILD symbol in the SPL code example to
cleanup from an old SPL to XPL symbol rename.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 include/spl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/spl.h b/include/spl.h
index 5078d7525abb..45dd44e03d13 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -93,7 +93,7 @@ enum xpl_phase_t {
  *
  * To include code only in SPL, you might do:
  *
- *    #if defined(CONFIG_XPL_BUILD) && !defined(CONFIG_TPL_BUILD)
+ *    #ifdef CONFIG_SPL_BUILD
  *    ...
  *    #endif
  *
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
                   ` (4 preceding siblings ...)
  2026-07-08 22:05 ` [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:24   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 07/11] Kconfig: Depend on correct xPL symbol Jonas Karlman
                   ` (4 subsequent siblings)
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Jonas Karlman

xPL_<name> symbols should typically depend on the associated xPL symbol.

Add missing depends on xPL to xPL_<name> symbols to avoid the xPL_<name>
symbols being available when the associated xPL symbol is disabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 common/Kconfig | 2 ++
 lib/Kconfig    | 7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index 345be4b8ca14..ab0557c3666b 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -138,6 +138,7 @@ config SILENT_CONSOLE
 
 config SPL_SILENT_CONSOLE
 	bool "Use a silent console in SPL"
+	depends on SPL
 	default y if SILENT_CONSOLE && !SANDBOX
 	help
 	  This selects a silent console in SPL. When enabled it drops some
@@ -149,6 +150,7 @@ config SPL_SILENT_CONSOLE
 
 config TPL_SILENT_CONSOLE
 	bool "Use a silent console in TPL"
+	depends on TPL
 	default y if SILENT_CONSOLE && !SANDBOX
 	help
 	  This selects a silent console in TPL. When enabled it drops some
diff --git a/lib/Kconfig b/lib/Kconfig
index 9e0f0ad7d068..72b53d7d5490 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -960,6 +960,7 @@ config TPL_LZMA
 
 config VPL_LZMA
 	bool "Enable LZMA decompression support for VPL build"
+	depends on VPL
 	default y if LZMA
 	help
 	  This enables support for LZMA compression algorithm for VPL boot.
@@ -972,23 +973,27 @@ config SPL_LZO
 
 config SPL_GZIP
 	bool "Enable gzip decompression support for SPL build"
+	depends on SPL
 	select SPL_ZLIB
 	help
 	  This enables support for the GZIP compression algorithm for SPL boot.
 
 config TPL_GZIP
-	bool "Enable gzip decompression support for SPL build"
+	bool "Enable gzip decompression support for TPL build"
+	depends on TPL
 	select TPL_ZLIB
 	help
 	  This enables support for the GZIP compression algorithm for TPL
 
 config SPL_ZLIB
 	bool
+	depends on SPL
 	help
 	  This enables compression lib for SPL boot.
 
 config TPL_ZLIB
 	bool
+	depends on TPL
 	help
 	  This enables compression lib for TPL
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 07/11] Kconfig: Depend on correct xPL symbol
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
                   ` (5 preceding siblings ...)
  2026-07-08 22:05 ` [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:25   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 08/11] Kconfig: i2c: " Jonas Karlman
                   ` (3 subsequent siblings)
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini, Simon Glass; +Cc: u-boot, Jonas Karlman

Change to depend on correct xPL symbol instead of a xPL symbol intended
for a different phase to make affected symbols available for correct
phase.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 arch/Kconfig         | 2 +-
 common/spl/Kconfig   | 2 +-
 drivers/core/Kconfig | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 8d63afeb138e..408e53524e5f 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -508,7 +508,7 @@ config SPL_SKIP_LOWLEVEL_INIT
 
 config TPL_SKIP_LOWLEVEL_INIT
 	bool "Skip calls to certain low level initialization functions in TPL"
-	depends on SPL && ARM
+	depends on TPL && ARM
 	help
 	  If enabled, then certain low level initializations (like setting up
 	  the memory controller) are omitted and/or U-Boot does not relocate
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 0618f42c9410..988d815f8c79 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -1768,7 +1768,7 @@ config TPL
 source "common/spl/Kconfig.tpl"
 
 config VPL
-	depends on SUPPORT_SPL && !COMPILE_TEST
+	depends on SUPPORT_VPL && !COMPILE_TEST
 	bool "Enable VPL"
 	help
 	  If you want to build VPL as well as the normal image, TPL and SPL,
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig
index ae0c34667723..a0e252b0529c 100644
--- a/drivers/core/Kconfig
+++ b/drivers/core/Kconfig
@@ -394,8 +394,8 @@ config TPL_OF_TRANSLATE
 	  smaller in size than fdt_translate_address()
 
 config VPL_OF_TRANSLATE
-	bool "Translate addresses using fdt_translate_address in SPL"
-	depends on SPL_DM && VPL_OF_CONTROL
+	bool "Translate addresses using fdt_translate_address in VPL"
+	depends on VPL_DM && VPL_OF_CONTROL
 	help
 	  If this option is enabled, the reg property will be translated
 	  using the fdt_translate_address() function. This is necessary
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
                   ` (6 preceding siblings ...)
  2026-07-08 22:05 ` [PATCH 07/11] Kconfig: Depend on correct xPL symbol Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:28   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 09/11] Kconfig: serial: " Jonas Karlman
                   ` (2 subsequent siblings)
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini, Heiko Schocher; +Cc: u-boot, Jonas Karlman

Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 drivers/i2c/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
index ab5af17858c8..125dc84819e6 100644
--- a/drivers/i2c/Kconfig
+++ b/drivers/i2c/Kconfig
@@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
 
 config SPL_SYS_I2C_LEGACY
 	bool "Enable legacy I2C subsystem and drivers in SPL"
-	depends on SUPPORT_SPL && !SPL_DM_I2C
+	depends on SPL && !SPL_DM_I2C
 	help
 	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
 	  in some size constrained situations.
 
 config TPL_SYS_I2C_LEGACY
 	bool "Enable legacy I2C subsystem and drivers in TPL"
-	depends on SUPPORT_TPL && !SPL_DM_I2C
+	depends on TPL && !TPL_DM_I2C
 	help
 	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
 	  in some size constrained situations.
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
                   ` (7 preceding siblings ...)
  2026-07-08 22:05 ` [PATCH 08/11] Kconfig: i2c: " Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:53   ` Tom Rini
  2026-07-13 14:30   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks Jonas Karlman
  2026-07-08 22:05 ` [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks Jonas Karlman
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot, Jonas Karlman

Change xPL_SERIAL_PRESENT symbols to depend on the xPL_DM_SERIAL symbol
intended for the related xPL phase instead of the DM_SERIAL symbol
used for U-Boot proper to make CONFIG_IS_ENABLED(SERIAL_PRESENT) guards
work as intended.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 drivers/serial/Kconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index e221800d5d06..f125061fe184 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -71,7 +71,7 @@ config SERIAL_PRESENT
 
 config SPL_SERIAL_PRESENT
 	bool "Provide a serial driver in SPL"
-	depends on DM_SERIAL && SPL
+	depends on SPL_DM_SERIAL
 	default y
 	help
 	  In very space-constrained devices even the full UART driver is too
@@ -81,7 +81,7 @@ config SPL_SERIAL_PRESENT
 
 config TPL_SERIAL_PRESENT
 	bool "Provide a serial driver in TPL"
-	depends on DM_SERIAL && TPL
+	depends on TPL_DM_SERIAL
 	default y
 	help
 	  In very space-constrained devices even the full UART driver is too
@@ -91,7 +91,7 @@ config TPL_SERIAL_PRESENT
 
 config VPL_SERIAL_PRESENT
 	bool "Provide a serial driver in VPL"
-	depends on DM_SERIAL && VPL
+	depends on VPL_DM_SERIAL
 	default y
 	help
 	  In very space-constrained devices even the full UART driver is too
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
                   ` (8 preceding siblings ...)
  2026-07-08 22:05 ` [PATCH 09/11] Kconfig: serial: " Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:53   ` Tom Rini
  2026-07-13 14:29   ` Simon Glass
  2026-07-08 22:05 ` [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks Jonas Karlman
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini, Stefan Bosch; +Cc: u-boot, Jonas Karlman

The xPL_SILENT_CONSOLE Kconfig symbols are not fully respected for xPL
builds, instead common code is guarded by a mix of SILENT_CONSOLE and
xPL_SILENT_CONSOLE symbols.

Change to consistently use CONFIG_IS_ENABLED(SILENT_CONSOLE) to make the
common code properly guarded by the intended Kconfig symbol.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 board/friendlyarm/nanopi2/board.c |  4 ++--
 boot/bootm.c                      |  4 ++--
 common/autoboot.c                 |  2 +-
 common/console.c                  | 12 ++++++------
 include/env_callback.h            |  2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c
index 5e560a7f9275..be092f3d5a27 100644
--- a/board/friendlyarm/nanopi2/board.c
+++ b/board/friendlyarm/nanopi2/board.c
@@ -441,7 +441,7 @@ int board_init(void)
 	bd_lcd_config_gpio();
 	bd_lcd_init();
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE))
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE))
 		gd->flags |= GD_FLG_SILENT;
 
 	return 0;
@@ -459,7 +459,7 @@ int board_late_init(void)
 
 	set_ether_addr();
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE))
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE))
 		gd->flags &= ~GD_FLG_SILENT;
 
 	bd_backlight_on();
diff --git a/boot/bootm.c b/boot/bootm.c
index 803d6406be40..3cbd824f0df5 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -873,7 +873,7 @@ int bootm_process_cmdline(char *buf, int maxlen, int flags)
 	int ret;
 
 	/* Check config first to enable compiler to eliminate code */
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) &&
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) &&
 	    !IS_ENABLED(CONFIG_SILENT_U_BOOT_ONLY) &&
 	    (flags & BOOTM_CL_SILENT)) {
 		ret = fixup_silent_linux(buf, maxlen);
@@ -899,7 +899,7 @@ int bootm_process_cmdline_env(int flags)
 	int ret;
 
 	/* First check if any action is needed */
-	do_silent = IS_ENABLED(CONFIG_SILENT_CONSOLE) &&
+	do_silent = CONFIG_IS_ENABLED(SILENT_CONSOLE) &&
 	    !IS_ENABLED(CONFIG_SILENT_U_BOOT_ONLY) && (flags & BOOTM_CL_SILENT);
 	if (!do_silent && !IS_ENABLED(CONFIG_BOOTARGS_SUBST))
 		return 0;
diff --git a/common/autoboot.c b/common/autoboot.c
index 4b80ddb5b28f..a3d932f290f4 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -426,7 +426,7 @@ static int abortboot(int bootdelay)
 			abort = abortboot_single_key(bootdelay);
 	}
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && abort)
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && abort)
 		gd->flags &= ~GD_FLG_SILENT;
 
 	return abort;
diff --git a/common/console.c b/common/console.c
index 54d1249422d4..eb84d1732939 100644
--- a/common/console.c
+++ b/common/console.c
@@ -72,7 +72,7 @@ static int on_console(const char *name, const char *value, enum env_op op,
 }
 U_BOOT_ENV_CALLBACK(console, on_console);
 
-#ifdef CONFIG_SILENT_CONSOLE
+#if CONFIG_IS_ENABLED(SILENT_CONSOLE)
 static int on_silent(const char *name, const char *value, enum env_op op,
 	int flags)
 {
@@ -687,7 +687,7 @@ static void print_pre_console_buffer(int flushpoint)
 	char buf_out[CONFIG_VAL(PRE_CON_BUF_SZ) + 1];
 	char *buf_in;
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
 		return;
 
 	buf_in = map_sysmem(CONFIG_VAL(PRE_CON_BUF_ADDR), CONFIG_VAL(PRE_CON_BUF_SZ));
@@ -736,7 +736,7 @@ void putc(const char c)
 		return;
 	}
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
 		if (!(gd->flags & GD_FLG_DEVINIT))
 			pre_console_putc(c);
 		return;
@@ -776,7 +776,7 @@ void puts(const char *s)
 		return;
 	}
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
 		if (!(gd->flags & GD_FLG_DEVINIT))
 			pre_console_puts(s);
 		return;
@@ -813,7 +813,7 @@ void flush(void)
 	if (IS_ENABLED(CONFIG_DEBUG_UART) && !(gd->flags & GD_FLG_SERIAL_READY))
 		return;
 
-	if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
+	if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT))
 		return;
 
 	if (IS_ENABLED(CONFIG_DISABLE_CONSOLE) && (gd->flags & GD_FLG_DISABLE_CONSOLE))
@@ -999,7 +999,7 @@ static bool console_update_silent(void)
 {
 	unsigned long flags = gd->flags;
 
-	if (!IS_ENABLED(CONFIG_SILENT_CONSOLE))
+	if (!CONFIG_IS_ENABLED(SILENT_CONSOLE))
 		return false;
 
 	if (IS_ENABLED(CONFIG_SILENT_CONSOLE_UNTIL_ENV) && !(gd->flags & GD_FLG_ENV_READY)) {
diff --git a/include/env_callback.h b/include/env_callback.h
index 1181ab4a1579..131bf76206e5 100644
--- a/include/env_callback.h
+++ b/include/env_callback.h
@@ -14,7 +14,7 @@
 
 #define ENV_CALLBACK_VAR ".callbacks"
 
-#ifdef CONFIG_SILENT_CONSOLE
+#if CONFIG_IS_ENABLED(SILENT_CONSOLE)
 #define SILENT_CALLBACK "silent:silent,"
 #else
 #define SILENT_CALLBACK
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
  2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
                   ` (9 preceding siblings ...)
  2026-07-08 22:05 ` [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks Jonas Karlman
@ 2026-07-08 22:05 ` Jonas Karlman
  2026-07-09  1:53   ` Tom Rini
  2026-07-13 14:29   ` Simon Glass
  10 siblings, 2 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-08 22:05 UTC (permalink / raw)
  To: Tom Rini, Peng Fan, Jaehoon Chung; +Cc: u-boot, Jonas Karlman

Use CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) instead of directly checking
CONFIG_SPL_LIBCOMMON_SUPPORT when guarding printf/log calls to depend on
correct xPL_LIBCOMMON_SUPPORT symbol. Also change to use IS_ENABLED()
for the XPL_BUILD symbol checks for consistency.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
---
 boot/common_fit.c        |  2 +-
 common/spl/spl_usb.c     |  2 +-
 drivers/mmc/mmc-uclass.c |  4 ++--
 drivers/mmc/mmc.c        | 16 ++++++++--------
 drivers/mmc/mmc_legacy.c |  4 ++--
 include/spl.h            |  6 +++---
 lib/hang.c               |  2 +-
 7 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/boot/common_fit.c b/boot/common_fit.c
index fd434fe28e19..9dcec1cd7d7d 100644
--- a/boot/common_fit.c
+++ b/boot/common_fit.c
@@ -53,7 +53,7 @@ int fit_find_config_node(const void *fdt)
 	     node = fdt_next_subnode(fdt, node)) {
 		name = fdt_getprop(fdt, node, FIT_DESC_PROP, &len);
 		if (!name) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 			printf("%s: Missing FDT description in DTB\n",
 			       __func__);
 #endif
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index 932da56ab6db..365d57063c9d 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -31,7 +31,7 @@ int spl_usb_load(struct spl_image_info *spl_image,
 	}
 
 	if (err) {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+#if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 		printf("%s: usb init failed: err - %d\n", __func__, err);
 #endif
 		return err;
diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 698530088fe7..ffb5e9800fb5 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -318,7 +318,7 @@ struct mmc *find_mmc_device(int dev_num)
 	ret = blk_find_device(UCLASS_MMC, dev_num, &dev);
 
 	if (ret) {
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 		printf("MMC Device %d not found\n", dev_num);
 #endif
 		return NULL;
@@ -390,7 +390,7 @@ void mmc_do_preinit(void)
 	}
 }
 
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 void print_mmc_devices(char separator)
 {
 	struct udevice *dev;
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 2e5655606564..f24a66c389a9 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -328,7 +328,7 @@ int mmc_poll_for_busy(struct mmc *mmc, int timeout_ms)
 			break;
 
 		if (status & MMC_STATUS_MASK) {
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 			log_err("Status Error: %#08x\n", status);
 #endif
 			return -ECOMM;
@@ -341,7 +341,7 @@ int mmc_poll_for_busy(struct mmc *mmc, int timeout_ms)
 	}
 
 	if (timeout_ms <= 0) {
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 		log_err("Timeout waiting card ready\n");
 #endif
 		return -ETIMEDOUT;
@@ -483,7 +483,7 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
 
 	if (blkcnt > 1) {
 		if (mmc_send_stop_transmission(mmc, false)) {
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 			log_err("mmc fail to send stop cmd\n");
 #endif
 			return 0;
@@ -534,7 +534,7 @@ ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
 		return 0;
 
 	if ((start + blkcnt) > block_dev->lba) {
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 		log_err("MMC: block number 0x" LBAF " exceeds max(0x" LBAF ")\n",
 			start + blkcnt, block_dev->lba);
 #endif
@@ -2769,8 +2769,8 @@ static int mmc_startup(struct mmc *mmc)
 	bdesc->blksz = mmc->read_bl_len;
 	bdesc->log2blksz = LOG2(bdesc->blksz);
 	bdesc->lba = lldiv(mmc->capacity, mmc->read_bl_len);
-#if !defined(CONFIG_XPL_BUILD) || \
-		(defined(CONFIG_SPL_LIBCOMMON_SUPPORT) && \
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || \
+		(CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && \
 		!CONFIG_IS_ENABLED(USE_TINY_PRINTF))
 	sprintf(bdesc->vendor, "Man %06x Snr %04x%04x",
 		mmc->cid[0] >> 24, (mmc->cid[2] & 0xffff),
@@ -3028,7 +3028,7 @@ retry:
 		err = mmc_send_op_cond(mmc);
 
 		if (err) {
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 			if (!quiet)
 				log_err("Card did not respond to voltage select! : %d\n",
 					err);
@@ -3083,7 +3083,7 @@ int mmc_start_init(struct mmc *mmc)
 #endif
 	if (no_card) {
 		mmc->has_init = 0;
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 		log_err("MMC: no card present\n");
 #endif
 		return -ENOMEDIUM;
diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
index 8f8ba34be717..d29c611011bf 100644
--- a/drivers/mmc/mmc_legacy.c
+++ b/drivers/mmc/mmc_legacy.c
@@ -44,7 +44,7 @@ struct mmc *find_mmc_device(int dev_num)
 			return m;
 	}
 
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 	printf("MMC Device %d not found\n", dev_num);
 #endif
 
@@ -93,7 +93,7 @@ void mmc_list_add(struct mmc *mmc)
 	list_add_tail(&mmc->link, &mmc_devices);
 }
 
-#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 void print_mmc_devices(char separator)
 {
 	struct mmc *m;
diff --git a/include/spl.h b/include/spl.h
index 45dd44e03d13..98d1a8fda409 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -792,7 +792,7 @@ struct spl_boot_device {
  * @load_image: Function to call to load image
  */
 struct spl_image_loader {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+#if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 	const char *name;
 #endif
 	uint boot_device;
@@ -809,7 +809,7 @@ struct spl_image_loader {
 /* Helper function for accessing the name */
 static inline const char *spl_loader_name(const struct spl_image_loader *loader)
 {
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+#if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 	const char *name;
 	name = spl_board_loader_name(loader->boot_device);
 	return name ?: loader->name;
@@ -828,7 +828,7 @@ static inline const char *spl_loader_name(const struct spl_image_loader *loader)
  * _boot_device is the BOOT_DEVICE_... value
  * _method is the load_image function to call
  */
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
+#if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
 #define SPL_LOAD_IMAGE_METHOD(_name, _priority, _boot_device, _method) \
 	SPL_LOAD_IMAGE(_boot_device ## _priority ## _method) = { \
 		.name = _name, \
diff --git a/lib/hang.c b/lib/hang.c
index f3c3c896f0ab..42c5722740a3 100644
--- a/lib/hang.c
+++ b/lib/hang.c
@@ -22,7 +22,7 @@
  */
 void hang(void)
 {
-#if !defined(CONFIG_XPL_BUILD) || \
+#if !IS_ENABLED(CONFIG_XPL_BUILD) || \
 		(CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) && \
 		 CONFIG_IS_ENABLED(SERIAL))
 	puts("### ERROR ### Please RESET the board ###\n");
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks
  2026-07-08 22:05 ` [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
@ 2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:23   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:52 UTC (permalink / raw)
  To: Jonas Karlman
  Cc: Ilias Apalodimas, Simon Glass, Quentin Schulz, Kever Yang, u-boot

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

On Wed, Jul 08, 2026 at 10:05:27PM +0000, Jonas Karlman wrote:

> The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
> Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
> are therefore redundant.
> 
> Drop the redundant TPL_BUILD symbol check from conditional guards that
> also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
> symbol rename.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check
  2026-07-08 22:05 ` [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
@ 2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:23   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:52 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

On Wed, Jul 08, 2026 at 10:05:28PM +0000, Jonas Karlman wrote:

> The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
> Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
> are therefore redundant.
> 
> Drop the redundant TPL_BUILD symbol check from conditional guards that
> also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
> symbol rename.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks
  2026-07-08 22:05 ` [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
@ 2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:23   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:52 UTC (permalink / raw)
  To: Jonas Karlman
  Cc: Lukasz Majewski, Simon Glass, Quentin Schulz, Kever Yang, u-boot

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

On Wed, Jul 08, 2026 at 10:05:29PM +0000, Jonas Karlman wrote:

> The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
> Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
> are therefore redundant.
> 
> Drop the redundant TPL_BUILD symbol check from conditional guards that
> also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
> symbol rename.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
  2026-07-08 22:05 ` [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
@ 2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:23   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:52 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Simon Glass, Bin Meng, u-boot

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

On Wed, Jul 08, 2026 at 10:05:30PM +0000, Jonas Karlman wrote:

> The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
> Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
> are therefore redundant.
> 
> Drop the redundant TPL_BUILD symbol check from conditional guards that
> also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
> symbol rename.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example
  2026-07-08 22:05 ` [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example Jonas Karlman
@ 2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:24   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:52 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

On Wed, Jul 08, 2026 at 10:05:31PM +0000, Jonas Karlman wrote:

> The old meaning of the SPL_BUILD symbol has been transfered to a new
> XPL_BUILD symbol, leaving the SPL_BUILD symbol only to be defined for
> SPL builds, and not all xPL builds.
> 
> Change to only use the SPL_BUILD symbol in the SPL code example to
> cleanup from an old SPL to XPL symbol rename.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
  2026-07-08 22:05 ` [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols Jonas Karlman
@ 2026-07-09  1:52   ` Tom Rini
  2026-07-09  6:41     ` Jonas Karlman
  2026-07-13 14:24   ` Simon Glass
  1 sibling, 1 reply; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:52 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 826 bytes --]

On Wed, Jul 08, 2026 at 10:05:32PM +0000, Jonas Karlman wrote:

> xPL_<name> symbols should typically depend on the associated xPL symbol.
> 
> Add missing depends on xPL to xPL_<name> symbols to avoid the xPL_<name>
> symbols being available when the associated xPL symbol is disabled.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> ---
>  common/Kconfig | 2 ++
>  lib/Kconfig    | 7 ++++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)

Did this go through CI? I ask because with SPL/TPL, we have the problem
of PowerPC being special from the rest of the world with these symbols
and I want to be sure everything still is building, before I do a
before/after size check on the series (and probably keep the binaries,
so I can checksum before/after and make sure they're the same).

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-08 22:05 ` [PATCH 08/11] Kconfig: i2c: " Jonas Karlman
@ 2026-07-09  1:52   ` Tom Rini
  2026-07-09  7:12     ` Jonas Karlman
  2026-07-13 14:28   ` Simon Glass
  1 sibling, 1 reply; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:52 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Heiko Schocher, u-boot

[-- Attachment #1: Type: text/plain, Size: 1276 bytes --]

On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:

> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> ---
>  drivers/i2c/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> index ab5af17858c8..125dc84819e6 100644
> --- a/drivers/i2c/Kconfig
> +++ b/drivers/i2c/Kconfig
> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
>  
>  config SPL_SYS_I2C_LEGACY
>  	bool "Enable legacy I2C subsystem and drivers in SPL"
> -	depends on SUPPORT_SPL && !SPL_DM_I2C
> +	depends on SPL && !SPL_DM_I2C
>  	help
>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
>  	  in some size constrained situations.
>  
>  config TPL_SYS_I2C_LEGACY
>  	bool "Enable legacy I2C subsystem and drivers in TPL"
> -	depends on SUPPORT_TPL && !SPL_DM_I2C
> +	depends on TPL && !TPL_DM_I2C
>  	help
>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
>  	  in some size constrained situations.

Building on the last email, I think these might need to be
[ST]PL_FRAMEWORK not [ST]PL.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 07/11] Kconfig: Depend on correct xPL symbol
  2026-07-08 22:05 ` [PATCH 07/11] Kconfig: Depend on correct xPL symbol Jonas Karlman
@ 2026-07-09  1:52   ` Tom Rini
  2026-07-13 14:25   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:52 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

On Wed, Jul 08, 2026 at 10:05:33PM +0000, Jonas Karlman wrote:

> Change to depend on correct xPL symbol instead of a xPL symbol intended
> for a different phase to make affected symbols available for correct
> phase.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
  2026-07-08 22:05 ` [PATCH 09/11] Kconfig: serial: " Jonas Karlman
@ 2026-07-09  1:53   ` Tom Rini
  2026-07-09  7:27     ` Jonas Karlman
  2026-07-13 14:30   ` Simon Glass
  1 sibling, 1 reply; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:53 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 1312 bytes --]

On Wed, Jul 08, 2026 at 10:05:35PM +0000, Jonas Karlman wrote:

> Change xPL_SERIAL_PRESENT symbols to depend on the xPL_DM_SERIAL symbol
> intended for the related xPL phase instead of the DM_SERIAL symbol
> used for U-Boot proper to make CONFIG_IS_ENABLED(SERIAL_PRESENT) guards
> work as intended.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> ---
>  drivers/serial/Kconfig | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> index e221800d5d06..f125061fe184 100644
> --- a/drivers/serial/Kconfig
> +++ b/drivers/serial/Kconfig
> @@ -71,7 +71,7 @@ config SERIAL_PRESENT
>  
>  config SPL_SERIAL_PRESENT
>  	bool "Provide a serial driver in SPL"
> -	depends on DM_SERIAL && SPL
> +	depends on SPL_DM_SERIAL
>  	default y
>  	help
>  	  In very space-constrained devices even the full UART driver is too

Using the database option to qconfig.py, this is not equivalent. There's
901 platforms today that enable SPL_SERIAL_PRESENT, and 344 that enable
SPL_SERIAL_PRESENT but not SPL_DM_SERIAL. Now it's possible that there's
no functional change here. Something like "pinetab" would be a single
platform to check the size changes on as it's SPL_SERIAL_PRESENT=y and
SPL_DM_SERIAL=n.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
  2026-07-08 22:05 ` [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks Jonas Karlman
@ 2026-07-09  1:53   ` Tom Rini
  2026-07-13 14:29   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:53 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Stefan Bosch, u-boot

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

On Wed, Jul 08, 2026 at 10:05:36PM +0000, Jonas Karlman wrote:

> The xPL_SILENT_CONSOLE Kconfig symbols are not fully respected for xPL
> builds, instead common code is guarded by a mix of SILENT_CONSOLE and
> xPL_SILENT_CONSOLE symbols.
> 
> Change to consistently use CONFIG_IS_ENABLED(SILENT_CONSOLE) to make the
> common code properly guarded by the intended Kconfig symbol.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
  2026-07-08 22:05 ` [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks Jonas Karlman
@ 2026-07-09  1:53   ` Tom Rini
  2026-07-10 13:51     ` Tom Rini
  2026-07-13 14:29   ` Simon Glass
  1 sibling, 1 reply; 52+ messages in thread
From: Tom Rini @ 2026-07-09  1:53 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Peng Fan, Jaehoon Chung, u-boot

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

On Wed, Jul 08, 2026 at 10:05:37PM +0000, Jonas Karlman wrote:

> Use CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) instead of directly checking
> CONFIG_SPL_LIBCOMMON_SUPPORT when guarding printf/log calls to depend on
> correct xPL_LIBCOMMON_SUPPORT symbol. Also change to use IS_ENABLED()
> for the XPL_BUILD symbol checks for consistency.
> 
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>

Reviewed-by: Tom Rini <trini@konsulko.com>

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-09  6:41     ` Jonas Karlman
  2026-07-09 13:41       ` Tom Rini
  0 siblings, 1 reply; 52+ messages in thread
From: Jonas Karlman @ 2026-07-09  6:41 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot

Hi Tom,

On 7/9/2026 3:52 AM, Tom Rini wrote:
> On Wed, Jul 08, 2026 at 10:05:32PM +0000, Jonas Karlman wrote:
> 
>> xPL_<name> symbols should typically depend on the associated xPL symbol.
>>
>> Add missing depends on xPL to xPL_<name> symbols to avoid the xPL_<name>
>> symbols being available when the associated xPL symbol is disabled.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> ---
>>  common/Kconfig | 2 ++
>>  lib/Kconfig    | 7 ++++++-
>>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> Did this go through CI? I ask because with SPL/TPL, we have the problem
> of PowerPC being special from the rest of the world with these symbols
> and I want to be sure everything still is building, before I do a
> before/after size check on the series (and probably keep the binaries,
> so I can checksum before/after and make sure they're the same).
> 

The CI has been run [1] on a branch that contains these changes and the
pending Rockchip TPL cleanup/consistency series, not standalone.

Compared to the patches that was sent there is a small diff with && xPL
being dropped in the final series sent to ML:

 config xPL_SERIAL_PRESENT
        bool "Provide a serial driver in xPL"
-       depends on xPL_DM_SERIAL && xPL
+       depends on xPL_DM_SERIAL
        default y
        help
          In very space-constrained devices even the full UART driver is too

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/pipelines/30636

Regards,
Jonas

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-09  7:12     ` Jonas Karlman
  2026-07-09 13:19       ` Jonas Karlman
                         ` (2 more replies)
  0 siblings, 3 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-09  7:12 UTC (permalink / raw)
  To: Tom Rini; +Cc: Heiko Schocher, u-boot

Hi Tom,

On 7/9/2026 3:52 AM, Tom Rini wrote:
> On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:
> 
>> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
>> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> ---
>>  drivers/i2c/Kconfig | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
>> index ab5af17858c8..125dc84819e6 100644
>> --- a/drivers/i2c/Kconfig
>> +++ b/drivers/i2c/Kconfig
>> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
>>  
>>  config SPL_SYS_I2C_LEGACY
>>  	bool "Enable legacy I2C subsystem and drivers in SPL"
>> -	depends on SUPPORT_SPL && !SPL_DM_I2C
>> +	depends on SPL && !SPL_DM_I2C
>>  	help
>>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
>>  	  in some size constrained situations.
>>  
>>  config TPL_SYS_I2C_LEGACY
>>  	bool "Enable legacy I2C subsystem and drivers in TPL"
>> -	depends on SUPPORT_TPL && !SPL_DM_I2C
>> +	depends on TPL && !TPL_DM_I2C
>>  	help
>>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
>>  	  in some size constrained situations.
> 
> Building on the last email, I think these might need to be
> [ST]PL_FRAMEWORK not [ST]PL.
> 

I have mostly tested this series with additional changes that alias
putc()/puts() to printch()/printascii() in xPL builds when
common/console.o is unavailable and DEBUG_UART=y, patches that will
be sent as a separate series.

It is possible such change may have hidden some latent issues, now
trying to push a branch that contains changes that ends at the patches
included in this series, but due to timeouts it was not possible prior
to sending this reply.

This patch can also be dropped if it causes any issues, I only added it
after a search for SUPPORT_xPL and noticed that these depends seem to be
incorrect. SUPPORT_xPL is used to tell if xPL can be enabled or not,
not if xPL is enabled/disabled.

Regards,
Jonas

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
  2026-07-09  1:53   ` Tom Rini
@ 2026-07-09  7:27     ` Jonas Karlman
  2026-07-09 13:44       ` Tom Rini
  0 siblings, 1 reply; 52+ messages in thread
From: Jonas Karlman @ 2026-07-09  7:27 UTC (permalink / raw)
  To: Tom Rini; +Cc: u-boot

Hi Tom,

On 7/9/2026 3:53 AM, Tom Rini wrote:
> On Wed, Jul 08, 2026 at 10:05:35PM +0000, Jonas Karlman wrote:
> 
>> Change xPL_SERIAL_PRESENT symbols to depend on the xPL_DM_SERIAL symbol
>> intended for the related xPL phase instead of the DM_SERIAL symbol
>> used for U-Boot proper to make CONFIG_IS_ENABLED(SERIAL_PRESENT) guards
>> work as intended.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> ---
>>  drivers/serial/Kconfig | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
>> index e221800d5d06..f125061fe184 100644
>> --- a/drivers/serial/Kconfig
>> +++ b/drivers/serial/Kconfig
>> @@ -71,7 +71,7 @@ config SERIAL_PRESENT
>>  
>>  config SPL_SERIAL_PRESENT
>>  	bool "Provide a serial driver in SPL"
>> -	depends on DM_SERIAL && SPL
>> +	depends on SPL_DM_SERIAL
>>  	default y
>>  	help
>>  	  In very space-constrained devices even the full UART driver is too
> 
> Using the database option to qconfig.py, this is not equivalent. There's
> 901 platforms today that enable SPL_SERIAL_PRESENT, and 344 that enable
> SPL_SERIAL_PRESENT but not SPL_DM_SERIAL. Now it's possible that there's
> no functional change here. Something like "pinetab" would be a single
> platform to check the size changes on as it's SPL_SERIAL_PRESENT=y and
> SPL_DM_SERIAL=n.
> 

This discrepancy is likely due to the 'default y' and the strange
'depend on', based on my observation xPL_SERIAL_PRESENT is mostly used
to guard U_BOOT_DRIVER() and other DM related functions, so I do not
expect any functional change after these changes.

Also did quick build tests of pinetab_defconfig and there was no binary
change to spl/ before or after this series.

Regards,
Jonas

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-09  7:12     ` Jonas Karlman
@ 2026-07-09 13:19       ` Jonas Karlman
  2026-07-09 13:43       ` Tom Rini
  2026-07-10 13:50       ` Tom Rini
  2 siblings, 0 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-09 13:19 UTC (permalink / raw)
  To: Tom Rini; +Cc: Heiko Schocher, u-boot

Hi again,

On 7/9/2026 9:12 AM, Jonas Karlman wrote:
> Hi Tom,
> 
> On 7/9/2026 3:52 AM, Tom Rini wrote:
>> On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:
>>
>>> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
>>> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
>>>
>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>> ---
>>>  drivers/i2c/Kconfig | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
>>> index ab5af17858c8..125dc84819e6 100644
>>> --- a/drivers/i2c/Kconfig
>>> +++ b/drivers/i2c/Kconfig
>>> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
>>>  
>>>  config SPL_SYS_I2C_LEGACY
>>>  	bool "Enable legacy I2C subsystem and drivers in SPL"
>>> -	depends on SUPPORT_SPL && !SPL_DM_I2C
>>> +	depends on SPL && !SPL_DM_I2C
>>>  	help
>>>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
>>>  	  in some size constrained situations.
>>>  
>>>  config TPL_SYS_I2C_LEGACY
>>>  	bool "Enable legacy I2C subsystem and drivers in TPL"
>>> -	depends on SUPPORT_TPL && !SPL_DM_I2C
>>> +	depends on TPL && !TPL_DM_I2C
>>>  	help
>>>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
>>>  	  in some size constrained situations.
>>
>> Building on the last email, I think these might need to be
>> [ST]PL_FRAMEWORK not [ST]PL.
>>
> 
> I have mostly tested this series with additional changes that alias
> putc()/puts() to printch()/printascii() in xPL builds when
> common/console.o is unavailable and DEBUG_UART=y, patches that will
> be sent as a separate series.
> 
> It is possible such change may have hidden some latent issues, now
> trying to push a branch that contains changes that ends at the patches
> included in this series, but due to timeouts it was not possible prior
> to sending this reply.

The CI pipeline [1] has now passed successfully for branch ci-kconfig [2].

[1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/pipelines/30642
[2] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/commits/ci-kconfig

Regards,
Jonas

> 
> This patch can also be dropped if it causes any issues, I only added it
> after a search for SUPPORT_xPL and noticed that these depends seem to be
> incorrect. SUPPORT_xPL is used to tell if xPL can be enabled or not,
> not if xPL is enabled/disabled.
> 
> Regards,
> Jonas


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
  2026-07-09  6:41     ` Jonas Karlman
@ 2026-07-09 13:41       ` Tom Rini
  0 siblings, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09 13:41 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]

On Thu, Jul 09, 2026 at 08:41:16AM +0200, Jonas Karlman wrote:
> Hi Tom,
> 
> On 7/9/2026 3:52 AM, Tom Rini wrote:
> > On Wed, Jul 08, 2026 at 10:05:32PM +0000, Jonas Karlman wrote:
> > 
> >> xPL_<name> symbols should typically depend on the associated xPL symbol.
> >>
> >> Add missing depends on xPL to xPL_<name> symbols to avoid the xPL_<name>
> >> symbols being available when the associated xPL symbol is disabled.
> >>
> >> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >> ---
> >>  common/Kconfig | 2 ++
> >>  lib/Kconfig    | 7 ++++++-
> >>  2 files changed, 8 insertions(+), 1 deletion(-)
> > 
> > Did this go through CI? I ask because with SPL/TPL, we have the problem
> > of PowerPC being special from the rest of the world with these symbols
> > and I want to be sure everything still is building, before I do a
> > before/after size check on the series (and probably keep the binaries,
> > so I can checksum before/after and make sure they're the same).
> > 
> 
> The CI has been run [1] on a branch that contains these changes and the
> pending Rockchip TPL cleanup/consistency series, not standalone.
> 
> Compared to the patches that was sent there is a small diff with && xPL
> being dropped in the final series sent to ML:
> 
>  config xPL_SERIAL_PRESENT
>         bool "Provide a serial driver in xPL"
> -       depends on xPL_DM_SERIAL && xPL
> +       depends on xPL_DM_SERIAL
>         default y
>         help
>           In very space-constrained devices even the full UART driver is too
> 
> [1] https://source.denx.de/u-boot/contributors/kwiboo/u-boot/-/pipelines/30636

OK, thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-09  7:12     ` Jonas Karlman
  2026-07-09 13:19       ` Jonas Karlman
@ 2026-07-09 13:43       ` Tom Rini
  2026-07-10 13:50       ` Tom Rini
  2 siblings, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09 13:43 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Heiko Schocher, u-boot

[-- Attachment #1: Type: text/plain, Size: 2227 bytes --]

On Thu, Jul 09, 2026 at 09:12:24AM +0200, Jonas Karlman wrote:
> Hi Tom,
> 
> On 7/9/2026 3:52 AM, Tom Rini wrote:
> > On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:
> > 
> >> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
> >> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
> >>
> >> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >> ---
> >>  drivers/i2c/Kconfig | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> >> index ab5af17858c8..125dc84819e6 100644
> >> --- a/drivers/i2c/Kconfig
> >> +++ b/drivers/i2c/Kconfig
> >> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
> >>  
> >>  config SPL_SYS_I2C_LEGACY
> >>  	bool "Enable legacy I2C subsystem and drivers in SPL"
> >> -	depends on SUPPORT_SPL && !SPL_DM_I2C
> >> +	depends on SPL && !SPL_DM_I2C
> >>  	help
> >>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
> >>  	  in some size constrained situations.
> >>  
> >>  config TPL_SYS_I2C_LEGACY
> >>  	bool "Enable legacy I2C subsystem and drivers in TPL"
> >> -	depends on SUPPORT_TPL && !SPL_DM_I2C
> >> +	depends on TPL && !TPL_DM_I2C
> >>  	help
> >>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
> >>  	  in some size constrained situations.
> > 
> > Building on the last email, I think these might need to be
> > [ST]PL_FRAMEWORK not [ST]PL.
> > 
> 
> I have mostly tested this series with additional changes that alias
> putc()/puts() to printch()/printascii() in xPL builds when
> common/console.o is unavailable and DEBUG_UART=y, patches that will
> be sent as a separate series.
> 
> It is possible such change may have hidden some latent issues, now
> trying to push a branch that contains changes that ends at the patches
> included in this series, but due to timeouts it was not possible prior
> to sending this reply.

OK. You should have access to git.u-boot-project.org now, to run CI
there. To ensure there's no timeout problems you might need to do a
local patch to switch the yaml to use git.u-boot-project.org too when
cloning test hooks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
  2026-07-09  7:27     ` Jonas Karlman
@ 2026-07-09 13:44       ` Tom Rini
  0 siblings, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-09 13:44 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: u-boot

[-- Attachment #1: Type: text/plain, Size: 2031 bytes --]

On Thu, Jul 09, 2026 at 09:27:07AM +0200, Jonas Karlman wrote:
> Hi Tom,
> 
> On 7/9/2026 3:53 AM, Tom Rini wrote:
> > On Wed, Jul 08, 2026 at 10:05:35PM +0000, Jonas Karlman wrote:
> > 
> >> Change xPL_SERIAL_PRESENT symbols to depend on the xPL_DM_SERIAL symbol
> >> intended for the related xPL phase instead of the DM_SERIAL symbol
> >> used for U-Boot proper to make CONFIG_IS_ENABLED(SERIAL_PRESENT) guards
> >> work as intended.
> >>
> >> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >> ---
> >>  drivers/serial/Kconfig | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> >> index e221800d5d06..f125061fe184 100644
> >> --- a/drivers/serial/Kconfig
> >> +++ b/drivers/serial/Kconfig
> >> @@ -71,7 +71,7 @@ config SERIAL_PRESENT
> >>  
> >>  config SPL_SERIAL_PRESENT
> >>  	bool "Provide a serial driver in SPL"
> >> -	depends on DM_SERIAL && SPL
> >> +	depends on SPL_DM_SERIAL
> >>  	default y
> >>  	help
> >>  	  In very space-constrained devices even the full UART driver is too
> > 
> > Using the database option to qconfig.py, this is not equivalent. There's
> > 901 platforms today that enable SPL_SERIAL_PRESENT, and 344 that enable
> > SPL_SERIAL_PRESENT but not SPL_DM_SERIAL. Now it's possible that there's
> > no functional change here. Something like "pinetab" would be a single
> > platform to check the size changes on as it's SPL_SERIAL_PRESENT=y and
> > SPL_DM_SERIAL=n.
> > 
> 
> This discrepancy is likely due to the 'default y' and the strange
> 'depend on', based on my observation xPL_SERIAL_PRESENT is mostly used
> to guard U_BOOT_DRIVER() and other DM related functions, so I do not
> expect any functional change after these changes.
> 
> Also did quick build tests of pinetab_defconfig and there was no binary
> change to spl/ before or after this series.

OK, good to know, thanks. I'll grab the series and do the world build
before/after test.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-09  7:12     ` Jonas Karlman
  2026-07-09 13:19       ` Jonas Karlman
  2026-07-09 13:43       ` Tom Rini
@ 2026-07-10 13:50       ` Tom Rini
  2026-07-10 15:39         ` Jonas Karlman
  2 siblings, 1 reply; 52+ messages in thread
From: Tom Rini @ 2026-07-10 13:50 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Heiko Schocher, u-boot

[-- Attachment #1: Type: text/plain, Size: 2866 bytes --]

On Thu, Jul 09, 2026 at 09:12:24AM +0200, Jonas Karlman wrote:
> Hi Tom,
> 
> On 7/9/2026 3:52 AM, Tom Rini wrote:
> > On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:
> > 
> >> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
> >> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
> >>
> >> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >> ---
> >>  drivers/i2c/Kconfig | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> >> index ab5af17858c8..125dc84819e6 100644
> >> --- a/drivers/i2c/Kconfig
> >> +++ b/drivers/i2c/Kconfig
> >> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
> >>  
> >>  config SPL_SYS_I2C_LEGACY
> >>  	bool "Enable legacy I2C subsystem and drivers in SPL"
> >> -	depends on SUPPORT_SPL && !SPL_DM_I2C
> >> +	depends on SPL && !SPL_DM_I2C
> >>  	help
> >>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
> >>  	  in some size constrained situations.
> >>  
> >>  config TPL_SYS_I2C_LEGACY
> >>  	bool "Enable legacy I2C subsystem and drivers in TPL"
> >> -	depends on SUPPORT_TPL && !SPL_DM_I2C
> >> +	depends on TPL && !TPL_DM_I2C
> >>  	help
> >>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
> >>  	  in some size constrained situations.
> > 
> > Building on the last email, I think these might need to be
> > [ST]PL_FRAMEWORK not [ST]PL.
> > 
> 
> I have mostly tested this series with additional changes that alias
> putc()/puts() to printch()/printascii() in xPL builds when
> common/console.o is unavailable and DEBUG_UART=y, patches that will
> be sent as a separate series.
> 
> It is possible such change may have hidden some latent issues, now
> trying to push a branch that contains changes that ends at the patches
> included in this series, but due to timeouts it was not possible prior
> to sending this reply.
> 
> This patch can also be dropped if it causes any issues, I only added it
> after a search for SUPPORT_xPL and noticed that these depends seem to be
> incorrect. SUPPORT_xPL is used to tell if xPL can be enabled or not,
> not if xPL is enabled/disabled.

I don't want to drop this, but there are a handful of platforms that
change:
10: Kconfig: i2c: Depend on correct xPL symbol
   aarch64: (for 1/1 boards) all -60.0 text -60.0
            ls1043aqds_tfa : all -60 text -60
               u-boot: add: 0/-1, grow: 0/-1 bytes: 0/-60 (-60)
                 function                                   old     new   delta
                 board_early_init_f                          68      64      -4
                 i2c_early_init_f                            56       -     -56

Can you please look in to it and see what needs to be changed? Thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
  2026-07-09  1:53   ` Tom Rini
@ 2026-07-10 13:51     ` Tom Rini
  0 siblings, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-10 13:51 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Peng Fan, Jaehoon Chung, u-boot

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

On Wed, Jul 08, 2026 at 07:53:13PM -0600, Tom Rini wrote:
> On Wed, Jul 08, 2026 at 10:05:37PM +0000, Jonas Karlman wrote:
> 
> > Use CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) instead of directly checking
> > CONFIG_SPL_LIBCOMMON_SUPPORT when guarding printf/log calls to depend on
> > correct xPL_LIBCOMMON_SUPPORT symbol. Also change to use IS_ENABLED()
> > for the XPL_BUILD symbol checks for consistency.
> > 
> > Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> 
> Reviewed-by: Tom Rini <trini@konsulko.com>

So, this isn't size-neutral:
   aarch64: (for 1/1 boards) all +77.0 rodata +57.0 text +20.0
            ax3005_scm3005 : all +77 rodata +57 text +20
               u-boot: add: 0/0, grow: 2/0 bytes: 41/0 (41)
                 function                                   old     new   delta
                 static.__func__                            285     306     +21
                 fit_find_config_node                       240     260     +20

(and a number of other boards). But I think it's a bug fix of
unintentional behavior today. So I'm just noting this here for the
record.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-10 13:50       ` Tom Rini
@ 2026-07-10 15:39         ` Jonas Karlman
  2026-07-10 15:56           ` Tom Rini
  0 siblings, 1 reply; 52+ messages in thread
From: Jonas Karlman @ 2026-07-10 15:39 UTC (permalink / raw)
  To: Tom Rini; +Cc: Heiko Schocher, u-boot

Hi Tom,

On 7/10/2026 3:50 PM, Tom Rini wrote:
> On Thu, Jul 09, 2026 at 09:12:24AM +0200, Jonas Karlman wrote:
>> Hi Tom,
>>
>> On 7/9/2026 3:52 AM, Tom Rini wrote:
>>> On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:
>>>
>>>> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
>>>> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
>>>>
>>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>>> ---
>>>>  drivers/i2c/Kconfig | 4 ++--
>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
>>>> index ab5af17858c8..125dc84819e6 100644
>>>> --- a/drivers/i2c/Kconfig
>>>> +++ b/drivers/i2c/Kconfig
>>>> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
>>>>  
>>>>  config SPL_SYS_I2C_LEGACY
>>>>  	bool "Enable legacy I2C subsystem and drivers in SPL"
>>>> -	depends on SUPPORT_SPL && !SPL_DM_I2C
>>>> +	depends on SPL && !SPL_DM_I2C
>>>>  	help
>>>>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
>>>>  	  in some size constrained situations.
>>>>  
>>>>  config TPL_SYS_I2C_LEGACY
>>>>  	bool "Enable legacy I2C subsystem and drivers in TPL"
>>>> -	depends on SUPPORT_TPL && !SPL_DM_I2C
>>>> +	depends on TPL && !TPL_DM_I2C
>>>>  	help
>>>>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
>>>>  	  in some size constrained situations.
>>>
>>> Building on the last email, I think these might need to be
>>> [ST]PL_FRAMEWORK not [ST]PL.
>>>
>>
>> I have mostly tested this series with additional changes that alias
>> putc()/puts() to printch()/printascii() in xPL builds when
>> common/console.o is unavailable and DEBUG_UART=y, patches that will
>> be sent as a separate series.
>>
>> It is possible such change may have hidden some latent issues, now
>> trying to push a branch that contains changes that ends at the patches
>> included in this series, but due to timeouts it was not possible prior
>> to sending this reply.
>>
>> This patch can also be dropped if it causes any issues, I only added it
>> after a search for SUPPORT_xPL and noticed that these depends seem to be
>> incorrect. SUPPORT_xPL is used to tell if xPL can be enabled or not,
>> not if xPL is enabled/disabled.
> 
> I don't want to drop this, but there are a handful of platforms that
> change:
> 10: Kconfig: i2c: Depend on correct xPL symbol
>    aarch64: (for 1/1 boards) all -60.0 text -60.0
>             ls1043aqds_tfa : all -60 text -60
>                u-boot: add: 0/-1, grow: 0/-1 bytes: 0/-60 (-60)
>                  function                                   old     new   delta
>                  board_early_init_f                          68      64      -4
>                  i2c_early_init_f                            56       -     -56
> 
> Can you please look in to it and see what needs to be changed? Thanks.

From a quick look this size change may be caused due to use of an
'imply SPL_SYS_I2C_LEGACY' instead of using an 'imply SYS_I2C_LEGACY'
in arch/arm/cpu/armv8/fsl-layerscape/Kconfig.

'config MACH_SUN8I_R40' is another platform that also possible miss
an 'imply SYS_I2C_LEGACY' to match other similar sunxi platforms.

Building this target I also noticed some more SPL_<name> symbols that
may be missing a 'depends on SPL':

  > grep CONFIG_SPL .config
  # CONFIG_SPL_SYS_L2_PL310 is not set
  # CONFIG_SPL is not set
  # CONFIG_SPL_SYS_STDIO_DEREGISTER is not set
  # CONFIG_SPL_NVMEM is not set
  CONFIG_SPL_SYS_NAND_SELF_INIT=y
  # CONFIG_SPL_PHY_ATHEROS is not set
  # CONFIG_SPL_PHY_TI_DP83867 is not set
  # CONFIG_SPL_LZMA_SIZE_OPTIMIZATION is not set

Should possible add 'depends on' to some of them in a v2.

Regards,
Jonas

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-10 15:39         ` Jonas Karlman
@ 2026-07-10 15:56           ` Tom Rini
  2026-07-10 23:52             ` Jonas Karlman
  0 siblings, 1 reply; 52+ messages in thread
From: Tom Rini @ 2026-07-10 15:56 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Heiko Schocher, u-boot

[-- Attachment #1: Type: text/plain, Size: 4057 bytes --]

On Fri, Jul 10, 2026 at 05:39:08PM +0200, Jonas Karlman wrote:
> Hi Tom,
> 
> On 7/10/2026 3:50 PM, Tom Rini wrote:
> > On Thu, Jul 09, 2026 at 09:12:24AM +0200, Jonas Karlman wrote:
> >> Hi Tom,
> >>
> >> On 7/9/2026 3:52 AM, Tom Rini wrote:
> >>> On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:
> >>>
> >>>> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
> >>>> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
> >>>>
> >>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >>>> ---
> >>>>  drivers/i2c/Kconfig | 4 ++--
> >>>>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> >>>> index ab5af17858c8..125dc84819e6 100644
> >>>> --- a/drivers/i2c/Kconfig
> >>>> +++ b/drivers/i2c/Kconfig
> >>>> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
> >>>>  
> >>>>  config SPL_SYS_I2C_LEGACY
> >>>>  	bool "Enable legacy I2C subsystem and drivers in SPL"
> >>>> -	depends on SUPPORT_SPL && !SPL_DM_I2C
> >>>> +	depends on SPL && !SPL_DM_I2C
> >>>>  	help
> >>>>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
> >>>>  	  in some size constrained situations.
> >>>>  
> >>>>  config TPL_SYS_I2C_LEGACY
> >>>>  	bool "Enable legacy I2C subsystem and drivers in TPL"
> >>>> -	depends on SUPPORT_TPL && !SPL_DM_I2C
> >>>> +	depends on TPL && !TPL_DM_I2C
> >>>>  	help
> >>>>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
> >>>>  	  in some size constrained situations.
> >>>
> >>> Building on the last email, I think these might need to be
> >>> [ST]PL_FRAMEWORK not [ST]PL.
> >>>
> >>
> >> I have mostly tested this series with additional changes that alias
> >> putc()/puts() to printch()/printascii() in xPL builds when
> >> common/console.o is unavailable and DEBUG_UART=y, patches that will
> >> be sent as a separate series.
> >>
> >> It is possible such change may have hidden some latent issues, now
> >> trying to push a branch that contains changes that ends at the patches
> >> included in this series, but due to timeouts it was not possible prior
> >> to sending this reply.
> >>
> >> This patch can also be dropped if it causes any issues, I only added it
> >> after a search for SUPPORT_xPL and noticed that these depends seem to be
> >> incorrect. SUPPORT_xPL is used to tell if xPL can be enabled or not,
> >> not if xPL is enabled/disabled.
> > 
> > I don't want to drop this, but there are a handful of platforms that
> > change:
> > 10: Kconfig: i2c: Depend on correct xPL symbol
> >    aarch64: (for 1/1 boards) all -60.0 text -60.0
> >             ls1043aqds_tfa : all -60 text -60
> >                u-boot: add: 0/-1, grow: 0/-1 bytes: 0/-60 (-60)
> >                  function                                   old     new   delta
> >                  board_early_init_f                          68      64      -4
> >                  i2c_early_init_f                            56       -     -56
> > 
> > Can you please look in to it and see what needs to be changed? Thanks.
> 
> From a quick look this size change may be caused due to use of an
> 'imply SPL_SYS_I2C_LEGACY' instead of using an 'imply SYS_I2C_LEGACY'
> in arch/arm/cpu/armv8/fsl-layerscape/Kconfig.
> 
> 'config MACH_SUN8I_R40' is another platform that also possible miss
> an 'imply SYS_I2C_LEGACY' to match other similar sunxi platforms.
> 
> Building this target I also noticed some more SPL_<name> symbols that
> may be missing a 'depends on SPL':
> 
>   > grep CONFIG_SPL .config
>   # CONFIG_SPL_SYS_L2_PL310 is not set
>   # CONFIG_SPL is not set
>   # CONFIG_SPL_SYS_STDIO_DEREGISTER is not set
>   # CONFIG_SPL_NVMEM is not set
>   CONFIG_SPL_SYS_NAND_SELF_INIT=y
>   # CONFIG_SPL_PHY_ATHEROS is not set
>   # CONFIG_SPL_PHY_TI_DP83867 is not set
>   # CONFIG_SPL_LZMA_SIZE_OPTIMIZATION is not set
> 
> Should possible add 'depends on' to some of them in a v2.

Great, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-10 15:56           ` Tom Rini
@ 2026-07-10 23:52             ` Jonas Karlman
  2026-07-13 21:48               ` Tom Rini
  0 siblings, 1 reply; 52+ messages in thread
From: Jonas Karlman @ 2026-07-10 23:52 UTC (permalink / raw)
  To: Tom Rini; +Cc: Heiko Schocher, u-boot

Hi Tom,

On 7/10/2026 5:56 PM, Tom Rini wrote:
> On Fri, Jul 10, 2026 at 05:39:08PM +0200, Jonas Karlman wrote:
>> Hi Tom,
>>
>> On 7/10/2026 3:50 PM, Tom Rini wrote:
>>> On Thu, Jul 09, 2026 at 09:12:24AM +0200, Jonas Karlman wrote:
>>>> Hi Tom,
>>>>
>>>> On 7/9/2026 3:52 AM, Tom Rini wrote:
>>>>> On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:
>>>>>
>>>>>> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
>>>>>> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
>>>>>>
>>>>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>>>>> ---
>>>>>>  drivers/i2c/Kconfig | 4 ++--
>>>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
>>>>>> index ab5af17858c8..125dc84819e6 100644
>>>>>> --- a/drivers/i2c/Kconfig
>>>>>> +++ b/drivers/i2c/Kconfig
>>>>>> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
>>>>>>  
>>>>>>  config SPL_SYS_I2C_LEGACY
>>>>>>  	bool "Enable legacy I2C subsystem and drivers in SPL"
>>>>>> -	depends on SUPPORT_SPL && !SPL_DM_I2C
>>>>>> +	depends on SPL && !SPL_DM_I2C
>>>>>>  	help
>>>>>>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
>>>>>>  	  in some size constrained situations.
>>>>>>  
>>>>>>  config TPL_SYS_I2C_LEGACY
>>>>>>  	bool "Enable legacy I2C subsystem and drivers in TPL"
>>>>>> -	depends on SUPPORT_TPL && !SPL_DM_I2C
>>>>>> +	depends on TPL && !TPL_DM_I2C
>>>>>>  	help
>>>>>>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
>>>>>>  	  in some size constrained situations.
>>>>>
>>>>> Building on the last email, I think these might need to be
>>>>> [ST]PL_FRAMEWORK not [ST]PL.
>>>>>
>>>>
>>>> I have mostly tested this series with additional changes that alias
>>>> putc()/puts() to printch()/printascii() in xPL builds when
>>>> common/console.o is unavailable and DEBUG_UART=y, patches that will
>>>> be sent as a separate series.
>>>>
>>>> It is possible such change may have hidden some latent issues, now
>>>> trying to push a branch that contains changes that ends at the patches
>>>> included in this series, but due to timeouts it was not possible prior
>>>> to sending this reply.
>>>>
>>>> This patch can also be dropped if it causes any issues, I only added it
>>>> after a search for SUPPORT_xPL and noticed that these depends seem to be
>>>> incorrect. SUPPORT_xPL is used to tell if xPL can be enabled or not,
>>>> not if xPL is enabled/disabled.
>>>
>>> I don't want to drop this, but there are a handful of platforms that
>>> change:
>>> 10: Kconfig: i2c: Depend on correct xPL symbol
>>>    aarch64: (for 1/1 boards) all -60.0 text -60.0
>>>             ls1043aqds_tfa : all -60 text -60
>>>                u-boot: add: 0/-1, grow: 0/-1 bytes: 0/-60 (-60)
>>>                  function                                   old     new   delta
>>>                  board_early_init_f                          68      64      -4
>>>                  i2c_early_init_f                            56       -     -56
>>>
>>> Can you please look in to it and see what needs to be changed? Thanks.
>>
>> From a quick look this size change may be caused due to use of an
>> 'imply SPL_SYS_I2C_LEGACY' instead of using an 'imply SYS_I2C_LEGACY'
>> in arch/arm/cpu/armv8/fsl-layerscape/Kconfig.
>>
>> 'config MACH_SUN8I_R40' is another platform that also possible miss
>> an 'imply SYS_I2C_LEGACY' to match other similar sunxi platforms.

I have now done some more digging and it looks like SYS_I2C_EARLY_INIT
is the culprit.

  config SYS_I2C_EARLY_INIT
	bool "Enable legacy I2C subsystem early in boot"
	depends on BOARD_EARLY_INIT_F && SPL_SYS_I2C_LEGACY && SYS_I2C_MXC
	help
	  Add the function prototype for i2c_early_init_f which is called in
	  board_early_init_f.

Not sure what to do here, it is possible that just dropping
SPL_SYS_I2C_LEGACY from depends would ensure the code is restored.

However, that also feels strange as the intent of i2c_early_init_f() is
to initialize I2C_LEGACY, and most of the affected boards use DM_I2C:

  > tools/qconfig.py -f ~SPL SYS_I2C_EARLY_INIT
  5 matches
  ls1043aqds_tfa_SECURE_BOOT ls1043aqds_tfa ls1046aqds_tfa_SECURE_BOOT ls1046aqds_tfa ls2080aqds_qspi

  > tools/qconfig.py -f ~SPL SYS_I2C_EARLY_INIT ~DM_I2C
  1 matches
  ls2080aqds_qspi

(Please note that my qconfig.db does not cover 100% of all defconfigs.)

All other code seem to be protected by CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
so I am not expecting any other change for targets that use xPL=n.

Regards,
Jonas

>>
>> Building this target I also noticed some more SPL_<name> symbols that
>> may be missing a 'depends on SPL':
>>
>>   > grep CONFIG_SPL .config
>>   # CONFIG_SPL_SYS_L2_PL310 is not set
>>   # CONFIG_SPL is not set
>>   # CONFIG_SPL_SYS_STDIO_DEREGISTER is not set
>>   # CONFIG_SPL_NVMEM is not set
>>   CONFIG_SPL_SYS_NAND_SELF_INIT=y
>>   # CONFIG_SPL_PHY_ATHEROS is not set
>>   # CONFIG_SPL_PHY_TI_DP83867 is not set
>>   # CONFIG_SPL_LZMA_SIZE_OPTIMIZATION is not set
>>
>> Should possible add 'depends on' to some of them in a v2.
> 
> Great, thanks!
> 


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks
  2026-07-08 22:05 ` [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-13 14:23   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:23 UTC (permalink / raw)
  To: jonas
  Cc: Tom Rini, Ilias Apalodimas, Simon Glass, Quentin Schulz,
	Kever Yang, u-boot

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> Makefile: Drop redundant CONFIG_TPL_BUILD checks
>
> The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
> Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
> are therefore redundant.
>
> Drop the redundant TPL_BUILD symbol check from conditional guards that
> also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
> symbol rename.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> arch/arm/mach-rockchip/Makefile | 2 +-
>  drivers/Makefile                | 2 +-
>  drivers/bus/Makefile            | 2 +-
>  drivers/mtd/Makefile            | 2 +-
>  drivers/mtd/nand/Makefile       | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check
  2026-07-08 22:05 ` [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-13 14:23   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:23 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, Simon Glass, u-boot

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> dm: core: Drop redundant CONFIG_TPL_BUILD check
>
> The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
> Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
> are therefore redundant.
>
> Drop the redundant TPL_BUILD symbol check from conditional guards that
> also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
> symbol rename.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> drivers/core/ofnode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks
  2026-07-08 22:05 ` [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-13 14:23   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:23 UTC (permalink / raw)
  To: jonas
  Cc: Tom Rini, Lukasz Majewski, Simon Glass, Quentin Schulz,
	Kever Yang, u-boot

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks
>
> The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
> Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
> are therefore redundant.
>
> Drop the redundant TPL_BUILD symbol check from conditional guards that
> also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
> symbol rename.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> drivers/clk/rockchip/clk_rk3368.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
  2026-07-08 22:05 ` [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-13 14:23   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:23 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, Simon Glass, Bin Meng, u-boot

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
>
> The XPL_BUILD symbol is set for all xPL phases, i.e. TPL, VPL and SPL.
> Conditional guards that test for both XPL_BUILD and TPL_BUILD symbols
> are therefore redundant.
>
> Drop the redundant TPL_BUILD symbol check from conditional guards that
> also test for the XPL_BUILD symbol to cleanup from an old SPL to XPL
> symbol rename.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> arch/x86/cpu/apollolake/fsp_bindings.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example
  2026-07-08 22:05 ` [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-13 14:24   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:24 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, u-boot

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> spl: Simplify xPL_BUILD conditional guard example
>
> The old meaning of the SPL_BUILD symbol has been transfered to a new
> XPL_BUILD symbol, leaving the SPL_BUILD symbol only to be defined for
> SPL builds, and not all xPL builds.
>
> Change to only use the SPL_BUILD symbol in the SPL code example to
> cleanup from an old SPL to XPL symbol rename.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> include/spl.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
  2026-07-08 22:05 ` [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-13 14:24   ` Simon Glass
  2026-07-13 14:53     ` Jonas Karlman
  1 sibling, 1 reply; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:24 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, u-boot

Hi Jonas,

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> Kconfig: Add missing depends on xPL to xPL_ symbols
>
> xPL_<name> symbols should typically depend on the associated xPL symbol.
>
> Add missing depends on xPL to xPL_<name> symbols to avoid the xPL_<name>
> symbols being available when the associated xPL symbol is disabled.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>
> common/Kconfig | 2 ++
>  lib/Kconfig    | 7 ++++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)

> diff --git a/lib/Kconfig b/lib/Kconfig
> @@ -972,23 +973,27 @@ config SPL_LZO
>  config TPL_GZIP
> -     bool "Enable gzip decompression support for SPL build"
> +     bool "Enable gzip decompression support for TPL build"
> +     depends on TPL

The prompt fix is separate from adding the dependencies, so please can
you mention it in the commit message? Otherwise it looks like a stray
hunk.

> diff --git a/lib/Kconfig b/lib/Kconfig
> @@ -960,6 +960,7 @@ config TPL_LZMA
>  config VPL_LZMA
>       bool "Enable LZMA decompression support for VPL build"
> +     depends on VPL

BTW SPL_LZMA_SIZE_OPTIMIZATION (between SPL_LZMA and TPL_LZMA) has no
dependency at all, so it shows up in menuconfig even without SPL. It
fits the pattern this patch fixes and could get 'depends on SPL_LZMA'
while you are here. What do you think?

Reviewed-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 07/11] Kconfig: Depend on correct xPL symbol
  2026-07-08 22:05 ` [PATCH 07/11] Kconfig: Depend on correct xPL symbol Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-13 14:25   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:25 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, Simon Glass, u-boot

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> Kconfig: Depend on correct xPL symbol
>
> Change to depend on correct xPL symbol instead of a xPL symbol intended
> for a different phase to make affected symbols available for correct
> phase.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> arch/Kconfig         | 2 +-
>  common/spl/Kconfig   | 2 +-
>  drivers/core/Kconfig | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-08 22:05 ` [PATCH 08/11] Kconfig: i2c: " Jonas Karlman
  2026-07-09  1:52   ` Tom Rini
@ 2026-07-13 14:28   ` Simon Glass
  2026-07-13 15:02     ` Jonas Karlman
  1 sibling, 1 reply; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:28 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, Heiko Schocher, u-boot

Hi Jonas,

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> Kconfig: i2c: Depend on correct xPL symbol
>
> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>
> drivers/i2c/Kconfig | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
>  config TPL_SYS_I2C_LEGACY
>       bool "Enable legacy I2C subsystem and drivers in TPL"
> -     depends on SUPPORT_TPL && !SPL_DM_I2C
> +     depends on TPL && !TPL_DM_I2C

This also changes !SPL_DM_I2C to !TPL_DM_I2C, which fixes what looks
like a copy-paste error, similar to the DM_SERIAL fix in the next
patch. Please can you mention this in the commit message too? I
checked the boards that enable TPL_SYS_I2C_LEGACY (the mpc85xx
P1010RDB / P1020RDB / P2020RDB NAND configs) and none enables SPL_DM
or TPL_DM, so there should no functional change, but it is worth
recording that this dependency is also being corrected.

With that (assuming you figure out what Tom raised):

Reviewed-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
  2026-07-08 22:05 ` [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks Jonas Karlman
  2026-07-09  1:53   ` Tom Rini
@ 2026-07-13 14:29   ` Simon Glass
  2026-07-13 15:16     ` Jonas Karlman
  1 sibling, 1 reply; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:29 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, Stefan Bosch, u-boot

Hi Jonas,

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
>
> The xPL_SILENT_CONSOLE Kconfig symbols are not fully respected for xPL
> builds, instead common code is guarded by a mix of SILENT_CONSOLE and
> xPL_SILENT_CONSOLE symbols.
>
> Change to consistently use CONFIG_IS_ENABLED(SILENT_CONSOLE) to make the
> common code properly guarded by the intended Kconfig symbol.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> board/friendlyarm/nanopi2/board.c |  4 ++--
>  boot/bootm.c                      |  4 ++--
>  common/autoboot.c                 |  2 +-
>  common/console.c                  | 12 ++++++------
>  include/env_callback.h            |  2 +-
>  5 files changed, 12 insertions(+), 12 deletions(-)

> diff --git a/common/console.c b/common/console.c
> @@ -736,7 +736,7 @@ void putc(const char c)
> -     if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
> +     if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {

This slightly changes what SPL_SILENT_CONSOLE means. Previously the
xPL symbol only dropped the boot-progress messages in spl.c at build
time, but now it also gates the run-time GD_FLG_SILENT checks here
when console.c is built for SPL (i.e. with SPL_SERIAL). The help text
in common/Kconfig still says "The GD_FLG_SILENT flag is not used in
SPL so there is no run-time control of console messages in SPL", which
no longer matches. Please can you update the SPL_SILENT_CONSOLE and
TPL_SILENT_CONSOLE help text?

> diff --git a/common/console.c b/common/console.c
> @@ -72,7 +72,7 @@ static int on_console(const char *name, const char *value, enum env_op op,
> -#ifdef CONFIG_SILENT_CONSOLE
> +#if CONFIG_IS_ENABLED(SILENT_CONSOLE)

Just to check: there is no VPL_SILENT_CONSOLE symbol, so in a VPL
build this (and the other converted checks) is now always false, where
before it followed the proper symbol. I suspect that is fine since no
in-tree board enables both VPL and SILENT_CONSOLE, but please mention
it in the commit message, or add the VPL symbol alongside the SPL/TPL
ones in common/Kconfig

Regards,
Simon

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
  2026-07-08 22:05 ` [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks Jonas Karlman
  2026-07-09  1:53   ` Tom Rini
@ 2026-07-13 14:29   ` Simon Glass
  1 sibling, 0 replies; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:29 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, Peng Fan, Jaehoon Chung, u-boot

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
>
> Use CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT) instead of directly checking
> CONFIG_SPL_LIBCOMMON_SUPPORT when guarding printf/log calls to depend on
> correct xPL_LIBCOMMON_SUPPORT symbol. Also change to use IS_ENABLED()
> for the XPL_BUILD symbol checks for consistency.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> Reviewed-by: Tom Rini <trini@konsulko.com>
>
> boot/common_fit.c        |  2 +-
>  common/spl/spl_usb.c     |  2 +-
>  drivers/mmc/mmc-uclass.c |  4 ++--
>  drivers/mmc/mmc.c        | 16 ++++++++--------
>  drivers/mmc/mmc_legacy.c |  4 ++--
>  include/spl.h            |  6 +++---
>  lib/hang.c               |  2 +-
>  7 files changed, 18 insertions(+), 18 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
  2026-07-08 22:05 ` [PATCH 09/11] Kconfig: serial: " Jonas Karlman
  2026-07-09  1:53   ` Tom Rini
@ 2026-07-13 14:30   ` Simon Glass
  2026-07-13 15:10     ` Jonas Karlman
  1 sibling, 1 reply; 52+ messages in thread
From: Simon Glass @ 2026-07-13 14:30 UTC (permalink / raw)
  To: jonas; +Cc: Tom Rini, u-boot

Hi Jonas,

On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> Kconfig: serial: Depend on correct xPL symbol
>
> Change xPL_SERIAL_PRESENT symbols to depend on the xPL_DM_SERIAL symbol
> intended for the related xPL phase instead of the DM_SERIAL symbol
> used for U-Boot proper to make CONFIG_IS_ENABLED(SERIAL_PRESENT) guards
> work as intended.
>
> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>
> drivers/serial/Kconfig | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> @@ -81,7 +81,7 @@ config SPL_SERIAL_PRESENT
>  config TPL_SERIAL_PRESENT
>       bool "Provide a serial driver in TPL"
> -     depends on DM_SERIAL && TPL
> +     depends on TPL_DM_SERIAL

BTW this makes the workaround in ns16550.c redundant:

    /* TODO(sjg@chromium.org): Integrate this into a macro like
CONFIG_IS_ENABLED */
    #if !defined(CONFIG_TPL_BUILD) || defined(CONFIG_TPL_DM_SERIAL)

That guard sits inside CONFIG_IS_ENABLED(SERIAL_PRESENT), which with
this change already implies TPL_DM_SERIAL in a TPL build. Please can
you add a patch to drop it? I'd be happy to see that hack go :-)

> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
> @@ -91,7 +91,7 @@ config TPL_SERIAL_PRESENT
>  config VPL_SERIAL_PRESENT
>       bool "Provide a serial driver in VPL"
> -     depends on DM_SERIAL && VPL
> +     depends on VPL_DM_SERIAL

Just below this, the help text says 'This option enables the full UART
in TPL' where it should say VPL - it would be nice to fix it here or
in a follow-up.

Reviewed-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
  2026-07-13 14:24   ` Simon Glass
@ 2026-07-13 14:53     ` Jonas Karlman
  0 siblings, 0 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-13 14:53 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, u-boot

On 7/13/2026 4:24 PM, Simon Glass wrote:
> Hi Jonas,
> 
> On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
>> Kconfig: Add missing depends on xPL to xPL_ symbols
>>
>> xPL_<name> symbols should typically depend on the associated xPL symbol.
>>
>> Add missing depends on xPL to xPL_<name> symbols to avoid the xPL_<name>
>> symbols being available when the associated xPL symbol is disabled.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>
>> common/Kconfig | 2 ++
>>  lib/Kconfig    | 7 ++++++-
>>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
>> diff --git a/lib/Kconfig b/lib/Kconfig
>> @@ -972,23 +973,27 @@ config SPL_LZO
>>  config TPL_GZIP
>> -     bool "Enable gzip decompression support for SPL build"
>> +     bool "Enable gzip decompression support for TPL build"
>> +     depends on TPL
> 
> The prompt fix is separate from adding the dependencies, so please can
> you mention it in the commit message? Otherwise it looks like a stray
> hunk.

Sure, will update commit message in v2.

> 
>> diff --git a/lib/Kconfig b/lib/Kconfig
>> @@ -960,6 +960,7 @@ config TPL_LZMA
>>  config VPL_LZMA
>>       bool "Enable LZMA decompression support for VPL build"
>> +     depends on VPL
> 
> BTW SPL_LZMA_SIZE_OPTIMIZATION (between SPL_LZMA and TPL_LZMA) has no
> dependency at all, so it shows up in menuconfig even without SPL. It
> fits the pattern this patch fixes and could get 'depends on SPL_LZMA'
> while you are here. What do you think?

Thanks, I have already added following for v2 of this patch:

- SPL_SYS_L2_PL310
- SPL_SYS_STDIO_DEREGISTER
- SPL_NVMEM

And a new patch that adds depends on [xPL_]LZMA to
[xPL_]LZMA_SIZE_OPTIMIZATION symbols, I felt it was different enough to
put such change in a dedicated patch.

Will send the v2 once the I2C_LEGACY size change is resolved/accepted.

Regards,
Jonas

> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Regards,
> Simon

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-13 14:28   ` Simon Glass
@ 2026-07-13 15:02     ` Jonas Karlman
  2026-07-13 15:17       ` Simon Glass
  0 siblings, 1 reply; 52+ messages in thread
From: Jonas Karlman @ 2026-07-13 15:02 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, Heiko Schocher, u-boot

Hi Simon,

On 7/13/2026 4:28 PM, Simon Glass wrote:
> Hi Jonas,
> 
> On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
>> Kconfig: i2c: Depend on correct xPL symbol
>>
>> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
>> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>
>> drivers/i2c/Kconfig | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
>> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
>> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
>>  config TPL_SYS_I2C_LEGACY
>>       bool "Enable legacy I2C subsystem and drivers in TPL"
>> -     depends on SUPPORT_TPL && !SPL_DM_I2C
>> +     depends on TPL && !TPL_DM_I2C
> 
> This also changes !SPL_DM_I2C to !TPL_DM_I2C, which fixes what looks
> like a copy-paste error, similar to the DM_SERIAL fix in the next
> patch. Please can you mention this in the commit message too? I
> checked the boards that enable TPL_SYS_I2C_LEGACY (the mpc85xx
> P1010RDB / P1020RDB / P2020RDB NAND configs) and none enables SPL_DM
> or TPL_DM, so there should no functional change, but it is worth
> recording that this dependency is also being corrected.

Sure and great, I will update commit message in v2.

> 
> With that (assuming you figure out what Tom raised):

It looked like SYS_I2C_EARLY_INIT is the culprit for size change.

See [1] for my findings, and I am still not sure if we can live without
the call to i2c_early_init_f() for the handful of possible affected
boards.

My gut feeling, without knowing anything about the affected platform,
says we should accept the dropped call to i2c_early_init_f() ;-)

[1] https://lore.kernel.org/u-boot/975a650f-88cf-4b2d-8f83-2df3f93ab25d@kwiboo.se/

Regards,
Jonas

> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Regards,
> Simon


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
  2026-07-13 14:30   ` Simon Glass
@ 2026-07-13 15:10     ` Jonas Karlman
  0 siblings, 0 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-13 15:10 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, u-boot

Hi Simon,

On 7/13/2026 4:30 PM, Simon Glass wrote:
> Hi Jonas,
> 
> On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
>> Kconfig: serial: Depend on correct xPL symbol
>>
>> Change xPL_SERIAL_PRESENT symbols to depend on the xPL_DM_SERIAL symbol
>> intended for the related xPL phase instead of the DM_SERIAL symbol
>> used for U-Boot proper to make CONFIG_IS_ENABLED(SERIAL_PRESENT) guards
>> work as intended.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>>
>> drivers/serial/Kconfig | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
>> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
>> @@ -81,7 +81,7 @@ config SPL_SERIAL_PRESENT
>>  config TPL_SERIAL_PRESENT
>>       bool "Provide a serial driver in TPL"
>> -     depends on DM_SERIAL && TPL
>> +     depends on TPL_DM_SERIAL
> 
> BTW this makes the workaround in ns16550.c redundant:
> 
>     /* TODO(sjg@chromium.org): Integrate this into a macro like
> CONFIG_IS_ENABLED */
>     #if !defined(CONFIG_TPL_BUILD) || defined(CONFIG_TPL_DM_SERIAL)
> 
> That guard sits inside CONFIG_IS_ENABLED(SERIAL_PRESENT), which with
> this change already implies TPL_DM_SERIAL in a TPL build. Please can
> you add a patch to drop it? I'd be happy to see that hack go :-)

Sure, I will add a patch to drop this in v2.

I was initially unsure if we needed this after the
CONFIG_IS_ENABLED(SERIAL_PRESENT) change, so decided to ignore it.

Very good to have confirmation that this indeed no longer is needed :-)

> 
>> diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
>> @@ -91,7 +91,7 @@ config TPL_SERIAL_PRESENT
>>  config VPL_SERIAL_PRESENT
>>       bool "Provide a serial driver in VPL"
>> -     depends on DM_SERIAL && VPL
>> +     depends on VPL_DM_SERIAL
> 
> Just below this, the help text says 'This option enables the full UART
> in TPL' where it should say VPL - it would be nice to fix it here or
> in a follow-up.

Sure, I will include a fix for this typo in v2.

Regards,
Jonas

> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> Regards,
> Simon


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
  2026-07-13 14:29   ` Simon Glass
@ 2026-07-13 15:16     ` Jonas Karlman
  0 siblings, 0 replies; 52+ messages in thread
From: Jonas Karlman @ 2026-07-13 15:16 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, Stefan Bosch, u-boot

Hi Simon,

On 7/13/2026 4:29 PM, Simon Glass wrote:
> Hi Jonas,
> 
> On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
>> console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
>>
>> The xPL_SILENT_CONSOLE Kconfig symbols are not fully respected for xPL
>> builds, instead common code is guarded by a mix of SILENT_CONSOLE and
>> xPL_SILENT_CONSOLE symbols.
>>
>> Change to consistently use CONFIG_IS_ENABLED(SILENT_CONSOLE) to make the
>> common code properly guarded by the intended Kconfig symbol.
>>
>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
>> Reviewed-by: Tom Rini <trini@konsulko.com>
>>
>> board/friendlyarm/nanopi2/board.c |  4 ++--
>>  boot/bootm.c                      |  4 ++--
>>  common/autoboot.c                 |  2 +-
>>  common/console.c                  | 12 ++++++------
>>  include/env_callback.h            |  2 +-
>>  5 files changed, 12 insertions(+), 12 deletions(-)
> 
>> diff --git a/common/console.c b/common/console.c
>> @@ -736,7 +736,7 @@ void putc(const char c)
>> -     if (IS_ENABLED(CONFIG_SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
>> +     if (CONFIG_IS_ENABLED(SILENT_CONSOLE) && (gd->flags & GD_FLG_SILENT)) {
> 
> This slightly changes what SPL_SILENT_CONSOLE means. Previously the
> xPL symbol only dropped the boot-progress messages in spl.c at build
> time, but now it also gates the run-time GD_FLG_SILENT checks here
> when console.c is built for SPL (i.e. with SPL_SERIAL). The help text
> in common/Kconfig still says "The GD_FLG_SILENT flag is not used in
> SPL so there is no run-time control of console messages in SPL", which
> no longer matches. Please can you update the SPL_SILENT_CONSOLE and
> TPL_SILENT_CONSOLE help text?

Sure, I will drop the following part of the help text in v2.

  The GD_FLG_SILENT flag is not used in xPL so there
  is no run-time control of console messages in xPL.

> 
>> diff --git a/common/console.c b/common/console.c
>> @@ -72,7 +72,7 @@ static int on_console(const char *name, const char *value, enum env_op op,
>> -#ifdef CONFIG_SILENT_CONSOLE
>> +#if CONFIG_IS_ENABLED(SILENT_CONSOLE)
> 
> Just to check: there is no VPL_SILENT_CONSOLE symbol, so in a VPL
> build this (and the other converted checks) is now always false, where
> before it followed the proper symbol. I suspect that is fine since no
> in-tree board enables both VPL and SILENT_CONSOLE, but please mention
> it in the commit message, or add the VPL symbol alongside the SPL/TPL
> ones in common/Kconfig

Sure, I will mention the changed behavior for VPL in commit message in v2.

Regards,
Jonas

> 
> Regards,
> Simon


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-13 15:02     ` Jonas Karlman
@ 2026-07-13 15:17       ` Simon Glass
  0 siblings, 0 replies; 52+ messages in thread
From: Simon Glass @ 2026-07-13 15:17 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Tom Rini, Heiko Schocher, u-boot

Hi Jonas,

On Mon, 13 Jul 2026 at 09:02, Jonas Karlman <jonas@kwiboo.se> wrote:
>
> Hi Simon,
>
> On 7/13/2026 4:28 PM, Simon Glass wrote:
> > Hi Jonas,
> >
> > On 2026-07-08T22:05:26, Jonas Karlman <jonas@kwiboo.se> wrote:
> >> Kconfig: i2c: Depend on correct xPL symbol
> >>
> >> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
> >> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
> >>
> >> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >>
> >> drivers/i2c/Kconfig | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> >> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
> >>  config TPL_SYS_I2C_LEGACY
> >>       bool "Enable legacy I2C subsystem and drivers in TPL"
> >> -     depends on SUPPORT_TPL && !SPL_DM_I2C
> >> +     depends on TPL && !TPL_DM_I2C
> >
> > This also changes !SPL_DM_I2C to !TPL_DM_I2C, which fixes what looks
> > like a copy-paste error, similar to the DM_SERIAL fix in the next
> > patch. Please can you mention this in the commit message too? I
> > checked the boards that enable TPL_SYS_I2C_LEGACY (the mpc85xx
> > P1010RDB / P1020RDB / P2020RDB NAND configs) and none enables SPL_DM
> > or TPL_DM, so there should no functional change, but it is worth
> > recording that this dependency is also being corrected.
>
> Sure and great, I will update commit message in v2.
>
> >
> > With that (assuming you figure out what Tom raised):
>
> It looked like SYS_I2C_EARLY_INIT is the culprit for size change.
>
> See [1] for my findings, and I am still not sure if we can live without
> the call to i2c_early_init_f() for the handful of possible affected
> boards.
>
> My gut feeling, without knowing anything about the affected platform,
> says we should accept the dropped call to i2c_early_init_f() ;-)

No argument from ,e...there has been plenty of time to migrate those boards!

>
> [1] https://lore.kernel.org/u-boot/975a650f-88cf-4b2d-8f83-2df3f93ab25d@kwiboo.se/
>
> Regards,
> Jonas
>
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>

Regards,
Simon

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
  2026-07-10 23:52             ` Jonas Karlman
@ 2026-07-13 21:48               ` Tom Rini
  0 siblings, 0 replies; 52+ messages in thread
From: Tom Rini @ 2026-07-13 21:48 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Heiko Schocher, u-boot, Peng Fan

[-- Attachment #1: Type: text/plain, Size: 5886 bytes --]

On Sat, Jul 11, 2026 at 01:52:26AM +0200, Jonas Karlman wrote:
> Hi Tom,
> 
> On 7/10/2026 5:56 PM, Tom Rini wrote:
> > On Fri, Jul 10, 2026 at 05:39:08PM +0200, Jonas Karlman wrote:
> >> Hi Tom,
> >>
> >> On 7/10/2026 3:50 PM, Tom Rini wrote:
> >>> On Thu, Jul 09, 2026 at 09:12:24AM +0200, Jonas Karlman wrote:
> >>>> Hi Tom,
> >>>>
> >>>> On 7/9/2026 3:52 AM, Tom Rini wrote:
> >>>>> On Wed, Jul 08, 2026 at 10:05:34PM +0000, Jonas Karlman wrote:
> >>>>>
> >>>>>> Change to depend on the xPL symbol instead of the SUPPORT_xPL symbol to
> >>>>>> only make the xPL_SYS_I2C_LEGACY symbols available when xPL is enabled.
> >>>>>>
> >>>>>> Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >>>>>> ---
> >>>>>>  drivers/i2c/Kconfig | 4 ++--
> >>>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>>>>>
> >>>>>> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> >>>>>> index ab5af17858c8..125dc84819e6 100644
> >>>>>> --- a/drivers/i2c/Kconfig
> >>>>>> +++ b/drivers/i2c/Kconfig
> >>>>>> @@ -78,14 +78,14 @@ config SYS_I2C_LEGACY
> >>>>>>  
> >>>>>>  config SPL_SYS_I2C_LEGACY
> >>>>>>  	bool "Enable legacy I2C subsystem and drivers in SPL"
> >>>>>> -	depends on SUPPORT_SPL && !SPL_DM_I2C
> >>>>>> +	depends on SPL && !SPL_DM_I2C
> >>>>>>  	help
> >>>>>>  	  Enable the legacy I2C subsystem and drivers in SPL.  This is useful
> >>>>>>  	  in some size constrained situations.
> >>>>>>  
> >>>>>>  config TPL_SYS_I2C_LEGACY
> >>>>>>  	bool "Enable legacy I2C subsystem and drivers in TPL"
> >>>>>> -	depends on SUPPORT_TPL && !SPL_DM_I2C
> >>>>>> +	depends on TPL && !TPL_DM_I2C
> >>>>>>  	help
> >>>>>>  	  Enable the legacy I2C subsystem and drivers in TPL.  This is useful
> >>>>>>  	  in some size constrained situations.
> >>>>>
> >>>>> Building on the last email, I think these might need to be
> >>>>> [ST]PL_FRAMEWORK not [ST]PL.
> >>>>>
> >>>>
> >>>> I have mostly tested this series with additional changes that alias
> >>>> putc()/puts() to printch()/printascii() in xPL builds when
> >>>> common/console.o is unavailable and DEBUG_UART=y, patches that will
> >>>> be sent as a separate series.
> >>>>
> >>>> It is possible such change may have hidden some latent issues, now
> >>>> trying to push a branch that contains changes that ends at the patches
> >>>> included in this series, but due to timeouts it was not possible prior
> >>>> to sending this reply.
> >>>>
> >>>> This patch can also be dropped if it causes any issues, I only added it
> >>>> after a search for SUPPORT_xPL and noticed that these depends seem to be
> >>>> incorrect. SUPPORT_xPL is used to tell if xPL can be enabled or not,
> >>>> not if xPL is enabled/disabled.
> >>>
> >>> I don't want to drop this, but there are a handful of platforms that
> >>> change:
> >>> 10: Kconfig: i2c: Depend on correct xPL symbol
> >>>    aarch64: (for 1/1 boards) all -60.0 text -60.0
> >>>             ls1043aqds_tfa : all -60 text -60
> >>>                u-boot: add: 0/-1, grow: 0/-1 bytes: 0/-60 (-60)
> >>>                  function                                   old     new   delta
> >>>                  board_early_init_f                          68      64      -4
> >>>                  i2c_early_init_f                            56       -     -56
> >>>
> >>> Can you please look in to it and see what needs to be changed? Thanks.
> >>
> >> From a quick look this size change may be caused due to use of an
> >> 'imply SPL_SYS_I2C_LEGACY' instead of using an 'imply SYS_I2C_LEGACY'
> >> in arch/arm/cpu/armv8/fsl-layerscape/Kconfig.
> >>
> >> 'config MACH_SUN8I_R40' is another platform that also possible miss
> >> an 'imply SYS_I2C_LEGACY' to match other similar sunxi platforms.
> 
> I have now done some more digging and it looks like SYS_I2C_EARLY_INIT
> is the culprit.
> 
>   config SYS_I2C_EARLY_INIT
> 	bool "Enable legacy I2C subsystem early in boot"
> 	depends on BOARD_EARLY_INIT_F && SPL_SYS_I2C_LEGACY && SYS_I2C_MXC
> 	help
> 	  Add the function prototype for i2c_early_init_f which is called in
> 	  board_early_init_f.
> 
> Not sure what to do here, it is possible that just dropping
> SPL_SYS_I2C_LEGACY from depends would ensure the code is restored.

Ah, good work. Yes, this is tricky.

> However, that also feels strange as the intent of i2c_early_init_f() is
> to initialize I2C_LEGACY, and most of the affected boards use DM_I2C:
> 
>   > tools/qconfig.py -f ~SPL SYS_I2C_EARLY_INIT
>   5 matches
>   ls1043aqds_tfa_SECURE_BOOT ls1043aqds_tfa ls1046aqds_tfa_SECURE_BOOT ls1046aqds_tfa ls2080aqds_qspi
> 
>   > tools/qconfig.py -f ~SPL SYS_I2C_EARLY_INIT ~DM_I2C
>   1 matches
>   ls2080aqds_qspi
> 
> (Please note that my qconfig.db does not cover 100% of all defconfigs.)
> 
> All other code seem to be protected by CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
> so I am not expecting any other change for targets that use xPL=n.

This is tricky, yes. Looking at all the boards which *have*
SYS_I2C_EARLY_INIT guards for calling i2c_early_init_f some presumably
used to, but do not now, set SPL_SYS_I2C_LEGACY. And going back to my
initial conversion of this symbol to Kconfig, I'm not sure it's 100%
right, now. I think we need to add SPL_SYS_I2C_EARLY_INIT and make both
of these symbols be "select ..." in the right board Kconfig, rather than
a prompted question. And with that, we should have:
ls1043aqds_tfa_SECURE_BOOT ls1043aqds_tfa ls1046aqds_tfa_SECURE_BOOT ls1046aqds_tfa
be "select SPL_SYS_I2C_EARLY_INIT" and then:
ls2080aqds_nand ls2080aqds_qspi
be doing both "select SPL_SYS_I2C_EARLY_INIT" and "select
SYS_I2C_EARLY_INIT".

There's also (and so I've cc'd Peng) some dead code to remove on other
layerscape platforms that don't call i2c_early_init_f (they're both
full and SPL DM i2c) and so have some dead code now.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2026-07-13 21:48 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08 22:05 [PATCH 00/11] treewide: Fix miscellaneous xPL related symbol issues Jonas Karlman
2026-07-08 22:05 ` [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
2026-07-09  1:52   ` Tom Rini
2026-07-13 14:23   ` Simon Glass
2026-07-08 22:05 ` [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
2026-07-09  1:52   ` Tom Rini
2026-07-13 14:23   ` Simon Glass
2026-07-08 22:05 ` [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks Jonas Karlman
2026-07-09  1:52   ` Tom Rini
2026-07-13 14:23   ` Simon Glass
2026-07-08 22:05 ` [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check Jonas Karlman
2026-07-09  1:52   ` Tom Rini
2026-07-13 14:23   ` Simon Glass
2026-07-08 22:05 ` [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example Jonas Karlman
2026-07-09  1:52   ` Tom Rini
2026-07-13 14:24   ` Simon Glass
2026-07-08 22:05 ` [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols Jonas Karlman
2026-07-09  1:52   ` Tom Rini
2026-07-09  6:41     ` Jonas Karlman
2026-07-09 13:41       ` Tom Rini
2026-07-13 14:24   ` Simon Glass
2026-07-13 14:53     ` Jonas Karlman
2026-07-08 22:05 ` [PATCH 07/11] Kconfig: Depend on correct xPL symbol Jonas Karlman
2026-07-09  1:52   ` Tom Rini
2026-07-13 14:25   ` Simon Glass
2026-07-08 22:05 ` [PATCH 08/11] Kconfig: i2c: " Jonas Karlman
2026-07-09  1:52   ` Tom Rini
2026-07-09  7:12     ` Jonas Karlman
2026-07-09 13:19       ` Jonas Karlman
2026-07-09 13:43       ` Tom Rini
2026-07-10 13:50       ` Tom Rini
2026-07-10 15:39         ` Jonas Karlman
2026-07-10 15:56           ` Tom Rini
2026-07-10 23:52             ` Jonas Karlman
2026-07-13 21:48               ` Tom Rini
2026-07-13 14:28   ` Simon Glass
2026-07-13 15:02     ` Jonas Karlman
2026-07-13 15:17       ` Simon Glass
2026-07-08 22:05 ` [PATCH 09/11] Kconfig: serial: " Jonas Karlman
2026-07-09  1:53   ` Tom Rini
2026-07-09  7:27     ` Jonas Karlman
2026-07-09 13:44       ` Tom Rini
2026-07-13 14:30   ` Simon Glass
2026-07-13 15:10     ` Jonas Karlman
2026-07-08 22:05 ` [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks Jonas Karlman
2026-07-09  1:53   ` Tom Rini
2026-07-13 14:29   ` Simon Glass
2026-07-13 15:16     ` Jonas Karlman
2026-07-08 22:05 ` [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks Jonas Karlman
2026-07-09  1:53   ` Tom Rini
2026-07-10 13:51     ` Tom Rini
2026-07-13 14:29   ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.