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

Support MediaTek mt8188 platform #6796

Merged
merged 8 commits into from
Dec 15, 2022
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
9 changes: 9 additions & 0 deletions scripts/xtensa-build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ DEFAULT_PLATFORMS=(
# the -a option for everyone.
SUPPORTED_PLATFORMS=( "${DEFAULT_PLATFORMS[@]}" )

# Waiting for container work in progress
SUPPORTED_PLATFORMS+=( mt8188 )

# Not actually "supported" in the main branch anymore (go to stable-v2.3
# instead) but kept here for historical reasons and experimentation
# convenience.
Expand Down Expand Up @@ -357,6 +360,12 @@ do
HOST="xtensa-mt8186-elf"
XTENSA_TOOLS_VERSION="RI-2020.5-linux"
;;
mt8188)
PLATFORM="mt8188"
XTENSA_CORE="hifi5_7stg_I64D128"
HOST="xtensa-mt8188-elf"
XTENSA_TOOLS_VERSION="RI-2020.5-linux"
;;
mt8195)
PLATFORM="mt8195"
XTENSA_CORE="hifi4_8195_PROD"
Expand Down
6 changes: 4 additions & 2 deletions src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ elseif(CONFIG_IMX8ULP)
set(platform_folder imx8ulp)
elseif(CONFIG_MT8186)
set(platform_folder mt8186)
elseif(CONFIG_MT8188)
set(platform_folder mt8188)
elseif(CONFIG_MT8195)
set(platform_folder mt8195)
endif()
Expand Down Expand Up @@ -552,8 +554,8 @@ set(UNSIGNED_RI byt cht hsw bdw sue)
list(APPEND UNSIGNED_RI imx8 imx8x imx8m imx8ulp)
# AMD
list(APPEND UNSIGNED_RI rn rmb)
# Mediatek
list(APPEND UNSIGNED_RI mt8186 mt8195)
# MediaTek
list(APPEND UNSIGNED_RI mt8186 mt8188 mt8195)

# Signed and non-deterministic but sof_ri_info.py is not compatible with
# manifest v1.5? "CSE manifest magic number not found"
Expand Down
15 changes: 15 additions & 0 deletions src/arch/xtensa/configs/mt8188_defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CONFIG_MT8188=y
CONFIG_CORE_COUNT=1
CONFIG_COMP_VOLUME=y
CONFIG_COMP_SRC=n
CONFIG_COMP_FIR=n
CONFIG_COMP_IIR=n
CONFIG_COMP_DCBLOCK=n
CONFIG_COMP_TDFB=n
CONFIG_COMP_TONE=n
CONFIG_COMP_MIXER=n
CONFIG_COMP_MUX=n
CONFIG_COMP_SWITCH=n
CONFIG_COMP_KPB=n
CONFIG_COMP_SEL=n
CONFIG_COMP_ASRC=n
4 changes: 4 additions & 0 deletions src/drivers/mediatek/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ if(CONFIG_MT8195)
add_subdirectory(mt8195)
endif()
if(CONFIG_MT8186)
add_subdirectory(mt818x)
add_subdirectory(mt8186)
endif()
if(CONFIG_MT8188)
add_subdirectory(mt818x)
endif()
2 changes: 1 addition & 1 deletion src/drivers/mediatek/mt8186/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-License-Identifier: BSD-3-Clause

add_local_sources(sof interrupt.c ipc.c timer.c afe-memif.c afe-dai.c afe-drv.c)
add_local_sources(sof afe-memif.c afe-dai.c afe-drv.c)

11 changes: 6 additions & 5 deletions src/drivers/mediatek/mt8186/afe-dai.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2022 Mediatek
//
// Author: Bo Pan <[email protected]>
// Chunxu Li <[email protected]>
/*
* Copyright(c) 2022 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* Chunxu Li <[email protected]>
*/

