]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: mach-k3: Add weak do_board_detect() to common file
authorAndrew Davis <afd@ti.com>
Thu, 6 Apr 2023 16:38:17 +0000 (11:38 -0500)
committerTom Rini <trini@konsulko.com>
Mon, 24 Apr 2023 17:18:48 +0000 (13:18 -0400)
This matches how it was done for pre-K3 TI platforms and it allows
us to move the forward declaration out of sys_proto.h.

It also removes the need for K3_BOARD_DETECT as one is free to simply
override the weak function in their board files as needed.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
arch/arm/mach-k3/Kconfig
arch/arm/mach-k3/am642_init.c
arch/arm/mach-k3/am654_init.c
arch/arm/mach-k3/common.c
arch/arm/mach-k3/common.h
arch/arm/mach-k3/include/mach/sys_proto.h
arch/arm/mach-k3/j721e_init.c
board/ti/common/Kconfig

index 7edbac26ccccb345031d0220d62b21e6a5d9a38e..a8c3a593d5704b70907e7dfd4c42b8fcaab46144 100644 (file)
@@ -187,11 +187,6 @@ 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 c7720cbaf35a0d6dcaf96be41df9d3617af0fb7c..ef84aad819cb873de59152d314ad177405fbfc94 100644 (file)
@@ -100,8 +100,8 @@ void do_dt_magic(void)
 {
        int ret, rescan;
 
-       if (IS_ENABLED(CONFIG_K3_BOARD_DETECT))
-               do_board_detect();
+       /* Perform board detection */
+       do_board_detect();
 
        /*
         * Board detection has been done.
index 12d74635cb01e7549527f4efa41db202733701a6..2336da4b454b8887cffafe0afb6690a44ce6bc6a 100644 (file)
@@ -245,8 +245,8 @@ void board_init_f(ulong dummy)
        /* Output System Firmware version info */
        k3_sysfw_print_ver();
 
-       if (IS_ENABLED(CONFIG_K3_BOARD_DETECT))
-               do_board_detect();
+       /* Perform board detection */
+       do_board_detect();
 
 #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
        ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(k3_avs),
index 4f2e14c3105472da1b391f9cba383b52f6e71c98..115f5959734572ff90591d59d2df1afeeb9ae920 100644 (file)
@@ -636,3 +636,13 @@ int misc_init_r(void)
 
        return 0;
 }
+
+/**
+ * do_board_detect() - Detect board description
+ *
+ * Function to detect board description. This is expected to be
+ * overridden in the SoC family board file where desired.
+ */
+void __weak do_board_detect(void)
+{
+}
index 531be0be54cbad57c167d7107d77cc8969274fc2..130f5021123aceca4d1060dde57df25920450c73 100644 (file)
@@ -35,3 +35,5 @@ void mmr_unlock(phys_addr_t base, u32 partition);
 bool is_rom_loaded_sysfw(struct rom_extended_boot_data *data);
 enum k3_device_type get_device_type(void);
 void ti_secure_image_post_process(void **p_image, size_t *p_size);
+struct ti_sci_handle *get_ti_sci_handle(void);
+void do_board_detect(void);
index 8cc75b636b515a2d88c63f826fb0951bf425d97f..939de0f79b40b69b77bb8b1175257e8495a6d1ed 100644 (file)
@@ -10,8 +10,6 @@
 void sdelay(unsigned long loops);
 u32 wait_on_value(u32 read_bit_mask, u32 match_value, void *read_addr,
                  u32 bound);
-struct ti_sci_handle *get_ti_sci_handle(void);
-int do_board_detect(void);
 int fdt_disable_node(void *blob, char *node_path);
 
 void k3_spl_init(void);
index eec5b726b953a53dc451c5f184ce952b771a8953..31d324e2179d249c0ff714498b79b27b9b65abd7 100644 (file)
@@ -140,8 +140,8 @@ void do_dt_magic(void)
        int ret, rescan, mmc_dev = -1;
        static struct mmc *mmc;
 
-       if (IS_ENABLED(CONFIG_K3_BOARD_DETECT))
-               do_board_detect();
+       /* Perform board detection */
+       do_board_detect();
 
        /*
         * Board detection has been done.
@@ -267,8 +267,8 @@ void board_init_f(ulong dummy)
        /* Output System Firmware version info */
        k3_sysfw_print_ver();
 
-       if (IS_ENABLED(CONFIG_K3_BOARD_DETECT))
-               do_board_detect();
+       /* Perform board detection */
+       do_board_detect();
 
 #if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0)
        ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(k3_avs),
index f03357cc75106bdec51e54d2edaba7eaa5474e65..49edd98014ab7d2009f8e312b9146e09531262ed 100644 (file)
@@ -1,6 +1,5 @@
 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