Commit Graph

609 Commits

Author SHA1 Message Date
Tomasz Lauda 98d3a838cb cnl: dw-dma: Verify dma not NULL
Check if returned DMA is not NULL.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-29 13:43:42 +01:00
Tomasz Lauda 7f9d39c819 core: Limit children irq mask
Currently we support maximum of 32 children irqs, so limit the irq mask to not overflow the children irq array.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-29 13:43:42 +01:00
Yan Wang 15d3a51e58 APL/CNL: Fix: Change DMA trace position update calling.
When DMA host buffer is wrapped, host DMA copy need more time to
finish copying.
So previous implementation will output old trace when DMA host buffer
is wrapped because positions update is sent before DMA copying finished.
Now trace_work() will always update previous position and avoid this.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-29 13:41:56 +01:00
Keyon Jie eba34c566d host-gw: fix hda-dma not start at pause release issue.
We don't need stop host dma at pause, which is aligned with baytrail
GPDMA.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-29 13:40:44 +01:00
Liam Girdwood 7ec3a7cb65 core: comp: Add component trigger API call.
Add a new component API for performing atomic stream state change
operations. This leave the cmd API for non atomic usage.

This patch also does some renaming to use _trigger() instead of _cmd().

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Tested-By: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-29 09:29:15 +01:00
Ranjani Sridharan 1c417f9f3d trace: core: add macro to enable sending all trace to mbox
This patch introduces a new macro that can be used to enable sending
all trace messages to mbox alongside the local trace buffer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-28 12:21:30 +01:00
Ranjani Sridharan 7616ca4aff trace: core: replace _trace_error() with generic _trace_event_mbox()
This patch modifies the _trace_error function names to a more generic
name _trace_event_mbox() and updates users.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-28 12:21:30 +01:00
Ranjani Sridharan cb1fc87454 trace: core: add trace_flush()
This patch adds a new trace_flush() feature to flush
the last remaining trace messages during panic.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-28 12:21:30 +01:00
Pan Xiuli 3d8089ed0f dma-trace: Fix reschedule bug to avoid dma buffer overflow
We have wrong logic in reschedule, we always reschedule the trace_work
once the buffer is half full and new trace coming. We will delay the old
schedule before the old scheduled trace_work is finally run.
Thus the trace_work will like the carrot in front of the DSP as the donkey,
the DSP will never run the trace_work that scheduled in the furture
while we are in busy state and lots of trace are coming continuously.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
Reviewed-by: Zhigang Wu <zhigang.wu@linux.intel.com>
Reviewed-by: Yan Wang <yan.wang@linux.intel.com>
Tested-by: Zhigang Wu <zhigang.wu@linux.intel.com>
2018-03-27 11:49:52 +01:00
Wu Zhigang 9112ee51b9 sof: Turn IRQs off globally when send command to pipeline component
When pipeline processing the command, we have to turn off the IRQs.
If not, the DMA IRQ will interrupt the pipeline state set process,
when pipeline is scheduled, the states inconsistence will cause xrun.

Signed-off-by: Wu Zhigang <zhigang.wu@linux.intel.com>
2018-03-27 11:48:09 +01:00
Ranjani Sridharan 210989dffe trace: core: add trace_error_value() and update users
This patch adds a new trace feature to send any error states/values
after the trace messages to mbox and modifes users of trace_value()
to use trace_error_value().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-26 08:38:16 +01:00
Liam Girdwood 1f8c6c4d20 ipc: trace: DA1 message is not an error.
Fix it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-23 14:18:42 +00:00
Liam Girdwood 915354cbb0 xtensa: arch: fix 64bit timer.
Timer would miss overflow condition, now logic same as BYT 64 bit timer.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-23 14:18:05 +00:00
Ranjani Sridharan 461200b950 volume: Add support for 4 channel input
This patch adds support for 4 channel input in volume

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-03-23 11:35:18 +00:00
Liam Girdwood 70f6636e68 hsw: ipc: ipcx/ipcd are only used for doorbell
IPCX and IPCD are 32bit wide and should only be used for doorbell on
HSW and BDW. Payload should be in mailbox.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-22 15:59:53 +00:00
Yan Wang d6fc4ece12 CNL: DMA: Add chan_size setting for host/link DMA IN/OUT on CNL.
"chan_size" is used for calculation of DMA register offset.
It must be set otherwise only the first channel is available.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-22 10:58:26 +00:00
Rander Wang 7e58038e8d cnl & apl: ssp: fix a typo for SOF failed with pulseAudio
Refine ssp setting, set SSRSA to stop capture, set SSTSA to
stop playback
2018-03-22 10:45:52 +00:00
Tomasz Lauda 7c94202ad2 cnl: scheduler: Add list of tasks per irq level
This patch adds list of tasks per each irq level and fixes the problem,
where scheduler tried to schedule the same task two times.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-21 16:57:46 +00:00
Tomasz Lauda 480407f474 cnl: core: Enable L1 cache for DSP
This time really enable L1 cache as we missed one more setting in boot_ldr.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-21 15:57:36 +00:00
Pan Xiuli 62664dfbbd mailbox: fix mailbox mappings to include exception space.
Fix mailbox mapping on BYT, HSW, APL and CNL.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-21 15:49:20 +00:00
Tomasz Lauda ecf43dd9da cnl: ssp: revert hardcoding TFT and RFT
This patch reverts hardcoding TFT and RFT values to 8.
They are now properly calculated below.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-21 09:47:57 +00:00
Tomasz Lauda 4c1d449543 cnl: ssp: fix ssp settings
We change ssp settings in order to properly transmit and receive data:
1. Use frame end padding instead of dummy stop bits.
   This way alignment bits will be transmitted at the end of whole frame instead of every slot.
