diff --git a/tools/topology/topology2/README.md b/tools/topology/topology2/README.md index 7148397f1d10..216bf57ba092 100644 --- a/tools/topology/topology2/README.md +++ b/tools/topology/topology2/README.md @@ -453,6 +453,23 @@ ACPI when selecting and loading the corresponding topology. Function topologies are intended to be reusable across devices that provide the same function. Please do not add any customized feature in the function topology. +`sof-hda-generic.conf` builds the HDA function topologies the same way `cavs-sdw.conf` builds the +`sof-sdca-*` ones: one conf, and macros that enable a single function and disable the others. + +| Function | Enable | Disable | +|---|---|---| +| HDA codec | `HDA_CONFIG=mix` (or `efx`, `src`, `dax`, `passthrough`) | `HDA_CONFIG=none` (default) | +| HDMI/DP (iDisp) | `NUM_HDMIS=3` (default) | `NUM_HDMIS=0` | +| PCH DMIC | `NUM_DMICS=1..4` | `NUM_DMICS=0` (default) | +| HDMI-IN (SSP) | `HDMI_IN_CAPTURE=true` | `HDMI_IN_CAPTURE=false` (default) | +| Bluetooth (SSP) | `ADD_BT=true` | `ADD_BT=false` (default) | + +The virtual widgets follow their function, so a disabled function leaves none behind. The +function topologies are the `sof---id` targets (see `sof_hda_get_tplg_files()`; +the HDA codec and HDMI ones have no NHLT blob and no ``) in +`production/tplg-targets-hda-generic.cmake`. They are loaded next to each other, so choose +non-overlapping PCM and pipeline IDs for each of them. + ### Registering CMake Targets Production topologies are registered in `production/tplg-targets-*.cmake` files. Each diff --git a/tools/topology/topology2/platform/intel/hda-codec-widgets.conf b/tools/topology/topology2/platform/intel/hda-codec-widgets.conf new file mode 100644 index 000000000000..f3beb507dfe6 --- /dev/null +++ b/tools/topology/topology2/platform/intel/hda-codec-widgets.conf @@ -0,0 +1,64 @@ +# Virtual widgets of the HDA codec DAPM widgets, used by the HDA function +# of sof-hda-generic.conf +Object.Widget.virtual [ + { + name 'codec0_in' + type input + index 1 + } + { + name 'codec1_in' + type input + index 2 + } + { + name 'codec0_out' + type output + index 3 + } + { + name 'codec1_out' + type output + index 4 + } + { + name 'codec2_in' + type input + index 5 + } + { + name 'codec2_out' + type output + index 6 + } + { + name 'Analog CPU Playback' + type out_drv + index 3 + } + { + name 'Digital CPU Playback' + type out_drv + index 4 + } + { + name 'Alt Analog CPU Playback' + type out_drv + index 5 + } + { + name 'Analog CPU Capture' + type input + index 6 + } + { + name 'Digital CPU Capture' + type input + index 7 + } + { + name 'Alt Analog CPU Capture' + type input + index 8 + } +] diff --git a/tools/topology/topology2/production/tplg-targets-hda-generic.cmake b/tools/topology/topology2/production/tplg-targets-hda-generic.cmake index 72872d110a4d..160356aefef6 100644 --- a/tools/topology/topology2/production/tplg-targets-hda-generic.cmake +++ b/tools/topology/topology2/production/tplg-targets-hda-generic.cmake @@ -123,4 +123,133 @@ EFX_DMIC0_TDFB_PARAMS=line4_pass,EFX_DMIC0_DRC_PARAMS=dmic_default" PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-ace3-2ch-dax.bin,\ DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,\ EFX_DMIC0_DRC_PARAMS=dmic_default,DOLBY_DAX_CORE_ID=1" + +# Platform independent function topologies, shared by all platforms. The HDA +# codec and HDMI topologies have no NHLT blob, so sof_hda_get_tplg_files() in +# the Linux kernel requests them without a platform in the name. +"sof-hda-generic\;sof-hda-id4\;HDA_CONFIG=mix,NUM_HDMIS=0,\ +HDA_MIC_ENHANCED_CAPTURE=true,EFX_HDA_MIC_TDFB_PARAMS=line2_pass,\ +EFX_HDA_MIC_DRC_PARAMS=passthrough" + +"sof-hda-generic\;sof-hdmi-pcm3-id1\;PLATFORM=ptl" + +# Function topologies, ACE1, named the way sof_hda_get_tplg_files() in the Linux +# kernel requests them. Each one enables a single function of +# sof-hda-generic.conf and disables the others (HDA_CONFIG=none, NUM_DMICS=0, +# NUM_HDMIS=0, HDMI_IN_CAPTURE=false, ADD_BT=false), the way the sof-sdca-* +# topologies do with cavs-sdw.conf. They are loaded next to each other, so +# their PCM and pipeline IDs must not collide. +"sof-hda-generic\;sof-mtl-dmic-2ch-id6\;PLATFORM=mtl,NUM_HDMIS=0,NUM_DMICS=2,\ +DMIC0_HOST_PIPELINE_ID=100,DMIC0_DAI_PIPELINE_ID=101,\ +DMIC0_DAI_PIPELINE_SRC=module-copier.101.2,\ +DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,\ +EFX_DMIC0_DRC_PARAMS=dmic_default" + +"sof-hda-generic\;sof-mtl-dmic-4ch-id6\;PLATFORM=mtl,NUM_HDMIS=0,NUM_DMICS=4,\ +DMIC0_HOST_PIPELINE_ID=100,DMIC0_DAI_PIPELINE_ID=101,\ +DMIC0_DAI_PIPELINE_SRC=module-copier.101.2,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line4_pass,\ +EFX_DMIC0_DRC_PARAMS=dmic_default" + +"sof-hda-generic\;sof-mtl-ssp6-hdmiin-id14\;PLATFORM=mtl,NUM_HDMIS=0,\ +HDMI_IN_CAPTURE=true,HDMI_IN_1_INDEX=1,HDMI_IN_2_INDEX=2,HDMI_IN_1_NAME=SSP1-HDMI,\ +HDMI_IN_1_ID=13,HDMI_IN_2_ID=14,\ +HDMI_IN_1_CP_HOST_PIPELINE_ID=210,HDMI_IN_1_CP_DAI_PIPELINE_ID=211,\ +HDMI_IN_2_CP_HOST_PIPELINE_ID=212,HDMI_IN_2_CP_DAI_PIPELINE_ID=213,\ +HDMI_IN_1_PCM_ID=7,HDMI_IN_2_PCM_ID=8" + +"sof-hda-generic\;sof-mtl-ssp2-bt-id8\;PLATFORM=mtl,NUM_HDMIS=0,ADD_BT=true,BT_DEEP_BUFFER=true,\ +BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,\ +BT_PB_HOST_PIPELINE_ID=200,BT_PB_DAI_PIPELINE_ID=201,BT_CP_HOST_PIPELINE_ID=202,BT_CP_DAI_PIPELINE_ID=203" + +# Function topologies, ACE3, named the way sof_hda_get_tplg_files() in the Linux +# kernel requests them. Each one enables a single function of +# sof-hda-generic.conf and disables the others (HDA_CONFIG=none, NUM_DMICS=0, +# NUM_HDMIS=0, HDMI_IN_CAPTURE=false, ADD_BT=false), the way the sof-sdca-* +# topologies do with cavs-sdw.conf. They are loaded next to each other, so +# their PCM and pipeline IDs must not collide. +"sof-hda-generic\;sof-ptl-dmic-2ch-id6\;PLATFORM=ptl,NUM_HDMIS=0,NUM_DMICS=2,\ +DMIC0_HOST_PIPELINE_ID=100,DMIC0_DAI_PIPELINE_ID=101,\ +DMIC0_DAI_PIPELINE_SRC=module-copier.101.2,\ +DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,\ +EFX_DMIC0_DRC_PARAMS=dmic_default" + +"sof-hda-generic\;sof-ptl-dmic-4ch-id6\;PLATFORM=ptl,NUM_HDMIS=0,NUM_DMICS=4,\ +DMIC0_HOST_PIPELINE_ID=100,DMIC0_DAI_PIPELINE_ID=101,\ +DMIC0_DAI_PIPELINE_SRC=module-copier.101.2,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line4_pass,\ +EFX_DMIC0_DRC_PARAMS=dmic_default" + +"sof-hda-generic\;sof-ptl-ssp6-hdmiin-id14\;PLATFORM=ptl,NUM_HDMIS=0,\ +HDMI_IN_CAPTURE=true,HDMI_IN_1_INDEX=1,HDMI_IN_2_INDEX=2,HDMI_IN_1_NAME=SSP1-HDMI,\ +HDMI_IN_1_ID=13,HDMI_IN_2_ID=14,\ +HDMI_IN_1_CP_HOST_PIPELINE_ID=210,HDMI_IN_1_CP_DAI_PIPELINE_ID=211,\ +HDMI_IN_2_CP_HOST_PIPELINE_ID=212,HDMI_IN_2_CP_DAI_PIPELINE_ID=213,\ +HDMI_IN_1_PCM_ID=7,HDMI_IN_2_PCM_ID=8" + +# Function topologies, ACE2 (LNL), named the way sof_hda_get_tplg_files() in the Linux +# kernel requests them. See the ACE1 ones above. +"sof-hda-generic\;sof-lnl-dmic-2ch-id6\;PLATFORM=lnl,NUM_HDMIS=0,NUM_DMICS=2,\ +DMIC0_HOST_PIPELINE_ID=100,DMIC0_DAI_PIPELINE_ID=101,\ +DMIC0_DAI_PIPELINE_SRC=module-copier.101.2,\ +DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,\ +EFX_DMIC0_DRC_PARAMS=dmic_default" + +"sof-hda-generic\;sof-lnl-dmic-4ch-id6\;PLATFORM=lnl,NUM_HDMIS=0,NUM_DMICS=4,\ +DMIC0_HOST_PIPELINE_ID=100,DMIC0_DAI_PIPELINE_ID=101,\ +DMIC0_DAI_PIPELINE_SRC=module-copier.101.2,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line4_pass,\ +EFX_DMIC0_DRC_PARAMS=dmic_default" + +"sof-hda-generic\;sof-lnl-ssp2-bt-id8\;PLATFORM=lnl,NUM_HDMIS=0,ADD_BT=true,BT_DEEP_BUFFER=true,\ +BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,\ +BT_PB_HOST_PIPELINE_ID=200,BT_PB_DAI_PIPELINE_ID=201,BT_CP_HOST_PIPELINE_ID=202,BT_CP_DAI_PIPELINE_ID=203" + +"sof-hda-generic\;sof-lnl-ssp6-hdmiin-id14\;PLATFORM=lnl,NUM_HDMIS=0,\ +HDMI_IN_CAPTURE=true,HDMI_IN_1_INDEX=1,HDMI_IN_2_INDEX=2,HDMI_IN_1_NAME=SSP1-HDMI,\ +HDMI_IN_1_ID=13,HDMI_IN_2_ID=14,\ +HDMI_IN_1_CP_HOST_PIPELINE_ID=210,HDMI_IN_1_CP_DAI_PIPELINE_ID=211,\ +HDMI_IN_2_CP_HOST_PIPELINE_ID=212,HDMI_IN_2_CP_DAI_PIPELINE_ID=213,\ +HDMI_IN_1_PCM_ID=7,HDMI_IN_2_PCM_ID=8" + +# Function topologies, ACE4 (NVL), named the way sof_hda_get_tplg_files() in the Linux +# kernel requests them. See the ACE1 ones above. +"sof-hda-generic\;sof-nvl-dmic-2ch-id6\;PLATFORM=nvl,NUM_HDMIS=0,NUM_DMICS=2,\ +DMIC0_HOST_PIPELINE_ID=100,DMIC0_DAI_PIPELINE_ID=101,\ +DMIC0_DAI_PIPELINE_SRC=module-copier.101.2,\ +DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line2_generic_pm10deg,\ +EFX_DMIC0_DRC_PARAMS=dmic_default" + +"sof-hda-generic\;sof-nvl-dmic-4ch-id6\;PLATFORM=nvl,NUM_HDMIS=0,NUM_DMICS=4,\ +DMIC0_HOST_PIPELINE_ID=100,DMIC0_DAI_PIPELINE_ID=101,\ +DMIC0_DAI_PIPELINE_SRC=module-copier.101.2,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +DMIC0_ENHANCED_CAPTURE=true,EFX_DMIC0_TDFB_PARAMS=line4_pass,\ +EFX_DMIC0_DRC_PARAMS=dmic_default" + +"sof-hda-generic\;sof-nvl-ssp2-bt-id8\;PLATFORM=nvl,NUM_HDMIS=0,ADD_BT=true,BT_DEEP_BUFFER=true,\ +BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,\ +BT_PB_HOST_PIPELINE_ID=200,BT_PB_DAI_PIPELINE_ID=201,BT_CP_HOST_PIPELINE_ID=202,BT_CP_DAI_PIPELINE_ID=203" + +"sof-hda-generic\;sof-nvl-ssp6-hdmiin-id14\;PLATFORM=nvl,NUM_HDMIS=0,\ +HDMI_IN_CAPTURE=true,HDMI_IN_1_INDEX=1,HDMI_IN_2_INDEX=2,HDMI_IN_1_NAME=SSP1-HDMI,\ +HDMI_IN_1_ID=13,HDMI_IN_2_ID=14,\ +HDMI_IN_1_CP_HOST_PIPELINE_ID=210,HDMI_IN_1_CP_DAI_PIPELINE_ID=211,\ +HDMI_IN_2_CP_HOST_PIPELINE_ID=212,HDMI_IN_2_CP_DAI_PIPELINE_ID=213,\ +HDMI_IN_1_PCM_ID=7,HDMI_IN_2_PCM_ID=8" +) + +list(APPEND SYMLINKS +# ARL and WCL use the MTL and PTL HDA function topologies +"sof-arl-dmic-2ch-id6\;sof-mtl-dmic-2ch-id6" +"sof-arl-dmic-4ch-id6\;sof-mtl-dmic-4ch-id6" +"sof-arl-ssp2-bt-id8\;sof-mtl-ssp2-bt-id8" +"sof-arl-ssp6-hdmiin-id14\;sof-mtl-ssp6-hdmiin-id14" +"sof-wcl-dmic-2ch-id6\;sof-ptl-dmic-2ch-id6" +"sof-wcl-dmic-4ch-id6\;sof-ptl-dmic-4ch-id6" +"sof-wcl-ssp2-bt-id8\;sof-ptl-ssp2-bt-id8" +"sof-wcl-ssp6-hdmiin-id14\;sof-ptl-ssp6-hdmiin-id14" ) diff --git a/tools/topology/topology2/sof-hda-generic.conf b/tools/topology/topology2/sof-hda-generic.conf index 968d46373b84..45276e496922 100644 --- a/tools/topology/topology2/sof-hda-generic.conf +++ b/tools/topology/topology2/sof-hda-generic.conf @@ -57,6 +57,7 @@ + Define { HDA_CONFIG "none" @@ -76,6 +77,7 @@ IncludeByKey.PLATFORM { "mtl" "platform/intel/mtl.conf" "lnl" "platform/intel/lnl.conf" "ptl" "platform/intel/ptl.conf" + "nvl" "platform/intel/ptl.conf" # Note: Assume same configuration as PTL } IncludeByKey.ADD_BT { @@ -84,11 +86,31 @@ IncludeByKey.ADD_BT { # include HDA config if needed. IncludeByKey.HDA_CONFIG { - "mix" "cavs-mixin-mixout-hda.conf" - "efx" "cavs-mixin-mixout-efx-hda.conf" - "src" "cavs-src-mixin-mixout-hda.conf" - "dax" "cavs-mixin-mixout-dax-hda.conf" - "passthrough" "cavs-passthrough-hda.conf" + # Without the HDA function the HDA confs do not bring in the TDFB class + # that the DMIC function uses + "none" { + + } + "mix" { + + + } + "efx" { + + + } + "src" { + + + } + "dax" { + + + } + "passthrough" { + + + } } # include DMIC config if needed. @@ -108,102 +130,44 @@ Define { } IncludeByKey.NUM_HDMIS { -"[3-4]" "platform/intel/hdmi-generic.conf" + "[3-4]" { + + # iDisp widgets, present only when the HDMI function is enabled + Object.Widget.virtual [ + { + name 'iDisp1_out' + type output + index 7 + } + { + name 'iDisp2_out' + type output + index 8 + } + { + name 'iDisp3_out' + type output + index 9 + } + { + name 'iDisp3 Tx' + type out_drv + index 0 + } + { + name 'iDisp2 Tx' + type out_drv + index 1 + } + { + name 'iDisp1 Tx' + type out_drv + index 2 + } + ] + } } IncludeByKey.HDMI_IN_CAPTURE { "true" "platform/intel/hdmi-in-capture.conf" } - -Object.Widget.virtual [ - { - name 'codec0_in' - type input - index 1 - } - { - name 'codec1_in' - type input - index 2 - } - { - name 'codec0_out' - type output - index 3 - } - { - name 'codec1_out' - type output - index 4 - } - { - name 'codec2_in' - type input - index 5 - } - { - name 'codec2_out' - type output - index 6 - } - { - name 'iDisp1_out' - type output - index 7 - } - { - name 'iDisp2_out' - type output - index 8 - } - { - name 'iDisp3_out' - type output - index 9 - } - { - name 'iDisp3 Tx' - type out_drv - index 0 - } - { - name 'iDisp2 Tx' - type out_drv - index 1 - } - { - name 'iDisp1 Tx' - type out_drv - index 2 - } - { - name 'Analog CPU Playback' - type out_drv - index 3 - } - { - name 'Digital CPU Playback' - type out_drv - index 4 - } - { - name 'Alt Analog CPU Playback' - type out_drv - index 5 - } - { - name 'Analog CPU Capture' - type input - index 6 - } - { - name 'Digital CPU Capture' - type input - index 7 - } - { - name 'Alt Analog CPU Capture' - type input - index 8 - } -]