[PATCH v4 00/12] Remove K3 misc sys_proto.h header

Hello all,
Some minor cleanups with end patch removing sys_proto.h. Why? Becouse I don't like headers of "miscellaneous".
Thanks, Andrew
Changes from v3: - [2/12] Fix copy/paste error (thanks Christian) - add more tags and rebase on latest
Changes from v2: - Reworked patch [2/12] to use static and turned it into common macro - Removed "EEPROM" from comment as board detection can use other methods - Added more reviewed by tags
Changes from v1: - Added reviewed by tag - Rebased on latest
Andrew Davis (12): arm: mach-k3: Move MSMC fixup to SoC level arm: mach-k3: Move J721e SoC detection out of common section soc: soc_ti_k3: Use hardware.h to remove definition duplication configs: j721x_evm: Remove unneeded check for SYS_K3_SPL_ATF configs: j721s2_evm.h: Remove refrences to J7200 EVM arm: mach-k3: Make release_resources_for_core_shutdown() common arm: mach-k3: Move sysfw-loader.h out of mach includes arm: mach-k3: Add weak do_board_detect() to common file arm: mach-k3: Remove unused fdt_disable_node() arm: mach-k3: Move sdelay() and wait_on_value() declaration arm: mach-k3: Move J721s2 SPL init functions to mach-k3 arm: mach-k3: Remove empty sys_proto.h include
arch/arm/mach-k3/Kconfig | 5 - arch/arm/mach-k3/am625_init.c | 2 +- arch/arm/mach-k3/am62a7_init.c | 2 +- arch/arm/mach-k3/am642_init.c | 59 +-------- arch/arm/mach-k3/am654_init.c | 58 +-------- arch/arm/mach-k3/common.c | 88 +++++++------ arch/arm/mach-k3/common.h | 5 +- arch/arm/mach-k3/include/mach/am62_hardware.h | 8 ++ .../arm/mach-k3/include/mach/am62a_hardware.h | 8 ++ arch/arm/mach-k3/include/mach/am64_hardware.h | 24 ++++ arch/arm/mach-k3/include/mach/am6_hardware.h | 19 +++ arch/arm/mach-k3/include/mach/hardware.h | 25 ++++ .../arm/mach-k3/include/mach/j721e_hardware.h | 19 +++ .../mach-k3/include/mach/j721s2_hardware.h | 19 +++ arch/arm/mach-k3/include/mach/sys_proto.h | 25 ---- arch/arm/mach-k3/j721e_init.c | 66 +--------- arch/arm/mach-k3/j721s2_init.c | 121 ++++++++++-------- arch/arm/mach-k3/security.c | 1 - arch/arm/mach-k3/sysfw-loader.c | 1 - .../mach-k3/{include/mach => }/sysfw-loader.h | 0 board/siemens/iot2050/board.c | 12 +- board/ti/am62ax/evm.c | 1 - board/ti/am62x/evm.c | 1 - board/ti/am64x/evm.c | 1 - board/ti/am65x/evm.c | 20 --- board/ti/common/Kconfig | 1 - board/ti/j721e/evm.c | 13 +- board/ti/j721e/j721e.env | 2 - board/ti/j721s2/evm.c | 81 ------------ board/ti/j721s2/j721s2.env | 2 - configs/am65x_evm_a53_defconfig | 2 +- configs/am65x_hs_evm_a53_defconfig | 2 +- configs/iot2050_pg1_defconfig | 1 + configs/iot2050_pg2_defconfig | 1 + configs/j7200_evm_a72_defconfig | 1 + configs/j7200_hs_evm_a72_defconfig | 1 + configs/j721e_evm_a72_defconfig | 1 + configs/j721e_hs_evm_a72_defconfig | 1 + configs/j721s2_evm_a72_defconfig | 2 +- configs/j721s2_hs_evm_a72_defconfig | 2 +- drivers/phy/phy-ti-am654.c | 1 - drivers/ram/k3-am654-ddrss.c | 5 +- drivers/soc/Kconfig | 2 +- drivers/soc/soc_ti_k3.c | 30 ++--- include/configs/j721s2_evm.h | 2 +- 45 files changed, 280 insertions(+), 463 deletions(-) delete mode 100644 arch/arm/mach-k3/include/mach/sys_proto.h rename arch/arm/mach-k3/{include/mach => }/sysfw-loader.h (100%)