2. Disable receive without transmit mode.
3. Do not change the source for MCLK.
4. DSP_A format shouldn't have start delay.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-21 09:47:37 +00:00
Liam Girdwood 856f768e3a version: Strip SOF_FW_XXX_ prefix from version number
The version information is generated using git tags and needs to be
numerical for version.h usage.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-21 09:42:56 +00:00
Tomasz Lauda ffd9093267 cnl: don't switch to lower clock
We don't want clock optimizations right now, so stay with 400 MHz clock.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-20 20:44:52 +00:00
Yan Wang 75ac44f663 Disable high frequent trace message in dw_dma_irq_handler().
It will cause DMA trace local buffer overflow and unnecessary.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-20 16:48:07 +00:00
Pan Xiuli c0025344ed dw-dma: Fix channel status for CNL
At the end of the DMA, we need to set the channel status into
parapre, otherwise next dma start will fail.
This will fix CNL pause resume issues.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-20 16:47:24 +00:00
Yan Wang a3fab58d59 Use tracev instead of trace for some high frequent traces on APL/CNL.
DMA trace itself uses DMA copying which will cause some DMA copying
related traces are called recursively.
So use tracev to avoid this.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-19 09:02:26 +00:00
Liam Girdwood f65131645f rimage: manifest: Move text offset into non immutable ROM structure.
text_offset was added to an immutable ROM structure that would break
some tools and cause instability. Fix this by creating a new structure
for rimage manifest data that can be modified without breaking the ROM
ABI.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-19 08:34:52 +00:00
Liam Girdwood d5def3349b byt: panic: Set IPCD with panic reason IPCX for trace point.
Aligned with driver.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-17 20:37:54 +00:00
Liam Girdwood 0c0281ba3f core: ipc: Fix error handling pointer deref
elem.next/prev can be accessed whilst NULL in certain error handling
conditions.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-16 13:22:11 +00:00
Liam Girdwood 25233ea17a trace: dma: remove disable DMA trace option
DMA based trace is the standard default trace method. mailbox trace is
no longer supported.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-03-16 10:30:48 +00:00
Tomasz Lauda 3542fc3c7d cnl: fix multiple streams
DMA channel should only be stopped, when corresponding interrupt is triggered.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-16 10:00:31 +00:00
Yan Wang 18f0a7c8c4 Increase HEAP_SYSTEM_SIZE for DMA trace local buffer.
After enable DMA trace on APL, original HEAP_SYSTEM_SIZE is not
enough and will cause allocation failure.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-16 09:13:51 +00:00
Tomasz Lauda 2a0bf7ddfa cnl: enable L1 cache
Enable L1 cache for DSP.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-15 21:25:55 +00:00
Tomasz Lauda 8c603f4451 cnl: fix buffer caps
DMA buffers should only reside in HEAP_HP_BUFFER.
This assures 128 byte address alignment.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-03-15 21:25:50 +00:00
Keyon Jie cc54f1313d apl-ssp: fix capture double speed issue
Previously TFT and RFT are set to 0s which means we are using
threshold level 1, where interrupt asserts for every valid bits
of each slot(e.g. for s16_le capture, interrupts assert for
each 16 bits), but DMAC will treat it as notification of one
full sample(e.g. 32 bits for s16_le stereo) and read those all
bits, this will lead to capture with double speed at format
s16_le stereo.

Here add handle for FIFO trigger Threshold level, set them to
bytes for each full sample(active_slots * valid_bits / 8), and
the issue is fixed.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-15 14:08:50 +00:00
Pan Xiuli ced518efdb host: Stop dma when pause
For gw-dma host, we need to stop the dma to make sure status are correct
for resume.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-15 08:18:46 +00:00
Keyon Jie aa09938fd3 interrupt: cannonlake: fix the software interrupt macro num gap
We add SOFTWARE1 and remove SOFTWARE10 to fix the gap, and change
the corresponding calling.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-14 10:01:32 +00:00
Keyon Jie f9a154f765 interrupt: apollolake: fix the software interrupt macro num gap
We add SOFTWARE1 and remove SOFTWARE10 to fix the gap, and change
the corresponding calling.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-14 10:01:32 +00:00
Yan Wang c0ec5743c5 APL/CNL: Initialize DMA trace data structure and definition on APL/CNL.
Add dma_trace_init_complete() calling on APL/CNL platform.
And use DMA_HOST_IN_DMAC as PLATFORM_TRACE_DMAC for DMA trace copying.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-14 09:56:15 +00:00
Yan Wang e1604c96a3 APL/CNL: Implement host DMA setting and position update on APL/CNL.
The host DMA has the different config method:
1. Get DMA channel based on stream tag.
2. Prepare DMA elem list based on local DMA trace buffer which make
sure that one trace record data can be transferred at least.
3. Need start DMA on firmware side before trigger start on kernel side.
4. Because no DMA callback in host DMA, add position update
calling at the end of trace_work().

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-14 09:56:15 +00:00
Yan Wang df7fbb37d9 APL/CNL: Save stream tag and host buffer size from kernel driver.
It is necessary to save stream tag and host buffer size for host
DMA setting.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-14 09:56:15 +00:00
Yan Wang ef4ec1f366 APL/CNL: Implement host DMA copy in existed DMA copy API.
Get DMA channel based on stream tag when use host DMA.
Need also call different API in dma_copy_to_host_nowait().

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-14 09:56:15 +00:00
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