From b3952de0bda6fcd0f2836c7cab25ee884e85eaab Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Fri, 30 Aug 2019 17:28:42 -0700 Subject: [PATCH 1/4] topology: sof-cht-max98090: fix media pipeline Need to add the SCHED_COMP name so pipeline will properly load Signed-off-by: Curtis Malainey --- tools/topology/sof-cht-max98090.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/topology/sof-cht-max98090.m4 b/tools/topology/sof-cht-max98090.m4 index 45b26eb303b2..a5fa400d813e 100644 --- a/tools/topology/sof-cht-max98090.m4 +++ b/tools/topology/sof-cht-max98090.m4 @@ -43,7 +43,8 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, # Schedule 192 frames per 4000us deadline on core 0 with priority 1 PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, 3, 1, 2, s32le, - 192, 4000, 1, 0) + 192, 4000, 1, 0, + 0, PIPELINE_PLAYBACK_SCHED_COMP_1) # Connect pipelines together SectionGraph."pipe-cht-max98090" { From 6fa9a387c856921e0cb9050fa76afd8b9dd32633 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Wed, 18 Sep 2019 15:02:29 -0700 Subject: [PATCH 2/4] topology: cht-max98090 add missing virtual widgets Topology will fail to probe without these widgets Signed-off-by: Curtis Malainey --- tools/topology/sof-cht-max98090.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/topology/sof-cht-max98090.m4 b/tools/topology/sof-cht-max98090.m4 index a5fa400d813e..19394c9b9939 100644 --- a/tools/topology/sof-cht-max98090.m4 +++ b/tools/topology/sof-cht-max98090.m4 @@ -88,3 +88,6 @@ DAI_CONFIG(SSP, 2, 0, SSP2-Codec, SSP_CLOCK(fsync, 48000, codec_slave), SSP_TDM(2, 20, 3, 3), SSP_CONFIG_DATA(SSP, 2, 16))) + +VIRTUAL_WIDGET(ssp2 Rx, out_drv, 1) +VIRTUAL_WIDGET(ssp2 Tx, out_drv, 2) From 8b779aecec94d082598bc6c7c492d064568b7be9 Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Thu, 19 Sep 2019 13:12:11 -0700 Subject: [PATCH 3/4] topology: sof-cht-max98090 move DAI definition above media pipeline The DAI definition needs to come first otherwise the media pipeline with be parsed incorrectly resulting in a failure to load the topology Signed-off-by: Curtis Malainey --- tools/topology/sof-cht-max98090.m4 | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/topology/sof-cht-max98090.m4 b/tools/topology/sof-cht-max98090.m4 index 19394c9b9939..1b2bd1cc8fa2 100644 --- a/tools/topology/sof-cht-max98090.m4 +++ b/tools/topology/sof-cht-max98090.m4 @@ -39,6 +39,19 @@ PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, 2, 0, 2, s32le, 48, 1000, 0, 0) +# +# DAI configuration +# +# SSP port 2 is our only pipeline DAI +# + +# playback DAI is SSP2 using 2 periods +# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 +DAI_ADD(sof/pipe-dai-playback.m4, + 1, SSP, 2, SSP2-Codec, + PIPELINE_SOURCE_1, 2, s16le, + 48, 1000, 0, 0) + # PCM Media Playback pipeline 3 on PCM 1 using max 2 channels of s32le. # Schedule 192 frames per 4000us deadline on core 0 with priority 1 PIPELINE_PCM_ADD(sof/pipe-pcm-media.m4, @@ -56,19 +69,6 @@ SectionGraph."pipe-cht-max98090" { ] } -# -# DAI configuration -# -# SSP port 2 is our only pipeline DAI -# - -# playback DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, 2, SSP2-Codec, - PIPELINE_SOURCE_1, 2, s16le, - 48, 1000, 0, 0) - # capture DAI is SSP2 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-capture.m4, From 30fc40d72a464dad1267d1a7998105871e6e5ecf Mon Sep 17 00:00:00 2001 From: Curtis Malainey Date: Mon, 23 Sep 2019 13:49:11 -0700 Subject: [PATCH 4/4] platforms: Enable optional cherrytrail DMA The 3rd DMAC that CHT has seems to be causing issues. Since it is not needed lets make it optional so the platform can be usable. Signed-off-by: Curtis Malainey --- src/platform/Kconfig | 8 ++++++++ src/platform/baytrail/include/platform/lib/dma.h | 2 +- src/platform/baytrail/lib/dma.c | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/platform/Kconfig b/src/platform/Kconfig index f54815941759..d8b49e74ef82 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -178,6 +178,14 @@ config CAVS_VERSION_2_0 help Select for CAVS version 2.0 +config CONFIG_CHERRYTRAIL_EXTRA_DW_DMA + bool "Support Cherrytrail 3rd DMAC" + default n if !CHERRYTRAIL + depends on CHERRYTRAIL + help + Select if you need support for all 3 DMACs versus the default 2 used + in baytrail. + # TODO: it should just take manifest version and offsets config FIRMWARE_SHORT_NAME string "Rimage firmware name" diff --git a/src/platform/baytrail/include/platform/lib/dma.h b/src/platform/baytrail/include/platform/lib/dma.h index b9e8539d5cdd..ff9b6780db3f 100644 --- a/src/platform/baytrail/include/platform/lib/dma.h +++ b/src/platform/baytrail/include/platform/lib/dma.h @@ -13,7 +13,7 @@ #include -#if defined CONFIG_CHERRYTRAIL +#if defined CONFIG_CHERRYTRAIL_EXTRA_DW_DMA #define PLATFORM_NUM_DMACS 3 #else #define PLATFORM_NUM_DMACS 2 diff --git a/src/platform/baytrail/lib/dma.c b/src/platform/baytrail/lib/dma.c index e038dcf2ef7f..e7324f258542 100644 --- a/src/platform/baytrail/lib/dma.c +++ b/src/platform/baytrail/lib/dma.c @@ -81,7 +81,7 @@ static struct dw_drv_plat_data dmac1 = { }, }; -#if defined CONFIG_CHERRYTRAIL +#if defined CONFIG_CHERRYTRAIL_EXTRA_DW_DMA static struct dw_drv_plat_data dmac2 = { .chan[0] = { .class = 7, @@ -149,7 +149,7 @@ struct dma dma[PLATFORM_NUM_DMACS] = { }, .ops = &dw_dma_ops, }, -#if defined CONFIG_CHERRYTRAIL +#if defined CONFIG_CHERRYTRAIL_EXTRA_DW_DMA { .plat_data = { .id = DMA_ID_DMAC2,