The MSMC fixup is something we do based on SoC, not based on the board. So this fixup does not belong in the board files. Move this to the mach-k3 common file so that it does not have to be done in each board that uses these SoCs.
We use ft_system_setup() here instead of ft_board_setup() since it is no longer board level. Enable OF_SYSTEM_SETUP in the configurations that use this to keep functionality the same.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- arch/arm/mach-k3/common.c | 16 ++++++++++++++++ arch/arm/mach-k3/include/mach/sys_proto.h | 1 - board/siemens/iot2050/board.c | 11 +---------- board/ti/am65x/evm.c | 18 ------------------ board/ti/j721e/evm.c | 11 +---------- board/ti/j721s2/evm.c | 16 ---------------- configs/am65x_evm_a53_defconfig | 2 +- configs/am65x_hs_evm_a53_defconfig | 2 +- configs/iot2050_pg1_defconfig | 1 + configs/iot2050_pg2_defconfig | 1 + configs/j7200_evm_a72_defconfig | 1 + configs/j7200_hs_evm_a72_defconfig | 1 + configs/j721e_evm_a72_defconfig | 1 + configs/j721e_hs_evm_a72_defconfig | 1 + configs/j721s2_evm_a72_defconfig | 2 +- configs/j721s2_hs_evm_a72_defconfig | 2 +- 16 files changed, 28 insertions(+), 59 deletions(-)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index a2adb791f6c..6870f13c520 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -386,6 +386,22 @@ int fdt_disable_node(void *blob, char *node_path) return 0; }
+#if defined(CONFIG_OF_SYSTEM_SETUP) +int ft_system_setup(void *blob, struct bd_info *bd) +{ + int ret; + + ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000"); + if (ret < 0) + ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", + "sram@70000000"); + if (ret) + printf("%s: fixing up msmc ram failed %d\n", __func__, ret); + + return ret; +} +#endif + #endif
#ifndef CONFIG_SYSRESET diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index 3d3d90d02d6..0b5d606eaa2 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -11,7 +11,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 fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name); int do_board_detect(void); void release_resources_for_core_shutdown(void); int fdt_disable_node(void *blob, char *node_path); diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c index df705b7c971..1ba3e90c6fc 100644 --- a/board/siemens/iot2050/board.c +++ b/board/siemens/iot2050/board.c @@ -482,19 +482,10 @@ fixup_error:
int ft_board_setup(void *blob, struct bd_info *bd) { - int ret; - - ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000"); - if (ret < 0) - ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", - "sram@70000000"); - if (ret) - pr_err("%s: fixing up msmc ram failed %d\n", __func__, ret); - if (board_is_m2()) m2_fdt_fixup(blob);
- return ret; + return 0; } #endif
diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c index b266ccb4b82..4053b8333cf 100644 --- a/board/ti/am65x/evm.c +++ b/board/ti/am65x/evm.c @@ -101,24 +101,6 @@ int board_fit_config_name_match(const char *name) } #endif
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, struct bd_info *bd) -{ - int ret; - - ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000"); - if (ret < 0) - ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", - "sram@70000000"); - if (ret) { - printf("%s: fixing up msmc ram failed %d\n", __func__, ret); - return ret; - } - - return 0; -} -#endif - #ifdef CONFIG_TI_I2C_BOARD_DETECT int do_board_detect(void) { diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index d4e672a7acd..00ce009d3e8 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -144,18 +144,9 @@ void spl_perform_fixups(struct spl_image_info *spl_image) #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, struct bd_info *bd) { - int ret; - - ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000"); - if (ret < 0) - ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", - "sram@70000000"); - if (ret) - printf("%s: fixing up msmc ram failed %d\n", __func__, ret); - detect_enable_hyperflash(blob);
- return ret; + return 0; } #endif
diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c index c86715fa211..9b130c141ac 100644 --- a/board/ti/j721s2/evm.c +++ b/board/ti/j721s2/evm.c @@ -73,22 +73,6 @@ int dram_init_banksize(void) return 0; }
-#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) -int ft_board_setup(void *blob, struct bd_info *bd) -{ - int ret; - - ret = fdt_fixup_msmc_ram(blob, "/bus@100000", "sram@70000000"); - if (ret < 0) - ret = fdt_fixup_msmc_ram(blob, "/interconnect@100000", - "sram@70000000"); - if (ret) - printf("%s: fixing up msmc ram failed %d\n", __func__, ret); - - return ret; -} -#endif - #ifdef CONFIG_TI_I2C_BOARD_DETECT /* * Functions specific to EVM and SK designs of J721S2/AM68 family. diff --git a/configs/am65x_evm_a53_defconfig b/configs/am65x_evm_a53_defconfig index bddd94ce80e..4af274e06d6 100644 --- a/configs/am65x_evm_a53_defconfig +++ b/configs/am65x_evm_a53_defconfig @@ -30,7 +30,7 @@ CONFIG_SPL_SPI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 -CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern" CONFIG_LOGLEVEL=7 diff --git a/configs/am65x_hs_evm_a53_defconfig b/configs/am65x_hs_evm_a53_defconfig index 898403aad98..bdd4b6420dd 100644 --- a/configs/am65x_hs_evm_a53_defconfig +++ b/configs/am65x_hs_evm_a53_defconfig @@ -30,7 +30,7 @@ CONFIG_SPL_SPI=y # CONFIG_PSCI_RESET is not set # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y -CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_fit_${boot}; run get_overlaystring; run run_fit" CONFIG_LOGLEVEL=7 diff --git a/configs/iot2050_pg1_defconfig b/configs/iot2050_pg1_defconfig index b02769609c7..957e3c4b2c2 100644 --- a/configs/iot2050_pg1_defconfig +++ b/configs/iot2050_pg1_defconfig @@ -28,6 +28,7 @@ CONFIG_SPL_SPI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTSTAGE=y CONFIG_SHOW_BOOT_PROGRESS=y diff --git a/configs/iot2050_pg2_defconfig b/configs/iot2050_pg2_defconfig index b20667780a3..1d221ade0d5 100644 --- a/configs/iot2050_pg2_defconfig +++ b/configs/iot2050_pg2_defconfig @@ -28,6 +28,7 @@ CONFIG_DISTRO_DEFAULTS=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_BOOTSTAGE=y CONFIG_SHOW_BOOT_PROGRESS=y CONFIG_SPL_SHOW_BOOT_PROGRESS=y diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig index 9b6512bacba..f9299780f71 100644 --- a/configs/j7200_evm_a72_defconfig +++ b/configs/j7200_evm_a72_defconfig @@ -31,6 +31,7 @@ CONFIG_SPL_SPI=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern" CONFIG_LOGLEVEL=7 diff --git a/configs/j7200_hs_evm_a72_defconfig b/configs/j7200_hs_evm_a72_defconfig index cfd2e80aded..e83525bcb5e 100644 --- a/configs/j7200_hs_evm_a72_defconfig +++ b/configs/j7200_hs_evm_a72_defconfig @@ -32,6 +32,7 @@ CONFIG_SPL_SPI=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_fit_${boot}; run get_overlaystring; run run_fit" CONFIG_LOGLEVEL=7 diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig index 452e4b9695d..46ad1b7d1a1 100644 --- a/configs/j721e_evm_a72_defconfig +++ b/configs/j721e_evm_a72_defconfig @@ -29,6 +29,7 @@ CONFIG_SPL_SPI=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run distro_bootcmd; run init_${boot}; run main_cpsw0_qsgmii_phyinit; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern" CONFIG_LOGLEVEL=7 diff --git a/configs/j721e_hs_evm_a72_defconfig b/configs/j721e_hs_evm_a72_defconfig index 651df4a4865..df4bf01daf9 100644 --- a/configs/j721e_hs_evm_a72_defconfig +++ b/configs/j721e_hs_evm_a72_defconfig @@ -30,6 +30,7 @@ CONFIG_SPL_SPI=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run main_cpsw0_qsgmii_phyinit; run boot_rprocs; run get_fit_${boot}; run get_overlay_${boot}; run run_fit" CONFIG_LOGLEVEL=7 diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig index 3a91df71d37..9889e1bd523 100644 --- a/configs/j721s2_evm_a72_defconfig +++ b/configs/j721s2_evm_a72_defconfig @@ -28,7 +28,7 @@ CONFIG_SPL_SPI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 -CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern" CONFIG_LOGLEVEL=7 diff --git a/configs/j721s2_hs_evm_a72_defconfig b/configs/j721s2_hs_evm_a72_defconfig index 453f2aabbfc..035d87b49f1 100644 --- a/configs/j721s2_hs_evm_a72_defconfig +++ b/configs/j721s2_hs_evm_a72_defconfig @@ -31,7 +31,7 @@ CONFIG_SPL_SPI=y # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 -CONFIG_OF_BOARD_SETUP=y +CONFIG_OF_SYSTEM_SETUP=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run boot_rprocs; run get_fit_${boot}; run get_overlaystring; run run_fit" CONFIG_LOGLEVEL=7

On Thu, Apr 06, 2023 at 11:38:10AM -0500, Andrew Davis wrote:
The MSMC fixup is something we do based on SoC, not based on the board. So this fixup does not belong in the board files. Move this to the mach-k3 common file so that it does not have to be done in each board that uses these SoCs.
We use ft_system_setup() here instead of ft_board_setup() since it is no longer board level. Enable OF_SYSTEM_SETUP in the configurations that use this to keep functionality the same.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com
For the series, applied to u-boot/master, thanks!

