[PATCH] arm: mach-k3: am6_init: Use CONFIG_TI_I2C_BOARD_DETECT

Bryan Brattlof bb at ti.com
Sun Feb 13 19:56:10 CET 2022


Hi Christian!

On this day, February  7, 2022, thus sayeth Christian Gmeiner:
> We only want to call bo_board_detect() if CONFIG_TI_I2C_BOARD_DETECT

s/bo_board_detect/do_board_detect/

> is set. Same as done for am64.
> 
> Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
> ---
>  arch/arm/mach-k3/am6_init.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-k3/am6_init.c b/arch/arm/mach-k3/am6_init.c
> index ffb7aaded2..8a6b1de764 100644
> --- a/arch/arm/mach-k3/am6_init.c
> +++ b/arch/arm/mach-k3/am6_init.c
> @@ -251,7 +251,8 @@ void board_init_f(ulong dummy)
>  	k3_sysfw_print_ver();
>  
>  	/* Perform EEPROM-based board detection */
> -	do_board_detect();
> +	if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
> +		do_board_detect();
>

Unless I'm mistaken the AM65 and AM64 use different do_board_detect()s.  
This one being defined inside board/ti/am65x/evm.c

At least that's why I think I get this nasty error when I try to build 
with CONFIG_TI_I2C_BOARD_DETECT turned off and your patch applied.


ard/ti/am65x/evm.c: In function ‘do_board_detect’:
board/ti/am65x/evm.c:136:35: error: ‘CONFIG_EEPROM_BUS_ADDRESS’ undeclared (first use in this function)
  136 |  ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
board/ti/am65x/evm.c:136:35: note: each undeclared identifier is reported only once for each function it appears in
board/ti/am65x/evm.c:137:7: error: ‘CONFIG_EEPROM_CHIP_ADDRESS’ undeclared (first use in this function)
  137 |       CONFIG_EEPROM_CHIP_ADDRESS);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~
board/ti/am65x/evm.c: In function ‘setup_board_eeprom_env’:
board/ti/am65x/evm.c:172:2: warning: implicit declaration of function ‘set_board_info_env_am6’ [-Wimplicit-function-declaration]
  172 |  set_board_info_env_am6(name);
      |  ^~~~~~~~~~~~~~~~~~~~~~
board/ti/am65x/evm.c: In function ‘probe_daughtercards’:
board/ti/am65x/evm.c:283:31: error: ‘CONFIG_EEPROM_BUS_ADDRESS’ undeclared (first use in this function)
  283 |   ret = ti_i2c_eeprom_am6_get(CONFIG_EEPROM_BUS_ADDRESS, i2c_addr,
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
board/ti/am65x/evm.c: In function ‘board_late_init’:
board/ti/am65x/evm.c:369:2: warning: implicit declaration of function ‘board_ti_am6_set_ethaddr’ [-Wimplicit-function-declaration]
  369 |  board_ti_am6_set_ethaddr(1, ep->mac_addr_cnt);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~


I will say I just turned CONFIG_TI_I2C_BOARD_DETECT off and chose the 
default options defconfig offered me. The chances are high I goofed on 
something.

Thanks for the patch!
~Bryan


More information about the U-Boot mailing list