diff --git a/tools/topology/topology2/CMakeLists.txt b/tools/topology/topology2/CMakeLists.txt index b2742b956dff..2a1ee5483e7e 100644 --- a/tools/topology/topology2/CMakeLists.txt +++ b/tools/topology/topology2/CMakeLists.txt @@ -3,7 +3,15 @@ # 3.17 required: foreach(... IN ZIP_LISTS ) cmake_minimum_required(VERSION 3.17) -add_custom_target(topologies2) +add_custom_target(topologies2 ALL + # Create directory structure to be provided for deployment + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ipc4-tplg + COMMAND ${CMAKE_COMMAND} -E create_symlink sof-ipc4-tplg ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ace-tplg + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/target/development + # copy the topology files only to target + COMMAND ${CMAKE_COMMAND} -E copy_if_different production/*.tplg ${CMAKE_CURRENT_BINARY_DIR}/target/sof-ipc4-tplg/ + COMMAND ${CMAKE_COMMAND} -E copy_if_different development/*.tplg ${CMAKE_CURRENT_BINARY_DIR}/target/development/ +) # Check alsatplg version and build topology2 if alsatplg version is # 1.2.7 or greater, see https://github.com/thesofproject/sof/issues/5323 @@ -29,7 +37,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_prod) add_subdirectory(development) -add_subdirectory(sof-ace-tplg) +add_subdirectory(production) diff --git a/tools/topology/topology2/avs-tplg/CMakeLists.txt b/tools/topology/topology2/production/CMakeLists.txt similarity index 72% rename from tools/topology/topology2/avs-tplg/CMakeLists.txt rename to tools/topology/topology2/production/CMakeLists.txt index 3dd21c511d89..fbaff16bb5bb 100644 --- a/tools/topology/topology2/avs-tplg/CMakeLists.txt +++ b/tools/topology/topology2/production/CMakeLists.txt @@ -1,8 +1,11 @@ # SPDX-License-Identifier: BSD-3-Clause -include(tplg-targets.cmake) +include(tplg-targets-cavs25.cmake) +include(tplg-targets-ace.cmake) +include(tplg-targets-hda-generic.cmake) -add_custom_target(topology2_cavs) + +add_custom_target(topology2_prod) 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_prod topology2_${output}) endforeach() diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/production/tplg-targets-ace.cmake similarity index 90% rename from tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake rename to tools/topology/topology2/production/tplg-targets-ace.cmake index 866163d8b001..fbdab3c49863 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/production/tplg-targets-ace.cmake @@ -1,21 +1,15 @@ # 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\;DEEPBUFFER_FW_DMA_MS=100,\ -DEEPBUFFER_D0I3_COMPATIBLE=true" -# HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI -"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100,\ -DEEPBUFFER_D0I3_COMPATIBLE=true" +list(APPEND TPLGS # 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,\ +"sof-hda-generic\;sof-hda-generic-ace1-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,DEEPBUFFER_FW_DMA_MS=100,\ +NHLT_BIN=nhlt-sof-hda-generic-ace1-4ch.bin,DEEPBUFFER_FW_DMA_MS=100,\ DEEPBUFFER_D0I3_COMPATIBLE=true" -"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,\ +"sof-hda-generic\;sof-hda-generic-ace1-2ch\;PLATFORM=mtl,\ +HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-ace1-2ch.bin,\ DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" # SDW + DMIC topology with passthrough pipelines diff --git a/tools/topology/topology2/avs-tplg/tplg-targets.cmake b/tools/topology/topology2/production/tplg-targets-cavs25.cmake similarity index 85% rename from tools/topology/topology2/avs-tplg/tplg-targets.cmake rename to tools/topology/topology2/production/tplg-targets-cavs25.cmake index 5dffcab26004..2c23c1b21e03 100644 --- a/tools/topology/topology2/avs-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/production/tplg-targets-cavs25.cmake @@ -1,18 +1,15 @@ # 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\;DEEPBUFFER_FW_DMA_MS=100" -# CAVS HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI -"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100" +list(APPEND TPLGS + # 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-cavs25-2ch\;\ +HDA_CONFIG=mix,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-cavs25-2ch.bin,\ DEEPBUFFER_FW_DMA_MS=100" -"sof-hda-generic\;sof-hda-generic-4ch\;\ -HDA_CONFIG=mix,NUM_DMICS=4,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-4ch.bin,\ +"sof-hda-generic\;sof-hda-generic-cavs25-4ch\;\ +HDA_CONFIG=mix,NUM_DMICS=4,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-generic-cavs25-4ch.bin,\ DEEPBUFFER_FW_DMA_MS=100,\ PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1" diff --git a/tools/topology/topology2/production/tplg-targets-hda-generic.cmake b/tools/topology/topology2/production/tplg-targets-hda-generic.cmake new file mode 100644 index 000000000000..063901d6d0f0 --- /dev/null +++ b/tools/topology/topology2/production/tplg-targets-hda-generic.cmake @@ -0,0 +1,18 @@ + +list(APPEND TPLGS +# HDMI only topology with passthrough pipelines +"sof-hda-generic\;sof-hda-generic-idisp\;DEEPBUFFER_FW_DMA_MS=100,\ +DEEPBUFFER_D0I3_COMPATIBLE=true" +# HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI +"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,DEEPBUFFER_FW_DMA_MS=100,\ +DEEPBUFFER_D0I3_COMPATIBLE=true" + +# 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,\ +DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" +"sof-hda-generic\;sof-hda-generic-4ch\;HDA_CONFIG=mix,NUM_DMICS=4,\ +DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true,\ +PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1" +) 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()