This patch adds audio_stream_get_frm_fmt() to read
struct audio_stream::frame_fmt and converts all users. Apart from
hiding internals of the structure, it also enforces the use of the
__sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
audio_stream_fmt_conversion() is used both directly with fields from
acquired buffers in its arguments and ordinary local variables. In
the former case the arguments should have cache annotations, in the
latter case it isn't compulsory. A choice has been made to enforce
cache annotations in both cases, which however now becomes an
inconvenience. Revert that by using temporary variables instead of
buffer fields directly.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds audio_stream_get_free() to read
struct audio_stream::free and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds audio_stream_get_avail() to read
struct audio_stream::avail and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds audio_stream_get_size() to read
struct audio_stream::size and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds audio_stream_get_addr() to read
struct audio_stream::addr and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds audio_stream_get_end_ptr() to read
struct audio_stream::end_addr and converts all users. Apart from
hiding internals of the structure, it also enforces the use of the
__sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds audio_stream_get_wptr() to read
struct audio_stream::w_ptr and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This is the first patch in a series, whose goal is to make struct
audio_stream opaque for its users. Instead of accessing structure
internals we'll add a set of accessor functions.
This patch adds audio_stream_get_rptr() to read
struct audio_stream::r_ptr and converts all users. Apart from hiding
internals of the structure, it also enforces the use of the
__sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
As recommended by Andrey in #7364, reduce the noise and log the
environment only for the `west build` command - unless the log level is
increased with `-v`, then log for every command.
Also fix a very unlikely corner case where the caller would invoke
execute_command() with `check=None` and get the opposite effect.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Clang requires fields to have a constant size and does not
support variable length array in structure causing build to
to fail at compile_check()
This change selects the compatible version of ALIGN_UP and
ALIGN_DOWN macro when compiling with Clang.
Signed-off-by: Nishal Kulkarni <nishalkulkarni@gmail.com>
when a DP module is to be created when DP
is disabled, module creation is rejected with
a message in log
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
DP scheduler is intended to work on MTL and
future platforms only - has not been tested on
any legacy.
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
This makes sure Zephyr's -fmacro-prefix-map is working and keeps the
builds reproducible when using a recent enough toolchain.
As found in the CONFIG_ASSERT PR
https://github.com/thesofproject/sof/pull/6530#issuecomment-1482330214
this is not true for old Xtensa toolchains.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit introduces support in the CMakeLists.txt of Zephyr for
building SOF for i.MX93 platform.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Get_total_process_data_process is used to get the processed data of
a module when stream is started. It is used to calculate pipeline
latency with the algorithm of subtracting processed data count between
source pipeline module and sink pipeline module. This patch will
calculate consumed & produced data count based on input & output buffer
setting and return produced data count for source module and consumed
data for sink module.
Currently only copier supports this function, now add it to
module_adapter framework to support other modules.
Signed-off-by: Rander Wang <rander.wang@intel.com>
In component.h the eq_iir and mixer have still the old component
API function prototypes. They can be removed as not needed. These
components do not support legacy mode.
Similar update is done to testbench common_test.h. The function
prototypes there are duplicate since they are now available in
component.h.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Catch the additional two warnings below:
warning: too many warnings
warning: cast removes address space
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When changing pointer type between different sparse address spaces,
the change has to be forced to let sparse know, that this is intended
and to avoid a warning. Fix such type cases in ams.c.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
In the case of ARM64 with GIC, the interrupts are cleared after
the ISR is executed (for reference please see arm_gic_eoi() and
arch/arm64/core/isr_wrapper.S from Zephyr). Thanks to this, we
don't need to clear them explicitly, hence there's no need for
interrupt_clear_mask() to be defined. This commit fixes linkage
problems caused by the fact that interrupt_clear_mask() is not
defined on ARM64.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
In the case of ARM64 with GIC, the interrupts are cleared after
the ISR is executed (for reference please see arm_gic_eoi() and
arch/arm64/core/isr_wrapper.S from Zephyr). Thanks to this, we
don't need to clear them explicitly, hence there's no need for
interrupt_clear() to be defined. This commit fixes linkage
problems caused by the fact that interrupt_clear() is not
defined on ARM64.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit makes sure that all macros used by the SAI driver
are correct in the case of i.MX93's SAI3.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Since i.MX93 doesn't support PM and doesn't have an implementation
for wait_for_interrupt() we need to encase the D3 preparation in
an ifndef block. This commit does exacly so.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Just like IMX8ULP i.MX93's EDMA2 uses a channel multiplexer
to assign a peripheral to a channel. To make the driver work
it's required to write the peripheral's line number to the
CH_MUX register.
This commit also introduces all macros necessary for EDMA2.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Zephyr DMA domain thread should have a higher priority than the
logging thread. Not meeting this criteria may cause problems
such as buzzing noises after resuming a paused stream. This
was the case on i.MX93.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit adds ZEPHYR_DMA_DOMAIN_THREAD_PRIO macro which
holds the value of the thread priority for Zephyr DMA domain.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Make sure users do not misinterpret our single `debug_overlay.conf` file
as some kind of complex and elaborate "debug build" concept. Also save
users who want to see the file a lot of time by naming it directly in
the --help.
Empty layers of indirection are just spurious obfuscation.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
CMake seems to behave differently on Linux and Windows: it generates
different `-I` command line parameters. This results in spurious
`__FILE__` mismatches and non-reproducible builds when using
CONFIG_ASSERT, see example in #7428.
On Windows, '..' seem resolved more often which also seems to convert
forward slashes to backslashes.
They are also less readable and wasting a bit of space. Remove them
using cmake_path(SET ...)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
By mistake, the lib_manager module used a private manifest header from the
rimage project. It included other private headers. Switched to the public
header.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
`drivers: imx: ipc`
Split long line into two short lines
at 135: FILE: src/drivers/imx/ipc.c:135:
"CHECK: line length of 103 exceeds 100 columns"
Modified to match the alignment of the open parenthesis
at 227: FILE: src/drivers/imx/ipc.c:227:
"CHECK: Alignment should match open parenthesis"
Split long line into two short lines
at 309: FILE: src/drivers/imx/ipc.c:309:
"CHECK: line length of 101 exceeds 100 columns"
`drivers: imx: sai`
Modified to match the alignment of the open parenthesis
at 353: FILE: src/drivers/imx/sai.c:353:
"CHECK: Alignment should match open parenthesis"
Signed-off-by: Jian De <jiande2020@gmail.com>
Calculation of SOF_TKN_BUF_SIZE in COMP_PERIOD_FRAMES() macro
led to incorrect results with large period size values.
For example at 48000Hz sampling rate, period size larger than
44739us would be incorrectly calculated.
This happens as m4 eval does arithmetic in 32bit signed values
and multiplication of period size and sampling rate can easily
exceed 2^31.
Fix the issue by splitting the arithmetic in steps that
fit available value range.
Link: https://github.com/thesofproject/sof/issues/7476
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
ARM64's GIC doesn't utilize cascaded interrupts so interrupt_get_irq
will have to return the given INTID.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit removes all occurrences of the soc.h header file
since this is not used. This also fixes build problem on i.MX93
caused by the fact that i.MX93 doesn't have a soc.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
SOF got broken for legacy internal driver builds when the host was
merged into the copier. Fix the breakage.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
host_dma_cb() should be static. Also move function description
comments to exported functions instead of their static wrappers.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
In most of the user code buffer control structures should only be
accessed after acquisition, not via their raw pointers.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
--cmake-args is actually safe, just a bit slower. See explanation in
https://github.com/zephyrproject-rtos/zephyr/pull/56671
Fixes unnecessary restriction added by commit 9fb7a607eb
("xtensa-build-zephyr.py: fix -C option so it can support whitespace")
Also warn for overlays because they act the same.
Log the `west config` due to the suggestion to use build.cmake-args and
the recent rimage changes in Zephyr PR 54700
Signed-off-by: Marc Herbert <marc.herbert@intel.com>