Commit Graph

5344 Commits

Author SHA1 Message Date
Adrian Bonislawski cc0f713e75 ipc: header size validation fix
This patch will deny IPC headers with size 0

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-06-05 13:57:37 +01:00
Tomasz Lauda aef54e4066 init: add missing inclusion
Adds misssing inclusion of drivers\interrupt.h.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-05 10:23:06 +03:00
Tomasz Lauda 01819425f9 io: add additional variations of reg access functions
Adds additional variations of register access functions:
- 64 bit register write,
- 8 bit register read,
- 8 bit register write,
- 8 bit register update.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-04 15:51:53 +01:00
Karol Trzcinski 014499c5db component: Align struct description
If it's possible, each line with comment to struct field
should be aligned, to keep code style consistent.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-04 15:42:52 +01:00
Karol Trzcinski 2c6cf95c73 component: Use UUID value stored in SRAM memory in component driver
It allows to comparison this full UUID value with value in IPC message,
what is important step to create new component from topology by their
UUID value.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-04 15:42:52 +01:00
Karol Trzcinski 03d92cef52 sof: Put UUID value of IPC components to runtime memory
UUID entries, related with components from topology,
should be loaded into SRAM to allow runtime comparison with
value in IPC message during component creation.
UUID of the components whose are not created by IPC message
are not needed in runtime, so there should not be there to
reduce memory consumtion - as it is now. It's untouched.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-04 15:42:52 +01:00
Karol Trzcinski 27d4c943f3 testbench: Add UUID for file component
Each component driver should have assigned UUID value and trace
contecxt, to allow generic component creation routine usage.
It's espiecially important for trace context, because it's
accessed by pointer so dereferencing NULL pointer will lead to
segmentation fault.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-04 15:42:52 +01:00
Tomasz Lauda c6f1609c51 mn: cleanup definitions
Cleanups MCLK and MN related functionality. Moves some defines
from ssp to mn header. Also hides some definitions in platform
specific headers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-04 15:31:06 +01:00
Janusz Jankowski 2a66504b29 schedule: dma: check irq register result
Check if re-register failed in dma_domain_unregister_owner.
Error reported by clang static analyzer.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-06-04 14:59:50 +01:00
Tomasz Lauda 3f079f9c0f ssp: use default clock for platforms without M/N dividers
Uses default SSP source clock for platforms without support
for M/N dividers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-04 14:27:05 +01:00
Tomasz Lauda a62f7a79fb dmic: add DMIC_HW_VERSION 3
Implements new DMIC_HW_VERSION 3. It requires to set ipm values
no matter how many controllers are implemented.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-04 14:25:50 +01:00
Slawomir Blauciak 9b2b031da7 topology: fix pipeline parameters mismatched with hardware configuration
The stream parameters set in the pipeline were mismatched with
the DMIC hardware configuration, which resulted in failures.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2020-06-04 14:22:36 +01:00
Karol Trzcinski ef43899c58 trace: Put global trace context entries to separate section
To allow changing trace level of global elements, like
system agent or component driver, than it must be possible
to find corresponding trace context.
It is the first step to allow iterating over the trace context
entries and find what we are looking for. Linker variables
_trace_ctx_start and _trace_ctx_end will be needed to know
this section size in runtime code.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-03 15:10:13 +02:00
Marc Herbert e25cfc1ac5 .gitignore: don't ignore all .* hidden files in every subdirectory
That's too extreme and was probably accidental because the rest of
commit d721347ad9 ("gitignore: ignore boot loaders and binaries.")
seems not related at all.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-03 14:21:00 +03:00
Marc Herbert c9c1b225e3 Kconfig: use relative 'rsource' paths so SOF can be a Zephyr module
As documented in https://docs.zephyrproject.org/2.2.0/guides/modules.html,
Zephyr and Kconfiglib support merging Kconfig menus across multiple git
repos. This requires relative inclusion paths.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-03 10:46:34 +01:00
Adrian Bonislawski a21cba16d9 ipc: check state in comp_free
This will prevent removing the component if not in a proper state
as required in our security requirements

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
2020-06-02 13:22:59 +01:00
Tomasz Lauda 59b4fcb11d idc: extract common protocol functions
Extracts IDC protocol related code to common file.
Platform specific driver has just the implementations
for hardware specific operations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-02 10:19:54 +02:00
Rander Wang 30e801c4d4 topology: sdw: fix dmic issue on tgl sdw platforms
Port commit a716056c4b ("tgl: use additional CHANNEL
define in rt711 + rts1308 tplg") to all tgl sdw platforms

Signed-off-by: Rander Wang <rander.wang@intel.com>
2020-06-01 10:55:36 +01:00
Karol Trzcinski c317729477 trace: buf: Add trace context for each buffer instance
Each buffer instance should use own trace context to allow
setting different log level per buffer.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-01 10:46:33 +01:00
Karol Trzcinski 483818a895 trace: pipe: Add trace context for each pipeline instance
Each pipeline instance should use own trace context to allow
setting different log level per pipeline.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-01 10:46:33 +01:00
Karol Trzcinski eb96c62015 trace: comp: Add trace context for each component instance
Each component instance should use own trace context to allow
setting different log level per component.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-06-01 10:46:33 +01:00
Daniel Baluta b040f2bf2b drivers: imx: Disable FIFO warning DMA flag
FIFO warning flag signals if SAI FIFO is empty (for transmitter)
or full (for receiver) and it is cleared automatically if the condition
is removed.

We already use FIFO request flag to signal DMA for data availability
so there is no need to enable FIFO warning DMA flag.

This aligns SAI firmware driver with SAI Linux kernel driver.

Also, this mitigates a problem in the SDMA driver where multiple
starting and stopping aplay in a loop results in an I/O error
after some time.
Investigation should continue to fix the SDMA driver.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-01 10:45:00 +01:00
Tomasz Lauda 7481be7bc3 bootloader: init HP SRAM based on PLATFORM_MEM_INIT_AT_BOOT
Initializes HP SRAM based on PLATFORM_MEM_INIT_AT_BOOT definition
instead of checking for cAVS version.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-01 11:23:57 +02:00
Tomasz Lauda bb0676da13 bootloader: don't check for CONFIG_BOOT_LOADER
Stops checking for CONFIG_BOOT_LOADER in boot_loader module.
It makes no sense, since this file is only compiled when
CONFIG_BOOT_LOADER is set.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-01 11:23:57 +02:00
Tomasz Lauda 4cd2af27bb boot_loader: use existing memory power gating functions
Removes from bootloader duplicated memory power gating functions
and uses existing implementations from pm_memory.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-01 11:23:57 +02:00
Tomasz Lauda 32ccc09edc pm_memory: simplify HP SRAM power related functions
Refactors and simplifies functions related to HP SRAM
power gating operations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-01 11:23:57 +02:00
Tomasz Lauda 11265e3e4f pm_memory: add functionality to handle also LP SRAM
Refactors pm_memory in order to add functionality to also
power gate LP SRAM in a similar fashion.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-01 11:23:57 +02:00
Tomasz Lauda 91bdf1a5de pm_memory: move everything to cAVS platform
Moves the entire pm_memory header from public directory
to cAVS specific one. Power management for memory is
currently done only for cAVS, so there is no point in
keeping one function public.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-01 11:23:57 +02:00
Tomasz Lauda e9d84cbc43 task: increase default stack size for EDF tasks
Increases default stack size for EDF tasks. Some of the
IPC operations are very stack heavy, so let's make sure
they won't exceed stack.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-01 11:23:32 +02:00
Tomasz Lauda 465a69fbc9 ipc: prevent SSP dai config double execution
Prevents DAI config to be executed double for SSP.
Along with this change we need to share dai private data.
From now on master core will be always responsible for setting
dai config on dai and it may happen that private data is allocated
by slave core.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-06-01 11:22:57 +02:00
Marcin Maka 5d190901e0 dai: add more info to err messages
Error messages should deliver as much information as possible
to speed up the debug process. Otherwise it relies on presence
of other info-level information in the log and requires scrolling
back to find out things that could be discovered immediately.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-06-01 10:00:12 +01:00
Seppo Ingalsuo 145d9aa09f Tools: Tune: Improve robustness of remote audio measure
Frequency response measure script mls_freq_resp.m could fail due to
network or ssh execution delays. This patch increases the recording
time by 3 seconds to ensure that remote device playback via ssh for
the relevant parts is within the local capture window.

Also the start marker search is done for first 5 seconds of captured
test signal. The script exits cleanly if the start and end markers
were not found and the captured waveform is shown to help understand
the possible network delays caused issue.

The BSD-3-Clause text is updated to short version.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-29 15:59:33 +01:00
Karol Trzcinski bebdbca87b rimage: Update to version with changed headers location
In new version of rimage software, headers are located in
rimage/src/include/rimage directory to make it easily accessible
from another source code without include path collision.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-05-29 11:15:22 +01:00
Marcin Maka caae629f79 tools: sof-ri-info: make cse mft parsing optional
It is a special --no_cse mode useful in case the cse part is
unparsable for any reason. Cse manifest parsing is skipped and
Adsp part is parsed only.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 58e244ee88 tools: sof-ri-info: add more verbose info about parsing progress
Running with -v option now gives more information about
the parsing progress which makes debug easier.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka a28525b23b tools: sof-ri-info: fix css mft parsing for bin with ext mft
CSS Manifest header must be created with file offset adjusted
by extended manifest size to loop through extensions correctly.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 3f39319549 tools: sof-ri-info: remove trailing zeroes from strings
Strings are padded with zeroes in the binary input file,
so rstrip used after decode removes them, otherwise such
a string cuts the output if inserted as argument in the
middle.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 5c3d0225a9 tools: sof-ri-info: display memory map
Information about modules memory occupation is displayed
when memory layout of the target platform is known
(determined by the fw binary name).

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka ebf381658f tools: sof-ri-info: compact layout of module entry info
More compact output is better for binaries containing
many module entries.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka ec13b0828f tools: sof-ri-info: add modules only mode
Additional parameters added:

no_modules - works like previous 'headers' option where
modules are excluded from output

no_headers - excludes cse manifest headers from output
and dumps info about the adsp modules only

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 8885b465df tools: sof-ri-info: move parsing adsp mft outside cse mft
There might be binaries where cse mft is not included.
And adsp mft begins at std offset 0x2000 from the optional
extended manifest.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka dcefb7f753 tools: sof-ri-info: log via info method only
All logging dispatched via Reader info method is more
consistent and better controlable.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Marcin Maka 4b7523c8c9 tools: sof-ri-info: use colors for terminal output only
Do not use colors if stdout is not a tty.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-05-28 20:25:48 +02:00
Tomasz Lauda e1efef73f3 ssp: fix log
Fixes invalid sequence of log parameters.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-28 14:05:17 +02:00
Tomasz Lauda 46897802a4 timestamp: move functionality to separate driver
Moves timestamp functionality into separate driver. This way every
future platform can have its own implementation.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 19:14:57 +02:00
Tomasz Lauda 1070ff5086 mn: use M/N dividers based on platform support
Compiles out M/N divider related functions based on
whether platform supports them or not. Currently
all cAVS platforms support dividers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 19:14:57 +02:00
Tomasz Lauda a4b7680adf ssp: move ssp driver out of the cavs specific directory
Shared ssp driver implementation between all possible Intel
platforms and not only cAVS. Currently depends only on cAVS,
since all other supported platforms don't support it.
Implementations for Baytrail and Haswell stay in their respective
platform directiories. It's built based on CONFIG_INTEL_SSP.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 19:14:57 +02:00
Tomasz Lauda f545e3e832 dmic: move dmic driver out of the cavs specific directory
Shares dmic driver implementation between all possible Intel
platforms and not only cAVS. Currently depends only on cAVS,
since all other supported platforms don't support it.
It's built based on CONFIG_INTEL_DMIC.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 19:14:57 +02:00
Tomasz Lauda 836ea9b0bd alh: move alh driver out of the cavs specific directory
Shares alh driver implementation between all possible Intel
platforms and not only cAVS. Currently depends only on
cAVS, since all other supported platforms don't support it.
It's built based on CONFIG_INTEL_ALH.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 19:14:57 +02:00
Tomasz Lauda b181bf09fc hda: move hda driver out of the cavs specific directory
Shares hda driver implementation between all Intel platforms and
not only cAVS. Currently it depends only on cAVS, since no other
supported Intel platform has the hardware. It's built based on new
CONFIG_INTEL_HDA, which is mandatory for cAVS and not user selectable.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-27 19:14:57 +02:00