Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mt8195 build to script #4741

Merged
merged 4 commits into from
Sep 10, 2021
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
8 changes: 7 additions & 1 deletion scripts/xtensa-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/mediatek/mt8195/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
)

15 changes: 6 additions & 9 deletions src/drivers/mediatek/mt8195/afe-memif.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
21 changes: 21 additions & 0 deletions src/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/platform/mt8195/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)