Skip to content

Commit f29f64e

Browse files
committed
mt8196 tplg
1 parent 6557df2 commit f29f64e

File tree

3 files changed

+172
-0
lines changed

3 files changed

+172
-0
lines changed

tools/topology/topology1/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ set(TPLGS
9898
"sof-mt8186-mt6366\;sof-mt8186-mt6366-rt1019-rt5682s-waves\;-DWAVES=1"
9999
"sof-mt8188-mt6359\;sof-mt8188"
100100
"sof-mt8188-mt6359\;sof-mt8188-waves\;-DWAVES=1"
101+
"sof-mt8196-mt6681\;sof-mt8196"
101102

102103
"sof-acp-renoir\;sof-acp"
103104
"sof-rn-rt5682-rt1019\;sof-rn-rt5682-rt1019"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# MT8196 differentiation for pipelines and components
3+
#
4+
5+
include(`memory.m4')
6+
7+
define(`PLATFORM_DAI_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE))
8+
define(`PLATFORM_HOST_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE))
9+
define(`PLATFORM_PASS_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE))
10+
define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE))
11+
12+
# Low Latency PCM Configuration
13+
W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "50000"'))
14+
W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens)
15+
16+
# Media PCM Configuration
17+
W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "100000"'))
18+
W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens)
19+
20+
# DAI schedule Configuration - scheduled by IRQ
21+
W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "5000"'))
22+
W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens)
23+
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
#
2+
# Topology for MT8196 board with mt6681
3+
#
4+
5+
# Include topology builder
6+
include(`utils.m4')
7+
include(`dai.m4')
8+
include(`pipeline.m4')
9+
include(`afe.m4')
10+
include(`pcm.m4')
11+
include(`buffer.m4')
12+
13+
# Include TLV library
14+
include(`common/tlv.m4')
15+
16+
# Include Token library
17+
include(`sof/tokens.m4')
18+
19+
# Include DSP configuration
20+
include(`platform/mediatek/mt8196.m4')
21+
22+
#
23+
# Define the pipelines
24+
#
25+
# PCM0 ---> AFE (Speaker - nau8318)
26+
# PCM1 ---> AFE (Headset playback - nau88l25)
27+
# PCM2 <--- AFE (DMIC0 - AP)
28+
# PCM3 <--- AFE (Headset record - nau88l25)
29+
# PCM4 <--- AFE (DMIC1 - AP)
30+
31+
dnl PIPELINE_PCM_ADD(pipeline,
32+
dnl pipe id, pcm, max channels, format,
33+
dnl period, priority, core,
34+
dnl pcm_min_rate, pcm_max_rate, pipeline_rate,
35+
dnl time_domain, sched_comp)
36+
37+
define(`ENDPOINT_NAME', `Speakers')
38+
# Low Latency playback pipeline 1 on PCM 16 using max 2 channels of s16le
39+
# Set 1000us deadline with priority 0 on core 0
40+
PIPELINE_PCM_ADD(ifdef(`WAVES', sof/pipe-waves-codec-playback.m4, sof/pipe-passthrough-playback.m4),
41+
1, 0, 2, s16le,
42+
1000, 0, 0,
43+
48000, 48000, 48000)
44+
undefine(`ENDPOINT_NAME')
45+
46+
define(`ENDPOINT_NAME', `Headphones')
47+
# Low Latency playback pipeline 2 on PCM 17 using max 2 channels of s16le
48+
# Set 1000us deadline with priority 0 on core 0
49+
PIPELINE_PCM_ADD(ifdef(`WAVES', sof/pipe-waves-codec-playback.m4, sof/pipe-passthrough-playback.m4),
50+
2, 1, 2, s16le,
51+
1000, 0, 0,
52+
48000, 48000, 48000)
53+
undefine(`ENDPOINT_NAME')
54+
# Low Latency capture pipeline 3 on PCM 18 using max 2 channels of s16le
55+
# Set 2000us deadline with priority 0 on core 0
56+
PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4,
57+
3, 2, 2, s16le,
58+
2000, 0, 0,
59+
48000, 48000, 48000)
60+
61+
# Low Latency capture pipeline 4 on PCM 19 using max 2 channels of s16le
62+
# Set 2000us deadline with priority 0 on core 0
63+
PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4,
64+
4, 3, 2, s16le,
65+
2000, 0, 0,
66+
48000, 48000, 48000)
67+
68+
# Low Latency capture pipeline 4 on PCM 20 using max 2 channels of s16le
69+
# Set 2000us deadline with priority 0 on core 0
70+
PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4,
71+
5, 4, 2, s16le,
72+
2000, 0, 0,
73+
48000, 48000, 48000)
74+
75+
76+
77+
#
78+
# DAIs configuration
79+
#
80+
81+
dnl DAI_ADD(pipeline,
82+
dnl pipe id, dai type, dai_index, dai_be,
83+
dnl buffer, periods, format,
84+
dnl deadline, priority, core)
85+
86+
87+
# playback DAI is AFE using 2 periods
88+
# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0
89+
DAI_ADD(sof/pipe-dai-playback.m4,
90+
1, AFE, 0, AFE_SOF_DL_24CH,
91+
PIPELINE_SOURCE_1, 2, s16le,
92+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
93+
94+
# playback DAI is AFE using 2 periods
95+
# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0
96+
DAI_ADD(sof/pipe-dai-playback.m4,
97+
2, AFE, 1, AFE_SOF_DL1,
98+
PIPELINE_SOURCE_2, 2, s16le,
99+
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
100+
# capture DAI is AFE using 2 periods
101+
# Buffers use s16le format, with 48 frame per 2000us on core 0 with priority 0
102+
DAI_ADD(sof/pipe-dai-capture.m4,
103+
3, AFE, 2, AFE_SOF_UL0,
104+
PIPELINE_SINK_3, 2, s16le,
105+
2000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
106+
107+
# capture DAI is AFE using 2 periods
108+
# Buffers use s16le format, with 48 frame per 2000us on core 0 with priority 0
109+
DAI_ADD(sof/pipe-dai-capture.m4,
110+
4, AFE, 3, AFE_SOF_UL1,
111+
PIPELINE_SINK_4, 2, s16le,
112+
2000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
113+
114+
# capture DAI is AFE using 2 periods
115+
# Buffers use s16le format, with 48 frame per 2000us on core 0 with priority 0
116+
DAI_ADD(sof/pipe-dai-capture.m4,
117+
5, AFE, 4, AFE_SOF_UL2,
118+
PIPELINE_SINK_5, 2, s16le,
119+
2000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)
120+
121+
#SCHEDULE_TIME_DOMAIN_DMA
122+
dnl PCM_PLAYBACK_ADD(name, pcm_id, playback)
123+
124+
# PCM Low Latency, id 0
125+
PCM_PLAYBACK_ADD(SOF_DL_24CH, 0, PIPELINE_PCM_1)
126+
PCM_PLAYBACK_ADD(SOF_DL1, 1, PIPELINE_PCM_2)
127+
PCM_CAPTURE_ADD(SOF_UL0, 2, PIPELINE_PCM_3)
128+
PCM_CAPTURE_ADD(SOF_UL1, 3, PIPELINE_PCM_4)
129+
PCM_CAPTURE_ADD(SOF_UL2, 4, PIPELINE_PCM_5)
130+
131+
132+
dnl DAI_CONFIG(type, dai_index, link_id, name, afe_config)
133+
134+
DAI_CONFIG(AFE, 0, 0, AFE_SOF_DL_24CH,
135+
AFE_CONFIG(AFE_CONFIG_DATA(AFE, 0, 48000, 2, s16le)))
136+
137+
DAI_CONFIG(AFE, 1, 0, AFE_SOF_DL1,
138+
AFE_CONFIG(AFE_CONFIG_DATA(AFE, 1, 48000, 2, s16le)))
139+
140+
DAI_CONFIG(AFE, 2, 0, AFE_SOF_UL0,
141+
AFE_CONFIG(AFE_CONFIG_DATA(AFE, 2, 48000, 2, s16le)))
142+
143+
DAI_CONFIG(AFE, 3, 0, AFE_SOF_UL1,
144+
AFE_CONFIG(AFE_CONFIG_DATA(AFE, 3, 48000, 2, s16le)))
145+
146+
DAI_CONFIG(AFE, 4, 0, AFE_SOF_UL2,
147+
AFE_CONFIG(AFE_CONFIG_DATA(AFE, 4, 48000, 2, s16le)))
148+

0 commit comments

Comments
 (0)