src/platform: Add "mtk" Zephyr platform for MediaTek DSPs by andyross · Pull Request #9755 · thesofproject/sof · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/boards/mt8186_mt8186_adsp.conf
6 changes: 6 additions & 0 deletions app/boards/mt8188_mt8188_adsp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Boilerplate. Because the "Platform" is a kconfig "choice" (of which
# "MTK" is an member), it can't be selected automatically from other
# kconfigs, nor expressed as a default. Don't put anything else here.
# Board-level config goes in Zephyr (and ideally in DTS). App-level
# config goes in prj.conf.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note it is accepted practise use to put vendor specific app settings in these board files. E.g. Intel example #9609 . I do agree anything that can be put in Zephyr board files/DTS or the app prj.conf, should not be put here.

CONFIG_MTK=y
6 changes: 6 additions & 0 deletions app/boards/mt8195_mt8195_adsp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Boilerplate. Because the "Platform" is a kconfig "choice" (of which
# "MTK" is an member), it can't be selected automatically from other
# kconfigs, nor expressed as a default. Don't put anything else here.
# Board-level config goes in Zephyr (and ideally in DTS). App-level
# config goes in prj.conf.
CONFIG_MTK=y
6 changes: 6 additions & 0 deletions app/boards/mt8196_mt8196_adsp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Boilerplate. Because the "Platform" is a kconfig "choice" (of which
# "MTK" is an member), it can't be selected automatically from other
# kconfigs, nor expressed as a default. Don't put anything else here.
# Board-level config goes in Zephyr (and ideally in DTS). App-level
# config goes in prj.conf.
CONFIG_MTK=y
24 changes: 23 additions & 1 deletion scripts/xtensa-build-zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,28 @@ class PlatformConfig:
"rmb_LX7_HiFi5_PROD",
RIMAGE_KEY = "key param ignored by acp_6_0"
),
# MediaTek platforms
# (move to platform_configs_all on next Zephyr SDK release after 0.17.0)
"mt8195" : PlatformConfig(
"mtk", "mt8195/mt8195/adsp",
f"RJ-2024.3{xtensa_tools_version_postfix}",
"hifi4_8195_PROD",
),
"mt8186" : PlatformConfig(
"mtk", "mt8186/mt8186/adsp",
f"RJ-2024.3{xtensa_tools_version_postfix}",
"hifi5_7stg_I64D128",
),
"mt8188" : PlatformConfig(
"mtk", "mt8188/mt8188/adsp",
f"RJ-2024.3{xtensa_tools_version_postfix}",
"hifi5_7stg_I64D128",
),
"mt8196" : PlatformConfig(
"mtk", "mt8196/mt8196/adsp",
f"RJ-2024.3{xtensa_tools_version_postfix}",
"HiFi5_MPU_lock_2023_11",
),
}

# These can all be built out of the box. --all builds all these.
Expand Down Expand Up @@ -1173,7 +1195,7 @@ def gzip_compress(fname, gzdst=None):

RI_INFO_UNSUPPORTED += ['imx8', 'imx8x', 'imx8m', 'imx8ulp', 'imx95']
RI_INFO_UNSUPPORTED += ['rn', 'acp_6_0']
RI_INFO_UNSUPPORTED += ['mt8186', 'mt8195']
RI_INFO_UNSUPPORTED += ['mt8186', 'mt8188', 'mt8195', 'mt8196']
Comment thread
andyross marked this conversation as resolved.

# For temporary workarounds. Unlike _UNSUPPORTED above, the platforms below will print a warning.
RI_INFO_FIXME = [ ]
Expand Down
1 change: 1 addition & 0 deletions src/drivers/mediatek/afe/afe-dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
SOF_DEFINE_REG_UUID(afe_dai);

DECLARE_TR_CTX(afe_dai_tr, SOF_UUID(afe_dai_uuid), LOG_LEVEL_INFO);
LOG_MODULE_DECLARE(mtk_afe, CONFIG_SOF_LOG_LEVEL);

static int afe_dai_drv_trigger(struct dai *dai, int cmd, int direction)
{
Expand Down
1 change: 1 addition & 0 deletions src/drivers/mediatek/afe/afe-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static struct mtk_base_afe mtk_afe;
SOF_DEFINE_REG_UUID(afedrv);

DECLARE_TR_CTX(afedrv_tr, SOF_UUID(afedrv_uuid), LOG_LEVEL_INFO);
LOG_MODULE_DECLARE(mtk_afe, CONFIG_SOF_LOG_LEVEL);

static inline void afe_reg_read(struct mtk_base_afe *afe, uint32_t reg, uint32_t *value)
{
Expand Down
1 change: 1 addition & 0 deletions src/drivers/mediatek/afe/afe-memif.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
SOF_DEFINE_REG_UUID(memif);

DECLARE_TR_CTX(memif_tr, SOF_UUID(memif_uuid), LOG_LEVEL_INFO);
LOG_MODULE_REGISTER(mtk_afe, CONFIG_SOF_LOG_LEVEL);

struct afe_memif_dma {
int direction; /* 1 downlink, 0 uplink */
Expand Down
16 changes: 13 additions & 3 deletions src/platform/Kconfig
Loading