#include <sof/audio/component.h>
#include <sof/drivers/afe-drv.h>
Expand Down
11 changes: 6 additions & 5 deletions src/drivers/mediatek/mt8186/afe-drv.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2022 Mediatek
//
// Author: Bo Pan <[email protected]>
// Chunxu Li <[email protected]>
/*
* Copyright(c) 2022 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* Chunxu Li <[email protected]>
*/

#include <sof/common.h>
#include <sof/lib/io.h>
Expand Down
11 changes: 6 additions & 5 deletions src/drivers/mediatek/mt8186/afe-memif.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2022 Mediatek
//
// Author: Bo Pan <[email protected]>
// Chunxu Li <[email protected]>
/*
* Copyright(c) 2022 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* Chunxu Li <[email protected]>
*/

#include <sof/common.h>
#include <sof/audio/component.h>
Expand Down
4 changes: 4 additions & 0 deletions src/drivers/mediatek/mt818x/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: BSD-3-Clause

add_local_sources(sof interrupt.c ipc.c timer.c)

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2022 Mediatek. All rights reserved.
//
// Author: Allen-KH Cheng <[email protected]>
// Tinghan Shen <[email protected]>
/*
* Copyright(c) 2022 MediaTek. All rights reserved.
*
* Author: Allen-KH Cheng <[email protected]>
* Tinghan Shen <[email protected]>
*/

#include <errno.h>
#include <inttypes.h>
Expand All @@ -23,10 +24,10 @@
#define PENDING_IRQ_INDEX_MAX 32

