Commit Graph

768 Commits

Author SHA1 Message Date
Yan Wang f5513cdfdb APL/CNL: Add stream_tag variable for saving parameter from kernel driver.
Add stream_tag variable for IPC message and DMA trace data
structure.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-14 09:56:15 +00:00
Pan Xiuli 9ec70bb523 dw-dma: Fix channel status
At the end of the DMA, we need to set the channel status into
parapre, otherwise next dma start will fail.
This will fix APL pause resume issues.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>

--
Test with:
Mininow max rt5651 and GP-MRB nocodec
SOF master: 728f1ff3e3
SOF-Tool master: 5b5bbe31e6
https://github.com/plbossart/sound/tree/topic/sof-v4.14:
fe5e29155127a717ba5ae454b4bdde99afa67723
2018-03-14 09:53:18 +00:00
Rander Wang cc421f6716 cnl: dma: refine dma interrupt processing on cnl
On cnl, all the dma share the same interrupt pin, so
all the dma controller need to be checked in interrupt
function.
2018-03-13 12:32:34 +00:00
Ranjani Sridharan c757d95c1c volume: fix volume underflows
This patch fixes the bug with volume ramp down which causes volume
to underflow causing unspecified behaviour.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-13 10:37:38 +00:00
Ranjani Sridharan fe5c842d78 library: fix host library build errors
This patch fixes the errors in host library compilation.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-13 10:21:29 +00:00
Yan Wang 14d3d18488 Use trace verbose intead of trace.
Too many trace will cause local trace buffer overflow.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-12 16:50:10 +00:00
Liam Girdwood 0e93dd516d timer: remove TIMER_AUDIO macro
Not used anywhere so delete it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-12 16:46:39 +00:00
Liam Girdwood ac894e489e hsw: timer: Use timer 1 for generic workqueue.
Timer 1 is the correct priority.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-12 16:46:28 +00:00
Liam Girdwood 0b400a2bdc hsw: timer: HSW/BDW use DSP core timers and have no ext timer.
HSW/BDW both use internal core DSP timers and dont have any external
timer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-12 12:12:13 +00:00
Ranjani Sridharan 20559967a0 volume: fix bug pertaining to volume ramp down
This patch fixes the bug in the check for terminating the volume
ramp down.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-12 12:12:11 +00:00
Liam Girdwood 939649bd98 hsw: timer: HSW/BDW use DSP core timers and have no ext timer.
HSW/BDW both use internal core DSP timers and dont have any external
timer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-12 12:11:40 +00:00
Ranjani Sridharan 335dd1fb44 volume: fix bug pertaining to volume ramp down
This patch fixes the bug in the check for terminating the volume
ramp down.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-12 12:11:35 +00:00
Pierre-Louis Bossart 26c291b88e ssp: fix inverted_frame handling for BYT and APL/CNL
inverted_frame variable should only be set in the _IF
cases

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-03-09 15:30:30 +00:00
Keyon Jie a92debe638 apl-ssp: fix for I2S/DSP_A/DSP_B/LEFT_J modes
Clean up SSPSP bits to make SSP output follow ALSA ASoC definition
of all I2S/DSP_A/DSP_B/LEFT_J modes.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-09 15:30:09 +00:00
Yan Wang 42be63b6f4 Fix channel number of CNL DMA.
The channel numbers of playback and capture are reversed on CNL.
The channel number of playback is 9.
The channel number of capture is 7.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-09 08:55:07 +00:00
Yan Wang 39838aa858 cnl: timer: Use SSP time source on CNL for workqueue.
Work queue cannot work rightly because it uses wrong timer setting.
Based on Keyon's comments, use SSP CLK intead of CPU CLK.
It is confirmed on my CNL platform.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-09 08:40:17 +00:00
Pierre-Louis Bossart 5851d164c3 clk: add missing break in switch block
Make static analyzers happy by adding a break.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-03-09 08:34:07 +00:00
Pierre-Louis Bossart cddc466c6b dw-dma: simplify conditional statement
detected with sonarcloud: fix pointer test and avoid
redundant evaluation of lli as always true.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-03-09 08:33:51 +00:00
Pierre-Louis Bossart 666770a159 volume: fix error in logical operations
Detected with sonarcloud: test evaluates as always true.
Make sure both volume and switch are handled correctly

