From 45465708f014338a581414c0f82cb7638cca2253 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Thu, 8 Sep 2022 09:15:04 -0700 Subject: [PATCH] soc: intel_adsp: Add ACE soc series ACE15_MTPM is one SOC from the ACE series. Organize it following cavs pattern. Signed-off-by: Flavio Ceolin --- boards/xtensa/intel_adsp_ace15_mtpm/Kconfig.board | 2 +- .../intel_adsp_ace15_mtpm_defconfig | 3 ++- drivers/dma/Kconfig.intel_adsp_gpdma | 2 +- drivers/dma/dma_intel_adsp_gpdma.c | 8 ++++---- drivers/mm/mm_drv_intel_adsp_mtl_tlb.c | 8 ++++---- drivers/timer/intel_adsp_timer.c | 6 +++--- soc/xtensa/intel_adsp/CMakeLists.txt | 4 ++-- .../intel_adsp/{ace_v1x => ace}/CMakeLists.txt | 0 .../intel_adsp/ace/Kconfig.defconfig.ace15_mtpm | 14 ++++++++++++++ .../{ace_v1x => ace}/Kconfig.defconfig.series | 15 +++++---------- .../intel_adsp/{ace_v1x => ace}/Kconfig.series | 6 +++--- .../intel_adsp/{ace_v1x => ace}/Kconfig.soc | 2 +- .../{ace_v1x => ace}/_soc_inthandlers.h | 0 .../intel_adsp/{ace_v1x => ace}/ace-link.ld | 0 .../{ace_v1x => ace}/asm_memory_management.h | 0 .../include/intel_ace15_mtpm}/ace_v1x-regs.h | 0 .../include/intel_ace15_mtpm}/adsp_ipc_regs.h | 0 .../include/intel_ace15_mtpm}/adsp_memory.h | 0 .../include/intel_ace15_mtpm}/adsp_shim.h | 0 soc/xtensa/intel_adsp/{ace_v1x => ace}/irq.c | 0 soc/xtensa/intel_adsp/{ace_v1x => ace}/linker.ld | 0 .../intel_adsp/{ace_v1x => ace}/multiprocessing.c | 0 soc/xtensa/intel_adsp/{ace_v1x => ace}/power.c | 0 .../intel_adsp/{ace_v1x => ace}/power_down.S | 0 soc/xtensa/intel_adsp/{ace_v1x => ace}/sram.c | 0 soc/xtensa/intel_adsp/common/boot.c | 2 +- 26 files changed, 41 insertions(+), 31 deletions(-) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/CMakeLists.txt (100%) create mode 100644 soc/xtensa/intel_adsp/ace/Kconfig.defconfig.ace15_mtpm rename soc/xtensa/intel_adsp/{ace_v1x => ace}/Kconfig.defconfig.series (86%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/Kconfig.series (85%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/Kconfig.soc (84%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/_soc_inthandlers.h (100%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/ace-link.ld (100%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/asm_memory_management.h (100%) rename soc/xtensa/intel_adsp/{ace_v1x/include => ace/include/intel_ace15_mtpm}/ace_v1x-regs.h (100%) rename soc/xtensa/intel_adsp/{ace_v1x/include => ace/include/intel_ace15_mtpm}/adsp_ipc_regs.h (100%) rename soc/xtensa/intel_adsp/{ace_v1x/include => ace/include/intel_ace15_mtpm}/adsp_memory.h (100%) rename soc/xtensa/intel_adsp/{ace_v1x/include => ace/include/intel_ace15_mtpm}/adsp_shim.h (100%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/irq.c (100%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/linker.ld (100%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/multiprocessing.c (100%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/power.c (100%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/power_down.S (100%) rename soc/xtensa/intel_adsp/{ace_v1x => ace}/sram.c (100%) diff --git a/boards/xtensa/intel_adsp_ace15_mtpm/Kconfig.board b/boards/xtensa/intel_adsp_ace15_mtpm/Kconfig.board index 6a354467913..d51735c9caa 100644 --- a/boards/xtensa/intel_adsp_ace15_mtpm/Kconfig.board +++ b/boards/xtensa/intel_adsp_ace15_mtpm/Kconfig.board @@ -5,4 +5,4 @@ config BOARD_INTEL_ADSP_ACE15_MTPM bool "Intel ADSP ACE 1.5 Meteor PCH M" - depends on SOC_SERIES_INTEL_ACE1X + depends on SOC_SERIES_INTEL_ACE diff --git a/boards/xtensa/intel_adsp_ace15_mtpm/intel_adsp_ace15_mtpm_defconfig b/boards/xtensa/intel_adsp_ace15_mtpm/intel_adsp_ace15_mtpm_defconfig index 53e0755b5cc..0f01d20faed 100644 --- a/boards/xtensa/intel_adsp_ace15_mtpm/intel_adsp_ace15_mtpm_defconfig +++ b/boards/xtensa/intel_adsp_ace15_mtpm/intel_adsp_ace15_mtpm_defconfig @@ -2,7 +2,8 @@ CONFIG_MAIN_STACK_SIZE=2048 -CONFIG_SOC_SERIES_INTEL_ACE1X=y +CONFIG_SOC_SERIES_INTEL_ACE=y +CONFIG_SOC_INTEL_ACE15_MTPM=y CONFIG_BOARD_INTEL_ADSP_ACE15_MTPM=y CONFIG_GEN_ISR_TABLES=y diff --git a/drivers/dma/Kconfig.intel_adsp_gpdma b/drivers/dma/Kconfig.intel_adsp_gpdma index fabcbeb36ce..8488793ae12 100644 --- a/drivers/dma/Kconfig.intel_adsp_gpdma +++ b/drivers/dma/Kconfig.intel_adsp_gpdma @@ -21,7 +21,7 @@ config DMA_INTEL_ADSP_GPDMA_NEED_CONTROLLER_OWNERSHIP config DMA_INTEL_ADSP_GPDMA_HAS_LLP bool "Intel ADSP GPDMA Linear Link Position Feature" - default y if SOC_SERIES_INTEL_ACE1X + default y if SOC_SERIES_INTEL_ACE help Intel ADSP GPDMA may optionally have a linear link position feature. diff --git a/drivers/dma/dma_intel_adsp_gpdma.c b/drivers/dma/dma_intel_adsp_gpdma.c index fd19c5aa711..474c5a9093e 100644 --- a/drivers/dma/dma_intel_adsp_gpdma.c +++ b/drivers/dma/dma_intel_adsp_gpdma.c @@ -188,7 +188,7 @@ static void intel_adsp_gpdma_clock_enable(const struct device *dev) uint32_t reg = dev_cfg->shim + GPDMA_CTL_OFFSET; uint32_t val; - if (IS_ENABLED(CONFIG_SOC_SERIES_INTEL_ACE1X)) { + if (IS_ENABLED(CONFIG_SOC_SERIES_INTEL_ACE)) { val = sys_read32(reg) | GPDMA_CTL_DGCD; } else { val = GPDMA_CTL_FDCGB; @@ -197,7 +197,7 @@ static void intel_adsp_gpdma_clock_enable(const struct device *dev) sys_write32(val, reg); } -#ifdef CONFIG_SOC_SERIES_INTEL_ACE1X +#ifdef CONFIG_SOC_SERIES_INTEL_ACE static void intel_adsp_gpdma_select_owner(const struct device *dev) { const struct intel_adsp_gpdma_cfg *const dev_cfg = dev->config; @@ -228,7 +228,7 @@ int intel_adsp_gpdma_init(const struct device *dev) const struct intel_adsp_gpdma_cfg *const dev_cfg = dev->config; int ret; -#ifdef CONFIG_SOC_SERIES_INTEL_ACE1X +#ifdef CONFIG_SOC_SERIES_INTEL_ACE /* Power up */ ret = intel_adsp_gpdma_enable(dev); if (ret != 0) { @@ -246,7 +246,7 @@ int intel_adsp_gpdma_init(const struct device *dev) /* Disable dynamic clock gating appropriately before initializing */ intel_adsp_gpdma_clock_enable(dev); -#ifdef CONFIG_SOC_SERIES_INTEL_ACE1X +#ifdef CONFIG_SOC_SERIES_INTEL_ACE /* DW DMA Owner Select to DSP */ intel_adsp_gpdma_select_owner(dev); #endif diff --git a/drivers/mm/mm_drv_intel_adsp_mtl_tlb.c b/drivers/mm/mm_drv_intel_adsp_mtl_tlb.c index c6eb10f1e5c..e08a4765ca6 100644 --- a/drivers/mm/mm_drv_intel_adsp_mtl_tlb.c +++ b/drivers/mm/mm_drv_intel_adsp_mtl_tlb.c @@ -144,7 +144,7 @@ static uint32_t get_hpsram_bank_idx(uintptr_t pa) */ static uint16_t flags_to_tlb_perms(uint32_t flags) { -#if defined(CONFIG_SOC_SERIES_INTEL_ACE1X) +#if defined(CONFIG_SOC_SERIES_INTEL_ACE) uint16_t perms = 0; if ((flags & SYS_MM_MEM_PERM_RW) == SYS_MM_MEM_PERM_RW) { @@ -161,7 +161,7 @@ static uint16_t flags_to_tlb_perms(uint32_t flags) #endif } -#if defined(CONFIG_SOC_SERIES_INTEL_ACE1X) +#if defined(CONFIG_SOC_SERIES_INTEL_ACE) /** * Convert TLB entry permission bits to the SYS_MM_MEM_PERM_* flags. * @@ -186,7 +186,7 @@ static uint16_t tlb_perms_to_flags(uint16_t perms) static int sys_mm_drv_hpsram_pwr(uint32_t bank_idx, bool enable, bool non_blocking) { -#if defined(CONFIG_SOC_SERIES_INTEL_ACE1X) +#if defined(CONFIG_SOC_SERIES_INTEL_ACE) if (bank_idx > mtl_hpsram_get_bank_count()) { return -1; } @@ -467,7 +467,7 @@ int sys_mm_drv_page_flag_get(void *virt, uint32_t *flags) ARG_UNUSED(virt); int ret = 0; -#if defined(CONFIG_SOC_SERIES_INTEL_ACE1X) +#if defined(CONFIG_SOC_SERIES_INTEL_ACE) uint16_t *tlb_entries = UINT_TO_POINTER(TLB_BASE); uint16_t ent; diff --git a/drivers/timer/intel_adsp_timer.c b/drivers/timer/intel_adsp_timer.c index 7f1118f580d..aeac39639fb 100644 --- a/drivers/timer/intel_adsp_timer.c +++ b/drivers/timer/intel_adsp_timer.c @@ -12,7 +12,7 @@ #include #include -#ifdef CONFIG_SOC_SERIES_INTEL_ACE1X +#ifdef CONFIG_SOC_SERIES_INTEL_ACE #include #endif @@ -27,7 +27,7 @@ #define COMPARATOR_IDX 0 /* 0 or 1 */ -#ifdef CONFIG_SOC_SERIES_INTEL_ACE1X +#ifdef CONFIG_SOC_SERIES_INTEL_ACE #define TIMER_IRQ MTL_IRQ_TO_ZEPHYR(MTL_INTL_TTS) #else #define TIMER_IRQ DSP_WCT_IRQ(COMPARATOR_IDX) @@ -189,7 +189,7 @@ static void irq_init(void) * (for per-core control) above the interrupt controller. * Drivers need to do that part. */ -#ifdef CONFIG_SOC_SERIES_INTEL_ACE1X +#ifdef CONFIG_SOC_SERIES_INTEL_ACE MTL_DINT[cpu].ie[MTL_INTL_TTS] |= BIT(COMPARATOR_IDX + 1); *WCTCS |= ADSP_SHIM_DSPWCTCS_TTIE(COMPARATOR_IDX); #else diff --git a/soc/xtensa/intel_adsp/CMakeLists.txt b/soc/xtensa/intel_adsp/CMakeLists.txt index 3cb4485c487..8a3b1f01f25 100644 --- a/soc/xtensa/intel_adsp/CMakeLists.txt +++ b/soc/xtensa/intel_adsp/CMakeLists.txt @@ -4,8 +4,8 @@ # SPDX-License-Identifier: Apache-2.0 add_subdirectory(common) -if(CONFIG_SOC_SERIES_INTEL_ACE1X) - add_subdirectory(ace_v1x) +if(CONFIG_SOC_SERIES_INTEL_ACE) + add_subdirectory(ace) endif() if(CONFIG_INTEL_ADSP_CAVS) add_subdirectory(cavs) diff --git a/soc/xtensa/intel_adsp/ace_v1x/CMakeLists.txt b/soc/xtensa/intel_adsp/ace/CMakeLists.txt similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/CMakeLists.txt rename to soc/xtensa/intel_adsp/ace/CMakeLists.txt diff --git a/soc/xtensa/intel_adsp/ace/Kconfig.defconfig.ace15_mtpm b/soc/xtensa/intel_adsp/ace/Kconfig.defconfig.ace15_mtpm new file mode 100644 index 00000000000..135aa8b49af --- /dev/null +++ b/soc/xtensa/intel_adsp/ace/Kconfig.defconfig.ace15_mtpm @@ -0,0 +1,14 @@ +# Copyright (c) 2022 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + + +if SOC_INTEL_ACE15_MTPM + +config SOC + string + default "intel_ace15_mtpm" + +config MP_NUM_CPUS + default 3 + +endif diff --git a/soc/xtensa/intel_adsp/ace_v1x/Kconfig.defconfig.series b/soc/xtensa/intel_adsp/ace/Kconfig.defconfig.series similarity index 86% rename from soc/xtensa/intel_adsp/ace_v1x/Kconfig.defconfig.series rename to soc/xtensa/intel_adsp/ace/Kconfig.defconfig.series index 03cbce6b336..1f4af4fe947 100644 --- a/soc/xtensa/intel_adsp/ace_v1x/Kconfig.defconfig.series +++ b/soc/xtensa/intel_adsp/ace/Kconfig.defconfig.series @@ -1,23 +1,16 @@ # Copyright (c) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -if SOC_SERIES_INTEL_ACE1X +if SOC_SERIES_INTEL_ACE config SOC_SERIES string - default "ace_v1x" + default "ace" config SOC_TOOLCHAIN_NAME string default "intel_s1000" -config SOC - string - default "intel_ace15_mtpm" - -config MP_NUM_CPUS - default 3 - config SMP default y @@ -72,4 +65,6 @@ config LOG_BACKEND_ADSP endif # LOG -endif # SOC_SERIES_INTEL_ACE1X +source "soc/xtensa/intel_adsp/ace/Kconfig.defconfig.ace*" + +endif # SOC_SERIES_INTEL_ACE diff --git a/soc/xtensa/intel_adsp/ace_v1x/Kconfig.series b/soc/xtensa/intel_adsp/ace/Kconfig.series similarity index 85% rename from soc/xtensa/intel_adsp/ace_v1x/Kconfig.series rename to soc/xtensa/intel_adsp/ace/Kconfig.series index 03bde73fe45..4a79a5aefc6 100644 --- a/soc/xtensa/intel_adsp/ace_v1x/Kconfig.series +++ b/soc/xtensa/intel_adsp/ace/Kconfig.series @@ -1,8 +1,8 @@ # Copyright (c) 2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -config SOC_SERIES_INTEL_ACE1X - bool "Intel ACE 1.x" +config SOC_SERIES_INTEL_ACE + bool "Intel ACE" select SOC_FAMILY_INTEL_ADSP select XTENSA select XTENSA_HAL if (("$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xcc") && ("$(ZEPHYR_TOOLCHAIN_VARIANT)" != "xcc-clang")) @@ -11,4 +11,4 @@ config SOC_SERIES_INTEL_ACE1X select SCHED_IPI_SUPPORTED select DW_ICTL_ACE_V1X help - Intel ACE 1.x + Intel ADSP ACE diff --git a/soc/xtensa/intel_adsp/ace_v1x/Kconfig.soc b/soc/xtensa/intel_adsp/ace/Kconfig.soc similarity index 84% rename from soc/xtensa/intel_adsp/ace_v1x/Kconfig.soc rename to soc/xtensa/intel_adsp/ace/Kconfig.soc index 1ec29e2148f..f3028bf51ab 100644 --- a/soc/xtensa/intel_adsp/ace_v1x/Kconfig.soc +++ b/soc/xtensa/intel_adsp/ace/Kconfig.soc @@ -6,6 +6,6 @@ choice config SOC_INTEL_ACE15_MTPM bool "ACE 1.5 Meteor PCH M" - depends on SOC_SERIES_INTEL_ACE1X + depends on SOC_SERIES_INTEL_ACE endchoice diff --git a/soc/xtensa/intel_adsp/ace_v1x/_soc_inthandlers.h b/soc/xtensa/intel_adsp/ace/_soc_inthandlers.h similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/_soc_inthandlers.h rename to soc/xtensa/intel_adsp/ace/_soc_inthandlers.h diff --git a/soc/xtensa/intel_adsp/ace_v1x/ace-link.ld b/soc/xtensa/intel_adsp/ace/ace-link.ld similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/ace-link.ld rename to soc/xtensa/intel_adsp/ace/ace-link.ld diff --git a/soc/xtensa/intel_adsp/ace_v1x/asm_memory_management.h b/soc/xtensa/intel_adsp/ace/asm_memory_management.h similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/asm_memory_management.h rename to soc/xtensa/intel_adsp/ace/asm_memory_management.h diff --git a/soc/xtensa/intel_adsp/ace_v1x/include/ace_v1x-regs.h b/soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/ace_v1x-regs.h similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/include/ace_v1x-regs.h rename to soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/ace_v1x-regs.h diff --git a/soc/xtensa/intel_adsp/ace_v1x/include/adsp_ipc_regs.h b/soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/adsp_ipc_regs.h similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/include/adsp_ipc_regs.h rename to soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/adsp_ipc_regs.h diff --git a/soc/xtensa/intel_adsp/ace_v1x/include/adsp_memory.h b/soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/adsp_memory.h similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/include/adsp_memory.h rename to soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/adsp_memory.h diff --git a/soc/xtensa/intel_adsp/ace_v1x/include/adsp_shim.h b/soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/adsp_shim.h similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/include/adsp_shim.h rename to soc/xtensa/intel_adsp/ace/include/intel_ace15_mtpm/adsp_shim.h diff --git a/soc/xtensa/intel_adsp/ace_v1x/irq.c b/soc/xtensa/intel_adsp/ace/irq.c similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/irq.c rename to soc/xtensa/intel_adsp/ace/irq.c diff --git a/soc/xtensa/intel_adsp/ace_v1x/linker.ld b/soc/xtensa/intel_adsp/ace/linker.ld similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/linker.ld rename to soc/xtensa/intel_adsp/ace/linker.ld diff --git a/soc/xtensa/intel_adsp/ace_v1x/multiprocessing.c b/soc/xtensa/intel_adsp/ace/multiprocessing.c similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/multiprocessing.c rename to soc/xtensa/intel_adsp/ace/multiprocessing.c diff --git a/soc/xtensa/intel_adsp/ace_v1x/power.c b/soc/xtensa/intel_adsp/ace/power.c similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/power.c rename to soc/xtensa/intel_adsp/ace/power.c diff --git a/soc/xtensa/intel_adsp/ace_v1x/power_down.S b/soc/xtensa/intel_adsp/ace/power_down.S similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/power_down.S rename to soc/xtensa/intel_adsp/ace/power_down.S diff --git a/soc/xtensa/intel_adsp/ace_v1x/sram.c b/soc/xtensa/intel_adsp/ace/sram.c similarity index 100% rename from soc/xtensa/intel_adsp/ace_v1x/sram.c rename to soc/xtensa/intel_adsp/ace/sram.c diff --git a/soc/xtensa/intel_adsp/common/boot.c b/soc/xtensa/intel_adsp/common/boot.c index 06e30536062..d2ea10bde8e 100644 --- a/soc/xtensa/intel_adsp/common/boot.c +++ b/soc/xtensa/intel_adsp/common/boot.c @@ -42,7 +42,7 @@ #define MANIFEST_SEGMENT_COUNT 3 /* FIXME: Use Kconfig or some other means */ -#if !defined(CONFIG_SOC_SERIES_INTEL_ACE1X) +#if !defined(CONFIG_SOC_SERIES_INTEL_ACE) #define RESET_MEMORY_HOLE #endif