Commit Graph

3478 Commits

Author SHA1 Message Date
Daniel Leung c00d39c71b Add rimage as a git submodule
This adds rimage as a git submodule by running:
  git submodule add https://github.com/thesofproject/rimage.git rimage
  git submodule set-branch --branch master rimage

This also modifies the build script to build the tool.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Daniel Leung bf795c5b24 Move signing key pair from rimage/ up one level
This is in preparation to make rimage as a standalone tool
outside of the SOF source tree.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Tomasz Lauda 2c9bb6372e cavs: platform: fix debug region size in FW ready
Fixes debug region size passed in FW ready message.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-05-07 17:49:12 +01:00
Seppo Ingalsuo fed3d2f3a9 Testbench: Add definition for token SOF_TKN_COMP_CORE_ID
This patch adds the token into header file tokens.h. It is used for
topology parsing for testbench and fuzzer. The same token has been
already defined in topology m4 macros.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:33:07 +01:00
Seppo Ingalsuo aded79d417 Audio: Set default SRC coefficients to 16 bits for APL platform
This patch adds for SRC component rate conversion filters coefficients
set selection to Kconfig. The menu entry allows to select a 16 bit or
32 bit set.

The default for Apollolake is changed to 16 bits to free up .bss for
other development. There's no known critical usage for SRC so the
lower quality and less conversions available should be acceptable.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-05-07 17:13:18 +01:00
Daniel Baluta ba883515b7 lib: imx8m: Switch to SDMA3
Both SDMA2/SDMA3 can move data from SDRAM to Peripherals. Anyhow, SDMA2
is traditionally used by non-DSP use case, so switch to SDMA3 to allow
for future use cases where we could have a scenario with multiple Audio
perhipherals running in parallel.

This also aligns the code with legacy firmware.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-05-07 13:36:49 +01:00
Marcin Maka 6ce635aa82 trace: replace TRACE_CLASS_ by uuids
All trace entries are identified by uuids only now.
Previous TRACE_CLASS_ identification removed completely.

UUIDs are passed to the tracing subsystem inside a trace
context. Each trace context defines run-time log level.
The level is initialized to LOG_LEVEL_INFO (this may be
change per instance is needed) and may be re-configured
at run-time.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-30 11:39:37 +02:00
Marcin Maka 14a6961bc9 mux: trace: create dedicated uuid for mux comp drier
Define missing uuid for mux comp driver.
There are two component types, so two different uuids must
be defined.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-30 11:39:37 +02:00
Marcin Maka 58977add50 mux: trace: fix uuid name assigned to demux driver
demux_uuid should be assgigned to comp_demux.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-04-30 11:39:37 +02:00
Tomasz Lauda af38b20bc8 pipeline: do not cancel task on xrun
We should not explicitly cancel pipeline task on xrun.
Xrun is handled by different functions and task state
flow will be handled by START and STOP commands.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-28 14:56:33 +02:00
Tomasz Lauda 1b57609a1e volume: do not schedule ramping as separate task
We should not be scheduling ramping as a separate task.
This patch makes it a part of copy function, which allows
for removal of entire schedule related code.
Ramping is done in maximum of 1 ms chunks by using functions
for retrieval of nearest zero crossing frame.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-28 12:57:48 +02:00
Tomasz Lauda 0a82b71a5b volume: implement functions for getting zero crossing frame
Implements functions for getting nearest zero crossing frame.
They will be used to reduce zipper noise during volume ramping
by updating ramp only on such frames. In the current implementation
average value of all channels is used to check sample sign change.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-28 12:57:48 +02:00
Daniel Baluta 60a5a96bbb drivers: imx: Writeback cache for desc/ccb/ctx
We need to make sure that backend memory is updated for
desc/ccb/ctx because they are modified in sdma_prep_desc.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 19:49:43 +03:00
Daniel Baluta 834b3d5c28 drivers: imx: sdma: Remove debug logs in sdma_interrupt
This logs are not very useful as SOF core calls this function
for all 32 channels, thus not providing much information.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 19:49:43 +03:00
Daniel Baluta 2a46ef6279 drivers: imx: sdma: Fix SDMA copy
Desired design of data copy uses 2 BD linked in a cyclic way.
This 2 BDs will act as a ping-pong buffer.

When a DMA channel is active the SDMA script will run and will look
for a BD with BD_DONE bit set. This means that BD is ready for transfer.
When SDMA transfer the current BD, pipeline works on filling the next
BD.

In order to implement this, we introduce next_bd which keeps track
which is the next BD to be made ready for SDMA.

Also, signal DMA_COPY notifier to prepare next BD for transfer.