Fixes: 43e86cab60 ('volume: fix logic for volume mute/unmute')
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-03-09 08:33:32 +00:00
Pierre-Louis Bossart 0ead019e1c pipeline: fix error handling
missing assignment of 'ret' variable, fix
Detected with sonarcloud.

Fixes: 4252c49d53 ('pipeline: Add XRUN state and handler within pipeline')
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-03-09 08:31:27 +00:00
Seppo Ingalsuo 618bedeb35 SRC: Deleted tiny int16 coefficients
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-03-09 08:18:55 +00:00
Seppo Ingalsuo 787baab230 SRC: Deleted std int24 coefficients
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-03-09 08:18:55 +00:00
Seppo Ingalsuo 3b3d2a9237 SRC: Deleted small int24 coefficients
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-03-09 08:18:55 +00:00
Seppo Ingalsuo 4ed28999bd SRC: Updated 16 bit coefficients
Update due to need for subfilter lengths those are multiple of four.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-03-09 08:18:55 +00:00
Seppo Ingalsuo b3417f6aa4 SRC: Updated 32 bit coefficients
The optimization assumes that sub-filters have length that is multiple
of four. The int24 Q1.23 format filter coefficients are replaced by
int32 Q1.31 format coefficients due to better match with Xtensa HiFi2
EP and and HiFi3 fractional types.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-03-09 08:18:55 +00:00
Seppo Ingalsuo e8afa16c33 SRC: Files structure change and add Xtensa optimized versions
This patch moves generic common code to src.c/h from src_core.c/h and
places generic C optimized filter to src_generic.c. The HiFi EP
version is in src_hifi2ep.c and HiFi3 version is in src_hifi3.c. Use of
the Xtensa optimized versions require xt-xcc compiler.

The non-used SRC in/out rates query code is removed. The 24 bit
coefficients were replaced by 32 bit coefficients those are compatible
with Xtensa fractional integer types.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2018-03-09 08:18:55 +00:00
Keyon Jie 728f1ff3e3 dma: change dma transfer type to enum.
Change to use enum for dma transfer type.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-07 11:31:50 +00:00
Keyon Jie 3e24ac8e9f hda-dma: fix src_width and dest_width for 32 bit container case
The src_width and dest_width are configured already in Bytes,
here fix it, otherwise 24/32 bit copying with hda-dma may have
problem.

