diff options
author | Andrew Davis <afd@ti.com> | 2023-04-06 11:38:17 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-04-24 13:18:48 -0400 |
commit | e25fe5b2759c792e2088c40ad1798659960c47c6 (patch) | |
tree | 85a4085f03f6ad6419bd9069445721e7579ff07b /arch/arm | |
parent | f5e494460842d26d5b066519dc28b96de2918dab (diff) | |
download | u-boot-e25fe5b2759c792e2088c40ad1798659960c47c6.tar.gz |
arm: mach-k3: Add weak do_board_detect() to common file
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-k3/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-k3/am642_init.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-k3/am654_init.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-k3/common.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-k3/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-k3/include/mach/sys_proto.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-k3/j721e_init.c | 8 |
7 files changed, 20 insertions, 15 deletions
diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig index 7edbac26ccc..a8c3a593d57 100644 --- a/arch/arm/mach-k3/Kconfig +++ b/arch/arm/mach-k3/Kconfig @@ -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" diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c index c7720cbaf35..ef84aad819c 100644 --- a/arch/arm/mach-k3/am642_init.c +++ b/arch/arm/mach-k3/am642_init.c @@ -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. diff --git a/arch/arm/mach-k3/am654_init.c b/arch/arm/mach-k3/am654_init.c index 12d74635cb0..2336da4b454 100644 --- a/arch/arm/mach-k3/am654_init.c +++ b/arch/arm/mach-k3/am654_init.c @@ -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), diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 4f2e14c3105..115f5959734 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -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) +{ +} diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h index 531be0be54c..130f5021123 100644 --- a/arch/arm/mach-k3/common.h +++ b/arch/arm/mach-k3/common.h @@ -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); diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index 8cc75b636b5..939de0f79b4 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -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); diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c index eec5b726b95..31d324e2179 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -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), |