]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: ti: j721e: Probe eeprom only when CONFIG_TI_I2C_BOARD_DETECT is defined
authorLokesh Vutla <lokeshvutla@ti.com>
Wed, 5 Aug 2020 17:14:14 +0000 (22:44 +0530)
committerLokesh Vutla <lokeshvutla@ti.com>
Tue, 11 Aug 2020 15:04:46 +0000 (20:34 +0530)
Guard all eeprom probe with TI_I2C_BOARD_DETECT to avoid reading eeprom
when eeprom is not available

Reviewed-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
arch/arm/mach-k3/j721e_init.c
board/ti/j721e/evm.c

index f9454e3273e55dfff06500695d9227249adad318..5ec62a92f82c179ddc26fadf81d97148634849f8 100644 (file)
@@ -208,7 +208,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();
 
 #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
        ret = uclass_get_device_by_driver(UCLASS_MISC, DM_GET_DRIVER(k3_avs),
index a1e8fe59c4da9204c74f5d7c2e3629c0f89219b3..7199d11e95c4c45dfca5145251836f3303dbae8a 100644 (file)
@@ -100,6 +100,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 }
 #endif
 
+#ifdef CONFIG_TI_I2C_BOARD_DETECT
 int do_board_detect(void)
 {
        int ret;
@@ -336,14 +337,17 @@ static int probe_daughtercards(void)
 
        return 0;
 }
+#endif
 
 int board_late_init(void)
 {
-       setup_board_eeprom_env();
-       setup_serial();
+       if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT)) {
+               setup_board_eeprom_env();
+               setup_serial();
 
-       /* Check for and probe any plugged-in daughtercards */
-       probe_daughtercards();
+               /* Check for and probe any plugged-in daughtercards */
+               probe_daughtercards();
+       }
 
        return 0;
 }
@@ -355,7 +359,9 @@ void spl_board_init(void)
        int ret;
 #endif
 
-       probe_daughtercards();
+       if (IS_ENABLED(CONFIG_TARGET_J721E_A72_EVM) &&
+           IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+               probe_daughtercards();
 
 #ifdef CONFIG_ESM_K3
        if (board_ti_k3_is("J721EX-PM2-SOM")) {