rx_size > tx->size where static size defined by FW is able
to accommodate the message is something usual and should not
add noise to INFO level.
tx->size > rx_size is something potentially dangerous since
the copy does not contain full data provided by the sender.
It should be logged at WARN level and addressed (cases where
partial copy is useful for anything are rather exceptional
and at this point it is not clear whether the original data
should be preserved and used or could be discarded as in case
where full data is safely copied).
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
This commit fixes the warning generated by clang-tidy due to
bugprone macro parentheses. It is recommended to surround macro
arguments in the replacement list with parentheses. This ensures
that the argument value is calculated properly.
Name of the warning generated: bugprone-macro-parentheses
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
Channel 0 is special. It is used to run other channels. It allows
copying data and instruction to and from SDMA RAM.
For channel 0 there will no be DMA API calls. E.g sdma_start,
sdma_stop etc.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Channel 0 shouldn't be touched by DMA API functions.
Thus its priority needs to be set in sdma_init_c0.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
sdma_start shouldn't be used to enable channel 0. We will reserve
dma_ops to only work on data channels.
For now introduce sdma_enable_channel that will take care of
starting a channel.
Replace internal usage of sdma_start from sdma_run_c0 with
sdma_enable_channel.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
The code removed just called the default common handler,
which is now done by the infrastructure.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
The code removed just called the default common handler,
which is now done by the infrastructure.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Actions perfomed by the default handler are required to keep
the component device state consistent (e.g. dev->frames are
initialized). While the current comp_params() silently skips
the component if params are not defined.
New simple components will not be required to define a handler
if no extra steps are needed.
It is also an opportunity to reduce the code of existing components
Note that most of the extra steps are moved to prepare() in many
implementations already (like volume), others may follow and remove
their params() handlers once reduced to a single call to the default
handler (like mux recently did).
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Travis stages are designed not to run after the first that fails. We
never used them for that, only for nicer presentation of
results. Running all tests independently of each other (e.g.: qemu and
doxygen) even when one fails is more important than presentation, so
reduce the number of stages to just two: "buildonly" and "tests"
Travis job name: doesn't look as good alone as when combined
with a stage name but it's enough to identify jobs.
Reducing to just one stage is tempting but it would require a lot more
naming surgery so let's start with this small diff and two stages for
now.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Functions written with metaprogramming are hard to read and debug,
so newly introduced version should be easier to understand for
new developers. Moreover introduced version is more generic and
compact because of usage single logging function implementation
regardless of given parameters number and usage of atomic or
mbox version.
There is no longer a need to heavy test logging function under
UT with different number of arguments, because of it singular
implementation.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
rrealloc function is no longer in use, so it is better
to remove it. Unused code is no longer tested so its
quality is unknown.
The current implementation is simple but expensive since
extra calls to malloc/free requires time and risky since
at some point requires double allocation of potentially
large object. Please consider re-implementation instead
of restoring.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Optimizes host copy function by removing checks for copy type
and using preconfigured callback instead.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
move lp sram heaps to put alternate reset vector sections at the beginning
add AltBootManifest section with entries to unpack
alternate reset vector asm and cmake link
unpack lpsram sections in master core boot
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
this will allow to access memory from the very beginning
and avoid problems in potential future changes
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This will allocate memory for dynamic vectors, unpack them
from WindowOverflow4 and setup global vecbase pointer used
in alternate reset vector
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
some sections may use different lma than vma address,
in such case rimage needs to use lma
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Sometimes they will be different and this will make developer
aware of the differences
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Some instructions like s32c1i depends on ATOMCTL register settings
and it should be set for slave cores to works properly and not hang
on these instuctions
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Changes schedule operations to return error in case
chosen scheduler is not found or scheduler doesn't
support mandatory operation.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Some components used stream.free/avail fields directly. With introduction
of audio_stream_get_free/avail getter functions, such usage should be
removed.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
Add underrun_permitted and overrun_permitted fields to audio_stream
structure and initialize them with regard to associated buffer config.
Add audio_stream_get_avail/free functions, which take above-mentioned
fields into account and use them in getter functions within audio_stream.h
instead of avail/free fields directly.
Signed-off-by: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
See https://github.com/thesofproject/sof/issues/2752
host-testbench.sh exits with success 0 when tests fail. Random, recent, all
green example in PR #2751:
https://travis-ci.org/github/thesofproject/sof/jobs/672996210 is green but:
eqiir test failed!
I didn't even have to spend time to search for this example, I only
looked at the most recent PR.
Ignoring failures is the very worst type of validation issue because it
makes everyone think everything is OK when it's not. Hides regressions.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This patch fixes an integer overflow issue that can occur in the
dcblocker. The overflow happened when doing x - x_prev. If x_prev
is sufficiently large (positive or negative), it can cause an overflow.
Casting x to a 64 bit int first fixes this issue.
Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
status of an output irqsteer line is a 64bit variable
composed of 2 x 32 bit registers.
Because first 64 output irqsteer lines only holds status for
IRQ in[0] we have a different formula for getting the status
compared to the existing implementation done for i.MX8QXP/i.MX8QM.
Mapping for status register is as follows:
line 0 -> [0 | chan0]
line 1 -> [chan2 | chan1]
line 3 -> [chan4 | chan 3]
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
IRQSTEER module on i.MX8MP accepts 160 interrupts in 5
groups of 32 interrupts and steers them to an output of 3 lines.
Each output line has 64 interrupts.
The interesting part here is how the interrupts are steered and
how the registers are mapped.
Each 32 IRQ input group has 1 register for mask/set/status. Lets name
REGn the base of such registers. Then, according to the documentation
we have:
REG0 -> IRQ in[159:128] }
REG1 -> IRQ in[127:96] } => IRQ out[2] [191:128] from in[159:96]
REG2 -> IRQ in[95:64] ]
REG3 -> IRQ in[63:32] ] => IRQ out[1] [127:64] from in[95:32]
REG4 -> IRQ in[31:0] | => IRQ out[0] [63:0] from in[31:0]
Notice that the original IRQ input interrupts are shifted with 32. When
computing the corresponding registers for an output register we need
to subtract 32 to get the correct register. This is achieved using
a fixup function which only applies for i.MX8MP.
Another important observation is that the IRQ in[31:0] is the single
valid group on output line 0. Thus in our represanation leaving a gap
with first 32 interrupts unused.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
On i.MX8MP irqsteer instance has only 3 output lines. So, reduce
the number of child nodes to 3.
Also, IRQSTEER on i.MX8MP has fewer input interrupts than on
i.MX8QM/i.MXQXP.
It has 160 input interrupts grouped as 5 lines of 32 interrupts, who
then are mapped on 3 output lines each with 64 interrupts.
The special case here is line 0 which holds only the first 32
interrupts. For this reason, we need to do:
- start with first child at 0 instead of 32, because interrupts
starting at 32 should be in a different child cascased
controller.
- fix formula for computing MASK/SET/STATUS registers
- fix irqs register num.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Looking at any recent Travis build log:
1. more than half the time is spent in the exact same "docker pull"
command,
2. The qemuboottest stage rebuilds again the exact same thing than the
previous test stage.
Fix 1. by re-using the same docker instance for multiple platforms.
Fix 2. by dropping from the test stage builds performed again in
the qemuboottest stage.
Random sample before:
Total (VM) time 1 hr 15 min
Real time 25 min (depends on current Travis load)
After:
Total (VM) time 30 min
Real time 10 min (depends on current Travis load)
The price to pay for this matrix reduction and speed up is coarser
reports in case of failure. Considering these tests are the most basic
possible one expects them to be rarely ever broken.
Remove the top-level matrix expansion as it was becoming impractical for
these heterogeneous builds ("PLATFORM=tools"?!). The combination of the
matrix and YAML anchors was not very obvious. Use YAML anchors
exclusively.
Rename default stage "test" to "buildonly"
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit fixes a doxygen issue caused by a mismatch between
dcblock_find_func()'s declaration and its corresponding comment block.
Signed-off-by: Sebastiano Carlucci <scarlucci@google.com>
Previous version worked only for empty lists.
There is potential case when buffer is already connected to
some local buffer on either end and then connected to a
buffer on another core which calls make_shared expected
to preserve existing links.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Rrealloc is a very expensive method and may fail for a large
component. There is existing platform specific method to "convert"
local objects into shared ones which is very quick on existing
platforms.
Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
Implements atomic scheduling of connected pipelines that
supposed to be triggered at the same time. If the trigger
is propagated to the connected pipelines, then the expectation
is that they should be started at the same system tick.
Otherwise it might potentially lead to losing some samples
at the beginning for one of the pipes.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit adds CHANNELS define in sof-tgl-rt711-i2s-rt1308.m4
topology in order to properly set pipeline pcm channels and dmic
configuration (STEREO_PDM0 or FOUR_CH_PDM0_PDM1 mode).
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Since the SOF kernel and firmware headers need to be the same the
rename is also done on firmware side. The fifo_bits_b parameter was
deprecated in firmware ABI version 3.0.1 and the value has been
ignored. Since the kernel sets this in case of ABI version 3.0.0 or
earlier the name reserved_2 is not appropriate.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>