Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion tools/topology/topology2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,15 @@ else()
endif()
endif()

add_subdirectory(cavs)
# generate ABI for IPC4
add_custom_command(OUTPUT abi.conf
COMMAND > abi.conf ${CMAKE_CURRENT_SOURCE_DIR}/get_abi.sh ${SOF_ROOT_SOURCE_DIRECTORY} "ipc4"
DEPENDS ${SOF_ROOT_SOURCE_DIRECTORY}/src/include/kernel/abi.h
)
add_custom_target(abi_target
DEPENDS abi.conf
)

add_dependencies(topologies2 topology2_cavs topology2_ace)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move these new targets to their corresponding subdirectories to keep them self-contained.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer each child to add itself to the parent but no big deal.

add_subdirectory(avs-tplg)
add_subdirectory(sof-ace-tplg)
52 changes: 52 additions & 0 deletions tools/topology/topology2/avs-tplg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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\;USE_CHAIN_DMA=true"
# CAVS HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI
"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,USE_CHAIN_DMA=true"
# 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,USE_CHAIN_DMA=true"
"sof-hda-generic\;sof-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-hda-generic-4ch.bin,USE_CHAIN_DMA=true"
# CAVS SDW topology with passthrough pipelines
"cavs-sdw\;cavs-sdw"

# CAVS SDW with SRC gain and mixer support
"cavs-sdw-src-gain-mixin\;cavs-sdw-src-gain-mixin"

# SDW + HDMI topology with passthrough pipelines
"cavs-sdw\;cavs-sdw-hdmi\;NUM_HDMIS=4"

# CAVS SSP topology for TGL
"cavs-nocodec\;sof-tgl-nocodec\;NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-nocodec.bin"
)

add_custom_target(topology2_cavs)

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_avs_${output} DEPENDS ${output}.tplg)
add_dependencies(topology2_cavs topology2_avs_${output})
endforeach()
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<searchdir:cavs>
<searchdir:include>
<searchdir:include/common>
<searchdir:include/components>
<searchdir:include/dais>
<searchdir:include/pipelines/cavs>
<searchdir:cavs/platform/intel>
<searchdir:platform/intel>

<vendor-token.conf>
<manifest.conf>
Expand All @@ -24,7 +23,7 @@
<hw_config.conf>
<manifest.conf>
<route.conf>
<cavs/common_definitions.conf>
<common_definitions.conf>
<copier.conf>
<pipeline.conf>
<dai.conf>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<searchdir:cavs>
<searchdir:include>
<searchdir:include/common>
<searchdir:include/components>
Expand All @@ -22,7 +21,7 @@
<hw_config.conf>
<manifest.conf>
<route.conf>
<cavs/common_definitions.conf>
<common_definitions.conf>
<copier.conf>
<pipeline.conf>
<dai.conf>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<searchdir:cavs>
<searchdir:include>
<searchdir:include/common>
<searchdir:include/components>
<searchdir:include/dais>
<searchdir:include/pipelines/cavs>
<searchdir:cavs/platform/intel>
<searchdir:platform/intel>

<vendor-token.conf>
<pdm_config.conf>
Expand All @@ -26,7 +25,7 @@
<hw_config.conf>
<manifest.conf>
<route.conf>
<cavs/common_definitions.conf>
<common_definitions.conf>
<copier.conf>
<pipeline.conf>
<dai.conf>
Expand Down
80 changes: 0 additions & 80 deletions tools/topology/topology2/cavs/CMakeLists.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#
# Where N is the unique pipeline ID within the same alsaconf node.
#
<cavs/common_definitions.conf>
<common_definitions.conf>
<include/common/audio_format.conf>
<include/components/copier.conf>
<include/components/gain.conf>
Expand Down
53 changes: 53 additions & 0 deletions tools/topology/topology2/sof-ace-tplg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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\;USE_CHAIN_DMA=true"
# HDA topology with mixer-based pipelines for HDA and passthrough pipelines for HDMI
"sof-hda-generic\;sof-hda-generic\;HDA_CONFIG=mix,USE_CHAIN_DMA=true"
# 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"

# SDW topology with passthrough pipelines
"cavs-sdw\;mtl-sdw"

# SDW + HDMI topology with passthrough pipelines
"cavs-sdw\;mtl-sdw-hdmi\;NUM_HDMIS=4"

# SDW + DMIC topology with passthrough pipelines
"cavs-sdw\;mtl-sdw-dmic\;NUM_DMICS=4,DMIC0_ID=2,DMIC1_ID=3,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-mtl-sdw-dmic.bin"

# SSP topology for MTL
"cavs-nocodec\;sof-mtl-nocodec\;PLATFORM=mtl,NUM_DMICS=2,\
PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-nocodec.bin"
)

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()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<searchdir:include/components>
<searchdir:include/dais>
<searchdir:include/pipelines/cavs>
<searchdir:cavs/platform/intel>
<searchdir:platform/intel>

<vendor-token.conf>
<tokens.conf>
Expand All @@ -26,7 +26,7 @@
<hw_config.conf>
<manifest.conf>
<route.conf>
<cavs/common_definitions.conf>
<common_definitions.conf>
<dmic-default.conf>
<hdmi-default.conf>

Expand Down