Commit Graph

663 Commits

Author SHA1 Message Date
Liam Girdwood 7e91484c26 uapi: ipc: Add executable memory flag
Add flag to mark memory as executable.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 21:50:38 +01:00
Liam Girdwood 7db25d8924 rimage: add support to build and sign runtime modules
Currently rimage only supports building ELF images with know TEXT, DATA
and BSS addresses. This patch adds support to build runtime relocatable
modules that can be loaded linked into the base SOF FW at runtime.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 21:49:19 +01:00
Liam Girdwood 78e7f30f42 ipc: page tables: Make page table API generic for use outside IPC core
Allow users outside of IPC to make use of compressed host page tables.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 20:45:47 +01:00
Liam Girdwood 301418d94d rimage: fix formatting and alignment of manifest section printf
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 16:40:31 +01:00
Liam Girdwood 4736bd7379 host: string: remove xthal references.
xthal only needed for xtensa arch.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 15:52:40 +01:00
Liam Girdwood 54e833e7a4 host: build fix for missing string.h
Add string.h for host build.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 14:31:51 +01:00
Liam Girdwood 8c71c4466b core: sof.h: remove unused code.
Code is not used or referenced anywhere.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 09:04:02 +01:00
Liam Girdwood 0e26f15448 rimage: display ELF section names.
Display the name of each ELF section to aid build and debug.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 08:58:02 +01:00
Liam Girdwood 5d7ad56d84 lib: string: Add rstrcmp() string compare.
Add strcmp() equivalent.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-12 08:56:53 +01:00
Keqiao.Zhang 949c4339ab dist: fix make dist compiling issue for HSW, APL and CNL
Signed-off-by: Keqiao.Zhang <keqiao.zhang@linux.intel.com>
2018-04-11 19:42:41 +01:00
Tomasz Lauda 7f35266a78 configure: Fix --with-dsp-core flag
--with-dsp-core flag should accept every core name.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2018-04-06 11:53:27 +01:00
Pierre-Louis Bossart 6900f4d094 uapi: ipc: move sample_valid_bits to SSP definitions
This field doesn't mean anything for DMIC or HDaudio, move it
where it makes sense (I2S/TDM modes)

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:21:45 +01:00
Pierre-Louis Bossart e7fd644c5e uapi: ipc: start moving SSP-specific fields into ssp structure
sample_valid_bits remains in main structure for now since it is
handled with a generic dai token.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:21:45 +01:00
Pierre-Louis Bossart fbcbe586d0 uapi: ipc: remove zero-length array for DAI IPC
Making this dynamic doesn't really save much memory and makes the
code more complex for no good reason

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:21:45 +01:00
Pierre-Louis Bossart 7579429eb6 uapi: ipc: align SSP IPC with kernel
Rename fields to follow topology definitions
Add placeholder for new fields for quirks and associated pdata
No functionality change

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:21:45 +01:00
Pierre-Louis Bossart 04b68062fe uapi: ipc: change DAI sample_valid_bits definition
The kernel uses this value as 32-bit uint, use the same definitions

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:21:45 +01:00
Pierre-Louis Bossart 1562d1fd3b uapi: ipc: align ipc.h with kernel
Style corrections and addition of panic codes

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:21:45 +01:00
Liam Girdwood d2cdb21084 Merge branch '1.1-stable' 2018-04-05 15:12:56 +01:00
Pierre-Louis Bossart 81708a5d2a sof: global replacement of 'reef' by 'sof'
Let's remove reef to avoid confusion/legacy.
no functionality change but the name of generated files
will change so targets and install scripts will need
to be updated

There should be only one occurrence of "Reef" left in
rimage/file_format.h, left as is for backwards compatibility.
This may be changed separately at a later point.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:10:14 +01:00
Pierre-Louis Bossart eb9b9231a7 clean: dos2unix: broadwell.x.in (take2, really clean)
Previous attempts left file in DOS mode

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:09:16 +01:00
Pierre-Louis Bossart 6989dd0e2d clean: dos2unix: haswell.x.in (take2, really clean)
Previous attempts left file in DOS mode

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:09:01 +01:00
Pierre-Louis Bossart 863805c051 clean: dos2unix: baytrail.x.in (take2, really clean)
Previous attempts left file in DOS mode

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 15:08:40 +01:00
Pierre-Louis Bossart a8bab6df81 clean: fix style warning before big SOF rename
Remove checkpatch warnings before the rename
to better track real ones

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 14:38:47 +01:00
Pierre-Louis Bossart 0f71a415ab interrupts: harden macros with parenthesis
It's crazy to use shifts and masks without parenthesis

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 14:38:47 +01:00
Pierre-Louis Bossart 3477df30d3 interrupts: fix non-sensical macro
Parenthesis are not balanced, not sure if/how this ever worked?

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-05 14:38:47 +01:00
Liam Girdwood 017c40bb67 dist: fix make dist for SRC
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-05 10:25:46 +01:00
Liam Girdwood c819afd16f clean: dos2unix: broadwell.x.in
Remove any DOS line termination.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-04 20:50:58 +01:00
Liam Girdwood 9e2750a1e6 clean: dos2unix: haswell.x.in
Remove any DOS line termination.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-04 20:50:25 +01:00
Liam Girdwood e831c81e6f clean: dos2unix: baytrail.x.in
Remove any DOS line termination.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-04 20:49:45 +01:00
Liam Girdwood 9383717cc3 core: atomic: Add atomic addition and subtraction APIs
Add APIs to allow atomic additions or subtractions.

