From 4796e5c29406664078b0f5092d06e2e0973a86d9 Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea Date: Wed, 25 Sep 2024 14:12:29 +0300 Subject: [PATCH] tools: topolgy1: add topology for imx95 Add topology for the imx95 platform. The pipeline is: HOST ----> VOLUME (optional, may be passthrough) ----> DAI Signed-off-by: Laurentiu Mihalcea --- tools/topology/topology1/CMakeLists.txt | 5 ++ tools/topology/topology1/sof-imx95-wm8962.m4 | 82 ++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 tools/topology/topology1/sof-imx95-wm8962.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 44b36774d3d1..b734031a9d13 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -69,6 +69,11 @@ set(TPLGS "sof-imx93-wm8962\;sof-imx93-wm8962\;-DPPROC=volume" ## end i.MX93 topologies + ## i.MX95 topologies + "sof-imx95-wm8962\;sof-imx95-wm8962\;-DPPROC=volume" + "sof-imx95-wm8962\;sof-imx95-passthrough-wm8962\;-DPPROC=passthrough" + ## end i.MX95 topologies + "sof-mt8195-mt6359-rt1019-rt5682\;sof-mt8195-mt6359-rt1019-rt5682" "sof-mt8195-mt6359-rt1019-rt5682\;sof-mt8195-mt6359-rt1019-rt5682-dts\;-DDTS=`DTS'" "sof-mt8195-mt6359-rt1019-rt5682\;sof-mt8195-mt6359-max98390-rt5682" diff --git a/tools/topology/topology1/sof-imx95-wm8962.m4 b/tools/topology/topology1/sof-imx95-wm8962.m4 new file mode 100644 index 000000000000..c920c6e9c99e --- /dev/null +++ b/tools/topology/topology1/sof-imx95-wm8962.m4 @@ -0,0 +1,82 @@ +# +# Topology for i.MX95 with WM8962 codec +# + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`sai.m4') +include(`pcm.m4') +include(`buffer.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include DSP configuration +include(`platform/imx/imx8.m4') + +# +# Define the pipelines +# +# PCM0 <----> PPROC <-----> SAI3 +# + +dnl PIPELINE_PCM_ADD(pipeline, +dnl pipe id, pcm, max channels, format, +dnl period, priority, core, +dnl pcm_min_rate, pcm_max_rate, pipeline_rate, +dnl time_domain, sched_comp) + +# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. +# Set 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-`PPROC'-playback.m4, + 1, 0, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) + +# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s32le. +# Set 1000us deadline with priority 0 on core 0 +PIPELINE_PCM_ADD(sof/pipe-`PPROC'-capture.m4, + 2, 0, 2, s32le, + 1000, 0, 0, + 48000, 48000, 48000) +# +# DAIs configuration +# + +dnl DAI_ADD(pipeline, +dnl pipe id, dai type, dai_index, dai_be, +dnl buffer, periods, format, +dnl period, priority, core, time_domain) + +# playback DAI is SAI_SAI_INDEX using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 1, SAI, 3, sai3-wm8962, + PIPELINE_SOURCE_1, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + +# capture DAI is SAI_SAI_INDEX using 2 periods +# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-capture.m4, + 2, SAI, 3, sai3-wm8962, + PIPELINE_SINK_2, 2, s32le, + 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) + + +# PCM Low Latency, id 0 + +dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) +PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + +dnl DAI_CONFIG(type, idx, link_id, name, sai_config) +DAI_CONFIG(SAI, 3, 0, sai3-wm8962, + SAI_CONFIG(I2S, SAI_CLOCK(mclk, 12288000, codec_mclk_in), + SAI_CLOCK(bclk, 3072000, codec_provider), + SAI_CLOCK(fsync, 48000, codec_provider), + SAI_TDM(2, 32, 3, 3), + SAI_CONFIG_DATA(SAI, 3, 0)))