diff --git a/scripts/xtensa-build-all.sh b/scripts/xtensa-build-all.sh index b3e34ce82aa0..2df924e86c53 100755 --- a/scripts/xtensa-build-all.sh +++ b/scripts/xtensa-build-all.sh @@ -6,7 +6,7 @@ set -e SUPPORTED_PLATFORMS=(byt cht bdw hsw apl skl kbl cnl sue icl jsl \ - imx8 imx8x imx8m imx8ulp tgl tgl-h rn) + imx8 imx8x imx8m imx8ulp tgl tgl-h rn mt8195) BUILD_ROM=no BUILD_DEBUG=no BUILD_FORCE_UP=no @@ -329,6 +329,12 @@ do HOST="xtensa-rn-elf" XTENSA_TOOLS_VERSION="RF-2016.4-linux" ;; + mt8195) + PLATFORM="mt8195" + XTENSA_CORE="hifi4_8195_PROD" + HOST="xtensa-mt8195-elf" + XTENSA_TOOLS_VERSION="RI-2019.1-linux" + ;; esac diff --git a/src/arch/xtensa/CMakeLists.txt b/src/arch/xtensa/CMakeLists.txt index a2ba820be6ae..0f24518c4567 100644 --- a/src/arch/xtensa/CMakeLists.txt +++ b/src/arch/xtensa/CMakeLists.txt @@ -31,6 +31,8 @@ elseif(CONFIG_IMX8M) set(platform_folder imx8m) elseif(CONFIG_IMX8ULP) set(platform_folder imx8ulp) +elseif(CONFIG_MT8195) + set(platform_folder mt8195) endif() if(CONFIG_CAVS) diff --git a/src/drivers/mediatek/mt8195/CMakeLists.txt b/src/drivers/mediatek/mt8195/CMakeLists.txt index a0b748083088..ac18de862e22 100644 --- a/src/drivers/mediatek/mt8195/CMakeLists.txt +++ b/src/drivers/mediatek/mt8195/CMakeLists.txt @@ -1,6 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause add_local_sources(sof ipc.c timer.c - interrupt.c uart.c afe-memif.c afe-dai.c afe-drv.c + interrupt.c afe-memif.c afe-dai.c afe-drv.c ) diff --git a/src/drivers/mediatek/mt8195/afe-memif.c b/src/drivers/mediatek/mt8195/afe-memif.c index feaf80563bed..0a97304908d2 100644 --- a/src/drivers/mediatek/mt8195/afe-memif.c +++ b/src/drivers/mediatek/mt8195/afe-memif.c @@ -465,7 +465,6 @@ static int memif_status(struct dma_chan_data *channel, struct dma_chan_status *s static int memif_set_config(struct dma_chan_data *channel, struct dma_sg_config *config) { struct afe_memif_dma *memif = dma_chan_get_data(channel); - int ret; int dai_id; int irq_id; unsigned int dma_addr; @@ -482,19 +481,17 @@ static int memif_set_config(struct dma_chan_data *channel, struct dma_sg_config switch (config->direction) { case DMA_DIR_MEM_TO_DEV: - if (direction != MEM_DIR_PLAYBACK) { - ret = -EINVAL; - break; - } + if (direction != MEM_DIR_PLAYBACK) + return -EINVAL; + dai_id = (int)AFE_HS_GET_DAI(config->dest_dev); irq_id = (int)AFE_HS_GET_IRQ(config->dest_dev); dma_addr = (int)config->elem_array.elems[0].src; break; case DMA_DIR_DEV_TO_MEM: - if (direction != MEM_DIR_CAPTURE) { - ret = -EINVAL; - break; - } + if (direction != MEM_DIR_CAPTURE) + return -EINVAL; + dai_id = (int)AFE_HS_GET_DAI(config->src_dev); irq_id = (int)AFE_HS_GET_IRQ(config->src_dev); dma_addr = (int)config->elem_array.elems[0].dest; diff --git a/src/platform/Kconfig b/src/platform/Kconfig index 7ed63698e555..233d54d2e46a 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -245,6 +245,19 @@ config RENOIR help Select if your target platform is renoir-compatible +config MT8195 + bool "Build for MTK MT8195" + select XT_INTERRUPT_LEVEL_1 + select XT_INTERRUPT_LEVEL_2 + select XT_INTERRUPT_LEVEL_3 + select DUMMY_DMA + select HOST_PTABLE + select XT_WAITI_DELAY + select MEDIATEK + select SCHEDULE_DMA_MULTI_CHANNEL + help + Select if your target platform is mt8195-compatible + endchoice config MAX_CORE_COUNT @@ -291,6 +304,13 @@ config IMX This has to be selected for every i.MX NXP platform. It enables NXP platforms-specific features. +config MEDIATEK + bool + default n + help + This has to be selected for every Mediatek platform. + It enables Mediatek platforms-specific features. + config CAVS bool default n @@ -427,6 +447,7 @@ config RIMAGE_SIGNING_SCHEMA default "imx8m" if IMX8M default "imx8ulp" if IMX8ULP default "rn" if RENOIR + default "mt8195" if MT8195 default "" help Signing schema name used by rimage to decide how to build final binary diff --git a/src/platform/mt8195/CMakeLists.txt b/src/platform/mt8195/CMakeLists.txt index 1452f7ec44a5..b5b1e06e9e10 100644 --- a/src/platform/mt8195/CMakeLists.txt +++ b/src/platform/mt8195/CMakeLists.txt @@ -2,5 +2,5 @@ add_subdirectory(lib) -add_local_sources(sof platform.c printf.c afe-platform.c) +add_local_sources(sof platform.c afe-platform.c) target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/platform/mt8195/include/platform)