From 289e77bb8de9772e026a8d154d0ec15bf621d913 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 4 Jan 2024 14:19:00 +0200 Subject: [PATCH] topology2: Merge avs-tplg and sof-ace-tplg under sof-ipc4-tplg Merge the avs-tplg and sof-ace-tplg under a common sof-ipc4-tplg target. This will follow the sof-docs specification, see link. The sof-hda-generic-2/4ch.tplg will be generated without embedded NHLT as it is not used under normal circumstance. Two flavor of the generic topology is generated for CAVS2.5 and ACE1/2 with included NHLT binary in case it is used by existing users, but it is unlikely. As noted in the documentation, on the deployed system a symlink is needed for ACE1/2 platforms for backwards compatibility: sof-ace-tplg -> sof-ipc4-tplg Link: https://github.com/thesofproject/sof-docs/blob/master/getting_started/intel_debug/introduction.rst#2-topology-file Signed-off-by: Peter Ujfalusi --- tools/topology/topology2/CMakeLists.txt | 5 +-- .../topology2/sof-ace-tplg/CMakeLists.txt | 27 -------------- .../CMakeLists.txt | 11 ++++-- .../tplg-targets-ace1.cmake} | 25 +------------ .../sof-ipc4-tplg/tplg-targets-ace2.cmake | 15 ++++++++ .../tplg-targets-cavs25.cmake} | 14 +------ .../tplg-targets-hda-generic.cmake | 37 +++++++++++++++++++ 7 files changed, 63 insertions(+), 71 deletions(-) delete mode 100644 tools/topology/topology2/sof-ace-tplg/CMakeLists.txt rename tools/topology/topology2/{avs-tplg => sof-ipc4-tplg}/CMakeLists.txt (70%) rename tools/topology/topology2/{sof-ace-tplg/tplg-targets.cmake => sof-ipc4-tplg/tplg-targets-ace1.cmake} (78%) create mode 100644 tools/topology/topology2/sof-ipc4-tplg/tplg-targets-ace2.cmake rename tools/topology/topology2/{avs-tplg/tplg-targets.cmake => sof-ipc4-tplg/tplg-targets-cavs25.cmake} (75%) create mode 100644 tools/topology/topology2/sof-ipc4-tplg/tplg-targets-hda-generic.cmake diff --git a/tools/topology/topology2/CMakeLists.txt b/tools/topology/topology2/CMakeLists.txt index b2742b956dff..a995119a255f 100644 --- a/tools/topology/topology2/CMakeLists.txt +++ b/tools/topology/topology2/CMakeLists.txt @@ -29,7 +29,6 @@ add_custom_target(abi_target DEPENDS abi.conf ) -add_dependencies(topologies2 topology2_cavs topology2_ace topology2_dev) -add_subdirectory(avs-tplg) +add_dependencies(topologies2 topology2_dev topology2) add_subdirectory(development) -add_subdirectory(sof-ace-tplg) +add_subdirectory(sof-ipc4-tplg) diff --git a/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt b/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt deleted file mode 100644 index 2e512cd14e56..000000000000 --- a/tools/topology/topology2/sof-ace-tplg/CMakeLists.txt +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -include(tplg-targets.cmake) - -add_custom_target(topology2_ace) - -foreach(tplg ${TPLGS}) - set(defines "") - list(LENGTH tplg length) - list(GET tplg 0 input) - list(GET tplg 1 output) - - math(EXPR last_index "${length}-1") - - # Get the pre-processor definitions from the 3rd item in the list for each topology - # ex: "hda-generic\;hda-generic-2ch\;HDA_CONFIG=gain,DMIC_CH=2", "defines" would contain "HDA_CONFIG=gain,DMIC_CH=2" - if (${last_index} EQUAL 2) - list(GET tplg ${last_index} defines) - endif() - - add_alsatplg2_command("${CMAKE_CURRENT_BINARY_DIR}/../abi.conf" abi_target - "${CMAKE_CURRENT_SOURCE_DIR}/../${input}" "${output}" - "${CMAKE_CURRENT_SOURCE_DIR}/../" "${defines}") - - add_custom_target(topology2_ace_${output} DEPENDS ${output}.tplg) - add_dependencies(topology2_ace topology2_ace_${output}) -endforeach() diff --git a/tools/topology/topology2/avs-tplg/CMakeLists.txt b/tools/topology/topology2/sof-ipc4-tplg/CMakeLists.txt similarity index 70% rename from tools/topology/topology2/avs-tplg/CMakeLists.txt rename to tools/topology/topology2/sof-ipc4-tplg/CMakeLists.txt index 3dd21c511d89..0463574b3268 100644 --- a/tools/topology/topology2/avs-tplg/CMakeLists.txt +++ b/tools/topology/topology2/sof-ipc4-tplg/CMakeLists.txt @@ -1,8 +1,11 @@ # SPDX-License-Identifier: BSD-3-Clause -include(tplg-targets.cmake) +include(tplg-targets-hda-generic.cmake) +include(tplg-targets-cavs25.cmake) +include(tplg-targets-ace1.cmake) +include(tplg-targets-ace2.cmake) -add_custom_target(topology2_cavs) +add_custom_target(topology2) foreach(tplg ${TPLGS}) set(defines "") @@ -22,6 +25,6 @@ foreach(tplg ${TPLGS}) "${CMAKE_CURRENT_SOURCE_DIR}/../${input}" "${output}" "${CMAKE_CURRENT_SOURCE_DIR}/../" "${defines}") - add_custom_target(topology2_avs_${output} DEPENDS ${output}.tplg) - add_dependencies(topology2_cavs topology2_avs_${output}) + add_custom_target(topology2_${output} DEPENDS ${output}.tplg) + add_dependencies(topology2 topology2_${output}) endforeach() diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-ace1.cmake similarity index 78% rename from tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake rename to tools/topology/topology2/sof-ipc4-tplg/tplg-targets-ace1.cmake index be4bf922a86f..46927ef29b3e 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-ace1.cmake @@ -1,19 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Array of "input-file-name;output-file-name;comma separated pre-processor variables" -set(TPLGS -# HDMI only topology with passthrough pipelines -"sof-hda-generic\;sof-hda-generic-idisp\;" -# HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI -"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix" -# If the alsatplg plugins for NHLT are not available, the NHLT blobs will not be added to the -# topologies below. -"sof-hda-generic\;sof-hda-generic-4ch\;PLATFORM=mtl,\ -HDA_CONFIG=mix,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,PREPROCESS_PLUGINS=nhlt,\ -NHLT_BIN=nhlt-sof-hda-generic-4ch.bin" -"sof-hda-generic\;sof-hda-generic-2ch\;PLATFORM=mtl,\ -HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-2ch.bin" - +list(APPEND TPLGS # SDW + DMIC topology with passthrough pipelines # We will change NUM_HDMIS to 3 once HDMI is enabled on MTL RVP "cavs-sdw\;sof-mtl-rt711-4ch\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ @@ -91,15 +79,4 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2.bin,\ BT_NAME=SSP1-BT,BT_INDEX=1,BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,ADD_BT=true,\ NUM_SDW_AMP_LINKS=1,SDW_SPK_STREAM=SDW2-Playback,SDW_AMP_FEEDBACK=false,\ SDW_JACK_CAPTURE_CH=1" - -# SDW topology for LNL RVP -"cavs-sdw\;sof-lnl-rt711-4ch\;PLATFORM=lnl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ -DMIC0_ID=2,DMIC1_ID=3,NUM_HDMIS=0,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-rt711-4ch.bin" - -"cavs-sdw\;sof-lnl-rt711-l0-rt1316-l23-rt714-l1\;PLATFORM=lnl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ -NUM_HDMIS=0,SDW_SPK_STREAM=SDW2-Playback,SDW_SPK_IN_STREAM=SDW2-Capture,SDW_DMIC_STREAM=SDW1-Capture" - -"cavs-sdw\;sof-lnl-rt712-l2-rt1712-l3\;PLATFORM=lnl,SDW_DMIC=1,NUM_HDMIS=0,NUM_SDW_AMP_LINKS=1,\ -SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ -SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" ) diff --git a/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-ace2.cmake b/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-ace2.cmake new file mode 100644 index 000000000000..9c97e7135367 --- /dev/null +++ b/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-ace2.cmake @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: BSD-3-Clause + +# Array of "input-file-name;output-file-name;comma separated pre-processor variables" +list(APPEND TPLGS +# SDW topology for LNL RVP +"cavs-sdw\;sof-lnl-rt711-4ch\;PLATFORM=lnl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +DMIC0_ID=2,DMIC1_ID=3,NUM_HDMIS=0,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-rt711-4ch.bin" + +"cavs-sdw\;sof-lnl-rt711-l0-rt1316-l23-rt714-l1\;PLATFORM=lnl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ +NUM_HDMIS=0,SDW_SPK_STREAM=SDW2-Playback,SDW_SPK_IN_STREAM=SDW2-Capture,SDW_DMIC_STREAM=SDW1-Capture" + +"cavs-sdw\;sof-lnl-rt712-l2-rt1712-l3\;PLATFORM=lnl,SDW_DMIC=1,NUM_HDMIS=0,NUM_SDW_AMP_LINKS=1,\ +SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ +SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" +) diff --git a/tools/topology/topology2/avs-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-cavs25.cmake similarity index 75% rename from tools/topology/topology2/avs-tplg/tplg-targets.cmake rename to tools/topology/topology2/sof-ipc4-tplg/tplg-targets-cavs25.cmake index 541ecbdd758b..b83fabd928a5 100644 --- a/tools/topology/topology2/avs-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-cavs25.cmake @@ -1,19 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Array of "input-file-name;output-file-name;comma separated pre-processor variables" -set(TPLGS -# CAVS HDMI only topology with passthrough pipelines -"sof-hda-generic\;sof-hda-generic-idisp\;" -# CAVS HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI -"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix" -# If the alsatplg plugins for NHLT are not available, the NHLT blobs will not be added to the -# topologies below. -"sof-hda-generic\;sof-hda-generic-2ch\;\ -HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-2ch.bin" -"sof-hda-generic\;sof-hda-generic-4ch\;\ -HDA_CONFIG=mix,NUM_DMICS=4,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch.bin,\ -PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1" - +list(APPEND TPLGS # IPC4 topology for TGL rt711 Headset + rt1316 Amplifier + rt714 DMIC "cavs-sdw\;sof-tgl-rt711-rt1316-rt714\;NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-rt711-rt1316-rt714.bin" diff --git a/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-hda-generic.cmake b/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-hda-generic.cmake new file mode 100644 index 000000000000..3d7ac62a2461 --- /dev/null +++ b/tools/topology/topology2/sof-ipc4-tplg/tplg-targets-hda-generic.cmake @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: BSD-3-Clause + +# Array of "input-file-name;output-file-name;comma separated pre-processor variables" +list(APPEND TPLGS +# HDMI only topology with passthrough pipelines +"sof-hda-generic\;sof-hda-generic-idisp\;" +# HDA topology with mixer-based pipelines for HDA and +# passthrough pipelines for HDMI +"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix" +# HDA topology with mixer-based pipelines for HDA and +# passthrough pipelines for HDMI and +# 2 or 4 DMIC, no NHLT blob included in topology +"sof-hda-generic\;sof-hda-generic-2ch\;HDA_CONFIG=mix,NUM_DMICS=2" +"sof-hda-generic\;sof-hda-generic-4ch\;HDA_CONFIG=mix,NUM_DMICS=4,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1" + +# HDA topology with mixer-based pipelines for HDA and +# passthrough pipelines for HDMI and +# 2 or 4 DMIC, no NHLT blob included in topology + +# Note: If the alsatplg plugins for NHLT are not available, the NHLT blobs will +# not be added to the topologies below. + +# Topologies for CAVS2.5 architecture +"sof-hda-generic\;sof-cavs25-nhlt-hda-generic-2ch\;HDA_CONFIG=mix,NUM_DMICS=2,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-cavs25-nhlt-hda-generic-2ch.bin" +"sof-hda-generic\;sof-cavs25-nhlt-hda-generic-4ch\;HDA_CONFIG=mix,NUM_DMICS=4,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-cavs25-nhlt-hda-generic-4ch.bin" + +# Topologies for ACE1 and ACE2 architectures +"sof-hda-generic\;sof-ace1-nhlt-hda-generic-2ch\;PLATFORM=mtl,HDA_CONFIG=mix,NUM_DMICS=2,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ace1-nhlt-hda-generic-2ch.bin" +"sof-hda-generic\;sof-ace1-nhlt-hda-generic-4ch\;PLATFORM=mtl,HDA_CONFIG=mix,NUM_DMICS=4,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-ace1-nhlt-hda-generic-4ch.bin" +)