Because, now only one BD is ready for transmit notice that in sdma_copy
function we get rid of the loop iterating over all BDs and just set
BD_DONE flag only to next_bd ready to be run.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 19:49:43 +03:00
Daniel Baluta e3df9e3550 drivers: imx: Set priority 0 to all channels
This is part of the initialization process, where
we make sure no channel is ready to run until all
configuration is done.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 19:49:43 +03:00
Daniel Baluta eafe58e55d drivers: imx: sdma: Make sure SDMA is not started yet
MC0PTR is the address of the first control block. Keep this
0 until everything is configured properly.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 19:49:43 +03:00
Daniel Baluta a27633a958 drivers: imx: sdma: Fix status r/w position
sdma channel type can also be _MCU2SHP/_SHP2MCU but this
case was missed from sdma_status.

Fix it now.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 19:49:43 +03:00
Daniel Baluta 33a0990cc4 drivers: imx: sai: Configure MCLK signal pin as output
For i.MX8MP the MCLK that enters codec is generated by SAI MCLK pin.
To allow this we need to configure MCLK pin as output.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 14:24:01 +01:00
Daniel Baluta 07da0a8145 drivers: imx: sai: Write data to FIFOs before enabling channels
If the channel is enabled before data is pushed to FIFOs, there is a small
chance to race here causing an underrun for Tx.

So, in order to avoid this add zeroes to FIFOs before actually enabling
the channels.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 14:24:01 +01:00
Daniel Baluta 63b872f027 drivers: imx: sai: Set SAI channel mode to output mode
CHMOD configures transmit data pins for:
  - 0b, TDM mode transmit data pins are tri-stated when slots are
        masked or channels are disabled.
  - 1b, Output mode, transmit data pins are never tri-stated and
        will output zero when slots are masked or channels are disabled.

We noticed that when data pins are tri-stated, there is noise on
some channels when FS clock value is high and data is read while
fsclk is transitioning from high to low.

So, select CHMOD to output mode so that pins will output 0.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 14:24:01 +01:00
Daniel Baluta 29414aa25e platform: imx8m: Fix FIFO depth for i.MX8M
On i.MX8M series, SAI FIFO is configured to hold 128 words.
(128 x 32 bits).

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-24 14:24:01 +01:00
Tomasz Lauda 761bbac5ac host: dai: limit number of bytes copied to one period
This patch limits number of bytes copied from DMA source
to maximum of one period size per one copy. This does not
change anything for DMA driven pipelines, but only for
timer driven. This limitation is to avoid high peak of MCPS
during copy, especially first one, where we usually have
two periods of data ready. Having some demanding processing
component on the pipe can end up in xrun if the MCPS limit
is exceeded.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 11:59:37 +01:00
Tomasz Lauda 16a5de769e dw-dma: increase number of linked list items
Increases number of linked list items for platforms supporting
hardware linked list. For timer based scheduling and multiple
pause/release sequences there could be such situation, where
three linked list items are not enough.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 11:59:37 +01:00
Karol Trzcinski b51e67f263 ext_manifest: Include probe support information
This is information is known during compilation time,
so it should be passed by extended manifest.
Reuse sof_ipc_probe_support struct to make parsing function
from host side as much universal as possible.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-23 11:12:24 +01:00
Karol Trzcinski 29b247e3f1 ext_manifest: Include compiler description information
This information is known at build time so should
be passed by extended manifest.
Introduced structure is designed to be fully compatible
with information provided through mailbox to make
parsing code on host side as much reusable as possible.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-23 11:12:24 +01:00
Karol Trzcinski 0c3f5dd475 ext_manifest: Include firmware version
Include such an information in extended manifest, to make it accessible
from host side before firmware load and run.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-23 11:12:24 +01:00
Karol Trzcinski 3318c07393 ext_manifest: Define extended manifest structures in firmware
Extended manifest is a place to store build time known firmware
metadata, for example firmware version or used compiler description.
Given information is read on host side before firmware startup.
This part of output binary is located as a first structure in binary
file.
Extended manifest should be skipped in firmware loading routine.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-23 11:12:24 +01:00
Karol Trzcinski 50f96f8ced sof: Add fw_metadata section
This section will be used to store information about firmware known
during compilation time.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-23 11:12:24 +01:00
Tomasz Lauda 3cba349741 pm_runtime: add core synchronization for Host DMA L1 Exit
Implements multicore synchronization mechanism for Host DMA L1 Exit.
Simple reference counter is added to avoid a situation, where shorter
processing on one core forces Host DMA bus to exit L1, when there is
still transfer happening on other core. PM_RUNTIME_HOST_DMA_L1 with get
is called in new NOTIFIER_ID_LL_PRE_RUN notification event.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 10:30:34 +02:00
Tomasz Lauda a70326a8de pm_runtime: cavs: make private data shared
Allocates cavs_pm_runtime_data as shared to make it usable
by multicore code.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 10:30:34 +02:00
Tomasz Lauda e2edd5be5b hda-dma: exit L1 only once for all DMA channels
Improves host component performance by extracting DMA L1 exit
to be executed commonly for all active DMA channels as registered
callback in low latency scheduler for timer domain. There is no
need to wait so many cycles for every channel separately.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 10:30:34 +02:00
Tomasz Lauda c613128063 hda-dma: save irq_disabled in channel data
Saves irq_disabled config flag in private channel data.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 10:30:34 +02:00
Tomasz Lauda caaf5849ec notifier: protect from preemption
Adds irq_local_disable/enable during notifier_register
and notifier_unregister calls to protect notify list
from preemption.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 10:30:34 +02:00
Tomasz Lauda b42234247b notifier: handle new aggregate flag
Implements handling of new notifier aggregate flag.
With this flag set the notifier will automatically use
existing handle instead of creating a new one. It's helpful
when we want to register only once for an event, but it's
very hard to explicitly keep track of number of registrations.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 10:30:34 +02:00
Tomasz Lauda 8d9e61f698 notifier: add flags
Adds possibility of defining flags, when performing
notifier registration.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-23 10:30:34 +02:00
Daniel Baluta c4285a6a8c drivers: imx: sdma: Remove INT and CONT from chan0 config
For running channel0 we only need 1 BD so remove BD_CONT flag.
Also, interacting with channel0 is done through polling so remove
BD_INT flag.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-22 15:30:25 +03:00
Daniel Baluta b363b3ab16 drivers: imx: Fix free/avail bytes in sdma_get_data_size
When the direction is DMA_DIR_MEM_TO_DEV it means that
we just got rid of some bytes so *free must be reported.

