Remove K3 misc sys_proto.h header
Subsystems (3)
v3 cover 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 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%)Signature · 1 line
2.39.2
PATCH v3 2/12 arm: mach-k3: Move J721e SoC detection out of common section
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.
--- 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(-)
arch/arm/mach-k3/common.c +0 -20
@@ -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) {
arch/arm/mach-k3/common.h +0 -3
@@ -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;
arch/arm/mach-k3/include/mach/hardware.h +25 -0
@@ -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_J7200; \ +} +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)
arch/arm/mach-k3/include/mach/sys_proto.h +0 -3
@@ -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 );
Signature · 1 line
2.39.2
PATCH v3 1/12 arm: mach-k3: Move MSMC fixup to SoC level
In reply to Andrew DavisThe 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.
--- 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(-)
arch/arm/mach-k3/common.c +16 -0
@@ -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
arch/arm/mach-k3/include/mach/sys_proto.h +0 -1
@@ -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);
board/siemens/iot2050/board.c +1 -10
@@ -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
board/ti/am65x/evm.c +0 -18
@@ -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 ) {
board/ti/j721e/evm.c +1 -10
@@ -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
board/ti/j721s2/evm.c +0 -16
@@ -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.
configs/am65x_evm_a53_defconfig +1 -1
@@ -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
configs/am65x_hs_evm_a53_defconfig +1 -1
@@ -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
configs/iot2050_pg1_defconfig +1 -0
@@ -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
configs/iot2050_pg2_defconfig +1 -0
@@ -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
configs/j7200_evm_a72_defconfig +1 -0
@@ -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
configs/j7200_hs_evm_a72_defconfig +1 -0
@@ -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
configs/j721e_evm_a72_defconfig +1 -0
@@ -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
configs/j721e_hs_evm_a72_defconfig +1 -0
@@ -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
configs/j721s2_evm_a72_defconfig +1 -1
@@ -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
configs/j721s2_hs_evm_a72_defconfig +1 -1
@@ -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
Signature · 1 line
2.39.2
PATCH v3 3/12 soc: soc_ti_k3: Use hardware.h to remove definition duplication
In reply to Andrew DavisThe K3 JTAG and SoC ID information is already stored in the K3 arch hardware file, include that and use its definitions here.
--- drivers/soc/Kconfig | 2 +- drivers/soc/soc_ti_k3.c | 30 +++++++++--------------------- 2 files changed, 10 insertions(+), 22 deletions(-)
drivers/soc/Kconfig +1 -1
@@ -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
drivers/soc/soc_ti_k3.c +9 -21
@@ -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];
Signature · 1 line
2.39.2
PATCH v3 4/12 configs: j721x_evm: Remove unneeded check for SYS_K3_SPL_ATF
In reply to Andrew DavisThe TARGET_x_R5_EVM check is already enough to limit these defines to only the correct builds. Remove the extra outer check.
--- board/ti/j721e/j721e.env | 2 -- board/ti/j721s2/j721s2.env | 2 -- 2 files changed, 4 deletions(-)
board/ti/j721e/j721e.env +0 -2
@@ -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
board/ti/j721s2/j721s2.env +0 -2
@@ -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}
Signature · 1 line
2.39.2
PATCH v3 5/12 configs: j721s2_evm.h: Remove refrences to J7200 EVM
In reply to Andrew DavisThe 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.
--- include/configs/j721s2_evm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/j721s2_evm.h +1 -1
@@ -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
Signature · 1 line
2.39.2
PATCH v3 6/12 arm: mach-k3: Make release_resources_for_core_shutdown() common
In reply to Andrew DavisThis 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.
--- 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(-)
arch/arm/mach-k3/am642_init.c +0 -51
@@ -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
arch/arm/mach-k3/am654_init.c +0 -51
54 lines not on this page · raw message
arch/arm/mach-k3/common.c +30 -2
@@ -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)
arch/arm/mach-k3/include/mach/am62_hardware.h +8 -0
@@ -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 */
arch/arm/mach-k3/include/mach/am62a_hardware.h +8 -0
@@ -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 */
arch/arm/mach-k3/include/mach/am64_hardware.h +24 -0
@@ -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 */
arch/arm/mach-k3/include/mach/am6_hardware.h +19 -0
@@ -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 */
arch/arm/mach-k3/include/mach/j721e_hardware.h +19 -0
@@ -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 */
arch/arm/mach-k3/include/mach/j721s2_hardware.h +19 -0
@@ -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 */
arch/arm/mach-k3/include/mach/sys_proto.h +0 -1
@@ -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 );
arch/arm/mach-k3/j721e_init.c +0 -55
58 lines not on this page · raw message
arch/arm/mach-k3/j721s2_init.c +0 -54
57 lines not on this page · raw message
Signature · 1 line
2.39.2
PATCH v3 7/12 arm: mach-k3: Move sysfw-loader.h out of mach includes
In reply to Andrew DavisThis header is only used locally by K3 init files, no need to have it up with the global mach includes. Move into local includes.
---
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%)arch/arm/mach-k3/am625_init.c +1 -1
@@ -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>
arch/arm/mach-k3/am62a7_init.c +1 -1
@@ -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>
arch/arm/mach-k3/am642_init.c +1 -1
@@ -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>
arch/arm/mach-k3/am654_init.c +1 -1
@@ -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>
arch/arm/mach-k3/j721e_init.c +1 -1
@@ -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>
arch/arm/mach-k3/j721s2_init.c +1 -1
@@ -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>
arch/arm/mach-k3/sysfw-loader.h renamed from arch/arm/mach-k3/include/mach/sysfw-loader.h +0 -0
Signature · 1 line
2.39.2
PATCH v3 10/12 arm: mach-k3: Move sdelay() and wait_on_value() declaration
In reply to Andrew DavisThese 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.
--- arch/arm/mach-k3/include/mach/sys_proto.h | 4 ---- drivers/ram/k3-am654-ddrss.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-k3/include/mach/sys_proto.h +0 -4
@@ -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 );
drivers/ram/k3-am654-ddrss.c +4 -0
@@ -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 */
Signature · 1 line
2.39.2
PATCH v3 8/12 arm: mach-k3: Add weak do_board_detect() to common file
In reply to Andrew DavisThis 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.
--- 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(-)
arch/arm/mach-k3/Kconfig +0 -5
@@ -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"
arch/arm/mach-k3/am642_init.c +2 -2
@@ -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.
arch/arm/mach-k3/am654_init.c +2 -2
@@ -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),
arch/arm/mach-k3/common.c +10 -0
@@ -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 ) +{ +}
arch/arm/mach-k3/common.h +2 -0
@@ -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 );
arch/arm/mach-k3/include/mach/sys_proto.h +0 -2
@@ -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 );
arch/arm/mach-k3/j721e_init.c +4 -4
@@ -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),
board/ti/common/Kconfig +0 -1
@@ -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
Signature · 1 line
2.39.2
PATCH v3 9/12 arm: mach-k3: Remove unused fdt_disable_node()
In reply to Andrew DavisThis function is not used currently; remove it.
--- arch/arm/mach-k3/common.c | 19 ------------------- arch/arm/mach-k3/include/mach/sys_proto.h | 1 - 2 files changed, 20 deletions(-)
arch/arm/mach-k3/common.c +0 -19
@@ -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) {
arch/arm/mach-k3/include/mach/sys_proto.h +0 -1
@@ -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 );
Signature · 1 line
2.39.2
PATCH v3 11/12 arm: mach-k3: Move J721s2 SPL init functions to mach-k3
In reply to Andrew DavisThis 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.
--- 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(-)
arch/arm/mach-k3/include/mach/sys_proto.h +0 -3
@@ -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
arch/arm/mach-k3/j721s2_init.c +64 -0
76 lines not on this page · raw message
board/ti/j721s2/evm.c +0 -63
66 lines not on this page · raw message
Signature · 1 line
2.39.2
PATCH v3 12/12 arm: mach-k3: Remove empty sys_proto.h include
In reply to Andrew DavisThis header file is now empty, remove it.
--- 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
arch/arm/mach-k3/am642_init.c +0 -2
@@ -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>
arch/arm/mach-k3/am654_init.c +0 -1
@@ -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>
arch/arm/mach-k3/common.c +0 -1
@@ -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>
arch/arm/mach-k3/include/mach/sys_proto.h deleted +0 -10
@@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ -* Andreas Dannenberg <[email protected]> -*/ - -#ifndef _SYS_PROTO_H_ -#define _SYS_PROTO_H_ - -#endif
arch/arm/mach-k3/j721e_init.c +0 -1
@@ -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>
arch/arm/mach-k3/j721s2_init.c +0 -1
@@ -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>
arch/arm/mach-k3/security.c +0 -1
@@ -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"
arch/arm/mach-k3/sysfw-loader.c +0 -1
@@ -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 ;
board/siemens/iot2050/board.c +0 -1
@@ -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>
board/ti/am62ax/evm.c +0 -1
@@ -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>
board/ti/am62x/evm.c +0 -1
@@ -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 ;
board/ti/am64x/evm.c +0 -1
@@ -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"
board/ti/am65x/evm.c +0 -2
@@ -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"
board/ti/j721e/evm.c +0 -2
@@ -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>
board/ti/j721s2/evm.c +0 -2
@@ -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>
drivers/phy/phy-ti-am654.c +0 -1
@@ -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>
drivers/ram/k3-am654-ddrss.c +0 -1
@@ -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"
Signature · 1 line
2.39.2
Re: [PATCH v3 02/12] arm: mach-k3: Move J721e SoC detection out of common section
In reply to Andrew DavisQuoted 82 lines
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.hand intohardware.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 <[email protected]>--- 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(-)arch/arm/mach-k3/common.c +0
-20@@ -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) {arch/arm/mach-k3/common.h +0
-3@@ -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;arch/arm/mach-k3/include/mach/hardware.h +6
-0@@ -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
arch/arm/mach-k3/include/mach/hardware.h line 54
Quoted 10 lines
arch/arm/mach-k3/include/mach/hardware.h +10
-0+#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_J7200; \
This is not what you want. Maybe
return soc == JTAG_ID_PARTNO_##ID; \
Quoted 29 lines
arch/arm/mach-k3/include/mach/hardware.h +9
-0+} +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)arch/arm/mach-k3/include/mach/sys_proto.h +0
-4@@ -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
Signature · 5 lines
greets -- Christian Gmeiner, MSc https://christian-gmeiner.info/privacypolicy
Re: [PATCH v3 08/12] arm: mach-k3: Add weak do_board_detect() to common file
In reply to Andrew DavisQuoted 8 lines
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_DETECTas one is free to simply override the weak function in their board files as needed.Signed-off-by Andrew Davis <[email protected]>
Quoted 138 lines
--- 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(-)arch/arm/mach-k3/Kconfig +0
-5@@ -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"arch/arm/mach-k3/am642_init.c +2
-2@@ -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. arch/arm/mach-k3/am654_init.c +2
-2@@ -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),arch/arm/mach-k3/common.c +10
-0@@ -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 ) +{ +}arch/arm/mach-k3/common.h +2
-0@@ -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 );arch/arm/mach-k3/include/mach/sys_proto.h +0
-2@@ -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 );arch/arm/mach-k3/j721e_init.c +4
-4@@ -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),board/ti/common/Kconfig +0
-2@@ -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 --2.39.2
Signature · 5 lines
greets -- Christian Gmeiner, MSc https://christian-gmeiner.info/privacypolicy
Re: [PATCH v3 12/12] arm: mach-k3: Remove empty sys_proto.h include
In reply to Andrew DavisQuoted 4 lines
This header file is now empty, remove it.
Signed-off-by Andrew Davis <[email protected]>
Quoted 253 lines
--- 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.harch/arm/mach-k3/am642_init.c +0
-2@@ -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> arch/arm/mach-k3/am654_init.c +0
-1@@ -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> arch/arm/mach-k3/common.c +0
-1@@ -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> arch/arm/mach-k3/include/mach/sys_proto.h deleted +0
-10@@ -1,10 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* -* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ -* Andreas Dannenberg <[email protected]> -*/ - -#ifndef _SYS_PROTO_H_ -#define _SYS_PROTO_H_ - -#endif arch/arm/mach-k3/j721e_init.c +0
-1@@ -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> arch/arm/mach-k3/j721s2_init.c +0
-1@@ -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> arch/arm/mach-k3/security.c +0
-1@@ -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" arch/arm/mach-k3/sysfw-loader.c +0
-1@@ -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 ;board/siemens/iot2050/board.c +0
-1@@ -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> board/ti/am62ax/evm.c +0
-1@@ -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> board/ti/am62x/evm.c +0
-1@@ -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 ;board/ti/am64x/evm.c +0
-1@@ -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" board/ti/am65x/evm.c +0
-2@@ -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" board/ti/j721e/evm.c +0
-2@@ -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> board/ti/j721s2/evm.c +0
-2@@ -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> drivers/phy/phy-ti-am654.c +0
-1@@ -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> drivers/ram/k3-am654-ddrss.c +0
-2@@ -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" --2.39.2
Signature · 5 lines
greets -- Christian Gmeiner, MSc https://christian-gmeiner.info/privacypolicy
Re: [PATCH v3 02/12] arm: mach-k3: Move J721e SoC detection out of common section
In reply to Christian GmeinerQuoted 94 lines · Christian Gmeiner
Quoted 82 lines
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.hand intohardware.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 <[email protected]>--- 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(-)arch/arm/mach-k3/common.c +0
-20@@ -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) {arch/arm/mach-k3/common.h +0
-3@@ -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;arch/arm/mach-k3/include/mach/hardware.h +6
-0@@ -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 0xbb38arch/arm/mach-k3/include/mach/hardware.h line 54
Quoted 10 lines
arch/arm/mach-k3/include/mach/hardware.h +10
-0+#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_J7200; \This is not what you want. Maybe
Quoted 2 lines
return soc == JTAG_ID_PARTNO_##ID; \
Ah, copy/paste error got me 😄 good catch, v4 on the way..
Thanks,
Andrew
Quoted 31 lines
Quoted 29 lines
arch/arm/mach-k3/include/mach/hardware.h +9
-0+} +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)arch/arm/mach-k3/include/mach/sys_proto.h +0
-4@@ -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