Skip to content

Commit

Permalink
platform: Add build support for mediatek mt8196 platform
Browse files Browse the repository at this point in the history
Add CMakefile for mediatek mt8196 platform to build.

Signed-off-by: hailong.fan <[email protected]>
  • Loading branch information
hailongfan-mtk committed Dec 26, 2024
1 parent 23c3b72 commit ec4bc1f
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 4 deletions.
1 change: 1 addition & 0 deletions scripts/docker_build/sof_builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" && \
Expand Down
8 changes: 6 additions & 2 deletions scripts/set_xtensa_params.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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';;
Expand Down
2 changes: 1 addition & 1 deletion scripts/xtensa-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/drivers/mediatek/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ endif()
if(CONFIG_MT8186 OR CONFIG_MT8188)
add_subdirectory(mt818x)
endif()
if(CONFIG_MT8196)
add_subdirectory(mt8196)
endif()
2 changes: 2 additions & 0 deletions src/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ elseif(CONFIG_MT8188)
add_subdirectory(mt8188)
elseif(CONFIG_MT8195)
add_subdirectory(mt8195)
elseif(CONFIG_MT8196)
add_subdirectory(mt8196)
endif()
22 changes: 22 additions & 0 deletions src/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions uuid-registry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ec4bc1f

Please sign in to comment.