From ec4bc1f07d6d5ab9f75e9bec7bdeea2b37dc1f39 Mon Sep 17 00:00:00 2001 From: "hailong.fan" Date: Thu, 26 Dec 2024 09:52:43 +0800 Subject: [PATCH] platform: Add build support for mediatek mt8196 platform Add CMakefile for mediatek mt8196 platform to build. Signed-off-by: hailong.fan --- scripts/docker_build/sof_builder/Dockerfile | 1 + scripts/set_xtensa_params.sh | 8 ++++++-- scripts/xtensa-build-all.sh | 2 +- src/arch/xtensa/CMakeLists.txt | 4 +++- src/drivers/mediatek/CMakeLists.txt | 3 +++ src/platform/CMakeLists.txt | 2 ++ src/platform/Kconfig | 22 +++++++++++++++++++++ uuid-registry.txt | 5 +++++ 8 files changed, 43 insertions(+), 4 deletions(-) diff --git a/scripts/docker_build/sof_builder/Dockerfile b/scripts/docker_build/sof_builder/Dockerfile index 90c082e4a173..843b5a448663 100644 --- a/scripts/docker_build/sof_builder/Dockerfile +++ b/scripts/docker_build/sof_builder/Dockerfile @@ -117,6 +117,7 @@ ENV PATH="/home/sof/work/xtensa-imx8ulp-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-mt8186-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-mt8195-elf/bin:${PATH}" ENV PATH="/home/sof/work/xtensa-mt8188-elf/bin:${PATH}" +ENV PATH="/home/sof/work/xtensa-mt8196-elf/bin:${PATH}" ARG NEWLIB_REPO=https://github.com/jcmvbkbc/newlib-xtensa.git RUN cd "$HOME" && \ diff --git a/scripts/set_xtensa_params.sh b/scripts/set_xtensa_params.sh index 622e30ddfbe0..e7af75d037fd 100644 --- a/scripts/set_xtensa_params.sh +++ b/scripts/set_xtensa_params.sh @@ -135,7 +135,11 @@ case "$platform" in HOST="xtensa-mt8195-elf" TOOLCHAIN_VER="RI-2019.1-linux" ;; - + mt8196) + XTENSA_CORE="HiFi5_MPU_lock_2023_11" + HOST="xtensa-mt8196-elf" + TOOLCHAIN_VER="RI-2023.11-linux" + ;; *) >&2 printf 'Unknown xtensa platform=%s\n' "$platform" return 1 @@ -144,7 +148,7 @@ esac # Pre-zephyr "XTOS" build, testbench,... case "$platform" in - mtl|lnl|ptl|acp_7_0) + mtl|lnl|ptl|acp_7_0|mt8196) SOF_CC_BASE='clang';; *) SOF_CC_BASE='xcc';; diff --git a/scripts/xtensa-build-all.sh b/scripts/xtensa-build-all.sh index a7d83c9fbd3e..4125be416614 100755 --- a/scripts/xtensa-build-all.sh +++ b/scripts/xtensa-build-all.sh @@ -10,7 +10,7 @@ set -e DEFAULT_PLATFORMS=( imx8m rn rmb vangogh - mt8186 mt8195 mt8188 + mt8186 mt8195 mt8188 mt8196 ) # Work in progress can be added to this "staging area" without breaking diff --git a/src/arch/xtensa/CMakeLists.txt b/src/arch/xtensa/CMakeLists.txt index e8478444b66e..0bc510e22330 100644 --- a/src/arch/xtensa/CMakeLists.txt +++ b/src/arch/xtensa/CMakeLists.txt @@ -26,6 +26,8 @@ elseif(CONFIG_MT8188) set(platform_folder mt8188) elseif(CONFIG_MT8195) set(platform_folder mt8195) +elseif(CONFIG_MT8196) + set(platform_folder mt8196) else() message(FATAL_ERROR "Platform not defined, check your Kconfiguration?") endif() @@ -477,7 +479,7 @@ set(UNSIGNED_RI imx8 imx8x imx8m imx8ulp) # AMD list(APPEND UNSIGNED_RI rn rmb vangogh acp_6_3 acp_7_0) # MediaTek -list(APPEND UNSIGNED_RI mt8186 mt8188 mt8195) +list(APPEND UNSIGNED_RI mt8186 mt8188 mt8195 mt8196) if(${fw_name} IN_LIST UNSIGNED_RI) # mere copy add_custom_command(OUTPUT reproducible.ri diff --git a/src/drivers/mediatek/CMakeLists.txt b/src/drivers/mediatek/CMakeLists.txt index f1090111e5d6..0dfbebbccf19 100644 --- a/src/drivers/mediatek/CMakeLists.txt +++ b/src/drivers/mediatek/CMakeLists.txt @@ -7,3 +7,6 @@ endif() if(CONFIG_MT8186 OR CONFIG_MT8188) add_subdirectory(mt818x) endif() +if(CONFIG_MT8196) + add_subdirectory(mt8196) +endif() diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index 8006b8b3caf8..56ff5b94c21f 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -21,4 +21,6 @@ elseif(CONFIG_MT8188) add_subdirectory(mt8188) elseif(CONFIG_MT8195) add_subdirectory(mt8195) +elseif(CONFIG_MT8196) + add_subdirectory(mt8196) endif() diff --git a/src/platform/Kconfig b/src/platform/Kconfig index 684f775049aa..fbc6d6eca9c7 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -273,6 +273,27 @@ config MT8195 help Select if your target platform is mt8195-compatible +config MT8196 + bool "Build for MTK MT8196" + select XT_INTERRUPT_LEVEL_1 + select XT_INTERRUPT_LEVEL_2 + select XT_INTERRUPT_LEVEL_3 + select XT_INTERRUPT_LEVEL_4 + select DUMMY_DMA + select HOST_PTABLE + select XT_WAITI_DELAY + select MEDIATEK + select XTENSA_EXCLUSIVE + select SCHEDULE_DMA_MULTI_CHANNEL + help + This configuration enables support for the MediaTek MT8196 platform. + It includes necessary interrupt levels, DMA support, and other + platform-specific features required for the proper functioning of + the MT8196 SoC. Enabling this option will ensure that the build + system includes all relevant drivers and configurations for MT8196. + + Select this option if your target platform is MT8196-compatible. + endchoice config MAX_CORE_COUNT @@ -476,6 +497,7 @@ config RIMAGE_SIGNING_SCHEMA default "mt8186" if MT8186 default "mt8188" if MT8188 default "mt8195" if MT8195 + default "mt8196" if MT8196 default "" help Signing schema name used by rimage to decide how to build final binary diff --git a/uuid-registry.txt b/uuid-registry.txt index bbf92ecd2ec2..0015543b7aa7 100644 --- a/uuid-registry.txt +++ b/uuid-registry.txt @@ -46,6 +46,7 @@ ec290e95-4a20-47eb-bbffd9c888431831 chmap 53863428-9a72-44df-af0ffe45ea2348ba clkdrv_mt8186 19d4e680-4479-48cc-af869f63d8b0098b clkdrv_mt8188 23b12fd5-c2a9-41a8-a2b3231ab7dcdc70 clkdrv_mt8195 +e87bf747-e574-4362-bf2cc015d2859dd9 clkdrv_mt8196 8890ea76-0df9-44ae-87e6994f4c15e9fa clock 7c42ce8b-0108-43d0-913756d660478c5f component 9ba00c83-ca12-4a83-943c1fa2e82f9dda copier @@ -82,15 +83,18 @@ a5dacb0e-88dc-415c-a1b53e8df77f1976 idc_cmd_task b90f5a4e-5537-4375-a1df95485472ff9e idc_task 696ae2bc-2877-11eb-adc10242ac120002 igo_nr fa00558c-d653-4851-a03ab21f125a9524 interrupt +2f520e85-49ba-4284-90d83def24af313b intc_mt8196 be60f97d-78df-4796-a0ee435cb56b720a ipc a814a1ca-0b83-466c-95872f35ff8d12e8 ipcgw 389c9186-5a7d-4ad1-a02ca02ecdadfb33 ipc_task 49be8ff3-71a3-4456-bb7e4723f2e5730c ipc_task_amd a3fe3bf2-39a4-4fc3-b3418a96e0a26759 ipc_task_mt818x +caef4bd7-7a2e-4039-9b061f5ff9ec3899 ipc_task_mt8196 6c8f0d53-ff77-4ca1-b825c0c4e1b0d322 ipc_task_posix 1862d39a-3a84-4d64-8c91dce1dfc122db irq 6533d0eb-b785-4709-84f5347c81720189 irq_acp d2e3f730-df39-42ee-81a839bfb4d024c2 irq_mt818x +7eb28333-f08f-436f-bbbd764ac21fc2f1 irq_mt8196 eba8d51f-7827-47b5-82eede6e7743af67 keyword d8218443-5ff3-4a4c-b3886cfe07b9562e kpb a8a0cb32-4a77-4db1-85c753d7ee07bce6 kpb4 @@ -135,6 +139,7 @@ d7f6712d-131c-45a7-82ed6aa9dc2291ea pm_runtime cf90d851-68a2-4987-a2de85aed0c8531c sgen_mt8186 99316bd9-07b9-4665-81796e048d67cb45 sgen_mt8188 9eb1a55b-fc20-4442-96131ff1023be493 sgen_mt8195 +bcf54c06-5702-4a60-ac4abb509123c649 sgen_mt8196 dabe8814-47e8-11ed-a58bb309974fecce shmread e2b6031c-47e8-11ed-07a97f801b6efa6c shmwrite 167a961e-8ae4-11ea-89f1000c29ce1635 smart_amp_test