Commit Graph

9855 Commits

Author SHA1 Message Date
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
Adrian Warecki b17d546283 lib_manager: Use correct manifest header from rimage
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>
2023-04-24 12:03:38 +03:00
Adrian Warecki 3cf3c9bb84 rimage: Update rimage revision to ab0429f
Changed rimage submodule revision to:
ab0429fdbe

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-04-24 12:03:38 +03:00
jiande 43efd2da50 drivers: imx: fix checkpatch styling error
`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>
2023-04-24 11:57:13 +03:00
Kai Vehmanen be43b4e4eb topology1: fix buffer size calculation if period-size >44ms
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>
2023-04-24 11:49:04 +03:00
Laurentiu Mihalcea f6d84391dc zephyr: include: rtos: interrupt.h: Make interrupt_get_irq work for ARM64 platforms
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>
2023-04-24 11:47:07 +03:00
Laurentiu Mihalcea f7d9e76f95 Remove unused <soc.h> header inclusions
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>
2023-04-24 11:40:53 +03:00
Guennadi Liakhovetski 5ae34cb8f9 host: fix legacy build
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>
2023-04-24 11:34:16 +03:00
Guennadi Liakhovetski d832aaa045 host: (cosmetic) make a function static and move comments
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>
2023-04-24 11:34:16 +03:00
Guennadi Liakhovetski d1a8feddfc buffer: fix access without acquisition
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>
2023-04-24 11:27:15 +03:00
Marc Herbert 192700181c xtensa-build-zephyr.py: downgrade --cmake-args restriction to a warning
--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>
2023-04-24 11:25:59 +03:00
Marc Herbert 7e19dfb5fa xtensa-build-zephyr.py: move one-time cmake arguments check later
No functional change, pure preparation for the next commit.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-24 11:25:59 +03:00
Laurentiu Mihalcea db3c469ee7 zephyr: include: sof: Add Zephyr version of compiler_info.h
This is required by ARM64 platforms as they don't have
an arch/compiler_info.h so the compilation would fail.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-24 10:23:58 +03:00
Ranjani Sridharan 6339cfd5aa topology2: Removed period_sink/source_count attributes
These were added for use with IPC3 but since topology2 is not targeted
for IPC3, there's no need to keep them anymore.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-24 10:10:51 +03:00
Ranjani Sridharan b3139af01c topology2: Remove num_audio_formats attribute
This has been replaced by num_input_audio_formats and
num_output_audio_formats. So remove the attribute from all components
and mark the token ID as deprecated.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-24 10:10:51 +03:00
Andrula Song 88990a62ef Audio_stream: Add default byte and frame alignment set in init function
Set byte_align as 1 and frame_align as 1 means no limit on both byte and
frame for this stream. Call audio_stream_init_alignment_constants in
audio_stream_init, set default align info while buffer created. And every
specific component can set its own byte and frame align info in its
prepare function later.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-04-24 10:09:32 +03:00
Guennadi Liakhovetski d604a3242d src: drop wrong type-casts to match cache annotations
No need for type-casting: void * is compatible with any pointers and
both pointers already have the __sparse_cache annotation. Dropping it
causes sparse warnings.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-04-21 15:04:31 -07:00
Bard Liao 6f96d0f37e topology2: rename NUM_SDW_AMPS to NUM_SDW_AMP_LINKS
NUM_SDW_AMPS refers to how many sdw links are used by the amp pcm.
Rename to NUM_SDW_AMP_LINKS for less confusing.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2023-04-21 20:48:09 +03:00
Serhiy Katsyuba e79b6343b8 host-zephyr: Fix glitches
Fixes glitches when host copier has different container size on
source and sink.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-04-21 20:45:12 +03:00
Ranjani Sridharan 228ecf5768 topology2: hdmi-generic: Fix audio format for DAI copier
It should only support 32-bit format for input and output.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-20 23:04:38 -07:00
Ranjani Sridharan 9fa5d722b4 topology2: Remove 24-bit audio formats in mixin/mixout
The 24-bit formats defined in topologies will never be used because the
mixin/mixout only support 32-bit format. So remove these audio formats
from the component and pipelines audio format definitions.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-20 23:04:38 -07:00
Ranjani Sridharan e5eb7dfc76 topology2: tokens: Split the tokens for input/output pin index
Separate the pin index token ID for input/output pin index to avoid
collisions between the two and incorrect pin index parsing in the
kernel.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-04-20 12:19:35 -07:00
Baofeng Tian b77dbc3c88 dai-zephyr: remove not used pointer and its assignment
buffer_ptr is no longer valid in dai-zephyr.c, remove it.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-04-20 21:07:55 +03:00
Laurentiu Mihalcea 0696f7eddc include: sof: debug: gdb: gdb.h: Add ifdef guard for symbol definition
GDB debug should only be used when CONFIG_DBG_DEBUG=y. On ARM64
platforms with Zephyr, including this header will cause compilation
errors due to the fact that they don't have an arch/ entry. This
commit fixes this issue by conditionally defining all symbols based
on CONFIG_GDB_DEBUG.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-20 13:20:39 +03:00
Laurentiu Mihalcea 6aa71dd6f2 zephyr: lib: alloc.c: Add heap for ARM64 platforms
This commit places the heap inside the .bss section for
all ARM64 platforms.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-04-20 12:59:24 +03:00