This belongs in the J721e specific file as it is the only place this is used. Any board level users should use the SOC driver.
While here, move the J721e and J7200 SoC IDs out of sys_proto.h and into hardware.h. Use a macro borrowed from Rockchip and add the rest of the SoC IDs for completeness and later use.
Signed-off-by: Andrew Davis afd@ti.com --- arch/arm/mach-k3/common.c | 20 ------------------ arch/arm/mach-k3/common.h | 3 --- arch/arm/mach-k3/include/mach/hardware.h | 25 +++++++++++++++++++++++ arch/arm/mach-k3/include/mach/sys_proto.h | 3 --- 4 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 6870f13c520..6e084de692c 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -488,26 +488,6 @@ int print_cpuinfo(void) } #endif
-bool soc_is_j721e(void) -{ - u32 soc; - - soc = (readl(CTRLMMR_WKUP_JTAG_ID) & - JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT; - - return soc == J721E; -} - -bool soc_is_j7200(void) -{ - u32 soc; - - soc = (readl(CTRLMMR_WKUP_JTAG_ID) & - JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT; - - return soc == J7200; -} - #ifdef CONFIG_ARM64 void board_prep_linux(struct bootm_headers *images) { diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h index 8f38fcef7f0..531be0be54c 100644 --- a/arch/arm/mach-k3/common.h +++ b/arch/arm/mach-k3/common.h @@ -9,9 +9,6 @@ #include <asm/armv7_mpu.h> #include <asm/hardware.h>
-#define J721E 0xbb64 -#define J7200 0xbb6d - struct fwl_data { const char *name; u16 fwl_id; diff --git a/arch/arm/mach-k3/include/mach/hardware.h b/arch/arm/mach-k3/include/mach/hardware.h index 2c60ef85432..9faf1d6ff06 100644 --- a/arch/arm/mach-k3/include/mach/hardware.h +++ b/arch/arm/mach-k3/include/mach/hardware.h @@ -6,6 +6,8 @@ #ifndef _ASM_ARCH_HARDWARE_H_ #define _ASM_ARCH_HARDWARE_H_
+#include <asm/io.h> + #ifdef CONFIG_SOC_K3_AM654 #include "am6_hardware.h" #endif @@ -36,6 +38,29 @@ #define JTAG_ID_VARIANT_MASK (0xf << 28) #define JTAG_ID_PARTNO_SHIFT 12 #define JTAG_ID_PARTNO_MASK (0xffff << 12) +#define JTAG_ID_PARTNO_AM65X 0xbb5a +#define JTAG_ID_PARTNO_J721E 0xbb64 +#define JTAG_ID_PARTNO_J7200 0xbb6d +#define JTAG_ID_PARTNO_AM64X 0xbb38 +#define JTAG_ID_PARTNO_J721S2 0xbb75 +#define JTAG_ID_PARTNO_AM62X 0xbb7e +#define JTAG_ID_PARTNO_AM62AX 0xbb8d + +#define K3_SOC_ID(id, ID) \ +static inline bool soc_is_##id(void) \ +{ \ + u32 soc = (readl(CTRLMMR_WKUP_JTAG_ID) & \ + JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT; \ + return soc == JTAG_ID_PARTNO_##ID; \ +} +K3_SOC_ID(am65x, AM65X) +K3_SOC_ID(j721e, J721E) +K3_SOC_ID(j7200, J7200) +K3_SOC_ID(am64x, AM64X) +K3_SOC_ID(j721s2, J721S2) +K3_SOC_ID(am62x, AM62X) +K3_SOC_ID(am62ax, AM62AX) + #define K3_SEC_MGR_SYS_STATUS 0x44234100 #define SYS_STATUS_DEV_TYPE_SHIFT 0 #define SYS_STATUS_DEV_TYPE_MASK (0xf) diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index 0b5d606eaa2..d5d4b787b7d 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -15,9 +15,6 @@ int do_board_detect(void); void release_resources_for_core_shutdown(void); int fdt_disable_node(void *blob, char *node_path);
-bool soc_is_j721e(void); -bool soc_is_j7200(void); - void k3_spl_init(void); void k3_mem_init(void); bool check_rom_loaded_sysfw(void);

This belongs in the J721e specific file as it is the only place this is used. Any board level users should use the SOC driver.
While here, move the J721e and J7200 SoC IDs out of sys_proto.h and into hardware.h. Use a macro borrowed from Rockchip and add the rest of the SoC IDs for completeness and later use.
Signed-off-by: Andrew Davis afd@ti.com
Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com
arch/arm/mach-k3/common.c | 20 ------------------ arch/arm/mach-k3/common.h | 3 --- arch/arm/mach-k3/include/mach/hardware.h | 25 +++++++++++++++++++++++ arch/arm/mach-k3/include/mach/sys_proto.h | 3 --- 4 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 6870f13c520..6e084de692c 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -488,26 +488,6 @@ int print_cpuinfo(void) } #endif
-bool soc_is_j721e(void) -{
u32 soc;
soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
return soc == J721E;
-}
-bool soc_is_j7200(void) -{
u32 soc;
soc = (readl(CTRLMMR_WKUP_JTAG_ID) &
JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
return soc == J7200;
-}
#ifdef CONFIG_ARM64 void board_prep_linux(struct bootm_headers *images) { diff --git a/arch/arm/mach-k3/common.h b/arch/arm/mach-k3/common.h index 8f38fcef7f0..531be0be54c 100644 --- a/arch/arm/mach-k3/common.h +++ b/arch/arm/mach-k3/common.h @@ -9,9 +9,6 @@ #include <asm/armv7_mpu.h> #include <asm/hardware.h>
-#define J721E 0xbb64 -#define J7200 0xbb6d
struct fwl_data { const char *name; u16 fwl_id; diff --git a/arch/arm/mach-k3/include/mach/hardware.h b/arch/arm/mach-k3/include/mach/hardware.h index 2c60ef85432..9faf1d6ff06 100644 --- a/arch/arm/mach-k3/include/mach/hardware.h +++ b/arch/arm/mach-k3/include/mach/hardware.h @@ -6,6 +6,8 @@ #ifndef _ASM_ARCH_HARDWARE_H_ #define _ASM_ARCH_HARDWARE_H_
+#include <asm/io.h>
#ifdef CONFIG_SOC_K3_AM654 #include "am6_hardware.h" #endif @@ -36,6 +38,29 @@ #define JTAG_ID_VARIANT_MASK (0xf << 28) #define JTAG_ID_PARTNO_SHIFT 12 #define JTAG_ID_PARTNO_MASK (0xffff << 12) +#define JTAG_ID_PARTNO_AM65X 0xbb5a +#define JTAG_ID_PARTNO_J721E 0xbb64 +#define JTAG_ID_PARTNO_J7200 0xbb6d +#define JTAG_ID_PARTNO_AM64X 0xbb38 +#define JTAG_ID_PARTNO_J721S2 0xbb75 +#define JTAG_ID_PARTNO_AM62X 0xbb7e +#define JTAG_ID_PARTNO_AM62AX 0xbb8d
+#define K3_SOC_ID(id, ID) \ +static inline bool soc_is_##id(void) \ +{ \
u32 soc = (readl(CTRLMMR_WKUP_JTAG_ID) & \
JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT; \
return soc == JTAG_ID_PARTNO_##ID; \
+} +K3_SOC_ID(am65x, AM65X) +K3_SOC_ID(j721e, J721E) +K3_SOC_ID(j7200, J7200) +K3_SOC_ID(am64x, AM64X) +K3_SOC_ID(j721s2, J721S2) +K3_SOC_ID(am62x, AM62X) +K3_SOC_ID(am62ax, AM62AX)
#define K3_SEC_MGR_SYS_STATUS 0x44234100 #define SYS_STATUS_DEV_TYPE_SHIFT 0 #define SYS_STATUS_DEV_TYPE_MASK (0xf) diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index 0b5d606eaa2..d5d4b787b7d 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -15,9 +15,6 @@ int do_board_detect(void); void release_resources_for_core_shutdown(void); int fdt_disable_node(void *blob, char *node_path);
-bool soc_is_j721e(void); -bool soc_is_j7200(void);
void k3_spl_init(void); void k3_mem_init(void); bool check_rom_loaded_sysfw(void); -- 2.39.2

The K3 JTAG and SoC ID information is already stored in the K3 arch hardware file, include that and use its definitions here.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- drivers/soc/Kconfig | 2 +- drivers/soc/soc_ti_k3.c | 30 +++++++++--------------------- 2 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index acf555baaec..85dac9de78a 100644 --- a/drivers/soc/Kconfig +++ b/drivers/soc/Kconfig @@ -10,7 +10,7 @@ config SOC_DEVICE specific device variant in use.
config SOC_DEVICE_TI_K3 - depends on SOC_DEVICE + depends on SOC_DEVICE && ARCH_K3 bool "Enable SoC Device ID driver for TI K3 SoCs" help This allows Texas Instruments Keystone 3 SoCs to identify diff --git a/drivers/soc/soc_ti_k3.c b/drivers/soc/soc_ti_k3.c index 8af0ac70519..42430d79a7a 100644 --- a/drivers/soc/soc_ti_k3.c +++ b/drivers/soc/soc_ti_k3.c @@ -8,21 +8,9 @@ #include <dm.h> #include <soc.h>
+#include <asm/arch/hardware.h> #include <asm/io.h>
-#define AM65X 0xbb5a -#define J721E 0xbb64 -#define J7200 0xbb6d -#define AM64X 0xbb38 -#define J721S2 0xbb75 -#define AM62X 0xbb7e -#define AM62AX 0xbb8d - -#define JTAG_ID_VARIANT_SHIFT 28 -#define JTAG_ID_VARIANT_MASK (0xf << 28) -#define JTAG_ID_PARTNO_SHIFT 12 -#define JTAG_ID_PARTNO_MASK (0xffff << 12) - struct soc_ti_k3_plat { const char *family; const char *revision; @@ -36,25 +24,25 @@ static const char *get_family_string(u32 idreg) soc = (idreg & JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
switch (soc) { - case AM65X: + case JTAG_ID_PARTNO_AM65X: family = "AM65X"; break; - case J721E: + case JTAG_ID_PARTNO_J721E: family = "J721E"; break; - case J7200: + case JTAG_ID_PARTNO_J7200: family = "J7200"; break; - case AM64X: + case JTAG_ID_PARTNO_AM64X: family = "AM64X"; break; - case J721S2: + case JTAG_ID_PARTNO_J721S2: family = "J721S2"; break; - case AM62X: + case JTAG_ID_PARTNO_AM62X: family = "AM62X"; break; - case AM62AX: + case JTAG_ID_PARTNO_AM62AX: family = "AM62AX"; break; default: @@ -81,7 +69,7 @@ static const char *get_rev_string(u32 idreg) soc = (idreg & JTAG_ID_PARTNO_MASK) >> JTAG_ID_PARTNO_SHIFT;
switch (soc) { - case J721E: + case JTAG_ID_PARTNO_J721E: if (rev > ARRAY_SIZE(j721e_rev_string_map)) goto bail; return j721e_rev_string_map[rev];

The TARGET_x_R5_EVM check is already enough to limit these defines to only the correct builds. Remove the extra outer check.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- board/ti/j721e/j721e.env | 2 -- board/ti/j721s2/j721s2.env | 2 -- 2 files changed, 4 deletions(-)
diff --git a/board/ti/j721e/j721e.env b/board/ti/j721e/j721e.env index 446395adfa5..f442d155842 100644 --- a/board/ti/j721e/j721e.env +++ b/board/ti/j721e/j721e.env @@ -21,7 +21,6 @@ args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 ${mtdparts} run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
-#if CONFIG_SYS_K3_SPL_ATF #if CONFIG_TARGET_J721E_R5_EVM addr_mcur5f0_0load=0x89000000 name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw @@ -29,7 +28,6 @@ name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw addr_mcur5f0_0load=0x89000000 name_mcur5f0_0fw=/lib/firmware/j7200-mcu-r5f0_0-fw #endif -#endif
boot=mmc mmcdev=1 diff --git a/board/ti/j721s2/j721s2.env b/board/ti/j721s2/j721s2.env index 2152f8849f9..f4467770e40 100644 --- a/board/ti/j721s2/j721s2.env +++ b/board/ti/j721s2/j721s2.env @@ -25,12 +25,10 @@ boot=mmc mmcdev=1 bootpart=1:2 bootdir=/boot -#if CONFIG_SYS_K3_SPL_ATF #if CONFIG_TARGET_J721S2_R5_EVM addr_mcur5f0_0load=0x89000000 name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw #endif -#endif rd_spec=- init_mmc=run args_all args_mmc get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}

The J7200 EVM will not include this file, this J7200 checks look to be a copy/paste errora from j721e_evm.h, which J7200 *can* include.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- include/configs/j721s2_evm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/j721s2_evm.h b/include/configs/j721s2_evm.h index 2fa93b79614..1e0da9f96c5 100644 --- a/include/configs/j721s2_evm.h +++ b/include/configs/j721s2_evm.h @@ -16,7 +16,7 @@ #define CFG_SYS_SDRAM_BASE1 0x880000000
/* SPL Loader Configuration */ -#if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM) +#if defined(CONFIG_TARGET_J721S2_A72_EVM) #define CFG_SYS_UBOOT_BASE 0x50280000 /* Image load address in RAM for DFU boot*/ #else

This function is the same for each device when it needs to shutdown the R5 core. Move this to the common section and move the remaining device specific ID list to the device hardware include.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- arch/arm/mach-k3/am642_init.c | 51 ----------------- arch/arm/mach-k3/am654_init.c | 51 ----------------- arch/arm/mach-k3/common.c | 32 ++++++++++- arch/arm/mach-k3/include/mach/am62_hardware.h | 8 +++ .../arm/mach-k3/include/mach/am62a_hardware.h | 8 +++ arch/arm/mach-k3/include/mach/am64_hardware.h | 24 ++++++++ arch/arm/mach-k3/include/mach/am6_hardware.h | 19 +++++++ .../arm/mach-k3/include/mach/j721e_hardware.h | 19 +++++++ .../mach-k3/include/mach/j721s2_hardware.h | 19 +++++++ arch/arm/mach-k3/include/mach/sys_proto.h | 1 - arch/arm/mach-k3/j721e_init.c | 55 ------------------- arch/arm/mach-k3/j721s2_init.c | 54 ------------------ 12 files changed, 127 insertions(+), 214 deletions(-)
diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c index 1bf7e163cc4..86aced54646 100644 --- a/arch/arm/mach-k3/am642_init.c +++ b/arch/arm/mach-k3/am642_init.c @@ -346,54 +346,3 @@ u32 spl_boot_device(void) else return __get_backup_bootmedia(devstat); } - -#if defined(CONFIG_SYS_K3_SPL_ATF) - -#define AM64X_DEV_RTI8 127 -#define AM64X_DEV_RTI9 128 -#define AM64X_DEV_R5FSS0_CORE0 121 -#define AM64X_DEV_R5FSS0_CORE1 122 - -void release_resources_for_core_shutdown(void) -{ - struct ti_sci_handle *ti_sci = get_ti_sci_handle(); - struct ti_sci_dev_ops *dev_ops = &ti_sci->ops.dev_ops; - struct ti_sci_proc_ops *proc_ops = &ti_sci->ops.proc_ops; - int ret; - u32 i; - - const u32 put_device_ids[] = { - AM64X_DEV_RTI9, - AM64X_DEV_RTI8, - }; - - /* Iterate through list of devices to put (shutdown) */ - for (i = 0; i < ARRAY_SIZE(put_device_ids); i++) { - u32 id = put_device_ids[i]; - - ret = dev_ops->put_device(ti_sci, id); - if (ret) - panic("Failed to put device %u (%d)\n", id, ret); - } - - const u32 put_core_ids[] = { - AM64X_DEV_R5FSS0_CORE1, - AM64X_DEV_R5FSS0_CORE0, /* Handle CPU0 after CPU1 */ - }; - - /* Iterate through list of cores to put (shutdown) */ - for (i = 0; i < ARRAY_SIZE(put_core_ids); i++) { - u32 id = put_core_ids[i]; - - /* - * Queue up the core shutdown request. Note that this call - * needs to be followed up by an actual invocation of an WFE - * or WFI CPU instruction. - */ - ret = proc_ops->proc_shutdown_no_wait(ti_sci, id); - if (ret) - panic("Failed sending core %u shutdown message (%d)\n", - id, ret); - } -} -#endif diff --git a/arch/arm/mach-k3/am654_init.c b/arch/arm/mach-k3/am654_init.c index 70059edb039..abd0c0bccbc 100644 --- a/arch/arm/mach-k3/am654_init.c +++ b/arch/arm/mach-k3/am654_init.c @@ -353,54 +353,3 @@ u32 spl_boot_device(void) else return __get_backup_bootmedia(devstat); } - -#ifdef CONFIG_SYS_K3_SPL_ATF - -#define AM6_DEV_MCU_RTI0 134 -#define AM6_DEV_MCU_RTI1 135 -#define AM6_DEV_MCU_ARMSS0_CPU0 159 -#define AM6_DEV_MCU_ARMSS0_CPU1 245 - -void release_resources_for_core_shutdown(void) -{ - struct ti_sci_handle *ti_sci = get_ti_sci_handle(); - struct ti_sci_dev_ops *dev_ops = &ti_sci->ops.dev_ops; - struct ti_sci_proc_ops *proc_ops = &ti_sci->ops.proc_ops; - int ret; - u32 i; - - const u32 put_device_ids[] = { - AM6_DEV_MCU_RTI0, - AM6_DEV_MCU_RTI1, - }; - - /* Iterate through list of devices to put (shutdown) */ - for (i = 0; i < ARRAY_SIZE(put_device_ids); i++) { - u32 id = put_device_ids[i]; - - ret = dev_ops->put_device(ti_sci, id); - if (ret) - panic("Failed to put device %u (%d)\n", id, ret); - } - - const u32 put_core_ids[] = { - AM6_DEV_MCU_ARMSS0_CPU1, - AM6_DEV_MCU_ARMSS0_CPU0, /* Handle CPU0 after CPU1 */ - }; - - /* Iterate through list of cores to put (shutdown) */ - for (i = 0; i < ARRAY_SIZE(put_core_ids); i++) { - u32 id = put_core_ids[i]; - - /* - * Queue up the core shutdown request. Note that this call - * needs to be followed up by an actual invocation of an WFE - * or WFI CPU instruction. - */ - ret = proc_ops->proc_shutdown_no_wait(ti_sci, id); - if (ret) - panic("Failed sending core %u shutdown message (%d)\n", - id, ret); - } -} -#endif diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 6e084de692c..4f2e14c3105 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -189,9 +189,37 @@ int load_firmware(char *name_fw, char *name_loadaddr, u32 *loadaddr) return size; }
-__weak void release_resources_for_core_shutdown(void) +void release_resources_for_core_shutdown(void) { - debug("%s not implemented...\n", __func__); + struct ti_sci_handle *ti_sci = get_ti_sci_handle(); + struct ti_sci_dev_ops *dev_ops = &ti_sci->ops.dev_ops; + struct ti_sci_proc_ops *proc_ops = &ti_sci->ops.proc_ops; + int ret; + u32 i; + + /* Iterate through list of devices to put (shutdown) */ + for (i = 0; i < ARRAY_SIZE(put_device_ids); i++) { + u32 id = put_device_ids[i]; + + ret = dev_ops->put_device(ti_sci, id); + if (ret) + panic("Failed to put device %u (%d)\n", id, ret); + } + + /* Iterate through list of cores to put (shutdown) */ + for (i = 0; i < ARRAY_SIZE(put_core_ids); i++) { + u32 id = put_core_ids[i]; + + /* + * Queue up the core shutdown request. Note that this call + * needs to be followed up by an actual invocation of an WFE + * or WFI CPU instruction. + */ + ret = proc_ops->proc_shutdown_no_wait(ti_sci, id); + if (ret) + panic("Failed sending core %u shutdown message (%d)\n", + id, ret); + } }
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) diff --git a/arch/arm/mach-k3/include/mach/am62_hardware.h b/arch/arm/mach-k3/include/mach/am62_hardware.h index db4a32cd461..88d58947269 100644 --- a/arch/arm/mach-k3/include/mach/am62_hardware.h +++ b/arch/arm/mach-k3/include/mach/am62_hardware.h @@ -57,4 +57,12 @@
#define TI_SRAM_SCRATCH_BOARD_EEPROM_START 0x43c30000
+#if defined(CONFIG_SYS_K3_SPL_ATF) && !defined(__ASSEMBLY__) + +static const u32 put_device_ids[] = {}; + +static const u32 put_core_ids[] = {}; + +#endif + #endif /* __ASM_ARCH_AM62_HARDWARE_H */ diff --git a/arch/arm/mach-k3/include/mach/am62a_hardware.h b/arch/arm/mach-k3/include/mach/am62a_hardware.h index 13bf50f147b..11080801c4c 100644 --- a/arch/arm/mach-k3/include/mach/am62a_hardware.h +++ b/arch/arm/mach-k3/include/mach/am62a_hardware.h @@ -86,4 +86,12 @@ #define TI_SRAM_SCRATCH_BOARD_EEPROM_START 0x70000001 #endif /* CONFIG_CPU_V7R */
+#if defined(CONFIG_SYS_K3_SPL_ATF) && !defined(__ASSEMBLY__) + +static const u32 put_device_ids[] = {}; + +static const u32 put_core_ids[] = {}; + +#endif + #endif /* __ASM_ARCH_AM62A_HARDWARE_H */ diff --git a/arch/arm/mach-k3/include/mach/am64_hardware.h b/arch/arm/mach-k3/include/mach/am64_hardware.h index 207ef95f218..44df887d5df 100644 --- a/arch/arm/mach-k3/include/mach/am64_hardware.h +++ b/arch/arm/mach-k3/include/mach/am64_hardware.h @@ -7,6 +7,11 @@ #ifndef __ASM_ARCH_AM64_HARDWARE_H #define __ASM_ARCH_AM64_HARDWARE_H
+#include <config.h> +#ifndef __ASSEMBLY__ +#include <linux/bitops.h> +#endif + #define PADCFG_MMR1_BASE 0x000f0000 #define MCU_PADCFG_MMR1_BASE 0x04080000 #define WKUP_CTRL_MMR0_BASE 0x43000000 @@ -41,4 +46,23 @@ /* Use Last 2K as Scratch pad */ #define TI_SRAM_SCRATCH_BOARD_EEPROM_START 0x7019f800
+#if defined(CONFIG_SYS_K3_SPL_ATF) && !defined(__ASSEMBLY__) + +#define AM64X_DEV_RTI8 127 +#define AM64X_DEV_RTI9 128 +#define AM64X_DEV_R5FSS0_CORE0 121 +#define AM64X_DEV_R5FSS0_CORE1 122 + +static const u32 put_device_ids[] = { + AM64X_DEV_RTI9, + AM64X_DEV_RTI8, +}; + +static const u32 put_core_ids[] = { + AM64X_DEV_R5FSS0_CORE1, + AM64X_DEV_R5FSS0_CORE0, /* Handle CPU0 after CPU1 */ +}; + +#endif + #endif /* __ASM_ARCH_DRA8_HARDWARE_H */ diff --git a/arch/arm/mach-k3/include/mach/am6_hardware.h b/arch/arm/mach-k3/include/mach/am6_hardware.h index f9f32918f7c..029041f415c 100644 --- a/arch/arm/mach-k3/include/mach/am6_hardware.h +++ b/arch/arm/mach-k3/include/mach/am6_hardware.h @@ -39,4 +39,23 @@
#define NAVSS_NBSS_THREADMAP 0x10
+#if defined(CONFIG_SYS_K3_SPL_ATF) && !defined(__ASSEMBLY__) + +#define AM6_DEV_MCU_RTI0 134 +#define AM6_DEV_MCU_RTI1 135 +#define AM6_DEV_MCU_ARMSS0_CPU0 159 +#define AM6_DEV_MCU_ARMSS0_CPU1 245 + +static const u32 put_device_ids[] = { + AM6_DEV_MCU_RTI0, + AM6_DEV_MCU_RTI1, +}; + +static const u32 put_core_ids[] = { + AM6_DEV_MCU_ARMSS0_CPU1, + AM6_DEV_MCU_ARMSS0_CPU0, /* Handle CPU0 after CPU1 */ +}; + +#endif + #endif /* __ASM_ARCH_AM6_HARDWARE_H */ diff --git a/arch/arm/mach-k3/include/mach/j721e_hardware.h b/arch/arm/mach-k3/include/mach/j721e_hardware.h index 247dee99ce5..376db389ba1 100644 --- a/arch/arm/mach-k3/include/mach/j721e_hardware.h +++ b/arch/arm/mach-k3/include/mach/j721e_hardware.h @@ -38,4 +38,23 @@ /* MCU SCRATCHPAD usage */ #define TI_SRAM_SCRATCH_BOARD_EEPROM_START CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE
+#if defined(CONFIG_SYS_K3_SPL_ATF) && !defined(__ASSEMBLY__) + +#define J721E_DEV_MCU_RTI0 262 +#define J721E_DEV_MCU_RTI1 263 +#define J721E_DEV_MCU_ARMSS0_CPU0 250 +#define J721E_DEV_MCU_ARMSS0_CPU1 251 + +static const u32 put_device_ids[] = { + J721E_DEV_MCU_RTI0, + J721E_DEV_MCU_RTI1, +}; + +static const u32 put_core_ids[] = { + J721E_DEV_MCU_ARMSS0_CPU1, + J721E_DEV_MCU_ARMSS0_CPU0, /* Handle CPU0 after CPU1 */ +}; + +#endif + #endif /* __ASM_ARCH_J721E_HARDWARE_H */ diff --git a/arch/arm/mach-k3/include/mach/j721s2_hardware.h b/arch/arm/mach-k3/include/mach/j721s2_hardware.h index 2e155ed9ec4..7948bcf4789 100644 --- a/arch/arm/mach-k3/include/mach/j721s2_hardware.h +++ b/arch/arm/mach-k3/include/mach/j721s2_hardware.h @@ -38,4 +38,23 @@ /* MCU SCRATCHPAD usage */ #define TI_SRAM_SCRATCH_BOARD_EEPROM_START CONFIG_SYS_K3_MCU_SCRATCHPAD_BASE
+#if defined(CONFIG_SYS_K3_SPL_ATF) && !defined(__ASSEMBLY__) + +#define J721S2_DEV_MCU_RTI0 295 +#define J721S2_DEV_MCU_RTI1 296 +#define J721S2_DEV_MCU_ARMSS0_CPU0 284 +#define J721S2_DEV_MCU_ARMSS0_CPU1 285 + +static const u32 put_device_ids[] = { + J721S2_DEV_MCU_RTI0, + J721S2_DEV_MCU_RTI1, +}; + +static const u32 put_core_ids[] = { + J721S2_DEV_MCU_ARMSS0_CPU1, + J721S2_DEV_MCU_ARMSS0_CPU0, /* Handle CPU0 after CPU1 */ +}; + +#endif + #endif /* __ASM_ARCH_J721S2_HARDWARE_H */ diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index d5d4b787b7d..8cc75b636b5 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -12,7 +12,6 @@ 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); -void release_resources_for_core_shutdown(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 9cae3ac67e9..8176ab8a499 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -378,58 +378,3 @@ u32 spl_boot_device(void) else return __get_backup_bootmedia(main_devstat); } - -#ifdef CONFIG_SYS_K3_SPL_ATF - -#define J721E_DEV_MCU_RTI0 262 -#define J721E_DEV_MCU_RTI1 263 -#define J721E_DEV_MCU_ARMSS0_CPU0 250 -#define J721E_DEV_MCU_ARMSS0_CPU1 251 - -void release_resources_for_core_shutdown(void) -{ - struct ti_sci_handle *ti_sci; - struct ti_sci_dev_ops *dev_ops; - struct ti_sci_proc_ops *proc_ops; - int ret; - u32 i; - - const u32 put_device_ids[] = { - J721E_DEV_MCU_RTI0, - J721E_DEV_MCU_RTI1, - }; - - ti_sci = get_ti_sci_handle(); - dev_ops = &ti_sci->ops.dev_ops; - proc_ops = &ti_sci->ops.proc_ops; - - /* Iterate through list of devices to put (shutdown) */ - for (i = 0; i < ARRAY_SIZE(put_device_ids); i++) { - u32 id = put_device_ids[i]; - - ret = dev_ops->put_device(ti_sci, id); - if (ret) - panic("Failed to put device %u (%d)\n", id, ret); - } - - const u32 put_core_ids[] = { - J721E_DEV_MCU_ARMSS0_CPU1, - J721E_DEV_MCU_ARMSS0_CPU0, /* Handle CPU0 after CPU1 */ - }; - - /* Iterate through list of cores to put (shutdown) */ - for (i = 0; i < ARRAY_SIZE(put_core_ids); i++) { - u32 id = put_core_ids[i]; - - /* - * Queue up the core shutdown request. Note that this call - * needs to be followed up by an actual invocation of an WFE - * or WFI CPU instruction. - */ - ret = proc_ops->proc_shutdown_no_wait(ti_sci, id); - if (ret) - panic("Failed sending core %u shutdown message (%d)\n", - id, ret); - } -} -#endif diff --git a/arch/arm/mach-k3/j721s2_init.c b/arch/arm/mach-k3/j721s2_init.c index 09e55ed4566..fb95984c1ab 100644 --- a/arch/arm/mach-k3/j721s2_init.c +++ b/arch/arm/mach-k3/j721s2_init.c @@ -264,57 +264,3 @@ u32 spl_boot_device(void) else return __get_backup_bootmedia(main_devstat); } - -#define J721S2_DEV_MCU_RTI0 295 -#define J721S2_DEV_MCU_RTI1 296 -#define J721S2_DEV_MCU_ARMSS0_CPU0 284 -#define J721S2_DEV_MCU_ARMSS0_CPU1 285 - -void release_resources_for_core_shutdown(void) -{ - if (IS_ENABLED(CONFIG_SYS_K3_SPL_ATF)) { - struct ti_sci_handle *ti_sci; - struct ti_sci_dev_ops *dev_ops; - struct ti_sci_proc_ops *proc_ops; - int ret; - u32 i; - - const u32 put_device_ids[] = { - J721S2_DEV_MCU_RTI0, - J721S2_DEV_MCU_RTI1, - }; - - ti_sci = get_ti_sci_handle(); - dev_ops = &ti_sci->ops.dev_ops; - proc_ops = &ti_sci->ops.proc_ops; - - /* Iterate through list of devices to put (shutdown) */ - for (i = 0; i < ARRAY_SIZE(put_device_ids); i++) { - u32 id = put_device_ids[i]; - - ret = dev_ops->put_device(ti_sci, id); - if (ret) - panic("Failed to put device %u (%d)\n", id, ret); - } - - const u32 put_core_ids[] = { - J721S2_DEV_MCU_ARMSS0_CPU1, - J721S2_DEV_MCU_ARMSS0_CPU0, /* Handle CPU0 after CPU1 */ - }; - - /* Iterate through list of cores to put (shutdown) */ - for (i = 0; i < ARRAY_SIZE(put_core_ids); i++) { - u32 id = put_core_ids[i]; - - /* - * Queue up the core shutdown request. Note that this call - * needs to be followed up by an actual invocation of an WFE - * or WFI CPU instruction. - */ - ret = proc_ops->proc_shutdown_no_wait(ti_sci, id); - if (ret) - panic("Failed sending core %u shutdown message (%d)\n", - id, ret); - } - } -}

This header is only used locally by K3 init files, no need to have it up with the global mach includes. Move into local includes.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- arch/arm/mach-k3/am625_init.c | 2 +- arch/arm/mach-k3/am62a7_init.c | 2 +- arch/arm/mach-k3/am642_init.c | 2 +- arch/arm/mach-k3/am654_init.c | 2 +- arch/arm/mach-k3/j721e_init.c | 2 +- arch/arm/mach-k3/j721s2_init.c | 2 +- arch/arm/mach-k3/{include/mach => }/sysfw-loader.h | 0 7 files changed, 6 insertions(+), 6 deletions(-) rename arch/arm/mach-k3/{include/mach => }/sysfw-loader.h (100%)
diff --git a/arch/arm/mach-k3/am625_init.c b/arch/arm/mach-k3/am625_init.c index a91c15ca4e1..026c4f9c02d 100644 --- a/arch/arm/mach-k3/am625_init.c +++ b/arch/arm/mach-k3/am625_init.c @@ -9,7 +9,7 @@ #include <spl.h> #include <asm/io.h> #include <asm/arch/hardware.h> -#include <asm/arch/sysfw-loader.h> +#include "sysfw-loader.h" #include "common.h" #include <dm.h> #include <dm/uclass-internal.h> diff --git a/arch/arm/mach-k3/am62a7_init.c b/arch/arm/mach-k3/am62a7_init.c index 02da24a3d6f..a89a9b4ae3a 100644 --- a/arch/arm/mach-k3/am62a7_init.c +++ b/arch/arm/mach-k3/am62a7_init.c @@ -8,7 +8,7 @@ #include <spl.h> #include <asm/io.h> #include <asm/arch/hardware.h> -#include <asm/arch/sysfw-loader.h> +#include "sysfw-loader.h" #include "common.h" #include <dm.h> #include <dm/uclass-internal.h> diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c index 86aced54646..c7720cbaf35 100644 --- a/arch/arm/mach-k3/am642_init.c +++ b/arch/arm/mach-k3/am642_init.c @@ -12,7 +12,7 @@ #include <spl.h> #include <asm/io.h> #include <asm/arch/hardware.h> -#include <asm/arch/sysfw-loader.h> +#include "sysfw-loader.h" #include <asm/arch/sys_proto.h> #include "common.h" #include <asm/arch/sys_proto.h> diff --git a/arch/arm/mach-k3/am654_init.c b/arch/arm/mach-k3/am654_init.c index abd0c0bccbc..12d74635cb0 100644 --- a/arch/arm/mach-k3/am654_init.c +++ b/arch/arm/mach-k3/am654_init.c @@ -13,7 +13,7 @@ #include <asm/io.h> #include <spl.h> #include <asm/arch/hardware.h> -#include <asm/arch/sysfw-loader.h> +#include "sysfw-loader.h" #include <asm/arch/sys_proto.h> #include "common.h" #include <dm.h> diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c index 8176ab8a499..eec5b726b95 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -12,7 +12,7 @@ #include <asm/io.h> #include <asm/armv7_mpu.h> #include <asm/arch/hardware.h> -#include <asm/arch/sysfw-loader.h> +#include "sysfw-loader.h" #include "common.h" #include <asm/arch/sys_proto.h> #include <linux/soc/ti/ti_sci_protocol.h> diff --git a/arch/arm/mach-k3/j721s2_init.c b/arch/arm/mach-k3/j721s2_init.c index fb95984c1ab..4785a747bf3 100644 --- a/arch/arm/mach-k3/j721s2_init.c +++ b/arch/arm/mach-k3/j721s2_init.c @@ -12,7 +12,7 @@ #include <asm/io.h> #include <asm/armv7_mpu.h> #include <asm/arch/hardware.h> -#include <asm/arch/sysfw-loader.h> +#include "sysfw-loader.h" #include "common.h" #include <asm/arch/sys_proto.h> #include <linux/soc/ti/ti_sci_protocol.h> diff --git a/arch/arm/mach-k3/include/mach/sysfw-loader.h b/arch/arm/mach-k3/sysfw-loader.h similarity index 100% rename from arch/arm/mach-k3/include/mach/sysfw-loader.h rename to arch/arm/mach-k3/sysfw-loader.h

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 | 5 ----- arch/arm/mach-k3/am642_init.c | 4 ++-- arch/arm/mach-k3/am654_init.c | 4 ++-- arch/arm/mach-k3/common.c | 10 ++++++++++ arch/arm/mach-k3/common.h | 2 ++ arch/arm/mach-k3/include/mach/sys_proto.h | 2 -- arch/arm/mach-k3/j721e_init.c | 8 ++++---- board/ti/common/Kconfig | 1 - 8 files changed, 20 insertions(+), 16 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), diff --git a/board/ti/common/Kconfig b/board/ti/common/Kconfig index f03357cc751..49edd98014a 100644 --- a/board/ti/common/Kconfig +++ b/board/ti/common/Kconfig @@ -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

This function is not used currently; remove it.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- arch/arm/mach-k3/common.c | 19 ------------------- arch/arm/mach-k3/include/mach/sys_proto.h | 1 - 2 files changed, 20 deletions(-)
diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 115f5959734..9f2f5a98771 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -395,25 +395,6 @@ int fdt_fixup_msmc_ram(void *blob, char *parent_path, char *node_name) return 0; }
-int fdt_disable_node(void *blob, char *node_path) -{ - int offs; - int ret; - - offs = fdt_path_offset(blob, node_path); - if (offs < 0) { - printf("Node %s not found.\n", node_path); - return offs; - } - ret = fdt_setprop_string(blob, offs, "status", "disabled"); - if (ret < 0) { - printf("Could not add status property to node %s: %s\n", - node_path, fdt_strerror(ret)); - return ret; - } - return 0; -} - #if defined(CONFIG_OF_SYSTEM_SETUP) int ft_system_setup(void *blob, struct bd_info *bd) { diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index 939de0f79b4..bbe57718e1a 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -10,7 +10,6 @@ void sdelay(unsigned long loops); u32 wait_on_value(u32 read_bit_mask, u32 match_value, void *read_addr, u32 bound); -int fdt_disable_node(void *blob, char *node_path);
void k3_spl_init(void); void k3_mem_init(void);

These probably should be in some system wide header given their use. Until then move them out of K3 sys_proto.h so we can finish cleaning that header out.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- arch/arm/mach-k3/include/mach/sys_proto.h | 4 ---- drivers/ram/k3-am654-ddrss.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index bbe57718e1a..4b4e2a5be39 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -7,10 +7,6 @@ #ifndef _SYS_PROTO_H_ #define _SYS_PROTO_H_
-void sdelay(unsigned long loops); -u32 wait_on_value(u32 read_bit_mask, u32 match_value, void *read_addr, - u32 bound); - void k3_spl_init(void); void k3_mem_init(void); bool check_rom_loaded_sysfw(void); diff --git a/drivers/ram/k3-am654-ddrss.c b/drivers/ram/k3-am654-ddrss.c index 4453c247b29..adac14f9464 100644 --- a/drivers/ram/k3-am654-ddrss.c +++ b/drivers/ram/k3-am654-ddrss.c @@ -18,6 +18,10 @@ #include <power/regulator.h> #include "k3-am654-ddrss.h"
+void sdelay(unsigned long loops); +u32 wait_on_value(u32 read_bit_mask, u32 match_value, void *read_addr, + u32 bound); + #define LDELAY 10000
/* DDRSS PHY configuration register fixed values */

This matches AM64 and J721e and removes the need to forward declare k3_spl_init(), k3_mem_init(), and check_rom_loaded_sysfw() in sys_proto.h.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- arch/arm/mach-k3/include/mach/sys_proto.h | 3 -- arch/arm/mach-k3/j721s2_init.c | 64 +++++++++++++++++++++++ board/ti/j721s2/evm.c | 63 ---------------------- 3 files changed, 64 insertions(+), 66 deletions(-)
diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h index 4b4e2a5be39..5638c6f8c8a 100644 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ b/arch/arm/mach-k3/include/mach/sys_proto.h @@ -7,7 +7,4 @@ #ifndef _SYS_PROTO_H_ #define _SYS_PROTO_H_
-void k3_spl_init(void); -void k3_mem_init(void); -bool check_rom_loaded_sysfw(void); #endif diff --git a/arch/arm/mach-k3/j721s2_init.c b/arch/arm/mach-k3/j721s2_init.c index 4785a747bf3..175ac4028a0 100644 --- a/arch/arm/mach-k3/j721s2_init.c +++ b/arch/arm/mach-k3/j721s2_init.c @@ -19,6 +19,7 @@ #include <dm.h> #include <dm/uclass-internal.h> #include <dm/pinctrl.h> +#include <dm/root.h> #include <mmc.h> #include <remoteproc.h>
@@ -182,6 +183,69 @@ void k3_mem_init(void) spl_enable_dcache(); }
+/* Support for the various EVM / SK families */ +#if defined(CONFIG_SPL_OF_LIST) && defined(CONFIG_TI_I2C_BOARD_DETECT) +void do_dt_magic(void) +{ + int ret, rescan, mmc_dev = -1; + static struct mmc *mmc; + + do_board_detect(); + + /* + * Board detection has been done. + * Let us see if another dtb wouldn't be a better match + * for our board + */ + if (IS_ENABLED(CONFIG_CPU_V7R)) { + ret = fdtdec_resetup(&rescan); + if (!ret && rescan) { + dm_uninit(); + dm_init_and_scan(true); + } + } + + /* + * Because of multi DTB configuration, the MMC device has + * to be re-initialized after reconfiguring FDT inorder to + * boot from MMC. Do this when boot mode is MMC and ROM has + * not loaded SYSFW. + */ + switch (spl_boot_device()) { + case BOOT_DEVICE_MMC1: + mmc_dev = 0; + break; + case BOOT_DEVICE_MMC2: + case BOOT_DEVICE_MMC2_2: + mmc_dev = 1; + break; + } + + if (mmc_dev > 0 && !check_rom_loaded_sysfw()) { + ret = mmc_init_device(mmc_dev); + if (!ret) { + mmc = find_mmc_device(mmc_dev); + if (mmc) { + ret = mmc_init(mmc); + if (ret) + printf("mmc init failed with error: %d\n", ret); + } + } + } +} +#endif + +#ifdef CONFIG_SPL_BUILD +void board_init_f(ulong dummy) +{ + k3_spl_init(); +#if defined(CONFIG_SPL_OF_LIST) && defined(CONFIG_TI_I2C_BOARD_DETECT) + do_dt_magic(); +#endif + k3_mem_init(); +} +#endif + u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device) { switch (boot_device) { diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c index 9b130c141ac..d3f9a655899 100644 --- a/board/ti/j721s2/evm.c +++ b/board/ti/j721s2/evm.c @@ -192,66 +192,3 @@ int board_late_init(void) void spl_board_init(void) { } - -/* Support for the various EVM / SK families */ -#if defined(CONFIG_SPL_OF_LIST) && defined(CONFIG_TI_I2C_BOARD_DETECT) -void do_dt_magic(void) -{ - int ret, rescan, mmc_dev = -1; - static struct mmc *mmc; - - do_board_detect(); - - /* - * Board detection has been done. - * Let us see if another dtb wouldn't be a better match - * for our board - */ - if (IS_ENABLED(CONFIG_CPU_V7R)) { - ret = fdtdec_resetup(&rescan); - if (!ret && rescan) { - dm_uninit(); - dm_init_and_scan(true); - } - } - - /* - * Because of multi DTB configuration, the MMC device has - * to be re-initialized after reconfiguring FDT inorder to - * boot from MMC. Do this when boot mode is MMC and ROM has - * not loaded SYSFW. - */ - switch (spl_boot_device()) { - case BOOT_DEVICE_MMC1: - mmc_dev = 0; - break; - case BOOT_DEVICE_MMC2: - case BOOT_DEVICE_MMC2_2: - mmc_dev = 1; - break; - } - - if (mmc_dev > 0 && !check_rom_loaded_sysfw()) { - ret = mmc_init_device(mmc_dev); - if (!ret) { - mmc = find_mmc_device(mmc_dev); - if (mmc) { - ret = mmc_init(mmc); - if (ret) - printf("mmc init failed with error: %d\n", ret); - } - } - } -} -#endif - -#ifdef CONFIG_SPL_BUILD -void board_init_f(ulong dummy) -{ - k3_spl_init(); -#if defined(CONFIG_SPL_OF_LIST) && defined(CONFIG_TI_I2C_BOARD_DETECT) - do_dt_magic(); -#endif - k3_mem_init(); -} -#endif

