Commit Graph

9879 Commits

Author SHA1 Message Date
Tomasz Leman 9632135d33 west.yml: upgrade zephyr to 9028ad5d71
Zepych update: total of 132 commits.

Changes include GP DMA power management changes.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-04-26 16:55:10 +03:00
Peter Ujfalusi f599f61311 audio: mixin_mixout_generic: normal_mix: Update src/dst after each copy
The copying part of the functions need to update the src/dst buffer
pointers after each iteration to correctly account for the possible wrap
of the buffer.

This was discovered while doing pause - 1sec_wait - resume - 3sec_wait
cycles and around the 10th iteration audio became 'metallic' sounding.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2023-04-26 15:04:39 +03:00
Guennadi Liakhovetski eee146bd02 lib-manager: fix compilation breakage
Fix breakage introduced by 32e4f7e27a ("buffer: use an accessor to
read struct audio_stream::end_ptr") which accidentally wrongly used
audio_stream_get_end_addr() to access the .end_addr member of
struct lib_manager_dma_buf.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-26 12:02:05 +01:00
Marc Herbert 34d7baa800 scripts: Dockerfile: re-add TGL toolchain removed by accident
TGL has always been using the `xtensa-cnl-elf` toolchain. That
toolchain was removed by accident when cavs 1.8 support (including
CNL) was removed by massive search/replace commit dc9ba281d7
("platform: remove support for cAVS 1.8 platforms")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-26 11:38:10 +01:00
Marc Herbert 0c7db9a58e Revert "scripts/docker-run.sh: run with sudo-cwd.sh"
This reverts commit 80e9c3454a.

This was merged too early, there are still build issues and failures
to solve first, notably issues caused by the now missing
xtensa-cnl-elf-gcc

https://github.com/thesofproject/sof/actions/runs/4789961860/jobs/8518459642
https://github.com/thesofproject/sof/actions/runs/4789961859/jobs/8518459155
etc.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-25 12:48:44 -07:00
Fred Oh 80e9c3454a scripts/docker-run.sh: run with sudo-cwd.sh
There is a UID mistmatch and file permission problem. sudo-cwd.sh will
switch id every docker run command.

This can be done like this,
./scripts/docker-run.sh ./scripts/sudo-cwd.sh CMD

But not to make build script, just include sudo-cwd.sh in docker-run.sh.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-04-25 15:30:45 +01:00
Fred Oh 05f92cb371 docker: upgrade to ubuntu 22.04 as a base image
Upgrade Ubuntu to latest LTS version, 22.04.
Permission issue has started when UID didn't match with local UID.
As an solution, created high value UID to unmatch local UID.
sof home doesn't have permission for others, so add o+rx permission to
avoid any permission issue when id does not match.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2023-04-25 15:30:45 +01:00
Guennadi Liakhovetski e57883f3c2 buffer: use an accessor to read struct audio_stream::channels
This patch adds audio_stream_get_channels() to read
struct audio_stream::channels 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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski f8e4d693b2 buffer: use an accessor to read struct audio_stream::rate
This patch adds audio_stream_get_rate() to read
struct audio_stream::rate 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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski a25f098b72 buffer: use an accessor to read struct audio_stream::valid_sample_fmt
This patch adds audio_stream_get_valid_fmt() to read
struct audio_stream::valid_sample_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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski 017b8ebcde buffer: use an accessor to read struct audio_stream::frame_fmt
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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski 3ab21638cf buffer: remove cache annotations from audio_stream_fmt_conversion()
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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski b8233ce791 buffer: use an accessor to read struct audio_stream::free
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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski b667c914c6 buffer: use an accessor to read struct audio_stream::avail
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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski 932cf4f73c buffer: use an accessor to read struct audio_stream::size
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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski f1ee4eb3ac buffer: use an accessor to read struct audio_stream::addr
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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski 32e4f7e27a buffer: use an accessor to read struct audio_stream::end_ptr
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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski 7bc69845cc buffer: use an accessor to read struct audio_stream::w_ptr
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>
2023-04-25 14:59:34 +01:00
Guennadi Liakhovetski e3bbd78ee2 buffer: use an accessor to read struct audio_stream::r_ptr
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>
2023-04-25 14:59:34 +01:00
Serhiy Katsyuba d2336bbe4b ipc4: copier: Fix memory leak
Adds forgotten buffer_free() for copier multi_endpoint_buffer.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-04-25 14:32:58 +03:00
Marc Herbert 322d2cc08f xtensa-build-zephyr.py: log environment changes only for `west build`
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>
2023-04-25 13:34:06 +03:00
Nishal Kulkarni c8253afad9 common.h: Prevent error when compiling with Clang
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>
2023-04-25 13:31:57 +03:00
Marcin Szkudlinski 730bbcad13 ipc4: raise error when DP cannot be created
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>
2023-04-25 13:23:28 +03:00
Marcin Szkudlinski 85b4cdd6c5 kconfig: limit DP scheduler to ACE
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>
2023-04-25 13:23:28 +03:00
Marc Herbert 6f9f2ee28e .github/zephyr: build with the debug overlay and CONFIG_ASSERT
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>
2023-04-25 13:22:41 +03:00
Marc Herbert 4286bb3ee1 .github/zephyr: west update with new, faster git --filter-tree:0
Twice faster than shallow clones without any of the git describe or
other hassle. More info in
https://github.com/zephyrproject-rtos/west/issues/638

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-25 13:22:41 +03:00
Laurentiu Mihalcea 2b30188f1b zephyr: CMakeLists.txt: Add support for building SOF for i.MX93
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>
2023-04-25 13:04:58 +03:00
Laurentiu Mihalcea aff453e4c8 app: boards: Add new board configuration for i.MX93
This commit introduces a new board configuration for i.MX93.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-25 13:04:58 +03:00
Rander Wang 98a3f67b10 module_adapter: add get_total_process_data_process support
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>
2023-04-25 10:45:28 +01:00
Seppo Ingalsuo b3d1583f3c Audio: Component: Update to component.h module adapter conversions
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>
2023-04-25 10:39:50 +01:00
Marc Herbert d345c56e71 parse_sparse_output.sh: add "removes address space" and "too many"
Catch the additional two warnings below:

warning: too many warnings
warning: cast removes address space

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-25 11:52:23 +03:00
Greg Galloway f7a1d2aaf8 Update pull-request.yml
A small typo, but irrelevant as this PR doesn't need to be merged.

Signed-off-by: Greg Galloway <greg.galloway@intel.com>
2023-04-24 22:22:16 +01:00
Guennadi Liakhovetski 0a6b90eb34 ams: fix sparse address space change
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>
2023-04-24 22:12:07 +01:00
Guennadi Liakhovetski dfea410c8b asrc: fix buffer acquisition
Add missing buffer release calls in asrc_prepare().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-24 22:10:49 +01:00
Marc Herbert 9cd7090345 .github/zephyr: add -Werror to AFLAGS, not just CFLAGS
Past Zephyr experience showed that CFLAGS is not enough to cover all
cases: https://github.com/zephyrproject-rtos/zephyr/commit/8a603da6cde63

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-24 22:08:27 +01:00
Laurentiu Mihalcea 88c8c1eb27 tools: topology1: Add topology for i.MX93
As the name suggests, this commit introduces a new topolgy
used for i.MX93.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-24 22:06:58 +01:00
Laurentiu Mihalcea 4a492f5439 schedule: zephyr_dma_domain: Add macro for interrupt_clear_mask() on ARM64
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>
2023-04-24 21:50:51 +01:00
Laurentiu Mihalcea 05a3aa6212 platform: Introduce platform support for i.MX93
This commit introduces platform support for i.MX93.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-24 21:09:55 +01:00
Laurentiu Mihalcea cf254e6226 platform: Kconfig: Introduce configuration for i.MX93
This commit introduces a new configuration for i.MX93 platform.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-24 21:09:55 +01:00
Gerard Marull-Paretas ca68ba68f2 zephyr: update SYS_INIT calls
Update Zephyr head, and use the new call signature:
int (*init_fn)(void);

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-04-24 19:13:47 +03:00
Laurentiu Mihalcea b532c31f94 drivers: imx: ipc: Add macro for interrupt_clear() on ARM64
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>
2023-04-24 13:04:56 +03:00
Laurentiu Mihalcea bce47d09a9 include: sof: drivers: sai.h: Add support for i.MX93's SAI3
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>
2023-04-24 13:04:56 +03:00
Laurentiu Mihalcea a27c6d98a2 drivers: imx: Add ifndef block for D3 preparation
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>
2023-04-24 13:04:56 +03:00
Laurentiu Mihalcea 9a8046dd27 sof: drivers: mu: Add support for i.MX93 MU
i.MX93 uses V2 of the MU. This commit makes sure that all
offsets are set accordingly.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-24 13:04:56 +03:00
Laurentiu Mihalcea f783401e24 drivers: imx: edma: Introduce support for i.MX93's EDMA2
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>
2023-04-24 13:04:56 +03:00
Yong Zhi a706f40433 topology2: Enable chain DMA for MTL cavs-rt5682 topologies
Enable ChainDMA to support 16/32bit, channels_max 8 HDMI playback.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2023-04-24 12:24:36 +03:00
Laurentiu Mihalcea f78834aa23 schedule: zephyr_dma_domain: Make Zephyr DMA domain's thread priority higher
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>
2023-04-24 12:23:03 +03:00
Laurentiu Mihalcea 168f47b5cb schedule: zephyr_dma_domain: Add macro for DMA domain thread prio
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>
2023-04-24 12:23:03 +03:00
Marc Herbert c3c7b33175 xtensa-build-zephyr.py: change help for -d, just say it like it is
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>
2023-04-24 12:04:26 +03:00
Marc Herbert ed7c57ba32 zephyr/CMakeLists.txt: remove '..' in include paths
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>
2023-04-24 12:04:26 +03:00