From 145e17d1c90e227af7806cbfbba1d46cd7b0e4cc Mon Sep 17 00:00:00 2001 From: Daniel Schultz Date: Mon, 1 Apr 2024 13:50:39 -0700 Subject: [PATCH] soc: ti: k3: Add support for AM6442 The AM64x and AM62x are both SOCs from the TI K3 family and share common architecture designs. The M4F subsystem is actuall identical on both SOCs. Therefore, just add all missing CONFIGs, files, etc. to support the AM6442x SOC. Since MMR and RAT initialization are identical too, both functions can be re-used. However, since they might differ in the future, the am64x has it's own init function. Signed-off-by: Daniel Schultz --- soc/ti/k3/am6x/CMakeLists.txt | 2 +- soc/ti/k3/am6x/Kconfig | 1 + soc/ti/k3/am6x/Kconfig.soc | 5 +++++ soc/ti/k3/am6x/m4/soc.c | 14 +++++++------- soc/ti/k3/soc.yml | 3 +++ 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/soc/ti/k3/am6x/CMakeLists.txt b/soc/ti/k3/am6x/CMakeLists.txt index 9f0cb3dd2f..993d8d8d95 100644 --- a/soc/ti/k3/am6x/CMakeLists.txt +++ b/soc/ti/k3/am6x/CMakeLists.txt @@ -7,7 +7,7 @@ if(CONFIG_SOC_AM6234_A53) zephyr_sources_ifdef(CONFIG_ARM_MMU a53/mmu_regions.c) set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm64/scripts/linker.ld CACHE INTERNAL "") -elseif(CONFIG_SOC_AM6234_M4) +elseif(CONFIG_SOC_SERIES_AM6X_M4) zephyr_sources(m4/soc.c) zephyr_include_directories(m4) diff --git a/soc/ti/k3/am6x/Kconfig b/soc/ti/k3/am6x/Kconfig index 8eb993db66..f5596944bf 100644 --- a/soc/ti/k3/am6x/Kconfig +++ b/soc/ti/k3/am6x/Kconfig @@ -21,3 +21,4 @@ config SOC_SERIES_AM6X_M4 config SOC_PART_NUMBER default "AM6234" if SOC_AM6234_A53 default "AM6234" if SOC_AM6234_M4 + default "AM6442" if SOC_AM6442_M4 diff --git a/soc/ti/k3/am6x/Kconfig.soc b/soc/ti/k3/am6x/Kconfig.soc index fa9c8e20f7..df9805f92d 100644 --- a/soc/ti/k3/am6x/Kconfig.soc +++ b/soc/ti/k3/am6x/Kconfig.soc @@ -25,8 +25,13 @@ config SOC_AM6234_M4 bool select SOC_SERIES_AM6X_M4 +config SOC_AM6442_M4 + bool + select SOC_SERIES_AM6X_M4 + config SOC_SERIES default "am6x" if SOC_SERIES_AM6X config SOC default "am6234" if SOC_AM6234_M4 || SOC_AM6234_A53 + default "am6442" if SOC_AM6442_M4 diff --git a/soc/ti/k3/am6x/m4/soc.c b/soc/ti/k3/am6x/m4/soc.c index 9c86eb09a1..b2e261a4e9 100644 --- a/soc/ti/k3/am6x/m4/soc.c +++ b/soc/ti/k3/am6x/m4/soc.c @@ -17,7 +17,7 @@ #define CSL_MCU_PADCONFIG_LOCK0_KICK0_OFFSET (0x1008) #define CSL_MCU_PADCONFIG_LOCK1_KICK0_OFFSET (0x5008) -static struct address_trans_region_config region_config[] = { +static struct address_trans_region_config am6x_region_config[] = { { .system_addr = 0x0u, .local_addr = 0x80000000u, @@ -44,7 +44,7 @@ static struct address_trans_region_config region_config[] = { */ }; -static void mmr_unlock(void) +static void am6x_mmr_unlock(void) { uint32_t baseAddr = PINCTRL_BASE_ADDR; uintptr_t kickAddr; @@ -62,12 +62,12 @@ static void mmr_unlock(void) sys_write32(KICK1_UNLOCK_VAL, kickAddr); /* KICK 1 */ } -static int am62x_m4_init(void) +static int am6x_m4_init(void) { - sys_mm_drv_ti_rat_init( - region_config, ADDR_TRANSLATE_RAT_BASE_ADDR, ARRAY_SIZE(region_config)); - mmr_unlock(); + sys_mm_drv_ti_rat_init(am6x_region_config, ADDR_TRANSLATE_RAT_BASE_ADDR, + ARRAY_SIZE(am6x_region_config)); + am6x_mmr_unlock(); return 0; } -SYS_INIT(am62x_m4_init, EARLY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +SYS_INIT(am6x_m4_init, EARLY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); diff --git a/soc/ti/k3/soc.yml b/soc/ti/k3/soc.yml index 92ae28d5a0..3065ab13d4 100644 --- a/soc/ti/k3/soc.yml +++ b/soc/ti/k3/soc.yml @@ -7,3 +7,6 @@ family: cpuclusters: - name: m4 - name: a53 + - name: am6442 + cpuclusters: + - name: m4