1#
2# Topology for i.MX8ULP 9x9 board with bluetooth codec
3#
4
5# Include topology builder
6include(`utils.m4')
7include(`dai.m4')
8include(`pipeline.m4')
9include(`sai.m4')
10include(`pcm.m4')
11include(`buffer.m4')
12
13# Include TLV library
14include(`common/tlv.m4')
15
16# Include Token library
17include(`sof/tokens.m4')
18
19# Include DSP configuration
20include(`platform/imx/imx8.m4')
21
22#
23# Define the pipelines
24#
25# PCM0 <----> volume <-----> SAI6 (connect to BT)
26#
27
28define(`CHANNELS_MIN', 1)
29
30dnl PIPELINE_PCM_ADD(pipeline,
31dnl     pipe id, pcm, max channels, format,
32dnl     period, priority, core,
33dnl     pcm_min_rate, pcm_max_rate, pipeline_rate,
34dnl     time_domain, sched_comp)
35
36# Low Latency playback pipeline 1 on PCM 0 using max 1 channels of s16le.
37# Set 1000us deadline with priority 0 on core 0
38PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
39	1, 0, 1, s16le,
40	1000, 0, 0,
41	`RATE', `RATE', `RATE')
42
43undefine(`CHANNELS_MIN')
44
45# Low Latency capture pipeline 2 on PCM 0 using max 1 channels of s16le.
46# Set 1000us deadline with priority 0 on core 0
47PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
48	2, 0, 1, s16le,
49	1000, 0, 0,
50	`RATE', `RATE', `RATE')
51#
52# DAIs configuration
53#
54
55dnl DAI_ADD(pipeline,
56dnl     pipe id, dai type, dai_index, dai_be,
57dnl     buffer, periods, format,
58dnl     period, priority, core, time_domain)
59
60# playback DAI is SAI6 using 2 periods
61# Buffers use s16le format, with 16 frame per 1000us on core 0 with priority 0
62DAI_ADD(sof/pipe-dai-playback.m4,
63	1, SAI, 6, sai6-bt-sco-pcm-wb,
64	PIPELINE_SOURCE_1, 2, s16le,
65	1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA)
66
67# capture DAI is SAI6 using 2 periods
68# Buffers use s16le format, with 16 frame per 1000us on core 0 with priority 0
69DAI_ADD(sof/pipe-dai-capture.m4,
70	2, SAI, 6, sai6-bt-sco-pcm-wb,
71	PIPELINE_SINK_2, 2, s16le,
72	1000, 0, 0)
73
74# PCM Low Latency, id 0
75
76dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture)
77PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
78
79dnl DAI_CONFIG(type, idx, link_id, name, sai_config)
80DAI_CONFIG(SAI, 6, 0, sai6-bt-sco-pcm-wb,
81	SAI_CONFIG(I2S, SAI_CLOCK(mclk, 12288000, codec_mclk_out),
82		SAI_CLOCK(bclk, 256000, codec_consumer),
83		SAI_CLOCK(fsync, `RATE', codec_consumer),
84		SAI_TDM(1, 16, 1, 1),
85		SAI_CONFIG_DATA(SAI, 6, 0)))
86