Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UUID tplg support #2919

Merged
merged 18 commits into from
Aug 13, 2020
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
2 changes: 1 addition & 1 deletion tools/test/topology/test-all.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#

# Include topology builder
include(`utils.m4')
include(`dai.m4')
include(`ssp.m4')
include(`utils.m4')
include(`pipeline.m4')

# Include TLV library
Expand Down
2 changes: 1 addition & 1 deletion tools/test/topology/test-capture.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#

# Include topology builder
include(`utils.m4')
include(`dai.m4')
include(`ssp.m4')
include(`dmic.m4')
include(`utils.m4')
include(`pipeline.m4')

# Include TLV library
Expand Down
2 changes: 1 addition & 1 deletion tools/test/topology/test-playback.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#

# Include topology builder
include(`utils.m4')
include(`pipeline.m4')
include(`dai.m4')
include(`ssp.m4')
include(`utils.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down
12 changes: 12 additions & 0 deletions tools/topology/m4/asrc.m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
divert(-1)

dnl Defines the macro for ASRC widget
DECLARE_SOF_RT_UUID("asrc", asrc_uuid, 0xc8ec72f6, 0x8526, 0x4faf,
0x9d, 0x39, 0xa2, 0x3d, 0x0b, 0x54, 0x1d, 0xe2)

dnl ASRC name)
define(`N_ASRC', `ASRC'PIPELINE_ID`.'$1)

dnl W_ASRC(name, format, periods_sink, periods_source, data)
define(`W_ASRC',
`SectionVendorTuples."'N_ASRC($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(asrc_uuid)
` }'
`}'
`SectionData."'N_ASRC($1)`_data_uuid" {'
` tuples "'N_ASRC($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_ASRC($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand All @@ -31,6 +42,7 @@ define(`W_ASRC',
` type "asrc"'
` no_pm "true"'
` data ['
` "'N_ASRC($1)`_data_uuid"'
` "'N_ASRC($1)`_data_w"'
` "'N_ASRC($1)`_data_str"'
` "'$5`"'
Expand Down
12 changes: 12 additions & 0 deletions tools/topology/m4/ch_sel.m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
divert(-1)

dnl Define macro for channel selector widget
DECLARE_SOF_RT_UUID("selector", selector_uuid, 0x55a88ed5, 0x3d18, 0x46ca,
0x88, 0xf1, 0x0e, 0xe6, 0xea, 0xe9, 0x93, 0x0f)

dnl N_SELECTOR(name)
define(`N_SELECTOR', `SELECTOR'PIPELINE_ID`.'$1)

dnl W_SELECTOR(name, format, periods_sink, periods_source, core, kcontrols_list)
define(`W_SELECTOR',
`SectionVendorTuples."'N_SELECTOR($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(selector_uuid)
` }'
`}'
`SectionData."'N_SELECTOR($1)`_data_uuid" {'
` tuples "'N_SELECTOR($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_SELECTOR($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -39,6 +50,7 @@ define(`W_SELECTOR',
` type "effect"'
` no_pm "true"'
` data ['
` "'N_SELECTOR($1)`_data_uuid"'
` "'N_SELECTOR($1)`_data_w"'
` "'N_SELECTOR($1)`_data_str"'
` ]'
Expand Down
22 changes: 22 additions & 0 deletions tools/topology/m4/dai.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ divert(-1)
include(`debug.m4')

dnl Define macros for DAI IN/OUT widgets and DAI config
DECLARE_SOF_RT_UUID("dai", dai_comp_uuid, 0xc2b00d27, 0xffbc, 0x4150,
0xa5, 0x1a, 0x24, 0x5c, 0x79, 0xc5, 0xe5, 0x4b)

dnl N_DAI(name)
define(`N_DAI', DAI_NAME)
Expand All @@ -11,6 +13,15 @@ define(`N_DAI_IN', DAI_NAME`.IN')

dnl W_DAI_OUT(type, index, dai_link, format, periods_sink, periods_source, core)
define(`W_DAI_OUT',
`SectionVendorTuples."'N_DAI_OUT`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(dai_comp_uuid)
` }'
`}'
`SectionData."'N_DAI_OUT`_data_uuid" {'
` tuples "'N_DAI_OUT`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_DAI_OUT`_tuples_w_comp" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -56,6 +67,7 @@ define(`W_DAI_OUT',
` stream_name' STR($3)
` no_pm "true"'
` data ['
` "'N_DAI_OUT`_data_uuid"'
` "'N_DAI_OUT`_data_w"'
` "'N_DAI_OUT`_data_w_comp"'
` "'N_DAI_OUT`_data_str"'
Expand All @@ -65,6 +77,15 @@ define(`W_DAI_OUT',

dnl W_DAI_IN(type, index, dai_link, format, periods_sink, periods_source, core)
define(`W_DAI_IN',
`SectionVendorTuples."'N_DAI_IN`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(dai_comp_uuid)
` }'
`}'
`SectionData."'N_DAI_IN`_data_uuid" {'
` tuples "'N_DAI_IN`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_DAI_IN`_tuples_w_comp" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -110,6 +131,7 @@ define(`W_DAI_IN',
` stream_name' STR($3)
` no_pm "true"'
` data ['
` "'N_DAI_IN`_data_uuid"'
` "'N_DAI_IN`_data_w"'
` "'N_DAI_IN`_data_w_comp"'
` "'N_DAI_IN`_data_str"'
Expand Down
12 changes: 12 additions & 0 deletions tools/topology/m4/dcblock.m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
divert(-1)

dnl Define macro for DC Blocking Filter widget
DECLARE_SOF_RT_UUID("dcblock", dcblock_uuid, 0xb809efaf, 0x5681, 0x42b1,
0x9e, 0xd6, 0x04, 0xbb, 0x01, 0x2d, 0xd3, 0x84)

dnl N_DCBLOCK(name)
define(`N_DCBLOCK', `DCBLOCK'PIPELINE_ID`.'$1)

dnl W_DCBLOCK(name, format, periods_sink, periods_source, core, kcontrols_list)
define(`W_DCBLOCK',
`SectionVendorTuples."'N_DCBLOCK($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(dcblock_uuid)
` }'
`}'
`SectionData."'N_DCBLOCK($1)`_data_uuid" {'
` tuples "'N_DCBLOCK($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_DCBLOCK($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -41,6 +52,7 @@ define(`W_DCBLOCK',
` type "effect"'
` no_pm "true"'
` data ['
` "'N_DCBLOCK($1)`_data_uuid"'
` "'N_DCBLOCK($1)`_data_w"'
` "'N_DCBLOCK($1)`_data_str"'
` "'N_DCBLOCK($1)`_data_str_type"'
Expand Down
12 changes: 12 additions & 0 deletions tools/topology/m4/detect.m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
divert(-1)

dnl Define macro for generic detection widget
DECLARE_SOF_RT_UUID("kd-test", keyword_uuid, 0xeba8d51f, 0x7827, 0x47b5,
0x82, 0xee, 0xde, 0x6e, 0x77, 0x43, 0xaf, 0x67)

dnl N_DETECT(name)
define(`N_DETECT', `DETECT'PIPELINE_ID`.'$1)

dnl W_DETECT(name, format, periods_sink, periods_source, detect_type, stream_name, core, kcontrols_list)
define(`W_DETECT',
`SectionVendorTuples."'N_DETECT($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(keyword_uuid)
` }'
`}'
`SectionData."'N_DETECT($1)`_data_uuid" {'
` tuples "'N_DETECT($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_DETECT($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -42,6 +53,7 @@ define(`W_DETECT',
` event_flags "15"' # trapping PRE/POST_PMU/PMD events
` event_type "1"' # 1 for DAPM event for detect component
` data ['
` "'N_DETECT($1)`_data_uuid"'
` "'N_DETECT($1)`_data_w"'
` "'N_DETECT($1)`_data_str"'
` ]'
Expand Down
12 changes: 12 additions & 0 deletions tools/topology/m4/eq_fir.m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
divert(-1)

dnl Define macro for Eq effect widget
DECLARE_SOF_RT_UUID("eq-fir", eq_fir_uuid, 0x43a90ce7, 0xf3a5, 0x41df,
0xac, 0x06, 0xba, 0x98, 0x65, 0x1a, 0xe6, 0xa3)

dnl N_EQ_FIR(name)
define(`N_EQ_FIR', `EQFIR'PIPELINE_ID`.'$1)

dnl W_EQ(name, format, periods_sink, periods_source, core, kcontrols_list)
define(`W_EQ_FIR',
`SectionVendorTuples."'N_EQ_FIR($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(eq_fir_uuid)
` }'
`}'
`SectionData."'N_EQ_FIR($1)`_data_uuid" {'
` tuples "'N_EQ_FIR($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_EQ_FIR($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -41,6 +52,7 @@ define(`W_EQ_FIR',
` type "effect"'
` no_pm "true"'
` data ['
` "'N_EQ_FIR($1)`_data_uuid"'
` "'N_EQ_FIR($1)`_data_w"'
` "'N_EQ_FIR($1)`_data_str"'
` "'N_EQ_FIR($1)`_data_str_type"'
Expand Down
12 changes: 12 additions & 0 deletions tools/topology/m4/eq_iir.m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
divert(-1)

dnl Define macro for Eq effect widget
DECLARE_SOF_RT_UUID("eq-iir", eq_iir_uuid, 0x5150c0e6, 0x27f9, 0x4ec8,
0x83, 0x51, 0xc7, 0x05, 0xb6, 0x42, 0xd1, 0x2f)

dnl N_EQ_IIR(name)
define(`N_EQ_IIR', `EQIIR'PIPELINE_ID`.'$1)

dnl W_EQ(name, format, periods_sink, periods_source, core, kcontrols_list)
define(`W_EQ_IIR',
`SectionVendorTuples."'N_EQ_IIR($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(eq_iir_uuid)
` }'
`}'
`SectionData."'N_EQ_IIR($1)`_data_uuid" {'
` tuples "'N_EQ_IIR($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_EQ_IIR($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -41,6 +52,7 @@ define(`W_EQ_IIR',
` type "effect"'
` no_pm "true"'
` data ['
` "'N_EQ_IIR($1)`_data_uuid"'
` "'N_EQ_IIR($1)`_data_w"'
` "'N_EQ_IIR($1)`_data_str"'
` "'N_EQ_IIR($1)`_data_str_type"'
Expand Down
12 changes: 12 additions & 0 deletions tools/topology/m4/kpbm.m4
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
divert(-1)

dnl Define macro for Key Phrase Buffer Manager(kpbm) widget
DECLARE_SOF_RT_UUID("kpb", kpb_uuid, 0xd8218443, 0x5ff3, 0x4a4c,
0xb3, 0x88, 0x6c, 0xfe, 0x07, 0xb9, 0x56, 0x2e)

dnl N_KPBM(name)
define(`N_KPBM', `KPBM'$2`.'$1)

dnl W_KPBM(name, format, periods_sink, periods_source, pipeline_id, core, kcontrols_list)
define(`W_KPBM',
`SectionVendorTuples."'N_KPBM($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(kpb_uuid)
` }'
`}'
`SectionData."'N_KPBM($1)`_data_uuid" {'
` tuples "'N_KPBM($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_KPBM($1, $5)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -39,6 +50,7 @@ define(`W_KPBM',
` type "effect"'
` no_pm "true"'
` data ['
` "'N_KPBM($1)`_data_uuid"'
` "'N_KPBM($1, $5)`_data_w"'
` "'N_KPBM($1, $5)`_data_str"'
` ]'
Expand Down
12 changes: 12 additions & 0 deletions tools/topology/m4/mixer.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
divert(-1)

dnl Define macro for Mixer widget
DECLARE_SOF_RT_UUID("mixer", mixer_uuid, 0xbc06c037, 0x12aa, 0x417c,
0x9a, 0x97, 0x89, 0x28, 0x2e, 0x32, 0x1a, 0x76)

dnl N_MIXER(name)
define(`N_MIXER', `MIXER'PIPELINE_ID`.'$1)
Expand All @@ -10,6 +12,15 @@ define(`NPIPELINE_MIXER', `MIXER'$1`.'$2)

dnl W_MIXER(name, format, periods_sink, periods_source, core)
define(`W_MIXER',
`SectionVendorTuples."'N_MIXER($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
` SOF_TKN_COMP_UUID' STR(mixer_uuid)
` }'
`}'
`SectionData."'N_MIXER($1)`_data_uuid" {'
` tuples "'N_MIXER($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_MIXER($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand All @@ -35,6 +46,7 @@ define(`W_MIXER',
` type "mixer"'
` no_pm "true"'
` data ['
` "'N_MIXER($1)`_data_uuid"'
` "'N_MIXER($1)`_data_w"'
` "'N_MIXER($1)`_data_str"'
` ]'
Expand Down
18 changes: 17 additions & 1 deletion tools/topology/m4/muxdemux.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
divert(-1)

dnl Define macro for demux widget
dnl Define macro for mux/demux widget
DECLARE_SOF_RT_UUID("mux", mux_uuid, 0xc607ff4d, 0x9cb6, 0x49dc,
0xb6, 0x78, 0x7d, 0xa3, 0xc6, 0x3e, 0xa5, 0x57)
DECLARE_SOF_RT_UUID("demux", demux_uuid, 0xc4b26868, 0x1430, 0x470e,
0xa0, 0x89, 0x15, 0xd1, 0xc7, 0x7f, 0x85, 0x1a)

dnl Hard coded values for mux/demux config blob
define(mux_sof_magic, 0x00464F53)
Expand Down Expand Up @@ -36,6 +40,17 @@ define(`N_MUXDEMUX', `MUXDEMUX'PIPELINE_ID`.'$1)

dnl W_MUXDEMUX(name, mux/demux, format, periods_sink, periods_source, core, kcontrol_list)
define(`W_MUXDEMUX',
`SectionVendorTuples."'N_MUXDEMUX($1)`_tuples_uuid" {'
` tokens "sof_comp_tokens"'
` tuples."uuid" {'
ifelse(`$2', `0',
` SOF_TKN_COMP_UUID' STR(mux_uuid),
` SOF_TKN_COMP_UUID' STR(demux_uuid))
` }'
Copy link
Member

Choose a reason for hiding this comment

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

It's better here to have a uuid.m4 file that contains all UUIDs and is included by all topologies.

# uuid.m4 - set default UUIDs if NOT already set in topology.
# allows users to override the UUID if needed.
ifndef UUID_SRC
define UUID_SRC "blah blah blah"
endif

# and so on

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, will implement a m4 helper to generate this UUID byte array from the string copied from the firmware source directly.

`}'
`SectionData."'N_MUXDEMUX($1)`_data_uuid" {'
` tuples "'N_MUXDEMUX($1)`_tuples_uuid"'
`}'
`SectionVendorTuples."'N_MUXDEMUX($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
` tuples."word" {'
Expand Down Expand Up @@ -68,6 +83,7 @@ define(`W_MUXDEMUX',
` type "effect"'
` no_pm "true"'
` data ['
` "'N_MUXDEMUX($1)`_data_uuid"'
` "'N_MUXDEMUX($1)`_data_w"'
` "'N_MUXDEMUX($1)`_data_str"'
` ]'
Expand Down
Loading