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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This section will be used to store information about firmware known
during compilation time.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This tool must be able to read extended manifest content
and move to next manifest in proper way.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Add a wrapper to convert SOF API calls to Zephyr equivalents. This allows
development to continue in parallel with xtos/HAL and Zephyr RTOSes until
parity is reached.
The initlial Zephyr APIs to be used are HAL, boot, IRQs, scheduling and
memory. The wrapper reflects this and will probably grow until feature
parity is reached when it can be deleted (as Zephyr APIs can be used
directly).
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Use getopts to parse the arguments instead of manual parsing to leave no
room for errors, bugs, and inconsistent conventions introduced by custom
implementation.
The script uses no options as of now, so current implementation just
exits if any option is provided.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
"PLATFORMS" variable was used as an array while it is actually a string
used incorrectly making it work accidentally.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
xtensa-build-all.sh expects number of cores to be used when -j option is
specified. By default, it uses all the cores available which is what we
want, hence, omitting the option altogether.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Currently, "set -e" is being ignored for type command using redirections
and "A && true". "A && true" is a no-op and a peculiar case where
"set -e" ignores the exit code of A.
Exit code of the "type" command is used in an if statement which is
exactly what the function of "if" command is. Also, "set -e" ignores
exit codes of commands used in if statements.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Use getopts to parse the arguments instead of manual parsing to leave no
room for errors, bugs, and inconsistent conventions introduced by custom
implementation.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
`PLATFORMS` variable was used as an array while it is actually a string
used incorrectly making it work accidentally.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
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>
in bxt.m4 and sof-hda-generic.m4, they both define the
PIPE_VOLUME_PLAYBACK, this will cause wrong tplg result.
Refine the them in sof-hda-generic.m4 to PIPE_HEADSET_PLAYBACK
to fix the issue.
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>