[PATCH 1/1] board: ti: am335x: Do not call disabled PMIC functions

Tom Rini trini at konsulko.com
Fri Sep 19 16:10:58 CEST 2025


On Fri, Sep 19, 2025 at 08:15:28AM +0000, Maarten Brock wrote:
> > From: Tom Rini <trini at konsulko.com>
> > On Mon, Sep 08, 2025 at 04:05:04PM +0000, Maarten Brock wrote:
> > 
> > > When PMIC drivers are disabled their functions should not be called.
> > >
> > > Signed-off-by: Maarten Brock <maarten.brock at sttls.nl>
> > > ---
> > >
> > >  board/ti/am335x/board.c | 8 +++++++-
> > >  1 file changed, 7 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
> > > index 2b7ab68e83c..284c31cc329 100644
> > > --- a/board/ti/am335x/board.c
> > > +++ b/board/ti/am335x/board.c
> > > @@ -283,7 +283,7 @@ const struct dpll_params *get_dpll_ddr_params(void)
> > >
> > >  static u8 bone_not_connected_to_ac_power(void)
> > >  {
> > > -	if (board_is_bone()) {
> > > +	if (CONFIG_IS_ENABLED(PMIC_TPS65217) && board_is_bone()) {
> > >  		uchar pmic_status_reg;
> > >  		if (tps65217_reg_read(TPS65217_STATUS,
> > >  				      &pmic_status_reg))
> > 
> > The problem is that here and elsewhere we don't have SPL_xxx symbols and
> > so we're turning off these calls in SPL now on the platforms which would
> > be calling them.
> 
> That would be really odd. The function tps65217_reg_read() is not defined when CONFIG_PMIC_TPS65217 is not defined. So how could these calls work then? For me it leads to a build failure. Or did I use an incorrect macro with CONFIG_IS_ENABLED to solve this?

The symbol will be defined in both SPL and full U-Boot builds but
CONFIG_IS_ENABLED(X) only checks for CONFIG_$(PHASE_)X being enabled. So
the issue is that CONFIG_PMIC_TPS65217 is define but
CONFIG_SPL_PMIC_TPS65217 doesn't exist and isn't defined. The
IS_ENABLED(CONFIG_X) macro is what checks for CONFIG_X being defined,
regardless of phase of the build. It's the CONFIG_FOO_MODULE problem the
linux kernel has, except our modifier is in the middle, not the end of
the name.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250919/e0fcd8b4/attachment.sig>


More information about the U-Boot mailing list