treewide: Fix miscellaneous xPL related symbol issues
Subsystems (10)
cover treewide: Fix miscellaneous xPL related symbol issues
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(-)
Signature · 1 line
2.54.0
PATCH 1/11 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.
--- 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(-)
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,
drivers/Makefile +1 -1
@@ -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/
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.54.0
Re: [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks
Quoted 9 lines · Jonas Karlman
The
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.Signed-off-by Jonas Karlman <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks
In reply to Jonas KarlmanQuoted 13 lines · Jonas Karlman
Makefile: Drop redundantCONFIG_TPL_BUILDchecksThe
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
Quoted 6 lines
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(-)
Re: [PATCH 01/11] Makefile: Drop redundant CONFIG_TPL_BUILD checks
In reply to Jonas KarlmanHi Jonas,
Quoted 8 lines · Jonas Karlman
The
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.
Thanks!
Quentin
PATCH 2/11 dm: core: Drop redundant CONFIG_TPL_BUILD check
In reply to Jonas KarlmanThe 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.
--- drivers/core/ofnode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/core/ofnode.c +2 -2
@@ -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) */
Signature · 1 line
2.54.0
Re: [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check
Quoted 9 lines · Jonas Karlman
The
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.Signed-off-by Jonas Karlman <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check
In reply to Jonas KarlmanQuoted 10 lines · Jonas Karlman
dm: core: Drop redundant
CONFIG_TPL_BUILDcheckThe
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.
Quoted 5 lines
Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
drivers/core/ofnode.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Re: [PATCH 02/11] dm: core: Drop redundant CONFIG_TPL_BUILD check
In reply to Jonas KarlmanHi Jonas,
Quoted 8 lines · Jonas Karlman
The
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.
Thanks!
Quentin
PATCH 3/11 rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks
In reply to Jonas KarlmanThe 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.
--- drivers/clk/rockchip/clk_rk3368.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/rockchip/clk_rk3368.c +4 -4
@@ -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
Signature · 1 line
2.54.0
Re: [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks
Quoted 9 lines · Jonas Karlman
The
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.Signed-off-by Jonas Karlman <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 03/11] rockchip: clk: rk3368: Drop redundant CONFIG_TPL_BUILD checks
In reply to Jonas KarlmanQuoted 10 lines · Jonas Karlman
rockchip: clk: rk3368: Drop redundant
CONFIG_TPL_BUILDchecksThe
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.
Quoted 5 lines
Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
drivers/clk/rockchip/clk_rk3368.c| 8 ++++----1 file changed, 4 insertions(+), 4 deletions(-)
PATCH 4/11 x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
In reply to Jonas KarlmanThe 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.
--- arch/x86/cpu/apollolake/fsp_bindings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/cpu/apollolake/fsp_bindings.c +1 -1
@@ -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,
Signature · 1 line
2.54.0
Re: [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
Quoted 9 lines · Jonas Karlman
The
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.Signed-off-by Jonas Karlman <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
In reply to Jonas KarlmanQuoted 10 lines · Jonas Karlman
x86: apl:
fsp_bindings: Drop redundantCONFIG_TPL_BUILDcheckThe
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.
Quoted 5 lines
Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
arch/x86/cpu/apollolake/fsp_bindings.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH 04/11] x86: apl: fsp_bindings: Drop redundant CONFIG_TPL_BUILD check
In reply to Jonas KarlmanHi Jonas,
Quoted 8 lines · Jonas Karlman
The
XPL_BUILDsymbol is set for all xPL phases, i.e. TPL, VPL and SPL. Conditional guards that test for bothXPL_BUILDandTPL_BUILDsymbols are therefore redundant.Drop the redundant
TPL_BUILDsymbol check from conditional guards that also test for theXPL_BUILDsymbol to cleanup from an old SPL to XPL symbol rename.
Thanks!
Quentin
PATCH 5/11 spl: Simplify xPL_BUILD conditional guard example
In reply to Jonas KarlmanThe 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.
--- include/spl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/spl.h +1 -1
@@ -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 *
Signature · 1 line
2.54.0
Re: [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example
Quoted 8 lines · Jonas Karlman
The old meaning of the
SPL_BUILDsymbol has been transfered to a newXPL_BUILDsymbol, leaving theSPL_BUILDsymbol only to be defined for SPL builds, and not all xPL builds.Change to only use the
SPL_BUILDsymbol in the SPL code example to cleanup from an old SPL to XPL symbol rename.Signed-off-by Jonas Karlman <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example
In reply to Jonas KarlmanQuoted 6 lines · Jonas Karlman
spl: Simplify
xPL_BUILDconditional guard exampleThe old meaning of the
SPL_BUILDsymbol has been transfered to a newXPL_BUILDsymbol, leaving theSPL_BUILDsymbol only to be defined for SPL builds, and not all xPL builds.
Quoted 8 lines
Change to only use the
SPL_BUILDsymbol in the SPL code example to cleanup from an old SPL to XPL symbol rename.Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
include/spl.h| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Re: [PATCH 05/11] spl: Simplify xPL_BUILD conditional guard example
In reply to Jonas KarlmanHi Jonas,
Quoted 7 lines · Jonas Karlman
The old meaning of the
SPL_BUILDsymbol has been transfered to a newXPL_BUILDsymbol, leaving theSPL_BUILDsymbol only to be defined for SPL builds, and not all xPL builds.Change to only use the
SPL_BUILDsymbol in the SPL code example to cleanup from an old SPL to XPL symbol rename.
Thanks!
Quentin
PATCH 6/11 Kconfig: Add missing depends on xPL to xPL_ symbols
In reply to Jonas KarlmanxPL_<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.
--- common/Kconfig | 2 ++ lib/Kconfig | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-)
common/Kconfig +2 -0
@@ -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
lib/Kconfig +6 -1
@@ -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
Signature · 1 line
2.54.0
Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
Quoted 10 lines · 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 <[email protected]>--- 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).
Signature · 1 line
Tom
Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
Hi Tom,
Quoted 13 lines · Tom Rini
Quoted 10 lines · 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 <[email protected]>--- common/Kconfig | 2 ++ lib/Kconfig | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-)
Quoted 6 lines
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
Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
Quoted 37 lines · Jonas Karlman
Hi Tom,
Quoted 13 lines · Tom Rini
Quoted 10 lines · 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 <[email protected]>--- common/Kconfig | 2 ++ lib/Kconfig | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-)Quoted 6 lines
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"(quoted diff) +1
-1- 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
OK, thanks.
Signature · 1 line
Tom
Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
In reply to Jonas KarlmanHi Jonas,
Quoted 15 lines · Jonas Karlman
Kconfig: Add missing depends on xPL toxPL_symbolsxPL_<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 <[email protected]>common/Kconfig | 2 ++
lib/Kconfig | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-)
lib/Kconfig config SPL_LZO · line 975
Quoted 4 lines
lib/Kconfig +2
-1@@ -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.
lib/Kconfig config TPL_LZMA · line 962
Quoted 5 lines
lib/Kconfig +1
-0@@ -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?
Regards,
Simon
Re: [PATCH 06/11] Kconfig: Add missing depends on xPL to xPL_ symbols
Quoted 16 lines · Simon Glass
Hi Jonas,
Quoted 12 lines · Jonas Karlman
Kconfig: Add missing depends on xPL toxPL_symbolsxPL_<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 <[email protected]>common/Kconfig | 2 ++
lib/Kconfig | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-)
Quoted 10 lines
lib/Kconfig config SPL_LZO · line 975
Quoted 6 lines
lib/Kconfig +2
-1@@ -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 TPLThe 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.
Quoted 11 lines
lib/Kconfig config TPL_LZMA · line 962
Quoted 6 lines
lib/Kconfig +1
-0@@ -960,6 +960,7 @@ config TPL_LZMA config VPL_LZMA bool "Enable LZMA decompression support for VPL build" + depends on VPLBTW
SPL_LZMA_SIZE_OPTIMIZATION(betweenSPL_LZMAandTPL_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 onSPL_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
Quoted 5 lines
Reviewed-by Simon Glass <[email protected]>Regards,
Simon
PATCH 7/11 Kconfig: Depend on correct xPL symbol
In reply to Jonas KarlmanChange to depend on correct xPL symbol instead of a xPL symbol intended for a different phase to make affected symbols available for correct phase.
--- arch/Kconfig | 2 +- common/spl/Kconfig | 2 +- drivers/core/Kconfig | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/Kconfig +1 -1
@@ -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
common/spl/Kconfig +1 -1
@@ -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,
drivers/core/Kconfig +2 -2
@@ -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
Signature · 1 line
2.54.0
Re: [PATCH 07/11] Kconfig: Depend on correct xPL symbol
Quoted 5 lines · 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 <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 07/11] Kconfig: Depend on correct xPL symbol
In reply to Jonas KarlmanQuoted 6 lines · Jonas Karlman
Kconfig: Depend on correct xPL symbolChange to depend on correct xPL symbol instead of a xPL symbol intended for a different phase to make affected symbols available for correct phase.
Quoted 7 lines
Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
arch/Kconfig| 2 +-common/spl/Kconfig | 2 +- drivers/core/Kconfig | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
Re: [PATCH 07/11] Kconfig: Depend on correct xPL symbol
In reply to Jonas KarlmanHi Jonas,
Quoted 4 lines · 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.
Thanks!
Quentin
PATCH 8/11 Kconfig: i2c: Depend on correct xPL symbol
In reply to Jonas KarlmanChange 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.
--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/Kconfig +2 -2
@@ -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.
Signature · 1 line
2.54.0
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Quoted 19 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 10 lines
drivers/i2c/Kconfig +1
-1Enable 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.
Signature · 1 line
Tom
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 22 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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.
Quoted 11 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 7 lines
drivers/i2c/Kconfig +1
-1config 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
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Hi again,
Quoted 44 lines · Jonas Karlman
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 22 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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.Quoted 11 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 7 lines
drivers/i2c/Kconfig +1
-1config 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.ois unavailable and DEBUG_UART=y, patches that will be sent as a separate series.
Quoted 4 lines
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
Quoted 8 lines
This patch can also be dropped if it causes any issues, I only added it after a search for
SUPPORT_xPLand noticed that these depends seem to be incorrect.SUPPORT_xPLis used to tell if xPL can be enabled or not, not if xPL is enabled/disabled.Regards,
Jonas
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
In reply to Jonas KarlmanQuoted 44 lines · Jonas Karlman
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 22 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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.Quoted 11 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 7 lines
drivers/i2c/Kconfig +1
-1config 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.ois unavailable and DEBUG_UART=y, patches that will be sent as a separate series.
Quoted 4 lines
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.
Signature · 1 line
Tom
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
In reply to Jonas KarlmanQuoted 49 lines · Jonas Karlman
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 22 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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.Quoted 11 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 7 lines
drivers/i2c/Kconfig +1
-1config 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.ois 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.
Quoted 4 lines
This patch can also be dropped if it causes any issues, I only added it after a search for
SUPPORT_xPLand noticed that these depends seem to be incorrect.SUPPORT_xPLis 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.
Signature · 1 line
Tom
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Hi Tom,
Quoted 65 lines · Tom Rini
Quoted 49 lines · Jonas Karlman
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 22 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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.Quoted 11 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 7 lines
drivers/i2c/Kconfig +1
-1config 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.ois 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.
Quoted 4 lines
This patch can also be dropped if it causes any issues, I only added it after a search for
SUPPORT_xPLand noticed that these depends seem to be incorrect.SUPPORT_xPLis 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_f68 64 -4
i2c_early_init_f56 - -56
Quoted 1 line
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':
Quoted 1 line
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
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Quoted 90 lines · Jonas Karlman
Hi Tom,
Quoted 65 lines · Tom Rini
Quoted 49 lines · Jonas Karlman
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 22 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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.Quoted 11 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 7 lines
drivers/i2c/Kconfig +1
-1config 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.ois 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.
Quoted 4 lines
This patch can also be dropped if it causes any issues, I only added it after a search for
SUPPORT_xPLand noticed that these depends seem to be incorrect.SUPPORT_xPLis 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_f68 64 -4
i2c_early_init_f56 - -56Quoted 1 line
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 'implySYS_I2C_LEGACY' inarch/arm/cpu/armv8/fsl-layerscape/Kconfig.'config
MACH_SUN8I_R40' is another platform that also possible miss an 'implySYS_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':
Quoted 1 line
grep
CONFIG_SPL.config#
CONFIG_SPL_SYS_L2_PL310is not set
#CONFIG_SPLis not set
#CONFIG_SPL_SYS_STDIO_DEREGISTERis not set
#CONFIG_SPL_NVMEMis not set
CONFIG_SPL_SYS_NAND_SELF_INIT=y
#CONFIG_SPL_PHY_ATHEROSis not set
#CONFIG_SPL_PHY_TI_DP83867is not set
#CONFIG_SPL_LZMA_SIZE_OPTIMIZATIONis not set
Quoted 1 line
Should possible add 'depends on' to some of them in a v2.
Great, thanks!
Signature · 1 line
Tom
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Hi Tom,
Quoted 69 lines · Tom Rini
Quoted 68 lines · Jonas Karlman
Hi Tom,
Quoted 65 lines · Tom Rini
Quoted 49 lines · Jonas Karlman
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 22 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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.Quoted 11 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 7 lines
drivers/i2c/Kconfig +1
-1config 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.ois 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.
Quoted 4 lines
This patch can also be dropped if it causes any issues, I only added it after a search for
SUPPORT_xPLand noticed that these depends seem to be incorrect.SUPPORT_xPLis 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_f68 64 -4
i2c_early_init_f56 - -56
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
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 'implySYS_I2C_LEGACY' inarch/arm/cpu/armv8/fsl-layerscape/Kconfig.'config
MACH_SUN8I_R40' is another platform that also possible miss an 'implySYS_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:
Quoted 1 line
tools/qconfig.py-f ~SPLSYS_I2C_EARLY_INIT
5 matches
ls1043aqds_tfa_SECURE_BOOT ls1043aqds_tfa ls1046aqds_tfa_SECURE_BOOT ls1046aqds_tfa ls2080aqds_qspi
Quoted 1 line
tools/qconfig.py-f ~SPLSYS_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
Quoted 18 lines
Quoted 14 lines
Building this target I also noticed some more SPL_<name> symbols that may be missing a 'depends on SPL':
Quoted 1 line
grep
CONFIG_SPL.config#
CONFIG_SPL_SYS_L2_PL310is not set
#CONFIG_SPLis not set
#CONFIG_SPL_SYS_STDIO_DEREGISTERis not set
#CONFIG_SPL_NVMEMis not set
CONFIG_SPL_SYS_NAND_SELF_INIT=y
#CONFIG_SPL_PHY_ATHEROSis not set
#CONFIG_SPL_PHY_TI_DP83867is not set
#CONFIG_SPL_LZMA_SIZE_OPTIMIZATIONis not setQuoted 1 line
Should possible add 'depends on' to some of them in a v2.
Great, thanks!
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Quoted 91 lines · Jonas Karlman
Hi Tom,
Quoted 69 lines · Tom Rini
Quoted 68 lines · Jonas Karlman
Hi Tom,
Quoted 65 lines · Tom Rini
Quoted 49 lines · Jonas Karlman
Hi Tom,
Quoted 24 lines · Tom Rini
Quoted 22 lines · Jonas Karlman
Change to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>--- drivers/i2c/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/i2c/Kconfig +1
-1@@ -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.Quoted 11 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 91
Quoted 7 lines
drivers/i2c/Kconfig +1
-1config 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.ois 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.
Quoted 4 lines
This patch can also be dropped if it causes any issues, I only added it after a search for
SUPPORT_xPLand noticed that these depends seem to be incorrect.SUPPORT_xPLis 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_f68 64 -4
i2c_early_init_f56 - -56Quoted 8 lines
Quoted 8 lines
Quoted 1 line
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 'implySYS_I2C_LEGACY' inarch/arm/cpu/armv8/fsl-layerscape/Kconfig.'config
MACH_SUN8I_R40' is another platform that also possible miss an 'implySYS_I2C_LEGACY' to match other similar sunxi platforms.I have now done some more digging and it looks like
SYS_I2C_EARLY_INITis the culprit.config
SYS_I2C_EARLY_INIT
bool "Enable legacy I2C subsystem early in boot"
depends onBOARD_EARLY_INIT_F&&SPL_SYS_I2C_LEGACY&&SYS_I2C_MXChelp
Add the function prototype fori2c_early_init_fwhich is called inboard_early_init_f.
Quoted 2 lines
Not sure what to do here, it is possible that just dropping
SPL_SYS_I2C_LEGACYfrom depends would ensure the code is restored.
Ah, good work. Yes, this is tricky.
Quoted 7 lines
However, that also feels strange as the intent of
i2c_early_init_f()is to initializeI2C_LEGACY, and most of the affected boards useDM_I2C:Quoted 1 line
tools/qconfig.py-f ~SPLSYS_I2C_EARLY_INIT5 matches
ls1043aqds_tfa_SECURE_BOOTls1043aqds_tfals1046aqds_tfa_SECURE_BOOTls1046aqds_tfals2080aqds_qspi
Quoted 8 lines
Quoted 1 line
tools/qconfig.py-f ~SPLSYS_I2C_EARLY_INIT~DM_I2C1 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.
Signature · 1 line
Tom
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
In reply to Jonas KarlmanHi Jonas,
Quoted 12 lines · Jonas Karlman
Kconfig: i2c: Depend on correct xPL symbolChange to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>
drivers/i2c/Kconfig| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 80
Quoted 4 lines
drivers/i2c/Kconfig +1
-1@@ -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):
Regards,
Simon
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Hi Simon,
Quoted 13 lines · Simon Glass
Hi Jonas,
Quoted 9 lines · Jonas Karlman
Kconfig: i2c: Depend on correct xPL symbolChange to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>
drivers/i2c/Kconfig| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 14 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 80
Quoted 6 lines
drivers/i2c/Kconfig +1
-1@@ -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_I2CThis also changes !SPL_DM_I2C to !TPL_DM_I2C, which fixes what looks like a copy-paste error, similar to the
DM_SERIALfix in the next patch. Please can you mention this in the commit message too? I checked the boards that enableTPL_SYS_I2C_LEGACY(the mpc85xx P1010RDB / P1020RDB / P2020RDB NAND configs) and none enablesSPL_DMorTPL_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.
Quoted 2 lines
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/[email protected]/
Regards,
Jonas
Quoted 5 lines
Reviewed-by Simon Glass <[email protected]>Regards,
Simon
Re: [PATCH 08/11] Kconfig: i2c: Depend on correct xPL symbol
Hi Jonas,
Quoted 37 lines · Jonas Karlman
Hi Simon,
Quoted 13 lines · Simon Glass
Hi Jonas,
Quoted 9 lines · Jonas Karlman
Kconfig: i2c: Depend on correct xPL symbolChange to depend on the xPL symbol instead of the
SUPPORT_xPLsymbol to only make thexPL_SYS_I2C_LEGACYsymbols available when xPL is enabled.Signed-off-by Jonas Karlman <[email protected]>
drivers/i2c/Kconfig| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)Quoted 14 lines
drivers/i2c/Kconfig config SYS_I2C_LEGACY · line 80
Quoted 6 lines
drivers/i2c/Kconfig +1
-1@@ -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_I2CThis also changes !SPL_DM_I2C to !TPL_DM_I2C, which fixes what looks like a copy-paste error, similar to the
DM_SERIALfix in the next patch. Please can you mention this in the commit message too? I checked the boards that enableTPL_SYS_I2C_LEGACY(the mpc85xx P1010RDB / P1020RDB / P2020RDB NAND configs) and none enablesSPL_DMorTPL_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.
Quoted 2 lines
With that (assuming you figure out what Tom raised):
Quoted 8 lines
It looked like
SYS_I2C_EARLY_INITis 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!
Quoted 8 lines
[1] https://lore.kernel.org/u-boot/[email protected]/
Regards,
JonasQuoted 2 lines
Reviewed-by Simon Glass <[email protected]>
Regards,
Simon
PATCH 9/11 Kconfig: serial: Depend on correct xPL symbol
In reply to Jonas KarlmanChange 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.
--- drivers/serial/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/serial/Kconfig +3 -3
@@ -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
Signature · 1 line
2.54.0
Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
Quoted 15 lines · Jonas Karlman
Change
xPL_SERIAL_PRESENTsymbols to depend on thexPL_DM_SERIALsymbol intended for the related xPL phase instead of theDM_SERIALsymbol used for U-Boot proper to makeCONFIG_IS_ENABLED(SERIAL_PRESENT)guards work as intended.Signed-off-by Jonas Karlman <[email protected]>--- drivers/serial/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/serial/Kconfig +0
-0
drivers/serial/Kconfig config SERIAL_PRESENT · line 77
Quoted 8 lines
drivers/serial/Kconfig +1
-1@@ -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.
Signature · 1 line
Tom
Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
Hi Tom,
Quoted 18 lines · Tom Rini
Quoted 16 lines · Jonas Karlman
Change
xPL_SERIAL_PRESENTsymbols to depend on thexPL_DM_SERIALsymbol intended for the related xPL phase instead of theDM_SERIALsymbol used for U-Boot proper to makeCONFIG_IS_ENABLED(SERIAL_PRESENT)guards work as intended.Signed-off-by Jonas Karlman <[email protected]>--- drivers/serial/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/serial/Kconfig +0
-0@@ -71,7 +71,7 @@ config SERIAL_PRESENT
Quoted 15 lines
drivers/serial/Kconfig config SERIAL_PRESENT · line 77
Quoted 7 lines
drivers/serial/Kconfig +1
-1config 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 tooUsing the database option to
qconfig.py, this is not equivalent. There's 901 platforms today that enableSPL_SERIAL_PRESENT, and 344 that enableSPL_SERIAL_PRESENTbut notSPL_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
Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
Quoted 37 lines · Jonas Karlman
Hi Tom,
Quoted 18 lines · Tom Rini
Quoted 16 lines · Jonas Karlman
Change
xPL_SERIAL_PRESENTsymbols to depend on thexPL_DM_SERIALsymbol intended for the related xPL phase instead of theDM_SERIALsymbol used for U-Boot proper to makeCONFIG_IS_ENABLED(SERIAL_PRESENT)guards work as intended.Signed-off-by Jonas Karlman <[email protected]>--- drivers/serial/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/serial/Kconfig +0
-0@@ -71,7 +71,7 @@ config SERIAL_PRESENTQuoted 15 lines
drivers/serial/Kconfig config SERIAL_PRESENT · line 77
Quoted 7 lines
drivers/serial/Kconfig +1
-1config 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 tooUsing the database option to
qconfig.py, this is not equivalent. There's 901 platforms today that enableSPL_SERIAL_PRESENT, and 344 that enableSPL_SERIAL_PRESENTbut notSPL_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.
Quoted 7 lines
This discrepancy is likely due to the 'default y' and the strange 'depend on', based on my observation
xPL_SERIAL_PRESENTis mostly used to guardU_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_defconfigand 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.
Signature · 1 line
Tom
Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
In reply to Jonas KarlmanHi Jonas,
Quoted 14 lines · Jonas Karlman
Kconfig: serial: Depend on correct xPL symbolChange
xPL_SERIAL_PRESENTsymbols to depend on thexPL_DM_SERIALsymbol intended for the related xPL phase instead of theDM_SERIALsymbol used for U-Boot proper to makeCONFIG_IS_ENABLED(SERIAL_PRESENT)guards work as intended.Signed-off-by Jonas Karlman <[email protected]>
drivers/serial/Kconfig| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)
drivers/serial/Kconfig config SPL_SERIAL_PRESENT · line 83
Quoted 4 lines
drivers/serial/Kconfig +1
-1@@ -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([email protected]): 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 :-)
drivers/serial/Kconfig config TPL_SERIAL_PRESENT · line 93
Quoted 6 lines
drivers/serial/Kconfig +1
-1@@ -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.
Regards,
Simon
Re: [PATCH 09/11] Kconfig: serial: Depend on correct xPL symbol
Hi Simon,
Quoted 24 lines · Simon Glass
Hi Jonas,
Quoted 14 lines · Jonas Karlman
Kconfig: serial: Depend on correct xPL symbolChange
xPL_SERIAL_PRESENTsymbols to depend on thexPL_DM_SERIALsymbol intended for the related xPL phase instead of theDM_SERIALsymbol used for U-Boot proper to makeCONFIG_IS_ENABLED(SERIAL_PRESENT)guards work as intended.Signed-off-by Jonas Karlman <[email protected]>
drivers/serial/Kconfig| 6 +++---1 file changed, 3 insertions(+), 3 deletions(-)drivers/serial/Kconfig config SPL_SERIAL_PRESENT · line 83
Quoted 4 lines
drivers/serial/Kconfig +1
-1@@ -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_SERIALBTW this makes the workaround in
ns16550.credundant:
Quoted 7 lines
/* TODO([email protected]): 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 impliesTPL_DM_SERIALin 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 :-)
Quoted 11 lines
drivers/serial/Kconfig config TPL_SERIAL_PRESENT · line 93
Quoted 7 lines
drivers/serial/Kconfig +1
-1@@ -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_SERIALJust 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
Quoted 5 lines
Reviewed-by Simon Glass <[email protected]>Regards,
Simon
PATCH 10/11 console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
In reply to Jonas KarlmanThe 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.
--- 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(-)
board/friendlyarm/nanopi2/board.c +2 -2
@@ -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 ();
boot/bootm.c +2 -2
@@ -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 ;
common/autoboot.c +1 -1
@@ -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;
common/console.c +6 -6
@@ -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 )) {
include/env_callback.h +1 -1
@@ -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
Signature · 1 line
2.54.0
Re: [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
Quoted 8 lines · Jonas Karlman
The
xPL_SILENT_CONSOLEKconfigsymbols are not fully respected for xPL builds, instead common code is guarded by a mix ofSILENT_CONSOLEandxPL_SILENT_CONSOLEsymbols.Change to consistently use
CONFIG_IS_ENABLED(SILENT_CONSOLE)to make the common code properly guarded by the intendedKconfigsymbol.Signed-off-by Jonas Karlman <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
In reply to Jonas KarlmanHi Jonas,
Quoted 21 lines · Jonas Karlman
console: Use
CONFIG_IS_ENABLED()forSILENT_CONSOLEchecksThe
xPL_SILENT_CONSOLEKconfigsymbols are not fully respected for xPL builds, instead common code is guarded by a mix ofSILENT_CONSOLEandxPL_SILENT_CONSOLEsymbols.Change to consistently use
CONFIG_IS_ENABLED(SILENT_CONSOLE)to make the common code properly guarded by the intendedKconfigsymbol.Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
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(-)
common/console.c void putc(const char c) · line 736
Quoted 2 lines
common/console.c +1
-1@@ -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?
common/console.c static int on_console(const char *name, const char *value, enum env_op op, · line 72
Quoted 4 lines
common/console.c +1
-1@@ -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
Re: [PATCH 10/11] console: Use CONFIG_IS_ENABLED() for SILENT_CONSOLE checks
Hi Simon,
Quoted 22 lines · Simon Glass
Hi Jonas,
Quoted 18 lines · Jonas Karlman
console: Use
CONFIG_IS_ENABLED()forSILENT_CONSOLEchecksThe
xPL_SILENT_CONSOLEKconfigsymbols are not fully respected for xPL builds, instead common code is guarded by a mix ofSILENT_CONSOLEandxPL_SILENT_CONSOLEsymbols.Change to consistently use
CONFIG_IS_ENABLED(SILENT_CONSOLE)to make the common code properly guarded by the intendedKconfigsymbol.Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
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(-)
Quoted 13 lines
common/console.c void putc(const char c) · line 736
Quoted 4 lines
common/console.c +1
-1@@ -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_CONSOLEmeans. Previously the xPL symbol only dropped the boot-progress messages inspl.cat build time, but now it also gates the run-timeGD_FLG_SILENTchecks here whenconsole.cis built for SPL (i.e. withSPL_SERIAL). The help text in common/Kconfig still says "TheGD_FLG_SILENTflag 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 theSPL_SILENT_CONSOLEandTPL_SILENT_CONSOLEhelp 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.
Quoted 12 lines
common/console.c static int on_console(const char *name, const char *value, enum env_op op, · line 72
Quoted 5 lines
common/console.c +1
-1@@ -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_CONSOLEsymbol, 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 andSILENT_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
Quoted 3 lines
Regards,
Simon
PATCH 11/11 spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
In reply to Jonas KarlmanUse 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.
--- 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(-)
boot/common_fit.c +1 -1
@@ -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
common/spl/spl_usb.c +1 -1
@@ -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;
drivers/mmc/mmc-uclass.c +2 -2
@@ -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;
drivers/mmc/mmc.c +8 -8
@@ -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 ;
drivers/mmc/mmc_legacy.c +2 -2
@@ -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;
include/spl.h +3 -3
@@ -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, \
lib/hang.c +1 -1
@@ -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" );
Signature · 1 line
2.54.0
Re: [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
Quoted 6 lines · Jonas Karlman
Use
CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)instead of directly checkingCONFIG_SPL_LIBCOMMON_SUPPORTwhen guarding printf/log calls to depend on correctxPL_LIBCOMMON_SUPPORTsymbol. Also change to useIS_ENABLED()for theXPL_BUILDsymbol checks for consistency.Signed-off-by Jonas Karlman <[email protected]>
Signature · 1 line
Tom
Re: [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
Quoted 10 lines · Tom Rini
Quoted 6 lines · Jonas Karlman
Use
CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)instead of directly checkingCONFIG_SPL_LIBCOMMON_SUPPORTwhen guarding printf/log calls to depend on correctxPL_LIBCOMMON_SUPPORTsymbol. Also change to useIS_ENABLED()for theXPL_BUILDsymbol checks for consistency.Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
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.
Signature · 1 line
Tom
Re: [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
In reply to Jonas KarlmanQuoted 10 lines · Jonas Karlman
spl: Use
CONFIG_IS_ENABLED()forLIBCOMMON_SUPPORTchecksUse
CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)instead of directly checkingCONFIG_SPL_LIBCOMMON_SUPPORTwhen guarding printf/log calls to depend on correctxPL_LIBCOMMON_SUPPORTsymbol. Also change to useIS_ENABLED()for theXPL_BUILDsymbol checks for consistency.Signed-off-by Jonas Karlman <[email protected]>Reviewed-by Tom Rini <[email protected]>
Quoted 8 lines
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(-)
Re: [PATCH 11/11] spl: Use CONFIG_IS_ENABLED() for LIBCOMMON_SUPPORT checks
In reply to Jonas KarlmanHi Jonas,
Quoted 21 lines · Jonas Karlman
Use
CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)instead of directly checkingCONFIG_SPL_LIBCOMMON_SUPPORTwhen guarding printf/log calls to depend on correctxPL_LIBCOMMON_SUPPORTsymbol. Also change to useIS_ENABLED()for theXPL_BUILDsymbol checks for consistency.Signed-off-by Jonas Karlman <[email protected]>--- 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(-)boot/common_fit.c +0
-0
boot/common_fit.c int fit_find_config_node(const void *fdt) · line 56
Quoted 5 lines
boot/common_fit.c +1
-1@@ -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 )
I'm stuck on this and cannot make sense of it. I understand we don't have a CONFIG_LIBCOMMON_SUPPORT and we may want to printf in proper anyway...
I guess the issue is that if we use CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT), we will not check for CONFIG_SPL_LIBCOMMON_SUPPORT in proper (which is incorrect but what we're doing today) anymore and thus the printf won't be compiled in.
I'm thinking the right approach would be to define a
config LIBCOMMON_SUPPORT
def_bool y
help
Enable support for common U-Boot libraries. [...]
and replace all
#if !defined(CONFIG_XPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
with
#if CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT)
I'm assuming we don't have an issue with TPL using SPL_LIBCOMMON_SUPPORT without TPL_LIBCOMMON_SUPPORT as it won't be able to link due to missing library support in TPL?
Then we can simply replace the above in boot/common_fit.c with CONFIG_IS_ENABLED(LIBCOMMON_SUPPORT).
We may have an issue with
libs-$(CONFIG_$(PHASE_)LIBCOMMON_SUPPORT) += boot/ common/ cmd/ env/
in scripts/Makefile.xpl as those directories will already be in libs-y via the root Makefile for proper?
Quoted 79 lines
boot/common_fit.c +0
-0printf ("%s: Missing FDT description in DTB\n" , __func__);#endif common/spl/spl_usb.c +1
-1@@ -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;drivers/mmc/mmc-uclass.c +2
-2@@ -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;drivers/mmc/mmc.c +4
-4@@ -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
drivers/mmc/mmc.c static int mmc_startup(struct mmc *mmc) · line 2774
Quoted 8 lines
drivers/mmc/mmc.c +2
-2@@ -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 ))
If we also add a
config USE_TINY_PRINTF
def_bool n
I think we can remove the CONFIG_XPL_BUILD check since CONFIG_LIBCOMMON_SUPPORT and CONFIG_USE_TINY_PRINTF exist in proper?
Quoted 78 lines
drivers/mmc/mmc.c +2
-2sprintf(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 ;drivers/mmc/mmc_legacy.c +2
-2@@ -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;include/spl.h +3
-3@@ -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, \lib/hang.c +0
-0
lib/hang.c line 27
Quoted 7 lines
lib/hang.c +1
-1@@ -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 ))
If we add a CONFIG_LIBCOMMON_SUPPORT, I think we can remove the CONFIG_XPL_BUILD check since CONFIG_LIBCOMMON_SUPPORT and CONFIG_SERIAL exist in proper? I do think this would help make things clearer in general. What do you think?
A bit of a tangent, one of my biggest gripes about U-Boot is that we do not differentiate symbols that are meant to be phase-agnostic and those which are specific to a phase. I'm thinking we should have a PROPER_ prefix for symbols that are expected to apply to U-Boot proper only. If you have neither xPL or PROPER prefix, then it's meant to apply to all phases. But we often have mixes and it's difficult to know what's supposed to be used or not. I think it would make things much clearer as well.
For example, we have some ifdeffery in lib/Makefile around USE_TINY_PRINTF which we wouldn't need, had we a symbol for the proper phase (which can always be n/y and non-selectable by the user), then we simply can remove a bunch of ifeq ($(CONFIG_XPL_BUILD),y) checks.
Anyway, nothing required for this series and likely a big rework that may not be worth it in the end.
Cheers,
Quentin