]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mach-k3: introduce generic board detction kconfig option
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 3 Mar 2023 19:16:28 +0000 (20:16 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 29 Mar 2023 17:30:28 +0000 (13:30 -0400)
For non TI boards it is not possible to enable the do_board_detect()
call as TI_I2C_BOARD_DETECT is defined in board/ti/common/Kconfig.

I want to use do_board_detect() to dectect boards and properties based
on some SPI communication with a FPGA.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-k3/Kconfig
arch/arm/mach-k3/am642_init.c
arch/arm/mach-k3/am654_init.c
arch/arm/mach-k3/j721e_init.c
board/ti/common/Kconfig

index a8c3a593d5704b70907e7dfd4c42b8fcaab46144..7edbac26ccccb345031d0220d62b21e6a5d9a38e 100644 (file)
@@ -187,6 +187,11 @@ config K3_X509_SWRV
        help
          SWRV for X509 certificate used for boot images
 
+config K3_BOARD_DETECT
+       bool "Support for Board detection"
+       help
+          Support for board detection.
+
 source "board/ti/am65x/Kconfig"
 source "board/ti/am64x/Kconfig"
 source "board/ti/am62x/Kconfig"
index 96f292ea75c4ae868a00b461da491da51de66718..1bf7e163cc46c2f2be22cf5809fd592890d0354b 100644 (file)
@@ -100,7 +100,7 @@ void do_dt_magic(void)
 {
        int ret, rescan;
 
-       if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+       if (IS_ENABLED(CONFIG_K3_BOARD_DETECT))
                do_board_detect();
 
        /*
index 768fdd69602f4ddb6cd0a6b176db04d92bdd7766..70059edb039d919ba1d902eca8151e05233dd855 100644 (file)
@@ -245,8 +245,7 @@ void board_init_f(ulong dummy)
        /* Output System Firmware version info */
        k3_sysfw_print_ver();
 
-       /* Perform EEPROM-based board detection */
-       if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+       if (IS_ENABLED(CONFIG_K3_BOARD_DETECT))
                do_board_detect();
 
 #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
index 276cbb5dae2d74a3f043a8c0ff42b37af52dc2fe..9cae3ac67e9c2460ea14d8a88378f1cda66851a0 100644 (file)
@@ -140,7 +140,7 @@ void do_dt_magic(void)
        int ret, rescan, mmc_dev = -1;
        static struct mmc *mmc;
 
-       if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+       if (IS_ENABLED(CONFIG_K3_BOARD_DETECT))
                do_board_detect();
 
        /*
@@ -267,8 +267,7 @@ void board_init_f(ulong dummy)
        /* Output System Firmware version info */
        k3_sysfw_print_ver();
 
-       /* Perform EEPROM-based board detection */
-       if (IS_ENABLED(CONFIG_TI_I2C_BOARD_DETECT))
+       if (IS_ENABLED(CONFIG_K3_BOARD_DETECT))
                do_board_detect();
 
 #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
index 49edd98014ab7d2009f8e312b9146e09531262ed..f03357cc75106bdec51e54d2edaba7eaa5474e65 100644 (file)
@@ -1,5 +1,6 @@
 config TI_I2C_BOARD_DETECT
        bool "Support for Board detection for TI platforms"
+       select K3_BOARD_DETECT if ARCH_K3
        help
           Support for detection board information on Texas Instrument's
           Evaluation Boards which have I2C based EEPROM detection