Skip to contentSkip to conversation

Avoid needless CONFIG_TPL_BUILD checks for U-Boot proper build

PATCH In review Massimo Pegorer 3 participants 8 messages Sep 8 – Sep 21

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

cover Avoid needless CONFIG_TPL_BUILD checks for U-Boot proper build

Just check that CONFIG_XPL_BUILD is not set to select files for U-Boot proper build. Indeed, CONFIG_TPL_BUILD being set implies by design that CONFIG_XPL_BUILD is set too, therefore CONFIG_XPL_BUILD not set implies that CONFIG_TPL_BUILD is not set either, making its check needless.

---
Massimo Pegorer (2):
arch: arm: rockchip: Skip needless CONFIG_TPL_BUILD check
drivers: Skip needless CONFIG_TPL_BUILD check

 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(-)

---
base-commit: b4ac71db13a33c4e6532c60a781ddf34b7f4375a
change-id: 20260908-xpl-8c3ee1f3549e

Best regards,

Signature · 1 line
Massimo Pegorer <[email protected]>
#5 lore raw

PATCH 2/2 drivers: Skip needless CONFIG_TPL_BUILD check

Just check that CONFIG_XPL_BUILD is not set to select files for U-Boot proper build. Indeed, CONFIG_TPL_BUILD being set implies by design that CONFIG_XPL_BUILD is set too, therefore CONFIG_XPL_BUILD not set implies that CONFIG_TPL_BUILD is not set either, making its check needless.

Fixes 371dc068bbf5 ("drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD")
---
 drivers/Makefile          | 2 +-
 drivers/bus/Makefile      | 2 +-
 drivers/mtd/Makefile      | 2 +-
 drivers/mtd/nand/Makefile | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/Makefile +1 -1
index 269c3db12e8..da37338fe1f 100644
@@ -87,7 +87,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/
drivers/bus/Makefile +1 -1
index 2d242bc2886..239d9a35fe4 100644
@@ -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
drivers/mtd/Makefile +1 -1
index ce05e206073..e204f19ff8b 100644
@@ -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
drivers/mtd/nand/Makefile +1 -1
index c8169cf7390..cf53c5f601e 100644
@@ -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/
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 arch: arm: rockchip: Skip needless CONFIG_TPL_BUILD check

In reply to Massimo Pegorer

Just check that CONFIG_XPL_BUILD is not set to select files for U-Boot proper build. Indeed, CONFIG_TPL_BUILD being set implies by design that CONFIG_XPL_BUILD is set too, therefore CONFIG_XPL_BUILD not set implies that CONFIG_TPL_BUILD is not set either, making its check needless.

Fixes bef9fdbed2e5 ("arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD")
---
 arch/arm/mach-rockchip/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rockchip/Makefile +1 -1
index d3bc0689f89..8148816c48c 100644
@@ -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,
Signature · 1 line
2.34.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] arch: arm: rockchip: Skip needless CONFIG_TPL_BUILD check

Hi Massimo,

Quoted 5 lines · Massimo Pegorer

Just check that CONFIG_XPL_BUILD is not set to select files for U-Boot proper build. Indeed, CONFIG_TPL_BUILD being set implies by design that CONFIG_XPL_BUILD is set too, therefore CONFIG_XPL_BUILD not set implies that CONFIG_TPL_BUILD is not set either, making its check needless.

I suspect we have a lot more than this one.

A simple git grep "CONFIG_XPL_BUILD.*CONFIG_[TS]PL_BUILD" returned a few matches. And this is only for them being on the same line. It's not necessarily a direct replacement, as we have CONFIG_VPL_BUILD which could match too, but nothing (except sandbox) makes use of that stage at the moment.

Also git grep "CONFIG_[TS]PL_BUILD.*CONFIG_XPL_BUILD" returns another match.

Quoted 2 lines
Fixes bef9fdbed2e5 ("arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD")

Thanks!
Quentin

Reviewed-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] drivers: Skip needless CONFIG_TPL_BUILD check

In reply to Massimo Pegorer

Hi Massimo,

Quoted 5 lines · Massimo Pegorer

Just check that CONFIG_XPL_BUILD is not set to select files for U-Boot proper build. Indeed, CONFIG_TPL_BUILD being set implies by design that CONFIG_XPL_BUILD is set too, therefore CONFIG_XPL_BUILD not set implies that CONFIG_TPL_BUILD is not set either, making its check needless.

