[Sound-open-firmware] [PATCH 1/6] topology: Add initial SOF topology pipeline definitions
Add pipeline and token definitions to allow creation of SOF topology files. The files define standard pipelines and tokens that can be reused to build machine specific topology files.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/sof/pipe-dai.m4 | 24 +++++ topology/sof/pipe-low-latency-capture.m4 | 107 +++++++++++++++++++ topology/sof/pipe-low-latency-playback.m4 | 167 ++++++++++++++++++++++++++++++ topology/sof/pipe-pcm-media.m4 | 136 ++++++++++++++++++++++++ topology/sof/pipe-tone.m4 | 75 ++++++++++++++ topology/sof/tokens.m4 | 38 +++++++ 6 files changed, 547 insertions(+) create mode 100644 topology/sof/pipe-dai.m4 create mode 100644 topology/sof/pipe-low-latency-capture.m4 create mode 100644 topology/sof/pipe-low-latency-playback.m4 create mode 100644 topology/sof/pipe-pcm-media.m4 create mode 100644 topology/sof/pipe-tone.m4 create mode 100644 topology/sof/tokens.m4
diff --git a/topology/sof/pipe-dai.m4 b/topology/sof/pipe-dai.m4 new file mode 100644 index 0000000..06ac453 --- /dev/null +++ b/topology/sof/pipe-dai.m4 @@ -0,0 +1,24 @@ +# DAI connector + +# Include topology builder +include(`local.m4') + +# +# DAI definitions +# +W_DAI_OUT(DAI_SNAME, dai0p_plat_conf) +W_DAI_IN(DAI_SNAME, dai0c_plat_conf) + +#D_DAI(0, 1, 1) + +# +# Graph connections to pipelines + +SectionGraph.STR(DAI_NAME) { + index "0" + + lines [ + dapm(N_DAI_IN, OUT_BUF) + dapm(IN_BUF, N_DAI_OUT) + ] +} diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4 new file mode 100644 index 0000000..ddb5d8e --- /dev/null +++ b/topology/sof/pipe-low-latency-capture.m4 @@ -0,0 +1,107 @@ +# Low Latency Pipeline and PCM +# +# Pipeline Endpoints for connection are :- +# +# host PCM_C <--B5-- volume(0C) <--B4-- source DAI0 + +# Include topology builder +include(`local.m4') + +# +# Controls +# + +SectionControlMixer.STR(PCM PCM_ID Capture Volume) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "0" + shift "0" + } + channel."FR" { + reg "0" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + get "256" + put "256" + } + + # TLV 40 steps from -90dB to +20dB for 3dB + max "40" + invert "false" + tlv "vtlv_m90s3" +} + +# +# Components and Buffers +# + +W_PCM_CAPTURE(Low Latency Capture) +W_PGA(Capture Volume) +W_BUFFER(0, BUF_INT_SIZE) +W_BUFFER(1, BUF_PCM_SIZE) + +# +# Pipeline Graph +# +# host PCM <--B1-- volume( <--B0-- source DAI0 + +SectionGraph."pipe-ll-capture-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(N_PCM, N_BUFFER(1)) + dapm(N_BUFFER(1), N_PGA(Capture Volume)) + dapm(N_PGA(Capture Volume), N_BUFFER(0)) + ] +} + +# +# Pipeline Configuration. +# + +W_PIPELINE(N_PGA(Capture Volume), SCHEDULE_DEADLINE, pipe_ll_schedule_plat) + +# +# PCM Configuration +# + +SectionPCMCapabilities.STR(Low Latency Capture PCM_ID) { + + formats "S24_LE,S16_LE" + rate_min "48000" + rate_max "48000" + channels_min "2" + channels_max "4" + periods_min "2" + periods_max "4" + period_size_min "192" + period_size_max "16384" + buffer_size_min "384" + buffer_size_max "65536" +} + +# PCM Low Latency Capture +SectionPCM.STR(PCM PCM_ID) { + + index STR(PIPELINE_ID) + + # used for binding to the PCM + id STR(PCM_ID) + + dai.STR(Low Latency Capture PCM_ID) { + id STR(PCM_ID) + } + + pcm."capture" { + + capabilities STR(Low Latency Capture PCM_ID) + } +} diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4 new file mode 100644 index 0000000..6604ad1 --- /dev/null +++ b/topology/sof/pipe-low-latency-playback.m4 @@ -0,0 +1,167 @@ +# Low Latency Pipeline +# +# Low Latency Playback PCM mixed into single sink pipe. +# Low latency Capture PCM. +# +# Pipeline Endpoints for connection are :- +# +# LL Playback Mixer (Mixer) +# LL Capture Volume B4 (DAI buffer) +# LL Playback Volume B3 (DAI buffer) +# +# +# host PCM_P --B0--> volume(0P) --B1--+ +# |--ll mixer(M) --B2--> volume(LL) ---B3--> sink DAI0 +# pipeline n+1 >---+ +# | +# pipeline n+2 >---+ +# | +# pipeline n+3 >---+ .....etc....more pipes can be mixed here +# + +# Include topology builder +include(`local.m4') + +# +# Controls +# + +SectionControlMixer.STR(PCM PCM_ID Playback Volume) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "0" + shift "0" + } + channel."FR" { + reg "0" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + get "256" + put "256" + } + + # TLV 32 steps from -90dB to +6dB for 3dB + max "32" + invert "false" + tlv "vtlv_m90s3" +} + +SectionControlMixer.STR(Master Playback Volume) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "1" + shift "0" + } + channel."FR" { + reg "1" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + get "256" + put "256" + } + + # TLV 32 steps from -90dB to +6dB for 3dB + max "32" + invert "false" + tlv "vtlv_m90s3" +} + +# +# Components and Buffers +# + +W_PCM_PLAYBACK(Low Latency Playback) +W_PGA(Playback Volume) +W_PGA(Mixer Volume) +W_MIXER(0) +W_BUFFER(0, BUF_PCM_SIZE) +W_BUFFER(1, BUF_INT_SIZE) +W_BUFFER(2, BUF_INT_SIZE) +W_BUFFER(3, BUF_INT_SIZE) + +# +# Pipeline Graph +# +# host PCM_P --B0--> volume(0P) --B1--+ +# |--ll mixer(M) --B2--> volume(LL) ---B3--> sink DAI0 +# pipeline n+1 >---+ +# | +# pipeline n+2 >---+ +# | +# pipeline n+3 >---+ .....etc....more pipes can be mixed here +# + +SectionGraph."pipe-ll-playback-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(N_BUFFER(0), N_PCM) + dapm(N_PGA(Playback Volume), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(Playback Volume)) + dapm(N_MIXER(0), N_BUFFER(1)) + dapm(N_BUFFER(2), N_MIXER(0)) + dapm(N_PGA(Mixer Volume), N_BUFFER(2)) + dapm(N_BUFFER(3), N_PGA(Mixer Volume)) + ] +} + +# +# Pipeline Configuration. +# + +W_PIPELINE(N_PGA(Mixer Volume), SCHEDULE_DEADLINE, pipe_ll_schedule_plat) + +# +# PCM Configuration +# + +# PCM capabilities supported by FW +SectionPCMCapabilities.STR(Low Latency Playback PCM_ID) { + + formats "S24_LE,S16_LE" + rate_min "48000" + rate_max "48000" + channels_min "2" + channels_max "2" + periods_min "2" + periods_max "4" + period_size_min "192" + period_size_max "16384" + buffer_size_min "384" + buffer_size_max "65536" +} + +# PCM Low Latency Playback +SectionPCM.STR(PCM PCM_ID) { + + index STR(PIPELINE_ID) + + # used for binding to the PCM + id STR(PCM_ID) + + dai.STR(Low Latency Playback PCM_ID) { + id STR(PCM_ID) + } + + # Playback and Capture Configuration + pcm."playback" { + + capabilities STR(Low Latency Playback PCM_ID) + } +} diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4 new file mode 100644 index 0000000..688c81f --- /dev/null +++ b/topology/sof/pipe-pcm-media.m4 @@ -0,0 +1,136 @@ +# Low Power PCM Media Pipeline +# +# Low power PCM media playback with SRC and volume. +# +# Pipeline Endpoints for connection are :- +# +# host PCM_P --B0--> volume(0P) --B1--> SRC -- B2 --> Endpoint Pipeline +# + +# Include topology builder +include(`local.m4') + +# +# Controls +# + +SectionControlMixer.STR(PCM PCM_ID Playback Volume) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "1" + shift "0" + } + channel."FR" { + reg "1" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + get "256" + put "256" + } + + # TLV 32 steps from -90dB to +6dB for 3dB + max "32" + invert "false" + tlv "vtlv_m90s3" +} + + +# +# SRC Configuration +# + +SectionVendorTuples."media_src_tokens" { + tokens "sof_src_tokens" + + tuples."word" { + SOF_TKN_SRC_RATE_IN 16000 + SOF_TKN_SRC_RATE_IN 44100 + SOF_TKN_SRC_RATE_OUT 48000 + } +} + +SectionData."media_src_conf" { + tuples "media_src_tokens" +} + +# +# Components and Buffers +# + +W_PCM_PLAYBACK(Media Playback) +W_PGA(Playback Volume) +W_SRC(0, media_src_conf) +W_BUFFER(0, BUF_PCM_SIZE) +W_BUFFER(1, BUF_INT_SIZE) +W_BUFFER(2, BUF_INT_SIZE) + +# +# Pipeline Graph +# +# PCM --B0--> volume --B1--> SRC --> B2 --> Endpoint Pipeline +# + +SectionGraph."pipe-media-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(N_BUFFER(0), Media Playback PCM_ID) + dapm(N_PGA(Playback Volume), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(Playback Volume)) + dapm(N_SRC(0), N_BUFFER(1)) + dapm(N_BUFFER(2), N_SRC(0)) + ] +} + +# +# Pipeline Configuration. +# + +W_PIPELINE(N_SRC(0), SCHEDULE_DEADLINE, pipe_media_schedule_plat) + +# +# PCM Configuration +# + +# PCM capabilities supported by FW + +SectionPCMCapabilities.STR(Media Playback PCM_ID) { + formats "S24_LE,S16_LE" + rate_min "8000" + rate_max "192000" + channels_min "2" + channels_max "2" + periods_min "2" + periods_max "32" + period_size_min "4096" + period_size_max "262144" + buffer_size_min "8192" + buffer_size_max "8388608" +} + +# PCM Low Latency Playback and Capture +SectionPCM.STR(PCM PCM_ID) { + + index STR(PIPELINE_ID) + + # used for binding to the PCM + id STR(PCM_ID) + + dai.STR(Media Playback PCM_ID) { + id STR(PCM_ID) + } + + # Playback and Capture Configuration + pcm."playback" { + + capabilities STR(Media Playback PCM_ID) + } +} diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 new file mode 100644 index 0000000..24fe10f --- /dev/null +++ b/topology/sof/pipe-tone.m4 @@ -0,0 +1,75 @@ +# Tone Generator +# +# Multi Frequency Tone Generator. +# +# Pipeline Endpoints for connection are :- +# +# Tone --B0--> volume --B1--> Endpoint Pipeline +# + +# Include topology builder +include(`local.m4') + +# +# Controls +# + +SectionControlMixer.STR(Tone Volume PIPELINE_ID) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "1" + shift "0" + } + channel."FR" { + reg "1" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + get "256" + put "256" + } + + # TLV 32 steps from -90dB to +6dB for 3dB + max "32" + invert "false" + tlv "vtlv_m90s3" +} + +# +# Components and Buffers +# + +W_TONE(0) +W_PGA(Tone Volume) +W_BUFFER(0, BUF_INT_SIZE) +W_BUFFER(1, BUF_INT_SIZE) + + +# +# Pipeline Graph +# +# Tone --B0--> volume --B1--> Endpoint Pipeline +# + +SectionGraph."pipe-tone-PIPELINE_ID" { + index STR(PIPELINE_ID) + + lines [ + dapm(N_BUFFER(0), N_TONE(0)) + dapm(N_PGA(Tone Volume), N_BUFFER(0)) + dapm(N_BUFFER(1), N_PGA(Tone Volume)) + ] +} + +# +# Pipeline Configuration. +# + +W_PIPELINE(N_TONE(0), SCHEDULE_DEADLINE, pipe_tone_schedule_plat) diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 new file mode 100644 index 0000000..1ec48df --- /dev/null +++ b/topology/sof/tokens.m4 @@ -0,0 +1,38 @@ + +# +# SOF Tokens for differentiation. +# +# Differentiation can be done at the platform and machine level. +# +# Tokens are GUIDs + +# TODO: pre-process this with UAPI headers GNU cpp. + + +SectionVendorTokens."sof_buffer_tokens" { + SOF_TKN_BUF_SIZE "100" + SOF_TKN_BUF_PRELOAD "101" +} + +SectionVendorTokens."sof_dai_tokens" { + SOF_TKN_DAI_DMAC "151" + SOF_TKN_DAI_DMAC_CHAN "152" + SOF_TKN_DAI_DMAC_CONFIG "153" +} + +SectionVendorTokens."sof_sched_tokens" { + SOF_TKN_SCHED_DEADLINE "200" + SOF_TKN_SCHED_PRIORITY "201" + SOF_TKN_SCHED_MIPS "202" + SOF_TKN_SCHED_CORE "203" +} + +SectionVendorTokens."sof_volume_tokens" { + SOF_TKN_VOLUME_RAMP_STEP_TYPE "250" + SOF_TKN_VOLUME_RAMP_STEP_MS "251" +} + +SectionVendorTokens."sof_src_tokens" { + SOF_TKN_SRC_RATE_IN "300" + SOF_TKN_SRC_RATE_OUT "301" +}
Add initial configuration for DSP specific data. This data still requires further tuning.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/dsps/bdw.m4 | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ topology/dsps/bxt.m4 | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ topology/dsps/byt.m4 | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ topology/dsps/cht.m4 | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ topology/dsps/hsw.m4 | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 365 insertions(+) create mode 100644 topology/dsps/bdw.m4 create mode 100644 topology/dsps/bxt.m4 create mode 100644 topology/dsps/byt.m4 create mode 100644 topology/dsps/cht.m4 create mode 100644 topology/dsps/hsw.m4
diff --git a/topology/dsps/bdw.m4 b/topology/dsps/bdw.m4 new file mode 100644 index 0000000..24e0156 --- /dev/null +++ b/topology/dsps/bdw.m4 @@ -0,0 +1,73 @@ +# +# Broadwell differentiation for pipelines and components +# + +# Low Latency PCM Configuration +SectionVendorTuples."pipe_ll_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "0" + SOF_TKN_SCHED_MIPS "50000" + } +} + +SectionData."pipe_ll_schedule_plat" { + tuples "pipe_ll_schedule_plat_tokens" +} + +# Media PCM Configuration +SectionVendorTuples."pipe_media_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "1" + SOF_TKN_SCHED_MIPS "100000" + } +} + +SectionData."pipe_media_schedule_plat" { + tuples "pipe_media_schedule_plat_tokens" +} + +# Tone Signal Generator Configuration +SectionVendorTuples."pipe_tone_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "2" + SOF_TKN_SCHED_MIPS "200000" + } +} + +SectionData."pipe_tone_schedule_plat" { + tuples "pipe_tone_schedule_plat_tokens" +} + +# DAI0 platform playback configuration +SectionVendorTuples."dai0p_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" + } +} + +SectionData."dai0p_plat_conf" { + tuples "dai0p_plat_tokens" +} + +# DAI0 platform capture configuration +SectionVendorTuples."dai0c_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" + } +} + +SectionData."dai0c_plat_conf" { + tuples "dai0c_plat_tokens" +} diff --git a/topology/dsps/bxt.m4 b/topology/dsps/bxt.m4 new file mode 100644 index 0000000..fe21ae8 --- /dev/null +++ b/topology/dsps/bxt.m4 @@ -0,0 +1,73 @@ +# +# Broxton differentiation for pipelines and components +# + +# Low Latency PCM Configuration +SectionVendorTuples."pipe_ll_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "0" + SOF_TKN_SCHED_MIPS "50000" + } +} + +SectionData."pipe_ll_schedule_plat" { + tuples "pipe_ll_schedule_plat_tokens" +} + +# Media PCM Configuration +SectionVendorTuples."pipe_media_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "1" + SOF_TKN_SCHED_MIPS "100000" + } +} + +SectionData."pipe_media_schedule_plat" { + tuples "pipe_media_schedule_plat_tokens" +} + +# Tone Signal Generator Configuration +SectionVendorTuples."pipe_tone_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "2" + SOF_TKN_SCHED_MIPS "200000" + } +} + +SectionData."pipe_tone_schedule_plat" { + tuples "pipe_tone_schedule_plat_tokens" +} + +# DAI0 platform playback configuration +SectionVendorTuples."dai0p_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" + } +} + +SectionData."dai0p_plat_conf" { + tuples "dai0p_plat_tokens" +} + +# DAI0 platform capture configuration +SectionVendorTuples."dai0c_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" + } +} + +SectionData."dai0c_plat_conf" { + tuples "dai0c_plat_tokens" +} diff --git a/topology/dsps/byt.m4 b/topology/dsps/byt.m4 new file mode 100644 index 0000000..8aa3930 --- /dev/null +++ b/topology/dsps/byt.m4 @@ -0,0 +1,73 @@ +# +# Baytrail differentiation for pipelines and components +# + +# Low Latency PCM Configuration +SectionVendorTuples."pipe_ll_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "0" + SOF_TKN_SCHED_MIPS "50000" + } +} + +SectionData."pipe_ll_schedule_plat" { + tuples "pipe_ll_schedule_plat_tokens" +} + +# Media PCM Configuration +SectionVendorTuples."pipe_media_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "1" + SOF_TKN_SCHED_MIPS "100000" + } +} + +SectionData."pipe_media_schedule_plat" { + tuples "pipe_media_schedule_plat_tokens" +} + +# Tone Signal Generator Configuration +SectionVendorTuples."pipe_tone_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "2" + SOF_TKN_SCHED_MIPS "200000" + } +} + +SectionData."pipe_tone_schedule_plat" { + tuples "pipe_tone_schedule_plat_tokens" +} + +# DAI0 platform playback configuration +SectionVendorTuples."dai0p_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" + } +} + +SectionData."dai0p_plat_conf" { + tuples "dai0p_plat_tokens" +} + +# DAI0 platform capture configuration +SectionVendorTuples."dai0c_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" + } +} + +SectionData."dai0c_plat_conf" { + tuples "dai0c_plat_tokens" +} diff --git a/topology/dsps/cht.m4 b/topology/dsps/cht.m4 new file mode 100644 index 0000000..f6976aa --- /dev/null +++ b/topology/dsps/cht.m4 @@ -0,0 +1,73 @@ +# +# Cherrytrail differentiation for pipelines and components +# + +# Low Latency PCM Configuration +SectionVendorTuples."pipe_ll_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "0" + SOF_TKN_SCHED_MIPS "50000" + } +} + +SectionData."pipe_ll_schedule_plat" { + tuples "pipe_ll_schedule_plat_tokens" +} + +# Media PCM Configuration +SectionVendorTuples."pipe_media_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "1" + SOF_TKN_SCHED_MIPS "100000" + } +} + +SectionData."pipe_media_schedule_plat" { + tuples "pipe_media_schedule_plat_tokens" +} + +# Tone Signal Generator Configuration +SectionVendorTuples."pipe_tone_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "2" + SOF_TKN_SCHED_MIPS "200000" + } +} + +SectionData."pipe_tone_schedule_plat" { + tuples "pipe_tone_schedule_plat_tokens" +} + +# DAI0 platform playback configuration +SectionVendorTuples."dai0p_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" + } +} + +SectionData."dai0p_plat_conf" { + tuples "dai0p_plat_tokens" +} + +# DAI0 platform capture configuration +SectionVendorTuples."dai0c_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" + } +} + +SectionData."dai0c_plat_conf" { + tuples "dai0c_plat_tokens" +} diff --git a/topology/dsps/hsw.m4 b/topology/dsps/hsw.m4 new file mode 100644 index 0000000..1c155a9 --- /dev/null +++ b/topology/dsps/hsw.m4 @@ -0,0 +1,73 @@ +# +# Haswell differentiation for pipelines and components +# + +# Low Latency PCM Configuration +SectionVendorTuples."pipe_ll_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "0" + SOF_TKN_SCHED_MIPS "50000" + } +} + +SectionData."pipe_ll_schedule_plat" { + tuples "pipe_ll_schedule_plat_tokens" +} + +# Media PCM Configuration +SectionVendorTuples."pipe_media_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "1" + SOF_TKN_SCHED_MIPS "100000" + } +} + +SectionData."pipe_media_schedule_plat" { + tuples "pipe_media_schedule_plat_tokens" +} + +# Tone Signal Generator Configuration +SectionVendorTuples."pipe_tone_schedule_plat_tokens" { + tokens "sof_sched_tokens" + + tuples."word" { + SOF_TKN_SCHED_PRIORITY "2" + SOF_TKN_SCHED_MIPS "200000" + } +} + +SectionData."pipe_tone_schedule_plat" { + tuples "pipe_tone_schedule_plat_tokens" +} + +# DAI0 platform playback configuration +SectionVendorTuples."dai0p_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "0" + } +} + +SectionData."dai0p_plat_conf" { + tuples "dai0p_plat_tokens" +} + +# DAI0 platform capture configuration +SectionVendorTuples."dai0c_plat_tokens" { + tokens "sof_dai_tokens" + + tuples."word" { + SOF_TKN_DAI_DMAC "1" + SOF_TKN_DAI_DMAC_CHAN "1" + } +} + +SectionData."dai0c_plat_conf" { + tuples "dai0c_plat_tokens" +}
Add initial macros to simplify the construction of topology components and pipelines.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/m4/build.m4 | 44 ++++++++++++++ topology/m4/local.m4 | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 topology/m4/build.m4 create mode 100644 topology/m4/local.m4
diff --git a/topology/m4/build.m4 b/topology/m4/build.m4 new file mode 100644 index 0000000..0c40e4e --- /dev/null +++ b/topology/m4/build.m4 @@ -0,0 +1,44 @@ +#"PIPELINE_PCM_ADD(pipeline, id, pcm, pcm_buf, int_buf, frames, deadline) +define(`PIPELINE_PCM_ADD', +`undefine(`PCM_ID')' +`undefine(`PIPELINE_ID')' +`undefine(`BUF_PCM_SIZE')' +`undefine(`BUF_INT_SIZE')' +`undefine(`SCHEDULE_FRAMES')' +`undefine(`SCHEDULE_DEADLINE')' +`define(`PCM_ID', $3)' +`define(`PIPELINE_ID', $2)' +`define(`BUF_PCM_SIZE', STR($4))' +`define(`BUF_INT_SIZE', STR($5))' +`define(`SCHEDULE_FRAMES', STR($6))' +`define(`SCHEDULE_DEADLINE', STR($7))' +`include($1)' +) + +#PIPELINE_ADD(pipeline, id), int_buf, frames, deadline) +define(`PIPELINE_ADD', +`undefine(`PIPELINE_ID')' +`undefine(`BUF_INT_SIZE')' +`undefine(`SCHEDULE_FRAMES')' +`undefine(`SCHEDULE_DEADLINE')' +`define(`PIPELINE_ID', $2)' +`define(`BUF_INT_SIZE', STR($3))' +`define(`SCHEDULE_FRAMES', STR($4))' +`define(`SCHEDULE_DEADLINE', STR($5))' +`include($1)' +) + +#DAI_ADD(pipeline, dai_name, stream_name, win, wout)) +define(`DAI_ADD', +`undefine(`PIPELINE_ID')' +`undefine(`DAI_NAME')' +`undefine(`DAI_SNAME')' +`undefine(`IN_BUF')' +`undefine(`OUT_BUF')' +`define(`PIPELINE_ID', 0)' +`define(`DAI_NAME', $2)' +`define(`DAI_SNAME', $3)' +`define(`IN_BUF', $4)' +`define(`OUT_BUF', $5)' +`include($1)' +) diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 new file mode 100644 index 0000000..2408830 --- /dev/null +++ b/topology/m4/local.m4 @@ -0,0 +1,159 @@ +define(`concat',`$1$2') + +define(`STR', `"'$1`"') + +#create direct DAPM/pipeline link between 2 widgets) +define(`dapm', `"$1, , $2"') + +#SRC name) +define(`N_SRC', `SRC'PIPELINE_ID`.'$1) + +#W_SRC(name, data)) +define(`W_SRC', `SectionWidget."'N_SRC($1)`" {' +` index "'PIPELINE_ID`"' +` type "src"' +` no_pm "true"' +` data [' +` "'$2`"' +` ]' +`}') + +#Buffer name) +define(`N_BUFFER', `BUF'PIPELINE_ID`.'$1) + +#W_BUFFER(name, size)) +define(`W_BUFFER', +`SectionVendorTuples."'N_BUFFER($1)`_tuples" {' +` tokens "sof_buffer_tokens"' +` tuples."word" {' +` SOF_TKN_BUF_SIZE' $2 +` }' +`}' +`SectionData."'N_BUFFER($1)`_data" {' +` tuples "'N_BUFFER($1)`_tuples"' +`}' +`SectionWidget."'N_BUFFER($1)`" {' +` index "'PIPELINE_ID`"' +` type "buffer"' +` no_pm "true"' +` data [' +` "'N_BUFFER($1)`_data"' +` ]' +`}') + +#PCM name) +define(`N_PCM', `PCM'PCM_ID) + +#W_PCM_PLAYBACK(stream)) +define(`W_PCM_PLAYBACK', `SectionWidget."'N_PCM`" {' +` index "'PIPELINE_ID`"' +` type "aif_out"' +` no_pm "true"' +` stream_name "'$1`"' +`}') + + +#W_PCM_CAPTURE(stream)) +define(`W_PCM_CAPTURE', `SectionWidget."'N_PCM`" {' +` index "'PIPELINE_ID`"' +` type "aif_out"' +` no_pm "true"' +` stream_name "'$1`"' +`}') + +#PGA name) +define(`N_PGA', `PGA'PIPELINE_ID`.'$1) + +#W_PGA(name)) +define(`W_PGA', `SectionWidget."'N_PGA($1)`" {' +` index "'PIPELINE_ID`"' +` type "pga"' +` no_pm "true"' +`}') + +#Mixer Name) +define(`N_MIXER', `MIXER'PIPELINE_ID`.'$1) + +#Pipe Buffer name in pipeline (pipeline, buffer) +define(`NPIPELINE_MIXER', `MIXER'$1`.'$2) + +#W_MIXER(name)) +define(`W_MIXER', `SectionWidget."'N_MIXER($1)`" {' +` index "'PIPELINE_ID`"' +` type "mixer"' +` no_pm "true"' +`}') + + +#Tone name) +define(`N_TONE', `TONE'PIPELINE_ID`.'$1) + +#W_TONE(name)) +define(`W_TONE', `SectionWidget."'N_TONE($1)`" {' +` index "'PIPELINE_ID`"' +` type "siggen"' +` no_pm "true"' +`}') + +#DAI name) +define(`N_DAI', DAI_NAME) +define(`N_DAI_OUT', DAI_NAME`.OUT') +define(`N_DAI_IN', DAI_NAME`.IN') + +#W_DAI_OUT(stream, data)) +define(`W_DAI_OUT', `SectionWidget."'N_DAI_OUT`" {' +` index "'PIPELINE_ID`"' +` type "dai_out"' +` no_pm "true"' +` stream_name "'$1`"' +` data [' +` "'$2`"' +` ]' +`}') + +#W_DAI_IN(stream, data)) +define(`W_DAI_IN', `SectionWidget."'N_DAI_IN`" {' +` index "'PIPELINE_ID`"' +` type "dai_in"' +` no_pm "true"' +` stream_name "'$1`"' +` data [' +` "'$2`"' +` ]' +`}') + +#Pipe Buffer name in pipeline (pipeline, buffer) +define(`NPIPELINE_BUFFER', `BUF'$1`.'$2) + +#Pipeline name) +define(`N_PIPELINE', `PIPELINE.'PIPELINE_ID) + +#W_PIPELINE(stream, deadline, platform)) +define(`W_PIPELINE', +`SectionVendorTuples."'N_PIPELINE`_tuples" {' +` tokens "sof_sched_tokens"' +` tuples."word" {' +` SOF_TKN_SCHED_DEADLINE' $2 +` }' +`}' +`SectionData."'N_PIPELINE`_data" {' +` tuples "'N_PIPELINE`_tuples"' +`}' +`SectionWidget."'N_PIPELINE`" {' +` index "'PIPELINE_ID`"' +` type "scheduler"' +` no_pm "true"' +` stream_name "'$1`"' +` data [' +` "'N_PIPELINE`_data"' +` "'$3`"' +` ]' +`}') + +#D_DAI(id, playback, capture, data)) +define(`D_DAI', `SectionDAI."'N_DAI`" {' +` index "'PIPELINE_ID`"' +` id "'$1`"' +` playback "'$2`"' +` capture "'$3`"' +`}')
Add initial TLV library that can be included and re-used by pipelines.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/common/tlv.m4 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 topology/common/tlv.m4
diff --git a/topology/common/tlv.m4 b/topology/common/tlv.m4 new file mode 100644 index 0000000..e591fa8 --- /dev/null +++ b/topology/common/tlv.m4 @@ -0,0 +1,14 @@ +# TLV +# +# Common TLV control ranges +# + +SectionTLV."vtlv_m90s3" { + Comment "-90dB step 3dB" + + scale { + min "-9000" + step "300" + mute "1" + } +}
Add some initial machine specific topology configurations that define some simple pipelines for certain machines.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- topology/reef-apl-nocodec.m4 | 79 ++++++++++++++++++++++++++++++++++++++++++++ topology/reef-bdw-rt286.m4 | 76 ++++++++++++++++++++++++++++++++++++++++++ topology/reef-bdw-rt5640.m4 | 76 ++++++++++++++++++++++++++++++++++++++++++ topology/reef-bxt-nocodec.m4 | 77 ++++++++++++++++++++++++++++++++++++++++++ topology/reef-byt-nocodec.m4 | 77 ++++++++++++++++++++++++++++++++++++++++++ topology/reef-byt-rt5640.m4 | 77 ++++++++++++++++++++++++++++++++++++++++++ topology/reef-byt-rt5651.m4 | 76 ++++++++++++++++++++++++++++++++++++++++++ topology/reef-cht-nocodec.m4 | 77 ++++++++++++++++++++++++++++++++++++++++++ topology/reef-hsw-rt5640.m4 | 76 ++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 691 insertions(+) create mode 100644 topology/reef-apl-nocodec.m4 create mode 100644 topology/reef-bdw-rt286.m4 create mode 100644 topology/reef-bdw-rt5640.m4 create mode 100644 topology/reef-bxt-nocodec.m4 create mode 100644 topology/reef-byt-nocodec.m4 create mode 100644 topology/reef-byt-rt5640.m4 create mode 100644 topology/reef-byt-rt5651.m4 create mode 100644 topology/reef-cht-nocodec.m4 create mode 100644 topology/reef-hsw-rt5640.m4
diff --git a/topology/reef-apl-nocodec.m4 b/topology/reef-apl-nocodec.m4 new file mode 100644 index 0000000..f1c1819 --- /dev/null +++ b/topology/reef-apl-nocodec.m4 @@ -0,0 +1,79 @@ +# +# Topology for generic Apollolake board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Apollolake DSP configuration +include(`dsps/bxt.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-apl-nocodec" { + index "0" + + lines [ + # media 0 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + + +# +# BE configurations - overrides config in ACPI if present +# + +# BE configurations - overrides config in ACPI if present +SectionHWConfig."SSP2" { + + id "2" + format "I2S" + bclk_master "true" + bclk_freq "2400000" + mclk_freq "19200000" + fsyn_master "true" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +} + diff --git a/topology/reef-bdw-rt286.m4 b/topology/reef-bdw-rt286.m4 new file mode 100644 index 0000000..38d1c6a --- /dev/null +++ b/topology/reef-bdw-rt286.m4 @@ -0,0 +1,76 @@ +# +# Topology for generic Broadwell board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Broadwell DSP configuration +include(`dsps/bdw.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-bdw-rt286" { + index "0" + + lines [ + # media 0 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + + +# +# BE configurations - overrides config in ACPI if present +# +SectionHWConfig."SSP0" { + + id "2" + format "I2S" + bclk_master "true" + bclk_freq "2400000" + mclk_freq "24000000" + fsyn_master "true" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +} diff --git a/topology/reef-bdw-rt5640.m4 b/topology/reef-bdw-rt5640.m4 new file mode 100644 index 0000000..4bdfdb4 --- /dev/null +++ b/topology/reef-bdw-rt5640.m4 @@ -0,0 +1,76 @@ +# +# Topology for generic Broadwell board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Broadwell DSP configuration +include(`dsps/bdw.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-bdw-rt5640" { + index "0" + + lines [ + # media 0 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + + +# +# BE configurations - overrides config in ACPI if present +# +SectionHWConfig."SSP0" { + + id "2" + format "I2S" + bclk_master "true" + bclk_freq "2400000" + mclk_freq "24000000" + fsyn_master "true" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +} diff --git a/topology/reef-bxt-nocodec.m4 b/topology/reef-bxt-nocodec.m4 new file mode 100644 index 0000000..8634d3a --- /dev/null +++ b/topology/reef-bxt-nocodec.m4 @@ -0,0 +1,77 @@ +# +# Topology for generic Broxton board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Broxton DSP configuration +include(`dsps/bxt.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-bxt-nocodec" { + index "0" + + lines [ + # media 0 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + + +# +# BE configurations - overrides config in ACPI if present +# +SectionHWConfig."SSP2" { + + id "2" + format "I2S" + bclk_master "true" + bclk_freq "2400000" + mclk_freq "19200000" + fsyn_master "true" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +} + diff --git a/topology/reef-byt-nocodec.m4 b/topology/reef-byt-nocodec.m4 new file mode 100644 index 0000000..14660fa --- /dev/null +++ b/topology/reef-byt-nocodec.m4 @@ -0,0 +1,77 @@ +# +# Topology for generic Baytrail board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-byt-nocodec" { + index "0" + + lines [ + # media 0 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + + +# +# BE configurations - overrides config in ACPI if present +# +SectionHWConfig."SSP2" { + + id "2" + format "I2S" + bclk_master "true" + bclk_freq "2400000" + mclk_freq "19200000" + fsyn_master "true" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +} + diff --git a/topology/reef-byt-rt5640.m4 b/topology/reef-byt-rt5640.m4 new file mode 100644 index 0000000..90acec9 --- /dev/null +++ b/topology/reef-byt-rt5640.m4 @@ -0,0 +1,77 @@ +# +# Topology for generic Baytrail board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-byt-rt5640" { + index "0" + + lines [ + # media 0 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + + +# +# BE configurations - overrides config in ACPI if present +# +SectionHWConfig."SSP2" { + + id "2" + format "I2S" + bclk_master "true" + bclk_freq "2400000" + mclk_freq "19200000" + fsyn_master "true" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +} + diff --git a/topology/reef-byt-rt5651.m4 b/topology/reef-byt-rt5651.m4 new file mode 100644 index 0000000..e031807 --- /dev/null +++ b/topology/reef-byt-rt5651.m4 @@ -0,0 +1,76 @@ +# +# Topology for generic Baytrail board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Baytrail DSP configuration +include(`dsps/byt.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-byt-rt5651" { + index "0" + + lines [ + # media 0 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + + +# +# BE configurations - overrides config in ACPI if present +# +SectionHWConfig."SSP2" { + + id "2" + format "I2S" + bclk_master "true" + bclk_freq "2400000" + mclk_freq "19200000" + fsyn_master "true" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +} diff --git a/topology/reef-cht-nocodec.m4 b/topology/reef-cht-nocodec.m4 new file mode 100644 index 0000000..6ceed8e --- /dev/null +++ b/topology/reef-cht-nocodec.m4 @@ -0,0 +1,77 @@ +# +# Topology for generic CherryTrail board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include CherryTrail DSP configuration +include(`dsps/cht.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +#PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +#PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +#PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-cht-nocodec" { + index "0" + + lines [ + # media 0 +# dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 +# dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone +# dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + +# +# BE configurations - overrides config in ACPI if present +# +SectionHWConfig."SSP2" { + + id "2" + format "I2S" + bclk "master" + bclk_freq "2400000" + mclk "master" + mclk_freq "19200000" + fsync "master" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +} + diff --git a/topology/reef-hsw-rt5640.m4 b/topology/reef-hsw-rt5640.m4 new file mode 100644 index 0000000..0648df2 --- /dev/null +++ b/topology/reef-hsw-rt5640.m4 @@ -0,0 +1,76 @@ +# +# Topology for generic Haswell board with no codec. +# + +# Include topology builder +include(`local.m4') +include(`build.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include Haswell DSP configuration +include(`dsps/hsw.m4') + +# +# Define the pipelines +# + +# Low Latency playback pipeline 1 on PCM 0 +PIPELINE_PCM_ADD(sof/pipe-low-latency-playback.m4, 1, 0, 768, 768, 48, 1000, 0) + +# Low Latency capture pipeline 2 on PCM 1 +PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 1, 768, 768, 48, 1000, 0) + +# PCM Media Playback pipeline 3 on PCM 2 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 2, 1536, 1536, 96, 2000, 1) + +# PCM Media Playback pipeline 4 on PCM 3 +PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 4, 3, 1536, 1536, 96, 2000, 1) + +# Tone Playback pipeline 5 +PIPELINE_ADD(sof/pipe-tone.m4, 5, 3072, 192, 4000, 2) + + +# +# DAI configuration +# + +# SSP port 2 is our pipeline DAI +DAI_ADD(sof/pipe-dai.m4, SSP2, I2S Audio, NPIPELINE_BUFFER(2, 0), NPIPELINE_BUFFER(1, 3)) + +# Connect pipelines together +SectionGraph."pipe-hsw-rt5640" { + index "0" + + lines [ + # media 0 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(3, 2)) + # media 1 + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(4, 2)) + #tone + dapm(NPIPELINE_MIXER(1, 0), NPIPELINE_BUFFER(5, 1)) + ] +} + + +# +# BE configurations - overrides config in ACPI if present +# +SectionHWConfig."SSP0" { + + id "2" + format "I2S" + bclk_master "true" + bclk_freq "2400000" + mclk_freq "24000000" + fsyn_master "true" + fsync_freq "48000" + tdm_slots "2" + tdm_slot_width "25" + tx_slots "2" + rx_slots "2" +}
Add support to build topology text files into binary files understood by the drivers. This is a two stage build, the first stage is to pre-process the files with M4 into regular alsa-conf format and the second stage is to compile with the alsa topology compiler.
Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- .gitignore | 3 +++ Makefile.am | 2 +- configure.ac | 3 ++- topology/Makefile.am | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 topology/Makefile.am
diff --git a/.gitignore b/.gitignore index 145a58d..bc827b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.o *.in +*~ autom4te* *.Po *.swp @@ -16,3 +17,5 @@ ltmain.sh rimage/rimage rmbox/rmbox rwav/rwav +*.tplg +topology/*.conf diff --git a/Makefile.am b/Makefile.am index 3373168..ea01286 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1 @@ -SUBDIRS = rimage rmbox +SUBDIRS = rimage rmbox topology diff --git a/configure.ac b/configure.ac index b3d4473..87c7519 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,7 @@ AC_OUTPUT([ Makefile rimage/Makefile rmbox/Makefile + topology/Makefile ])
echo " @@ -23,4 +24,4 @@ echo " prefix: ${prefix} Compiler: ${CC} CFLAGS: ${CFLAGS} -" \ No newline at end of file +" diff --git a/topology/Makefile.am b/topology/Makefile.am new file mode 100644 index 0000000..98661f7 --- /dev/null +++ b/topology/Makefile.am @@ -0,0 +1,41 @@ + +# +# Dependencies +# + +DEPS = \ + dsps/*.m4 \ + common/*.m4 \ + m4/*.m4 \ + sof/*.m4 + +# +# Machines +# + +MACHINES = \ + reef-cht-nocodec.tplg \ + reef-apl-nocodec.tplg \ + reef-bxt-nocodec.tplg \ + reef-byt-nocodec.tplg \ + reef-bdw-rt286.tplg \ + reef-bdw-rt5640.tplg \ + reef-byt-rt5640.tplg \ + reef-byt-rt5651.tplg \ + reef-hsw-rt5640.tplg + +# Uncomment the following line if you want to debug conf files +.PRECIOUS: %.conf + +%.conf : %.m4 ${DEPS} + m4 -I m4 $< > $@ + +%.tplg : %.conf + alsatplg -v 1 -c $< -o $@ + +all: ${MACHINES} + +clean: + rm -f *.conf + rm -f *.tplg +
participants (1)
-
Liam Girdwood