* [PATCH] board: ti: am62x: Fix build without TI_I2C_BOARD_DETECT
@ 2026-07-15 3:32 Guo Hao via B4 Relay
2026-07-15 5:44 ` Varadarajan Narayanan
2026-07-16 7:38 ` Anshul Dalal
0 siblings, 2 replies; 5+ messages in thread
From: Guo Hao via B4 Relay @ 2026-07-15 3:32 UTC (permalink / raw)
To: Guillaume La Roque (TI.com), Mattijs Korpershoek, u-boot
Cc: Bryan Brattlof, Tom Rini, Yao Zi, Patrice Chotard,
Vishal Mahaveer, Peng Fan, Guo Hao
From: Guo Hao <guohaoprc@163.com>
setup_board_eeprom_env() and setup_serial_am6() are only available when
TI_I2C_BOARD_DETECT is enabled.
IS_ENABLED() does not remove the guarded statements during preprocessing,
so disabling TI_I2C_BOARD_DETECT results in an implicit function
declaration error. Use a preprocessor condition to match the condition
used for the function definition.
Fixes: ff1b83c095c2 ("board: am62x: Add support for reading eeprom data")
Signed-off-by: Guo Hao <guohaoprc@163.com>
---
board/ti/am62x/evm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index 49e58ad6d6c..f54abb56384 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -125,10 +125,10 @@ invalid_eeprom:
#if CONFIG_IS_ENABLED(BOARD_LATE_INIT)
int board_late_init(void)
{
- if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
- setup_board_eeprom_env();
- setup_serial_am6();
- }
+#if CONFIG_IS_ENABLED(TI_I2C_BOARD_DETECT)
+ setup_board_eeprom_env();
+ setup_serial_am6();
+#endif
ti_set_fdt_env(NULL, NULL);
return 0;
---
base-commit: 501d76ca801343cce6dafb17740a8b679ed17072
change-id: 20260715-am62x-no-board-detect-6b2eb4f7dd06
Best regards,
--
Guo Hao <guohaoprc@163.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] board: ti: am62x: Fix build without TI_I2C_BOARD_DETECT 2026-07-15 3:32 [PATCH] board: ti: am62x: Fix build without TI_I2C_BOARD_DETECT Guo Hao via B4 Relay @ 2026-07-15 5:44 ` Varadarajan Narayanan 2026-07-16 7:38 ` Anshul Dalal 1 sibling, 0 replies; 5+ messages in thread From: Varadarajan Narayanan @ 2026-07-15 5:44 UTC (permalink / raw) To: guohaoprc Cc: Guillaume La Roque (TI.com), Mattijs Korpershoek, u-boot, Bryan Brattlof, Tom Rini, Yao Zi, Patrice Chotard, Vishal Mahaveer, Peng Fan On Wed, Jul 15, 2026 at 11:32:26AM +0800, Guo Hao via B4 Relay wrote: > From: Guo Hao <guohaoprc@163.com> > > setup_board_eeprom_env() and setup_serial_am6() are only available when > TI_I2C_BOARD_DETECT is enabled. > > IS_ENABLED() does not remove the guarded statements during preprocessing, > so disabling TI_I2C_BOARD_DETECT results in an implicit function > declaration error. Use a preprocessor condition to match the condition > used for the function definition. > > Fixes: ff1b83c095c2 ("board: am62x: Add support for reading eeprom data") > Signed-off-by: Guo Hao <guohaoprc@163.com> Reviewed-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com> [ . . . ] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] board: ti: am62x: Fix build without TI_I2C_BOARD_DETECT 2026-07-15 3:32 [PATCH] board: ti: am62x: Fix build without TI_I2C_BOARD_DETECT Guo Hao via B4 Relay 2026-07-15 5:44 ` Varadarajan Narayanan @ 2026-07-16 7:38 ` Anshul Dalal 2026-07-21 8:14 ` Mattijs Korpershoek via U-Boot 1 sibling, 1 reply; 5+ messages in thread From: Anshul Dalal @ 2026-07-16 7:38 UTC (permalink / raw) To: Guo Hao Cc: Guillaume La Roque (TI.com), Mattijs Korpershoek, u-boot, Bryan Brattlof, Tom Rini, Yao Zi, Patrice Chotard, Vishal Mahaveer, Peng Fan On Wed, 15 Jul 2026 11:32:26 +0800, Guo Hao <guohaoprc@163.com> wrote: > setup_board_eeprom_env() and setup_serial_am6() are only available when > TI_I2C_BOARD_DETECT is enabled. > > IS_ENABLED() does not remove the guarded statements during preprocessing, > so disabling TI_I2C_BOARD_DETECT results in an implicit function > declaration error. Use a preprocessor condition to match the condition > used for the function definition. > > Fixes: ff1b83c095c2 ("board: am62x: Add support for reading eeprom data") > Signed-off-by: Guo Hao <guohaoprc@163.com> This is a valid fix however I wonder if there's an actual use-case where someone might want to disable TI_I2C_BOARD_DETECT on an EVM board. Also, it looks like the same issue exists for other platforms too (AM64x, AM65x, J721s2 ...). -- Anshul Dalal <anshuld@ti.com> ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] board: ti: am62x: Fix build without TI_I2C_BOARD_DETECT 2026-07-16 7:38 ` Anshul Dalal @ 2026-07-21 8:14 ` Mattijs Korpershoek via U-Boot [not found] ` <7b7be0c1.8185.19f841a7a0c.Coremail.guohaoprc@163.com> 0 siblings, 1 reply; 5+ messages in thread From: Mattijs Korpershoek via U-Boot @ 2026-07-21 8:14 UTC (permalink / raw) To: Anshul Dalal, Guo Hao Cc: Guillaume La Roque (TI.com), Mattijs Korpershoek, u-boot, Bryan Brattlof, Tom Rini, Yao Zi, Patrice Chotard, Vishal Mahaveer, Peng Fan On Thu, Jul 16, 2026 at 13:08, Anshul Dalal <anshuld@ti.com> wrote: > On Wed, 15 Jul 2026 11:32:26 +0800, Guo Hao <guohaoprc@163.com> wrote: >> setup_board_eeprom_env() and setup_serial_am6() are only available when >> TI_I2C_BOARD_DETECT is enabled. >> >> IS_ENABLED() does not remove the guarded statements during preprocessing, >> so disabling TI_I2C_BOARD_DETECT results in an implicit function >> declaration error. Use a preprocessor condition to match the condition >> used for the function definition. >> >> Fixes: ff1b83c095c2 ("board: am62x: Add support for reading eeprom data") >> Signed-off-by: Guo Hao <guohaoprc@163.com> > > This is a valid fix however I wonder if there's an actual use-case where someone > might want to disable TI_I2C_BOARD_DETECT on an EVM board. I agree with Anshul here. What's the use use-case for disabling i2c board detection? Also, if we really want it disabled, we could also create stub functions instead of replacing this. > > Also, it looks like the same issue exists for other platforms too (AM64x, AM65x, > J721s2 ...). > > -- > Anshul Dalal <anshuld@ti.com> ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <7b7be0c1.8185.19f841a7a0c.Coremail.guohaoprc@163.com>]
* Re:Re: [PATCH] board: ti: am62x: Fix build without TI_I2C_BOARD_DETECT [not found] ` <7b7be0c1.8185.19f841a7a0c.Coremail.guohaoprc@163.com> @ 2026-07-21 14:14 ` Mattijs Korpershoek via U-Boot 0 siblings, 0 replies; 5+ messages in thread From: Mattijs Korpershoek via U-Boot @ 2026-07-21 14:14 UTC (permalink / raw) To: 国豪, Mattijs Korpershoek Cc: Anshul Dalal, Guillaume La Roque (TI.com), u-boot, Bryan Brattlof, Tom Rini, Yao Zi, Patrice Chotard, Vishal Mahaveer, Peng Fan On Tue, Jul 21, 2026 at 17:55, 国豪 <guohaoprc@163.com> wrote: > Hi, > > > Thanks for the question. > > > My use case is a third-party board based on the AM6254 SoC, rather than a TI > EVM. The board reuses the common AM62x EVM boot flow, but it does not have a TI > AM6-compatible board EEPROM. Its board identity and device tree selection are > fixed by the board configuration. I see, thanks for the explanation. I think that this should be mentioned in the commit message. > > > I verified this behavior on the board. With TI_I2C_BOARD_DETECT enabled, U-Boot > probes I2C addresses 0x50 and 0x51, and both probes fail. The AM62x late-init > code then sets: > > > board_name=am62x_skevm > board_rev=unknown > board_software_revision=unknown > board_serial=unknown > serial#=0000000000000000 > > > This information is incorrect for the third-party board. Its configuration > therefore uses: > > > CONFIG_BOARD_LATE_INIT=y > # CONFIG_TI_I2C_BOARD_DETECT is not set > > > This keeps the board late-init hook, including the fdtfile setup, while > disabling the TI EVM EEPROM detection. > > > The submitted patch fixes the build error for this valid configuration. I am > also fine with the suggested no-op stubs, provided they preserve the behavior > of not applying EVM fallback information or setting a serial number when board > detection is disabled. I have a slight preference for adding setup_board_eeprom_env() and setup_serial_am6() as no-op stubs. But I'm not the TI board maintainer so I let them decide. > > > I limited this patch to AM62x, which is the platform I tested. I agree that the > same pattern should be addressed for the other affected platforms as well. > > > Best regards, > Guo Hao > > > > At 2026-07-21 16:14:08, "Mattijs Korpershoek" <mkorpershoek@kernel.org> wrote: >>On Thu, Jul 16, 2026 at 13:08, Anshul Dalal <anshuld@ti.com> wrote: >> >>> On Wed, 15 Jul 2026 11:32:26 +0800, Guo Hao <guohaoprc@163.com> wrote: >>>> setup_board_eeprom_env() and setup_serial_am6() are only available when >>>> TI_I2C_BOARD_DETECT is enabled. >>>> >>>> IS_ENABLED() does not remove the guarded statements during preprocessing, >>>> so disabling TI_I2C_BOARD_DETECT results in an implicit function >>>> declaration error. Use a preprocessor condition to match the condition >>>> used for the function definition. >>>> >>>> Fixes: ff1b83c095c2 ("board: am62x: Add support for reading eeprom data") >>>> Signed-off-by: Guo Hao <guohaoprc@163.com> >>> >>> This is a valid fix however I wonder if there's an actual use-case where someone >>> might want to disable TI_I2C_BOARD_DETECT on an EVM board. >> >>I agree with Anshul here. What's the use use-case for disabling i2c >>board detection? >> >>Also, if we really want it disabled, we could also create stub functions >>instead of replacing this. >> >>> >>> Also, it looks like the same issue exists for other platforms too (AM64x, AM65x, >>> J721s2 ...). >>> >>> -- >>> Anshul Dalal <anshuld@ti.com> ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-21 14:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15 3:32 [PATCH] board: ti: am62x: Fix build without TI_I2C_BOARD_DETECT Guo Hao via B4 Relay
2026-07-15 5:44 ` Varadarajan Narayanan
2026-07-16 7:38 ` Anshul Dalal
2026-07-21 8:14 ` Mattijs Korpershoek via U-Boot
[not found] ` <7b7be0c1.8185.19f841a7a0c.Coremail.guohaoprc@163.com>
2026-07-21 14:14 ` Mattijs Korpershoek via U-Boot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox