Commit Graph

10811 Commits

Author SHA1 Message Date
Tomasz Leman 17cb6d9e3a mtl: copier-host: fix build issue
After commit f639fc8e88 ("copier: rename parent_dev to dev") FW for MTL
platform is not building. This should be detected as merge conflict but it
went unnoticed.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-08-09 09:58:46 +03:00
Baofeng Tian 2d1f53aaeb copier: remove redundant parameters when create endpoint buffer
Remove no use or redundant parameters in create endpoint buffer
function.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian 84c52b4e41 copier:simplify ipcgtw create parameters
remove duplicate parameters and make function parameters
looks more simple.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian 4735864abe smart_amp: simplify smart amp parameters
use helper function to update stream parameters.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian 2130f8654b selector: simplify selector parameters
use helper function to update stream parameters selector buffers.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian 1ce4a401b0 mux: simplify set mux parameters
use helper function to update stream parameters for mux buffers.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian 5a38cb5dff google-rtc: simplify google-rtc parameters
use helper function to update stream parameters for sink buffers.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian 39805a9fcc aria: simplify aria parameter update
Use function to simplify buffer parameter update instead of
update one by one.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian 8515f772e1 copier-dai: remove duplicated frame format assignment
After dai device was removed, there is no parent device
and dai device classification, only one device left for copier.
The input ipc config is exactly copier device config, no
need extra assignment.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian a4af68a8df copier: refine dai init code
refine dai init code with reduce one more parameter.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian 6cda26cb2d copier-host: remove duplicated frame format assignment
since there is only one dev, there is no need to do
duplicated frame format assignment.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian f639fc8e88 copier: rename parent_dev to dev
parent_dev previously used as copier device, and corresponding
child_dev is host and dai, after host and dai device remove,
there is no concept for parent_dev, rename it to dev.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Baofeng Tian aa858dff6b copier: refine host creation
refine host creation to remove redundant parameters and code.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:43:37 +03:00
Anas Nashif 998f824826 platform: kconfig: remove undefined CAVS_LPRO_ONLY
This kconfig was removed in 2d02dd0ed5, do
not depend on it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-08 15:39:28 +03:00
Baofeng Tian e847c8b270 module_adapter: avoid module init crash in case of ipc data invalid
In ipc3 module creation, it is possible that ipc data
is invalid or corrupted, in this case, module init may crash.
This patch is adding error handling to avoid crash.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-08 15:23:09 +03:00
Tomasz Leman f222070b6c copier: synchronized fpi updates of hd-a gateways
This patch add synchronized FPI updates of HD-A gateways. Driver can
define group of such gateways via module init IPC. The driver may also
specify an update period for each group, different than the default one
determined by the system tick frequency.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-08-07 13:06:50 +01:00
Tomasz Leman ce78753e8a component: comment code style fix
Comment style correction after adding a new field in the structure.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-08-07 13:06:50 +01:00
Tomasz Leman b933e8c2fe ipc4: helper: storing size of received configuration
This patch temporary extends comp_ipc_config struct by the value of
input configuration size. Each module receive its own configuration at
creation (MODULE_INIT IPC). In case of a gateway those configuration can
contain additional value (aux_conf). The only way to check if such
config was received is to compare size of the data received via ipc and
standard configuration size.

This solution is temporary because ultimately it would be necessary to
transfer to each module the size of the received configuration along
with a pointer to the configuration itself. Just like the test is in the
case of a module adapter.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-08-07 13:06:50 +01:00
Marcin Szkudlinski e651c70531 dp: introduce per-core DP scheduler
This commit changes implementation of DP scheduler
At start point an incorrect assumption has been taken
that it is enough to have one single instance of
DP scheduler located on a primary core
This commit introduces one DP instance per core

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2023-08-07 09:25:35 +02:00
Alexander Boehm a1d321734f SAI: fix DSP_A/B frame sync pulse
SAI can be configured for a one bclk wide frame sync pulse
by setting CR4 SYWD to 0. The REG_SAI_CR4_SYWD()
macro subtracts 1 from its argument which resulted in
bad things happening. So use 1 as correct macro argument.

Signed-off-by: Alexander Boehm <aboehm@eurofunk.com>
2023-08-04 12:10:42 +01:00
Alexander Boehm 0ba64e98ec SAI: use topology params
The imx SAI driver used hardcoded clock dividers, word lengths
and #ifdefs to deal with differences between SOCs. Changed it
to respect all the SAI_CONFIG parameters.

Signed-off-by: Alexander Boehm <aboehm@eurofunk.com>
2023-08-04 12:10:42 +01:00
Alexander Boehm e9a4102f99 imx8m: increase max channels/streams
Increase PLATFORM_MAX_CHANNELS and PLATFORM_MAX_STREAMS
to 8 in order to enable the use of certain
components (e.g. 'volume') with 8 channels.
This necessitates an increased HEAP_RUNTIME_SIZE.

Signed-off-by: Alexander Boehm <aboehm@eurofunk.com>
2023-08-04 12:10:42 +01:00
Alexander Boehm edda342d6a topology1: fix sai.m4 clock inversion
A misplaced ) prevented the optional 'inverted'
flag from working as intended.

Signed-off-by: Alexander Boehm <aboehm@eurofunk.com>
2023-08-04 12:10:42 +01:00
Alexander Boehm e70175eb89 imx8m: add SAI2,5,6,7
Made the remaining imx8mp SAI peripherals available for use.
SAI4 does not exist.

Signed-off-by: Alexander Boehm <aboehm@eurofunk.com>
2023-08-04 12:10:42 +01:00
Alexander Boehm d176d09529 topology1: add imx8mp dual SAI topology, 8ch each
Use btsco driver to output and capture 8ch on SAI2 and 8ch on SAI3

Signed-off-by: Alexander Boehm <aboehm@eurofunk.com>
2023-08-04 12:10:42 +01:00
Liam Girdwood 767702f320 ipc4: ipc atomic state should be reset after timeout.
reset the atomic ipc4 message delay state after any timeout error.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-08-03 09:36:58 +01:00
Liam Girdwood 909a3277f1 ipc4: relax the IPC timeout checks and be nicer to other threads
No need to check every 250uS for ipc completion, relax this to avoid
any busy scheduling.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-08-03 09:36:58 +01:00
Liam Girdwood 916e31f3da ipc4: more dbg context for pipeline state changes
Give more context for pipeline context changes.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2023-08-03 09:36:58 +01:00
Andrula Song 658cb65bb5 Audio: Aria: Convert aria to module adapter interface
Convert the component aria to use module adapter interface.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-08-02 10:28:54 +01:00
Andrula Song abcd44feb5 Audio: Aria: Fix the mistake of cache invalidation
Fix the mistake of cache invalidation, since it is already
done in comp_new_ipc4().

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-08-02 10:28:54 +01:00
Jakub Dabek 4ac2ed4b3b vmh: fix build errors
Last commit created build errors in some configurations. Add fixes
to those issues.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2023-08-02 08:45:18 +02:00
Baofeng Tian 983b262512 mixer: correct data type for frame_fmt
use formal enum to replace uint16.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-01 22:10:32 +01:00
Baofeng Tian c9cec67d95 mixin_out: remove ipc config frame format assignment
there is no usage for mixin and mixout ipc_config frame
format, remove it in its init function, frame_fmt will be
calculated and assigned in params accordingly, also most of other
modules init funciton does not have this conversion.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-08-01 22:10:32 +01:00
Jakub Dabek 45d56931ef memory management: Add virtual heap memory allocators
Add virtual heap allocators that allocate on proper heaps and
map physical memory where nesscessary.
Add free function that frees up the virtual heap memory and
unmaps physical memory when possible.
Virtual heap allocator allows using virtual memory as a base
for allocation and booking memory. Physical memory banks
will be mapped when needed allowing for greater flexibility
with mapping.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2023-08-01 08:55:50 +02:00
Laurentiu Mihalcea cfd786110a schedule: zephyr_dma_domain: Add support for shared IRQs
In the case of DMA channels using the same IRQ line
the same interrupt handler with different data is
registered multiple times for the same interrupt.

This approach works perfectly fine when using the IRQ_STEER
IP since the way its driver works is it allows registering
multiple handlers+data for the same INTID.

When switching to ARM64, this approach no longer works since
the last irq_handler/irq_data pair will overwrite the previous
one for the same INTID. Because of this, the IRQ bit from the
DMA channel may not get cleared when multiple pipeline tasks
are scheduled. This reasoning applies to the ARM64 architecture
with GICv3 interrupt controller.

To overcome this, the Zephyr DMA domain now holds a list
of channels using the same IRQ. When the DMA IRQ gets triggered,
the handler will iterate through the list of channels using the
same IRQ and clear the interrupt.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-07-31 16:10:21 +01:00
Adrian Bonislawski 4832dc9388 ipc4: multi pipeline set state on different cores
This will allow to correctly set multiple pipelines state
even if they are allocated on different cores.

ipc4_set_pipeline_state will check if several cores are involved
- set ppl state if only current core requested
- process IPC on another core if only single secondary core requested
- send IDC messages if several secondary cores involved

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2023-07-31 15:55:36 +02:00
Laurentiu Mihalcea 54959a83ac src: drivers: imx: ipc.c: Don't assert GIR twice
According to MU's documentation from the i.MX TRM, setting
the GIRn bit to 1 if already 1 may lead to issuing a second interrupt.

This leads to kernel errors such as:

"reply size (16) exceeds the buffer size (12)"

because of the fact that the MU IRQ is triggered prematurely and
the firmware doesn't have enough time to write the reply. As such,
the host will read the message it has sent to the firmware instead
of its reply.

To fix this, make sure that GIRn is set to 0 before setting it 1.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-07-31 14:47:35 +01:00
Trevor Wu 23f009f830 buffer: fix DSP panic caused by buffer_attach
When using buffer_attach() on MediaTek platform after commit 3e3d0cde,
invalidating the dcache of a list can result in DSP panic.

To make sure that cached and uncached access is performed correctly on
Intel DSP implementations, invalidating the cache is necessary only for
INTEL platform. Therefore, adding #if CONFIG_INTEL to make the line
specific to INTEL platform.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
2023-07-31 12:23:29 +01:00
Curtis Malainey eb91a7f1fc ipc3: Deprecate invalid enums
Mark enums that are unused or never implemented as deprecated since they
will never be implemented as IPC3 is legacy.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2023-07-31 12:22:13 +01:00
Andrula Song efba70fdbe Audio: Fix the aligned feature comments
Fix the comments of align_frame_cnt and align_shift_idx to
make them more clear and understandable.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2023-07-31 11:29:14 +01:00
Andrey Borisovich e8fdfdda7a west.yml: Update rimage revision to aa0ac9ea
Pull in following rimage changes:
aa0ac9eae6 rimage.c: fix bug where -p requires a new
and ignored parameter

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2023-07-31 11:21:50 +01:00
Baofeng Tian 79532b8dbc copier: fix no consume for multi endpoint copy
In last time copier code split, it split multi-endpoint copy and
module copy with commit: e424b87, source buffer consume was missed,
added it back with this PR.

Fixes:#7979

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-07-31 08:59:15 +01:00
Serhiy Katsyuba cff23f5c4e Fix panic upon cancelling not scheduled task
Calling zephyr_ll_task_cancel() for a task which was actually never
scheduled results later in panic in zephyr_ll_task_done().

The fix makes zephyr_ll_task_cancel() do nothing for tasks which were
only initialized but never scheduled.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-07-28 19:15:05 +03:00
Daniel Baluta 6a70f38b15 imx: memory: Fix mixer going out of memory
Commit 05871a16de ("pipeline2.0: add source/sink api to
audio_stream") added two new fields to `struct audio_stream`:

 struct audio_stream {
+       struct sof_source source_api;
+       struct sof_sink sink_api;

and because `struct audio_stream` is part of `struct comp_buffer`
we see an increase of `struct comp_buffer` size from 256 to 384.

With this modification, i.MX mixer use case goes out of memory:

c0 dma-trace src/lib/alloc.c:765    ERROR failed to alloc 0x180 bytes zone 0x4 caps 0x1 flags 0x0
c0 dma-trace src/audio/buffer.c:51  ERROR buffer_alloc(): could not alloc structure

This is not ideal. Anyhow, it was necessary for new source/sink API.

Fix this by increasing the number of 512-byte heap blocks to 32.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2023-07-26 14:43:12 +01:00
Serhiy Katsyuba bfd134ff4c Fix pipeline_get_dai_comp_latency() for cross core
Pipeline data is allocated in cached space. This workaround
prevents from accessing another core pipeline data when
calculating latency.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-07-26 14:39:14 +01:00
Serhiy Katsyuba 071ba084a6 Add remote get_attribute for cross core connection
To support pipelines connection between cores, ipc4_create_buffer()
must be able to create buffer shared between source and sink
components created on different cores. ipc4_create_buffer() requires
source component obs size. When both source and sink components
created on same core, ipc4_create_buffer() is executed on that core,
otherwise it is executed of core 0 (IPC processing core). So for the
case when source and sink components are created on different cores
comp_get_attribute_remote() is used to receive source obs size.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-07-26 14:39:14 +01:00
Serhiy Katsyuba a63a877dbe bind/unbind support for cross core connection
bind/unbind handler must be called from core on which component was
created.
When both source and sink components are created on same core,
bind/unbind IPC is processed on that core. However, when connected
source and sink are on different cores, IPC is processed on core 0.
Hence comp_bind_remote() and comp_unbide_remote() is added to call
bind/unbide from proper core.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-07-26 14:39:14 +01:00
Curtis Malainey 1a89639cf0 ci: Add build all config
Utilize the posix build so that as many components as possible can be
built at once. Also build a bunch of `default n` components as well.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2023-07-26 13:31:36 +01:00
Curtis Malainey deed9a8808 scripts: fuzz: add support for build and overlays
Add support to specify an overlay file to use with the fuzz script and
another flag to build without fuzzing

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2023-07-26 13:31:36 +01:00
Curtis Malainey c5f00bfde7 audio: dsm: add stub for maxim dsm
Add a stub for the library so fuzzers and CI can compile the adapter

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2023-07-26 13:31:36 +01:00