When the direction is DMA_DIR_DEV_TO_MEM it means that
we just received some bytes so *avail must be reported.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-22 15:30:25 +03:00
Daniel Baluta 708743594b drivers: imx: sdma: Remove src_may_change and dst_may_change
We extract this information from config->direction. This makes
code easier to understand.

Notice here that we add BD_DONE for all cases, and remove BD_EXTD
as it doesn't make sense for device2memory and memory2device.

Will have m2m case later, it is not yet supported.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-22 15:30:25 +03:00
Daniel Baluta c2f44b0c3c drivers: imx: sdma: Use temp variable for bd in sdma_prep_desc
This is to reduce line lengths and make code easier to read

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-22 15:30:25 +03:00
Daniel Baluta 13127d861e drivers: imx: sdma: Simplify sdma_read_config
Save earlier fifo_paddr thus to reduce one level of indentation.
Also, get rid of src_may_change and dst_may change as we can
use config->direction instead.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-22 15:30:25 +03:00
Daniel Baluta 456d00119c drivers: imx: sdma: Simplify sdma_set_config
sdma_set_config is a very long function and hard to read
and understand.

In order to make this easier to understand we factor some code
into proper functions.

So, we introduce:
	* sdma_read_config, reads and verifies config received from SOF
          core
	* sdma_prep_desc to prepare sdma descriptor.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-04-22 15:30:25 +03:00
Tomasz Lauda 76b1bceb3f pipeline: disable system agent panic for DMA driven pipelines
Disables panic emitted by system agent on timer delay, when there
are DMA driven pipelines scheduled on the DSP. With such pipelines
running, timer interrupts can be delayed pretty often, so just
emit warning instead of full panic.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-22 10:31:22 +02:00
Tomasz Lauda 65dcba65bf agent: make panic on delay configurable
Adds additional functionality to system agent that allows
to enable and disable panic on delay when necessary.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-22 10:31:22 +02:00
Tomasz Lauda 5bf33d8616 agent: share agent across cores
Shares system agent across different DSP cores.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2020-04-22 10:31:22 +02:00
Seppo Ingalsuo 0befebb7f6 Memory: Enable 2 kB module pool for APL, CNL, ICL, TGL, Sue Creek
This patch enables a single 1 - 2 kB allocation for component
runtime. The disabled 2 kB pool entry caused ASRC component
to fail in some cases.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2020-04-21 20:49:29 +01:00
Marcin Rajwa 061c94e7c2 kpb: fix race condition in draining task
This patch fixes the race condition in the draining
task in which KPB was waiting for sink component to
free space in its input buffer while this component
was waiting for KPB to call its .copy() method
again. This problem has deeper underlying cause,
namely the lack of DMA IRQ which should signal the
end of transaction.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2020-04-21 20:48:44 +01:00
Liam Girdwood 6a19380578 ipc: handler: Need to include clk.h for Zephyr build
Needed for Zephyr build.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-21 20:34:34 +01:00
Deepak R Varma 7801540dba sof: audio: free memory before returning in error
Memory allocated for new KPB component should be released before
returning NULL in when one of sampling width or number of channels or
sampling frequency are set to unexpected values.

Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
2020-04-21 11:19:38 +01:00
Karol Trzcinski ab0c9e046d DMA: Fix fw panic after release on SdW platforms
Bug was caused because sdw controller is stopped first,
then DSP is stopped, so DW FIFO will never be consumed,
so timeout occurs, and watch dog will reset hardware.
Moreover polling for FIFO empty in duch a place should have positive
result only when pause take shorten than 1ms what is not
reasonable value.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-04-21 09:42:42 +01:00