Haha, didn't read this patch before sending my mail for patch 1. You caught some similar issues in other places :)

Quoted 2 lines
Fixes 371dc068bbf5 ("drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD")

Thanks for the cleanup!
Quentin

#3 lore raw

Re: [PATCH 1/2] arch: arm: rockchip: Skip needless CONFIG_TPL_BUILD check

In reply to Massimo Pegorer

Hi Massimo,

Quoted 16 lines · Massimo Pegorer

Just check that CONFIG_XPL_BUILD is not set to select files for U-Boot proper build. Indeed, CONFIG_TPL_BUILD being set implies by design that CONFIG_XPL_BUILD is set too, therefore CONFIG_XPL_BUILD not set implies that CONFIG_TPL_BUILD is not set either, making its check needless.

Fixes bef9fdbed2e5 ("arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD")
---
 arch/arm/mach-rockchip/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rockchip/Makefile +0 -0
index d3bc0689f89..8148816c48c 100644

arch/arm/mach-rockchip/Makefile obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o spl_common.o · line 18

Quoted 5 lines
arch/arm/mach-rockchip/Makefile +1 -1
@@ -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),)

This and next patch seem to match my patch at [1] :-)

[1] https://patch.msgid.link/[email protected]/

Regards,
Jonas

Quoted 4 lines
arch/arm/mach-rockchip/Makefile +0 -0
 # 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,
 
#4 lore raw

Re: [PATCH 1/2] arch: arm: rockchip: Skip needless CONFIG_TPL_BUILD check

Hi Jonas,

Il giorno dom 20 set 2026 alle ore 17:55 Jonas Karlman ha scritto:

Quoted 21 lines

Hi Massimo,

Quoted 17 lines · Massimo Pegorer

Just check that CONFIG_XPL_BUILD is not set to select files for U-Boot proper build. Indeed, CONFIG_TPL_BUILD being set implies by design that CONFIG_XPL_BUILD is set too, therefore CONFIG_XPL_BUILD not set implies that CONFIG_TPL_BUILD is not set either, making its check needless.

Fixes bef9fdbed2e5 ("arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD")
---
 arch/arm/mach-rockchip/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-rockchip/Makefile +0 -0
index d3bc0689f89..8148816c48c 100644
@@ -15,7 +15,7 @@ obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o spl_common.o
 
Quoted 6 lines

arch/arm/mach-rockchip/Makefile obj-tpl-$(CONFIG_ROCKCHIP_PX30) += px30-board-tpl.o spl_common.o · line 18

Quoted 4 lines
arch/arm/mach-rockchip/Makefile +1 -1
 obj-spl-$(CONFIG_ROCKCHIP_RK3036) += rk3036-board-spl.o spl_common.o
 
-ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
+ifeq ($(CONFIG_XPL_BUILD),)

This and next patch seem to match my patch at [1] :-)

Absolutely. Sorry, please ignore my series.
I look forward to your v2. Thanks.

Regards,
Massimo

Quoted 11 lines

[1] https://patch.msgid.link/[email protected]/

Regards,
Jonas

Quoted 4 lines
arch/arm/mach-rockchip/Makefile +0 -0
 # 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,
 
#7 lore raw
In reply to Massimo Pegorer

Hi,

Il giorno mar 8 set 2026 alle ore 19:05 Massimo Pegorer ha scritto:

Quoted 18 lines

Just check that CONFIG_XPL_BUILD is not set to select files for U-Boot proper build. Indeed, CONFIG_TPL_BUILD being set implies by design that CONFIG_XPL_BUILD is set too, therefore CONFIG_XPL_BUILD not set implies that CONFIG_TPL_BUILD is not set either, making its check needless.

---
Massimo Pegorer (2):
arch: arm: rockchip: Skip needless CONFIG_TPL_BUILD check
drivers: Skip needless CONFIG_TPL_BUILD check

 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(-)
Quoted 3 lines

---
base-commit: b4ac71db13a33c4e6532c60a781ddf34b7f4375a
change-id: 20260908-xpl-8c3ee1f3549e

Please, ignore the series, as these fixes are already addressed by [1].

Regards,
Massimo

[1] https://patch.msgid.link/[email protected]/

Quoted 5 lines

Best regards,
--
Massimo Pegorer <[email protected]>