Reported-by: Zhigang Wu <zhigang.wu@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-07 11:01:10 +00:00
Rander Wang 680798071e cnl: ssp: fix DSP_B setting in ssp
set ssp according to DSP_B spec

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
2018-03-07 09:35:50 +00:00
Rander Wang 0857b21acb cnl: dma: refine dma probe
Probe each dma individually
2018-03-07 09:33:34 +00:00
Pierre-Louis Bossart 1a784a9311 platform: cnl: fix clock settings
25MHz is not supported, use 24MHz

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-03-07 09:06:11 +00:00
Pierre-Louis Bossart fafb515277 clk: fix CNL clk allocation
All other platforms use RZONE_SYS, not sure why CannonLake
should be any different.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-03-07 09:06:11 +00:00
Pierre-Louis Bossart 7ee7d1f723 clk: fix ApolloLake SSP clock values
24.576, not 24.0 MHz

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-03-07 09:06:11 +00:00
Keyon Jie 77ed88aa4a hda-dma: fix configure direction wrong issue
The directions configured in sg_elem are actually dma transfer type,
not playback/capture direction, here correct them.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-06 21:41:50 +00:00
Keyon Jie 59c57d05cb host: host-gw: only check first_copy for playback
For capture, we don't need produce empty bytes, here add
check to fix capture can't start issue.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-06 21:41:40 +00:00
Liam Girdwood c4492e48b7 dma-trace: fix DMA trace buffer must be DMA-able memory
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-06 15:18:37 +00:00
Liam Girdwood 1376a81f31 apl: probe all SSP ports in platform init
Fix. We must probe all our SSP ports in platform init.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-06 15:01:24 +00:00
Liam Girdwood 5972ac363d alloc: rmalloc must check other zones/pools for capabilities
rmalloc should also check the buffer heap if no capable memory can be
found in the runtime heap.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-06 14:15:32 +00:00
Pan Xiuli e92ef97834 ipc: replace ipc position update with memory window
Add memeory window for stream region. And position offset binding for
component. Replace IPC position update with memory window update.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-05 14:50:55 +00:00
Pan Xiuli aa562f81ba platform: add stream region into sof_ipc_window
Add stream region memory window into sof_ipc_window used for position
update.
For APL and CNL, we got a 1 page space for stream region.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-05 14:49:57 +00:00
Pan Xiuli be610d53f9 platform: add sof_ipc_window for byt, hsw and bdw
Add sof_ipc_window for all platforms, and add IPC send after boot
compelted. Also remove the deprecated ready window.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-05 14:49:46 +00:00
Liam Girdwood 1f6aee5a39 memory: allocator: Remove RFLAGS_NONE/USED and use caps
Dont use RFLAGS_NONE, but use the new memory capabilities flags instead.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-05 14:49:35 +00:00
Liam Girdwood c760f83100 memory: allocator: Add support for different memory types and mappings
Currently memory heap pools are statically defined in the allocator core
and don't define the capabilities of the memory in each pool.

This patch adds support for different memory capabilities so that users
can allocate memory that complies with any capability requirements for
requested memory.

The patch also moves the memory heap pool mappings to platform specific
code so that platforms can define their own mappings, support multiple
mappings and can move the mappings into different physical memory areas.
mappings

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-05 14:49:15 +00:00
Liam Girdwood 3ef88cf994 alloc: add sanity check for malformed images.
Add a sanity check to make sure that data/rodata contains expected values
otherwise this can cause unpredictable behaviour that is difficult to
later diagnose.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-05 14:49:04 +00:00
Yan Wang fc7dcbf141 ipc: Remove "void*" pointer of parse_page_descriptors().
Compiler cannot check the real type of "void*" pointer.
It is easy to cause pointer conversion error.
So use the pointer of element list of struct dma_sg_elem instead
of void* pointer.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-02 09:25:11 +00:00
Pan Xiuli 3943df6f45 rimage: read the fixup text size form ELF
The actual text size will change and the hard code base_fw_text_size_fixup
could not fit the changing size. We should get the fixup size from the
module info just from the memory mapping.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-02 09:06:30 +00:00
Pan Xiuli 6fe22aa929 apl: Add text size in module info
Add total text size we used in memory mapping into module info to
help rimage build the right FW binary.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-02 09:06:30 +00:00
Rander Wang f8126f09e4 cnl: dma: fix playback failed at second time
Stop dma at the end of playback, or next time dma
is not available for playback
2018-03-02 09:03:27 +00:00
Yan Wang 1693b66bb1 Fix pointer of struct dma_trace_data.
Liam's previous patch modify the structure variable from instance to
pointer. So it is unnecessary to use "&".
This parameter of parse_page_descriptors() is "void*", so complier
doesn't find this error.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-01 12:42:03 +00:00
Rander Wang 28cb21b578 cnl: clk: correct it on cnl according to spec
Signed-off-by: Rander Wang <rander.wang@intel.com>
2018-02-28 09:24:49 +00:00