Avoid needless CONFIG_TPL_BUILD checks for U-Boot proper build
Subsystems (5)
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]>
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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
PATCH 1/2 arch: arm: rockchip: Skip needless CONFIG_TPL_BUILD check
In reply to Massimo PegorerJust 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.
--- arch/arm/mach-rockchip/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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),) # 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
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_BUILDis not set to select files for U-Boot proper build. Indeed,CONFIG_TPL_BUILDbeing set implies by design thatCONFIG_XPL_BUILDis set too, thereforeCONFIG_XPL_BUILDnot set implies thatCONFIG_TPL_BUILDis 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")Signed-off-by Massimo Pegorer <[email protected]>
Thanks!
Quentin
Re: [PATCH 2/2] drivers: Skip needless CONFIG_TPL_BUILD check
In reply to Massimo PegorerHi Massimo,
Quoted 5 lines · Massimo Pegorer
Just check that
CONFIG_XPL_BUILDis not set to select files for U-Boot proper build. Indeed,CONFIG_TPL_BUILDbeing set implies by design thatCONFIG_XPL_BUILDis set too, thereforeCONFIG_XPL_BUILDnot set implies thatCONFIG_TPL_BUILDis 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")Signed-off-by Massimo Pegorer <[email protected]>
Thanks for the cleanup!
Quentin
Re: [PATCH 1/2] arch: arm: rockchip: Skip needless CONFIG_TPL_BUILD check
In reply to Massimo PegorerHi Massimo,
Quoted 16 lines · Massimo Pegorer
Just check that
CONFIG_XPL_BUILDis not set to select files for U-Boot proper build. Indeed,CONFIG_TPL_BUILDbeing set implies by design thatCONFIG_XPL_BUILDis set too, thereforeCONFIG_XPL_BUILDnot set implies thatCONFIG_TPL_BUILDis not set either, making its check needless.Fixes bef9fdbed2e5 ("arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD")Signed-off-by Massimo Pegorer <[email protected]>--- arch/arm/mach-rockchip/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-rockchip/Makefile +0
-0
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,
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_BUILDis not set to select files for U-Boot proper build. Indeed,CONFIG_TPL_BUILDbeing set implies by design thatCONFIG_XPL_BUILDis set too, thereforeCONFIG_XPL_BUILDnot set implies thatCONFIG_TPL_BUILDis not set either, making its check needless.Fixes bef9fdbed2e5 ("arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD")Signed-off-by Massimo Pegorer <[email protected]>--- arch/arm/mach-rockchip/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-rockchip/Makefile +0
-0@@ -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
-1obj-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,
JonasQuoted 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,
Hi,
Il giorno mar 8 set 2026 alle ore 19:05 Massimo Pegorer ha scritto:
Quoted 18 lines
Just check that
CONFIG_XPL_BUILDis not set to select files for U-Boot proper build. Indeed,CONFIG_TPL_BUILDbeing set implies by design thatCONFIG_XPL_BUILDis set too, thereforeCONFIG_XPL_BUILDnot set implies thatCONFIG_TPL_BUILDis not set either, making its check needless.Signed-off-by Massimo Pegorer <[email protected]>---
Massimo Pegorer (2):
arch: arm: rockchip: Skip needlessCONFIG_TPL_BUILDcheck
drivers: Skip needlessCONFIG_TPL_BUILDcheckarch/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]>