This header file is now empty, remove it.
Signed-off-by: Andrew Davis afd@ti.com Reviewed-by: Christian Gmeiner christian.gmeiner@gmail.com --- arch/arm/mach-k3/am642_init.c | 2 -- arch/arm/mach-k3/am654_init.c | 1 - arch/arm/mach-k3/common.c | 1 - arch/arm/mach-k3/include/mach/sys_proto.h | 10 ---------- arch/arm/mach-k3/j721e_init.c | 1 - arch/arm/mach-k3/j721s2_init.c | 1 - arch/arm/mach-k3/security.c | 1 - arch/arm/mach-k3/sysfw-loader.c | 1 - board/siemens/iot2050/board.c | 1 - board/ti/am62ax/evm.c | 1 - board/ti/am62x/evm.c | 1 - board/ti/am64x/evm.c | 1 - board/ti/am65x/evm.c | 2 -- board/ti/j721e/evm.c | 2 -- board/ti/j721s2/evm.c | 2 -- drivers/phy/phy-ti-am654.c | 1 - drivers/ram/k3-am654-ddrss.c | 1 - 17 files changed, 30 deletions(-) delete mode 100644 arch/arm/mach-k3/include/mach/sys_proto.h
diff --git a/arch/arm/mach-k3/am642_init.c b/arch/arm/mach-k3/am642_init.c index ef84aad819c..5d53358cf26 100644 --- a/arch/arm/mach-k3/am642_init.c +++ b/arch/arm/mach-k3/am642_init.c @@ -13,9 +13,7 @@ #include <asm/io.h> #include <asm/arch/hardware.h> #include "sysfw-loader.h" -#include <asm/arch/sys_proto.h> #include "common.h" -#include <asm/arch/sys_proto.h> #include <linux/soc/ti/ti_sci_protocol.h> #include <dm.h> #include <dm/uclass-internal.h> diff --git a/arch/arm/mach-k3/am654_init.c b/arch/arm/mach-k3/am654_init.c index 2336da4b454..0d3889cde2b 100644 --- a/arch/arm/mach-k3/am654_init.c +++ b/arch/arm/mach-k3/am654_init.c @@ -14,7 +14,6 @@ #include <spl.h> #include <asm/arch/hardware.h> #include "sysfw-loader.h" -#include <asm/arch/sys_proto.h> #include "common.h" #include <dm.h> #include <dm/uclass-internal.h> diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index 9f2f5a98771..e29e51b7042 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -19,7 +19,6 @@ #include <asm/cache.h> #include <linux/soc/ti/ti_sci_protocol.h> #include <fdt_support.h> -#include <asm/arch/sys_proto.h> #include <asm/hardware.h> #include <asm/io.h> #include <fs_loader.h> diff --git a/arch/arm/mach-k3/include/mach/sys_proto.h b/arch/arm/mach-k3/include/mach/sys_proto.h deleted file mode 100644 index 5638c6f8c8a..00000000000 --- a/arch/arm/mach-k3/include/mach/sys_proto.h +++ /dev/null @@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ - * Andreas Dannenberg dannenberg@ti.com - */ - -#ifndef _SYS_PROTO_H_ -#define _SYS_PROTO_H_ - -#endif diff --git a/arch/arm/mach-k3/j721e_init.c b/arch/arm/mach-k3/j721e_init.c index 31d324e2179..9bba5f79545 100644 --- a/arch/arm/mach-k3/j721e_init.c +++ b/arch/arm/mach-k3/j721e_init.c @@ -14,7 +14,6 @@ #include <asm/arch/hardware.h> #include "sysfw-loader.h" #include "common.h" -#include <asm/arch/sys_proto.h> #include <linux/soc/ti/ti_sci_protocol.h> #include <dm.h> #include <dm/uclass-internal.h> diff --git a/arch/arm/mach-k3/j721s2_init.c b/arch/arm/mach-k3/j721s2_init.c index 175ac4028a0..001d9466c20 100644 --- a/arch/arm/mach-k3/j721s2_init.c +++ b/arch/arm/mach-k3/j721s2_init.c @@ -14,7 +14,6 @@ #include <asm/arch/hardware.h> #include "sysfw-loader.h" #include "common.h" -#include <asm/arch/sys_proto.h> #include <linux/soc/ti/ti_sci_protocol.h> #include <dm.h> #include <dm/uclass-internal.h> diff --git a/arch/arm/mach-k3/security.c b/arch/arm/mach-k3/security.c index 092588f4b5e..6179f7373aa 100644 --- a/arch/arm/mach-k3/security.c +++ b/arch/arm/mach-k3/security.c @@ -17,7 +17,6 @@ #include <linux/soc/ti/ti_sci_protocol.h> #include <mach/spl.h> #include <spl.h> -#include <asm/arch/sys_proto.h> #include <linux/dma-mapping.h>
#include "common.h" diff --git a/arch/arm/mach-k3/sysfw-loader.c b/arch/arm/mach-k3/sysfw-loader.c index c4c5c371100..9be2d9eaea2 100644 --- a/arch/arm/mach-k3/sysfw-loader.c +++ b/arch/arm/mach-k3/sysfw-loader.c @@ -23,7 +23,6 @@ #include <spi_flash.h>
#include <asm/io.h> -#include <asm/arch/sys_proto.h> #include "common.h"
DECLARE_GLOBAL_DATA_PTR; diff --git a/board/siemens/iot2050/board.c b/board/siemens/iot2050/board.c index 1ba3e90c6fc..2653e107450 100644 --- a/board/siemens/iot2050/board.c +++ b/board/siemens/iot2050/board.c @@ -21,7 +21,6 @@ #include <spl.h> #include <version.h> #include <linux/delay.h> -#include <asm/arch/sys_proto.h> #include <asm/arch/hardware.h> #include <asm/gpio.h> #include <asm/io.h> diff --git a/board/ti/am62ax/evm.c b/board/ti/am62ax/evm.c index beef3f2f3da..f2dd3b4192e 100644 --- a/board/ti/am62ax/evm.c +++ b/board/ti/am62ax/evm.c @@ -7,7 +7,6 @@ */
#include <asm/arch/hardware.h> -#include <asm/arch/sys_proto.h> #include <asm/io.h> #include <common.h> #include <dm/uclass.h> diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c index 20b2a701223..034fbed3aa4 100644 --- a/board/ti/am62x/evm.c +++ b/board/ti/am62x/evm.c @@ -15,7 +15,6 @@ #include <fdt_support.h> #include <asm/io.h> #include <asm/arch/hardware.h> -#include <asm/arch/sys_proto.h> #include <dm/uclass.h>
DECLARE_GLOBAL_DATA_PTR; diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c index c88139ac7ac..b63792e8888 100644 --- a/board/ti/am64x/evm.c +++ b/board/ti/am64x/evm.c @@ -14,7 +14,6 @@ #include <spl.h> #include <fdt_support.h> #include <asm/arch/hardware.h> -#include <asm/arch/sys_proto.h> #include <env.h>
#include "../common/board_detect.h" diff --git a/board/ti/am65x/evm.c b/board/ti/am65x/evm.c index 4053b8333cf..706b2198183 100644 --- a/board/ti/am65x/evm.c +++ b/board/ti/am65x/evm.c @@ -13,7 +13,6 @@ #include <image.h> #include <init.h> #include <net.h> -#include <asm/arch/sys_proto.h> #include <asm/arch/hardware.h> #include <asm/global_data.h> #include <asm/gpio.h> @@ -21,7 +20,6 @@ #include <asm/omap_common.h> #include <env.h> #include <spl.h> -#include <asm/arch/sys_proto.h>
#include "../common/board_detect.h"
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 00ce009d3e8..2398bead782 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -15,13 +15,11 @@ #include <init.h> #include <log.h> #include <net.h> -#include <asm/arch/sys_proto.h> #include <asm/arch/hardware.h> #include <asm/global_data.h> #include <asm/gpio.h> #include <asm/io.h> #include <spl.h> -#include <asm/arch/sys_proto.h> #include <dm.h> #include <dm/uclass-internal.h>
diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c index d3f9a655899..09d26883f19 100644 --- a/board/ti/j721s2/evm.c +++ b/board/ti/j721s2/evm.c @@ -15,12 +15,10 @@ #include <init.h> #include <log.h> #include <net.h> -#include <asm/arch/sys_proto.h> #include <asm/arch/hardware.h> #include <asm/gpio.h> #include <asm/io.h> #include <spl.h> -#include <asm/arch/sys_proto.h> #include <dm.h> #include <dm/uclass-internal.h> #include <dm/root.h> diff --git a/drivers/phy/phy-ti-am654.c b/drivers/phy/phy-ti-am654.c index 27a312227bc..70a746d2c92 100644 --- a/drivers/phy/phy-ti-am654.c +++ b/drivers/phy/phy-ti-am654.c @@ -16,7 +16,6 @@ #include <dt-bindings/phy/phy.h> #include <generic-phy.h> #include <asm/io.h> -#include <asm/arch/sys_proto.h> #include <power-domain.h> #include <regmap.h> #include <syscon.h> diff --git a/drivers/ram/k3-am654-ddrss.c b/drivers/ram/k3-am654-ddrss.c index adac14f9464..b8338f84a3d 100644 --- a/drivers/ram/k3-am654-ddrss.c +++ b/drivers/ram/k3-am654-ddrss.c @@ -13,7 +13,6 @@ #include <ram.h> #include <asm/io.h> #include <power-domain.h> -#include <asm/arch/sys_proto.h> #include <dm/device_compat.h> #include <power/regulator.h> #include "k3-am654-ddrss.h"
participants (3)
-
Andrew Davis
-
Christian Gmeiner
-
Tom Rini