This API can be used to synchronize buffer W/R pointers between
pipelines and components running on different DSP cores.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-04 16:37:43 +01:00
Liam Girdwood f32a390432 scripts: checkpatch: don't complain about int_t uint_t types
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-04 15:54:03 +01:00
Liam Girdwood 4a40468b6c scripts: checkpatch: dont complain about missing MAINTAINERS
File not used by SOF.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-04 15:50:44 +01:00
Liam Girdwood 06160169c9 ipc: core: rename intel-ipc.c to handler.c
Rename as there is nothing Intel specific about the IPC. It's generic.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-04 15:48:38 +01:00
Liam Girdwood 15a613f1f1 drivers: ssp: rename ssp.c to byt-ssp.c
Make way for hsw-ssp.c and make it easier to differentiate ssp drivers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-04 15:35:57 +01:00
Pierre-Louis Bossart b9880a5404 sof: scripts: build rimage in xtensa scripts
rimage is not built by default, which can lead to disconnects and
awful bugs when the memory layout changes.

Add rimage build+install as default for xtensa scripts

The BKM should be to rely on executing
./scripts/xtensa-build-all.sh [byt|cht|apl|cnl]
instead of manual commands...

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-04 15:13:43 +01:00
Liam Girdwood dff1bafc3a Merge tag 'v1.1'
v1.1
2018-04-04 15:02:18 +01:00
Pierre-Louis Bossart 082c86f9c5 mailbox: move multi-line macros to static inlines
Detected with Coverity:

In do_notify: The indentation of this code suggests it is nested when
it is not. (CWE-483)

multi_stmt_macro: The macro on this line expands into multiple
statements, only the first of which is nested within the preceding
parent while the rest are not.

	if (msg->rx_size && msg->rx_size < SOF_IPC_MSG_MAX_SIZE)
		mailbox_dspbox_read(msg->rx_data, 0, msg->rx_size);

Move mailbox macros to inline functions to remove the issue, keep
indentation the same and add typecasts as needed

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-03 15:03:45 +01:00
Pierre-Louis Bossart 669e7c9d65 sof: solve circular dependencies, move rmemcpy/arch_memcpy definitions
The preprocessor doesn't seem to care about circular dependencies,
the compiler does. So before we replace multi-line macros with
static inlines, move rmemcpy/arch_memcpy to a reef/string.h and
arch/string.h header file.

This is mostly useful for the mailbox functions, which depend on rmemcpy
but are also called from arch/reef.h dump/panic utilities

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-03 15:03:45 +01:00
Pierre-Louis Bossart f7471abe8f sof: scripts: force PATH to compile xtensa without environment dependencies
The ROOT is already assumed to be as $pwd/../xtensa-root/$ROOT,
set the PATH as well

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2018-04-03 15:03:45 +01:00
Keyon Jie c8586154c4 Host: fix error return handlings for some dma invokings.
Add hanle for error on dma_set_config(), dma_start() and dma_copy().

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-04-03 14:56:50 +01:00
Yan Wang 970bd97b82 Use tracev instead of trace for dai irq event.
This event is in pipeline and will produce many trace data in a short
time. It should use tracev to disable it by default.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2018-04-02 10:04:38 +01:00
Liam Girdwood d3d5b3159a Revert "dai: copy: Move buffer pointer updates into dai_copy()"
This reverts commit 7f9110c4c0.

This does not work when both buffer data consumer and producer are DMACs.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-04-02 10:00:44 +01:00
Wu Zhigang 7f9110c4c0 dai: copy: Move buffer pointer updates into dai_copy()
Move the DAI's buffer pointer update location from dai_dma_cb()
to dai_copy(). This fixes an occasional race where xrun recovery can
become out of sync with other pipeline components.

Signed-off-by: Wu Zhigang <zhigang.wu@linux.intel.com>
Tested-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-31 15:27:43 +01:00
Keyon Jie 9052f91303 dai: handle xrun with more clear logic
1. xrun happens.
2. trigger pipeline xrun and recover.
3. set dd->xrun in XRUN cmd from pipeline recover.
4. stop dma and reset buffer to 0s.
5. dai prepare and clear dd->xrun in prepare calling from recover.
6. start dma again in START cmd from pipeline recover.

This fix APL pause/release Xrun issue in my test.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2018-03-30 16:10:04 +01:00
Liam Girdwood 08f857088c cnl: core: Add support for xcc
xcc has more strict rules than gcc:
- Add missing sections to linker scripts
- Fix compile warnings
- Extend memory enabling timeout to infinite (too small delay for xcc)

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>

# Conflicts:
#	src/platform/apollolake/platform.c
#	src/platform/cannonlake/platform.c
2018-03-30 14:44:17 +01:00
Yan Wang 9f28604c3d APL/CNL Fix: Only send position once after copy DMA trace data on APL/CNL.
Firmware side should not send position in every trace_work() is called.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-30 12:16:59 +01:00
Yan Wang f09093a9a6 Fix: Don't update avail trace size when DMA copying fails.
When DMA copying fails, its returned copy size is negative error
number. So it shouldn't be used to update avail variable.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
2018-03-30 10:41:03 +01:00
Pan Xiuli e1c903bd6f dw-dma: recover dma status when release
Resume pause will re-start DMA, which will cause the DMA status diff
from buffer COMP. Add a release function to recover the status mainily
for LLI now.

This patch fixes pause/resume noise issues.

Tested-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-03-30 10:34:30 +01:00
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