diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index 4270457f1805..3bd733444f1b 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -50,6 +50,7 @@ + Define { MCLK 24576000 @@ -135,8 +136,23 @@ Object.Dai.SSP [ Object.Base.hw_config.1 { name "SSP0" id 0 - bclk_freq 3072000 - tdm_slot_width 32 + IncludeByKey.SSP0_RATE { + "48000" { + fsync_freq 48000 + bclk_freq 3072000 + tdm_slot_width 32 + } + "96000" { + fsync_freq 96000 + bclk_freq 6144000 + tdm_slot_width 32 + } + "192000" { + fsync_freq 192000 + bclk_freq 12288000 + tdm_slot_width 32 + } + } # TODO: remove this. Needs alsaptlg change. Object.Base.link_config.1 { clock_source 1 @@ -156,8 +172,23 @@ Object.Dai.SSP [ Object.Base.hw_config.1 { name "SSP2" id 0 - bclk_freq 3072000 - tdm_slot_width 32 + IncludeByKey.SSP2_RATE { + "48000" { + fsync_freq 48000 + bclk_freq 3072000 + tdm_slot_width 32 + } + "96000" { + fsync_freq 96000 + bclk_freq 6144000 + tdm_slot_width 32 + } + "192000" { + fsync_freq 192000 + bclk_freq 12288000 + tdm_slot_width 32 + } + } # TODO: remove this. Needs alsaptlg change. Object.Base.link_config.1 { clock_source 1 @@ -484,14 +515,17 @@ IncludeByKey.PASSTHROUGH { num_input_audio_formats 3 Object.Base.input_audio_format [ { + in_rate $SSP0_RATE in_bit_depth 16 in_valid_bit_depth 16 } { + in_rate $SSP0_RATE in_bit_depth 32 in_valid_bit_depth 24 } { + in_rate $SSP0_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -499,14 +533,17 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 3 Object.Base.output_audio_format [ { + out_rate $SSP0_RATE out_bit_depth 16 out_valid_bit_depth 16 } { + out_rate $SSP0_RATE out_bit_depth 32 out_valid_bit_depth 24 } { + out_rate $SSP0_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -527,14 +564,17 @@ IncludeByKey.PASSTHROUGH { num_input_audio_formats 3 Object.Base.input_audio_format [ { + in_rate $SSP2_RATE in_bit_depth 16 in_valid_bit_depth 16 } { + in_rate $SSP2_RATE in_bit_depth 32 in_valid_bit_depth 24 } { + in_rate $SSP2_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -542,14 +582,17 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 3 Object.Base.output_audio_format [ { + out_rate $SSP2_RATE out_bit_depth 16 out_valid_bit_depth 16 } { + out_rate $SSP2_RATE out_bit_depth 32 out_valid_bit_depth 24 } { + out_rate $SSP2_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -567,14 +610,17 @@ IncludeByKey.PASSTHROUGH { num_input_audio_formats 3 Object.Base.input_audio_format [ { + in_rate $SSP0_RATE in_bit_depth 16 in_valid_bit_depth 16 } { + in_rate $SSP0_RATE in_bit_depth 32 in_valid_bit_depth 24 } { + in_rate $SSP0_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -582,14 +628,17 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 3 Object.Base.output_audio_format [ { + out_rate $SSP0_RATE out_bit_depth 16 out_valid_bit_depth 16 } { + out_rate $SSP0_RATE out_bit_depth 32 out_valid_bit_depth 24 } { + out_rate $SSP0_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -605,14 +654,17 @@ IncludeByKey.PASSTHROUGH { num_input_audio_formats 3 Object.Base.input_audio_format [ { + in_rate $SSP2_RATE in_bit_depth 16 in_valid_bit_depth 16 } { + in_rate $SSP2_RATE in_bit_depth 32 in_valid_bit_depth 24 } { + in_rate $SSP2_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -620,14 +672,17 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 3 Object.Base.output_audio_format [ { + out_rate $SSP2_RATE out_bit_depth 16 out_valid_bit_depth 16 } { + out_rate $SSP2_RATE out_bit_depth 32 out_valid_bit_depth 24 } { + out_rate $SSP2_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -643,6 +698,42 @@ IncludeByKey.PASSTHROUGH { Object.Widget.host-copier.1 { stream_name 'SSP0 Capture' pcm_id 0 + num_input_audio_formats 3 + Object.Base.input_audio_format [ + { + in_rate $SSP0_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_rate $SSP0_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_rate $SSP0_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 3 + Object.Base.output_audio_format [ + { + out_rate $SSP0_RATE + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_rate $SSP0_RATE + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_rate $SSP0_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } } { @@ -652,6 +743,42 @@ IncludeByKey.PASSTHROUGH { Object.Widget.host-copier.1 { stream_name 'SSP2 Capture' pcm_id 2 + num_input_audio_formats 3 + Object.Base.input_audio_format [ + { + in_rate $SSP2_RATE + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_rate $SSP2_RATE + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_rate $SSP2_RATE + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 3 + Object.Base.output_audio_format [ + { + out_rate $SSP2_RATE + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_rate $SSP2_RATE + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_rate $SSP2_RATE + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } Object.Widget.pipeline."1" { @@ -677,6 +804,7 @@ IncludeByKey.PASSTHROUGH { Object.Base.input_audio_format [ { + in_rate $SSP0_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -684,6 +812,7 @@ IncludeByKey.PASSTHROUGH { num_output_audio_formats 1 Object.Base.output_audio_format [ { + out_rate $SSP0_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -711,6 +840,7 @@ Object.Pipeline.io-gateway-capture [ num_input_audio_formats 1 Object.Base.input_audio_format [ { + in_rate $SSP2_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -718,6 +848,7 @@ Object.Pipeline.io-gateway-capture [ num_output_audio_formats 1 Object.Base.output_audio_format [ { + out_rate $SSP2_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -948,12 +1079,34 @@ Object.PCM.pcm [ direction "playback" name "SSP0 Playback" formats 'S16_LE,S24_LE,S32_LE' + IncludeByKey.SSP0_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } } Object.PCM.pcm_caps.2 { direction "capture" name "SSP0 Capture" formats 'S16_LE,S24_LE,S32_LE' + IncludeByKey.SSP0_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } } } ] @@ -1064,12 +1217,34 @@ IncludeByKey.PASSTHROUGH { direction "playback" name "SSP2 Playback" formats 'S16_LE,S24_LE,S32_LE' + IncludeByKey.SSP2_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } } Object.PCM.pcm_caps.2 { direction "capture" name "SSP2 Capture" formats 'S16_LE,S24_LE,S32_LE' + IncludeByKey.SSP2_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } } } ] @@ -1216,8 +1391,23 @@ IncludeByKey.SSP1_ENABLED { Object.Base.hw_config.1 { name "SSP1" id 0 - bclk_freq 3072000 - tdm_slot_width 32 + IncludeByKey.SSP1_RATE { + "48000" { + fsync_freq 48000 + tdm_slot_width 32 + bclk_freq 3072000 + } + "96000" { + fsync_freq 96000 + tdm_slot_width 32 + bclk_freq 6144000 + } + "192000" { + fsync_freq 192000 + tdm_slot_width 32 + bclk_freq 12288000 + } + } # TODO: remove this. Needs alsaptlg change. Object.Base.link_config.1 { clock_source 1 @@ -1243,6 +1433,7 @@ IncludeByKey.SSP1_ENABLED { num_input_audio_formats 1 Object.Base.input_audio_format [ { + in_rate $SSP1_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -1250,6 +1441,7 @@ IncludeByKey.SSP1_ENABLED { num_output_audio_formats 1 Object.Base.output_audio_format [ { + out_rate $SSP1_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -1341,14 +1533,17 @@ IncludeByKey.SSP1_ENABLED { num_input_audio_formats 3 Object.Base.input_audio_format [ { + in_rate $SSP1_RATE in_bit_depth 16 in_valid_bit_depth 16 } { + in_rate $SSP1_RATE in_bit_depth 32 in_valid_bit_depth 24 } { + in_rate $SSP1_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -1356,14 +1551,17 @@ IncludeByKey.SSP1_ENABLED { num_output_audio_formats 3 Object.Base.output_audio_format [ { + out_rate $SSP1_RATE out_bit_depth 16 out_valid_bit_depth 16 } { + out_rate $SSP1_RATE out_bit_depth 32 out_valid_bit_depth 24 } { + out_rate $SSP1_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -1380,14 +1578,17 @@ IncludeByKey.SSP1_ENABLED { num_input_audio_formats 3 Object.Base.input_audio_format [ { + in_rate $SSP1_RATE in_bit_depth 16 in_valid_bit_depth 16 } { + in_rate $SSP1_RATE in_bit_depth 32 in_valid_bit_depth 24 } { + in_rate $SSP1_RATE in_bit_depth 32 in_valid_bit_depth 32 } @@ -1395,14 +1596,17 @@ IncludeByKey.SSP1_ENABLED { num_output_audio_formats 3 Object.Base.output_audio_format [ { + out_rate $SSP1_RATE out_bit_depth 16 out_valid_bit_depth 16 } { + out_rate $SSP1_RATE out_bit_depth 32 out_valid_bit_depth 24 } { + out_rate $SSP1_RATE out_bit_depth 32 out_valid_bit_depth 32 } @@ -1426,12 +1630,34 @@ IncludeByKey.SSP1_ENABLED { direction "playback" name "SSP1 Playback" formats 'S16_LE,S24_LE,S32_LE' + IncludeByKey.SSP1_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } } Object.PCM.pcm_caps.2 { direction "capture" name "SSP1 Capture" formats 'S16_LE,S24_LE,S32_LE' + IncludeByKey.SSP1_RATE { + "48000" { + rates '48000' + } + "96000" { + rates '96000' + } + "192000" { + rates '192000' + } + } } } ] diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index f5d5159afba0..eda55f2c3a92 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -68,6 +68,16 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-nocodec.bin" "cavs-nocodec\;sof-ptl-nocodec-dmic-4ch-96k\;PLATFORM=ptl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ DMIC0_RATE=96000,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-nocodec-dmic-4ch-96k.bin" +# SSP topology for PTL with 96 kHz DMIC and 96 kHz SSP0 +"cavs-nocodec\;sof-ptl-nocodec-dmic-4ch-96k-ssp0-96k\;PLATFORM=ptl,NUM_DMICS=4,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_RATE=96000,SSP0_RATE=96000,PASSTHROUGH=true,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-nocodec-dmic-4ch-96k-ssp0-96k.bin" + +# SSP topology for PTL with 96 kHz DMIC and 192 kHz SSP0 +"cavs-nocodec\;sof-ptl-nocodec-dmic-4ch-96k-ssp0-192k\;PLATFORM=ptl,NUM_DMICS=4,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_RATE=96000,SSP0_RATE=192000,PASSTHROUGH=true,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ptl-nocodec-dmic-4ch-96k-ssp0-192k.bin" + # SSP topology for PTL FPGA with lower DMIC IO clock of 19.2MHz, 2ch PDM0 enabled "cavs-nocodec\;sof-ptl-nocodec-fpga-2ch-pdm0\;PLATFORM=ptl,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,\ NHLT_BIN=nhlt-sof-ptl-nocodec-fpga-2ch-pdm0.bin,PASSTHROUGH=true,DMIC_IO_CLK=19200000" @@ -82,6 +92,11 @@ NHLT_BIN=nhlt-sof-ptl-nocodec-fpga-4ch.bin,PASSTHROUGH=true,DMIC_IO_CLK=19200000 PDM1_MIC_B_ENABLE=1,DMIC0_RATE=96000,PREPROCESS_PLUGINS=nhlt,\ NHLT_BIN=nhlt-sof-ptl-nocodec-fpga-dmic-4ch-96k.bin,PASSTHROUGH=true,DMIC_IO_CLK=19200000" +# SSP topology for PTL FPGA, same as previous but with 96 kHz SSP0 +"cavs-nocodec\;sof-ptl-nocodec-fpga-dmic-4ch-96k-ssp0-96k\;PLATFORM=ptl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ +PDM1_MIC_B_ENABLE=1,DMIC0_RATE=96000,SSP0_RATE=96000,PREPROCESS_PLUGINS=nhlt,\ +NHLT_BIN=nhlt-sof-ptl-nocodec-fpga-dmic-4ch-96k-ssp0-96k.bin,PASSTHROUGH=true,DMIC_IO_CLK=19200000" + # Topology for PTL with max98357a and rt5682 "cavs-rt5682\;sof-ptl-max98357a-rt5682-ssp2-ssp0\;PLATFORM=ptl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\ diff --git a/tools/topology/topology2/platform/intel/ssp-default.conf b/tools/topology/topology2/platform/intel/ssp-default.conf new file mode 100644 index 000000000000..cab144bd5da9 --- /dev/null +++ b/tools/topology/topology2/platform/intel/ssp-default.conf @@ -0,0 +1,12 @@ +# Default SSP variable definitions +Define { + SSP0_RATE 48000 + SSP0_BCLK_FREQ 3072000 + SSP0_TDM_SLOT_WIDTH 32 + SSP1_RATE 48000 + SSP1_BCLK_FREQ 3072000 + SSP1_TDM_SLOT_WIDTH 32 + SSP2_RATE 48000 + SSP2_BCLK_FREQ 3072000 + SSP2_TDM_SLOT_WIDTH 32 +}