/* d2e3f730-df39-42ee-81a8-39bfb4d024c2 */
DECLARE_SOF_UUID("irq-mt8186", irq_mt8186_uuid, 0xd2e3f730, 0xdf39, 0x42ee,
DECLARE_SOF_UUID("irq-818x", irq_mt818x_uuid, 0xd2e3f730, 0xdf39, 0x42ee,
0x81, 0xa8, 0x39, 0xbf, 0xb4, 0xd0, 0x24, 0xc2);

DECLARE_TR_CTX(int_tr, SOF_UUID(irq_mt8186_uuid), LOG_LEVEL_INFO);
DECLARE_TR_CTX(int_tr, SOF_UUID(irq_mt818x_uuid), LOG_LEVEL_INFO);

static void mtk_irq_init(void)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2022 Mediatek. All rights reserved.
//
// Author: Allen-KH Cheng <[email protected]>
// Tinghan Shen <[email protected]>
/*
* Copyright(c) 2022 MediaTek. All rights reserved.
*
* Author: Allen-KH Cheng <[email protected]>
* Tinghan Shen <[email protected]>
*/

#include <sof/debug/panic.h>
#include <rtos/interrupt.h>
Expand Down Expand Up @@ -160,7 +161,7 @@ int platform_ipc_init(struct ipc *ipc)

mbox_irq1 = mtk_irq_group_id(MTK_DSP_IRQ_MBOX1);
if (mbox_irq1 < 0) {
tr_err(&ipc_tr, "Invalid ipc mbox 0 IRQ:%d", mbox_irq1);
tr_err(&ipc_tr, "Invalid ipc mbox 1 IRQ:%d", mbox_irq1);
sof_panic(SOF_IPC_PANIC_IPC);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2022 Mediatek. All rights reserved.
//
// Author: Allen-KH Cheng <[email protected]>
// Tinghan Shen <[email protected]>
/*
* Copyright(c) 2022 MediaTek. All rights reserved.
*
* Author: Allen-KH Cheng <[email protected]>
* Tinghan Shen <[email protected]>
*/

#include <sof/audio/component_ext.h>
#include <rtos/interrupt.h>
Expand Down
11 changes: 6 additions & 5 deletions src/drivers/mediatek/mt8195/afe-dai.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: Bo Pan <[email protected]>
// YC Hung <[email protected]>
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* YC Hung <[email protected]>
*/

#include <sof/audio/component.h>
#include <sof/drivers/afe-drv.h>
Expand Down
11 changes: 6 additions & 5 deletions src/drivers/mediatek/mt8195/afe-drv.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: Bo Pan <[email protected]>
// YC Hung <[email protected]>
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* YC Hung <[email protected]>
*/

#include <sof/common.h>
#include <sof/lib/io.h>
Expand Down
11 changes: 6 additions & 5 deletions src/drivers/mediatek/mt8195/afe-memif.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: Bo Pan <[email protected]>
// YC Hung <[email protected]>
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* YC Hung <[email protected]>
*/

#include <sof/common.h>
#include <sof/audio/component.h>
Expand Down
9 changes: 5 additions & 4 deletions src/drivers/mediatek/mt8195/interrupt.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: Allen-KH Cheng <[email protected]>
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author: Allen-KH Cheng <[email protected]>
*/

#include <sof/common.h>
#include <rtos/bit.h>
Expand Down
9 changes: 5 additions & 4 deletions src/drivers/mediatek/mt8195/ipc.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: Allen-KH Cheng <[email protected]>
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author: Allen-KH Cheng <[email protected]>
*/

#include <sof/debug/panic.h>
#include <rtos/interrupt.h>
Expand Down
11 changes: 6 additions & 5 deletions src/drivers/mediatek/mt8195/timer.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author:Fengquan Chen <[email protected]>
// Allen-KH Cheng <[email protected]>
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author:Fengquan Chen <[email protected]>
* Allen-KH Cheng <[email protected]>
*/

#include <sof/audio/component_ext.h>
#include <rtos/interrupt.h>
Expand Down
13 changes: 7 additions & 6 deletions src/include/sof/drivers/afe-dai.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: Bo Pan <[email protected]>
// YC Hung <[email protected]>
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* YC Hung <[email protected]>
*/

#ifndef __SOF_DRIVERS_AFE_DAI_H__
#define __SOF_DRIVERS_AFE_DAI_H__
Expand Down
13 changes: 7 additions & 6 deletions src/include/sof/drivers/afe-drv.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: Bo Pan <[email protected]>
// YC Hung <[email protected]>
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* YC Hung <[email protected]>
*/

#ifndef __SOF_DRIVERS_AFE_DRV_H__
#define __SOF_DRIVERS_AFE_DRV_H__
Expand Down
13 changes: 7 additions & 6 deletions src/include/sof/drivers/afe-memif.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Mediatek
//
// Author: Bo Pan <[email protected]>
// YC Hung <[email protected]>
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright(c) 2021 MediaTek. All rights reserved.
*
* Author: Bo Pan <[email protected]>
* YC Hung <[email protected]>
*/

#ifndef __SOF_DRIVERS_AFE_MEMIF_H__
#define __SOF_DRIVERS_AFE_MEMIF_H__
Expand Down
2 changes: 2 additions & 0 deletions src/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ elseif(CONFIG_RENOIR OR CONFIG_REMBRANDT)
add_subdirectory(amd)
elseif(CONFIG_MT8186)
add_subdirectory(mt8186)
elseif(CONFIG_MT8188)
add_subdirectory(mt8188)
elseif(CONFIG_MT8195)
add_subdirectory(mt8195)
endif()
Expand Down
20 changes: 18 additions & 2 deletions src/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,21 @@ config MT8186
help
Select if your target platform is mt8186-compatible

config MT8188
bool "Build for MTK MT8188"
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
Select if your target platform is mt8188-compatible.

config MT8195
bool "Build for MTK MT8195"
select XT_INTERRUPT_LEVEL_1
Expand Down Expand Up @@ -354,8 +369,8 @@ config MEDIATEK
bool
default n
help
This has to be selected for every Mediatek platform.
It enables Mediatek platforms-specific features.
This has to be selected for every MediaTek platform.
It enables MediaTek platforms-specific features.

config CAVS
bool
Expand Down Expand Up @@ -528,6 +543,7 @@ config RIMAGE_SIGNING_SCHEMA
default "imx8ulp" if IMX8ULP
default "rn" if RENOIR
default "mt8186" if MT8186
default "mt8188" if MT8188
default "mt8195" if MT8195
default ""
help
Expand Down
Loading