Commit Graph

8706 Commits

Author SHA1 Message Date
Guennadi Liakhovetski 04dbe42607 cosmetic: remove two left-over empty lines
Previous commits removed code but left several empty lines behind,
remove two of them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-08 16:45:12 +01:00
Guennadi Liakhovetski e7fdc76315 ipc: improve list handling
Eliminate an unneeded negation in a test and use existing local
variables, instead of re-calculating list pointers. Also use
list_for_item() instead of open-coding it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-08 16:45:12 +01:00
Guennadi Liakhovetski 5fded96b0d hda-dma: replace multiple allocations with a single one
Instead of allocating channel data for each channel separately,
allocate them in a single array.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-08 16:45:12 +01:00
Guennadi Liakhovetski 66514f20e3 general: eliminate multiple cases of variable redundancy
On multiple occasions local variables are used for only one
intermediate operation and can easily be eliminated with no loss of
clarity. This increases code density to allow better overview.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-08 16:45:12 +01:00
Kai Vehmanen 7ad8176634 probe: fix compiler warning on uninitialized data in probe_gen_format()
Compiler emits a warning about possibly uninitialized use of valid_bytes
and container_bytes. Add an explicit return that covers this case.
The code has a "assert(false)" statement already, but this is not
sufficient and the compiler rightly warns about this.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-08 14:12:06 +01:00
Kai Vehmanen a65d3a8de5 probe: support Zephyr logging subsystem
Register logging module for probe.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-08 14:10:19 +01:00
Guennadi Liakhovetski b37a2f3d21 TGL: enable CONFIG_INCOHERENT correctly
Kconfig options with no description cannot be selected from
defconfig. They can only be selected from other Kconfig options.
This means, that CONFIG_INCOHERENT doesn't get selected on TGL. Move
it to Kconfig to fix this.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-08 12:14:13 +01:00
Guennadi Liakhovetski 904a633351 eq-iir: eq_iir_verify_params() has to acquire buffers
Failing to properly acquire buffer objects for access leads to a
CI regression.

BugLink: https://github.com/thesofproject/sof/issues/6075
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-08 12:14:13 +01:00
Guennadi Liakhovetski 0ba90d8e2a dai: acquire the DMA buffer for access
The DMA buffer in dai.c has to use cached alias for access. Besides
the pointer can be NULL, which has to be checked for.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-08 12:14:13 +01:00
Daniel Baluta 6231528924 topology: Fix setup control bytes comments
setup config data was removed with commit
5763c74bf4 ("codec_adapter: Remove setup config from module data")
update documentation to reflect this.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-08-05 19:22:37 +01:00
Marc Herbert cbd17c43ea .github/zephyr.yml: cosmetic matrix re-ordering
No functional change, this is a pure re-ordering of the matrix
parameters to put the shorter ones first which helps see more in narrow
columns like when looking as build logs on github.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-05 16:19:36 +01:00
Marc Herbert 473ec05b3b xtensa-build-zephyr.py: abort immediately on `west build` failure
Stop immediately when `west build` fails. Do no keep going and show a
totally unrelated smex build failure.

Also fix error message when zephyr/ is missing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-05 15:53:50 +01:00
Marc Herbert b29242a2ad xtensa-build-zephyr.py: -p ristine deletes STAGING_DIR
Make the new -p pristine build option also delete the staging_dir. This
solves a problem where the following sequence was leaving a stale
platform1 build in staging:

xtensa-build-zephyr.py -p platform1
   < code >
xtensa-build-zephyr.py -p platform2

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-05 15:53:50 +01:00
Kai Vehmanen 5fb1d45562 west: update to newer Zephyr baseline
Update zephyr to commit 8e55e59c5917 ('arch: introduce config DCLS').

Fixes build errors due to missing core-isa.h with tgl Intel target with
gcc build chain.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-05 15:52:45 +01:00
Daniel Baluta a8918f27bf imx: clk: Fix zephyr header include
After Zephyr commit:

855216f582d2 ("kconfig: default to LEGACY_INCLUDE_PATH=n")

we get a compile time error because legacy include paths are not
supported by default.

Fix this by adding 'zephyr/' prefix in proper places.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-08-05 12:41:19 +01:00
Pierre-Louis Bossart 190cfd79f7 topology1: add SSP1 for all ES8336, SSP5 for APL/GLK
We apparently missed quite a few platforms with SSP1, and SSP5 is also
needed for APL/GLK.

One day we'll have a better way to add topologies, but so far it's
brute-force combinatorial addition. Oh well.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-08-05 12:28:12 +01:00
Pierre-Louis Bossart 9d37a33335 Revert "TGL: enable CONFIG_INCOHERENT correctly"
This reverts commit e4a5359440.

we need to bring the daily tests back to normal, reverting until the
issue is fixed.

Nothing personal or agenda-based, it's just standard CI practice to
revert what broke the mainline - even more important to do so before
the week-end stress tests.

BugLink: https://github.com/thesofproject/sof/issues/6075
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-08-05 11:44:44 +01:00
Andrula Song db655bd3cf Audio: Pcm_converter: add hifi3 version new functions
Use hifi3 instructions implement new format conversion functions
of pcm_func_vc_map except  pcm_convert_s24_c32_to_s24_c24_link_gtw.
since there are still some bugs in it and it's for windows only.
Will implement this function after those bugs fixed and verified
as the original assumption of author.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-08-05 11:44:11 +01:00
Marc Herbert a114c45b2a .github/zephyr.yml: separate platforms a bit
It's faster like this and we also want platform-specific failures to be
identify as such and not block compilation of other platforms.

Also removed obsolete comment that sneaked in previous commit by
mistake and remove duplicate "zephyr" in the job name.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-05 10:18:38 +01:00
Adrian Bonislawski 19e4b6d5ce zephyr: ll-schedule: remove unnecessary next_tick logic
next_tick and start logic is unnecessary for
a strictly periodic Zephyr-based LL scheduler implementation

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-08-05 09:46:17 +01:00
Jaska Uimonen 7076f0ebb7 overlays: add ipc native drivers overlay for tgl
The native drivers zephyr build requires significantly more configs to
be set, so add those to separate overlay. This overlay can be used with
the -o switch when using the xtensa-build-zephyr script.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-08-05 09:31:38 +01:00
Jaska Uimonen 04abcb61f3 copier_generic: add logging register for zephyr
Zephyr builds with logging fail without registering the
log domain, so add it.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-08-05 09:31:38 +01:00
Jaska Uimonen d10fc746f5 dai-zephyr: add correct zephyr path to includes
Zephyr has appended "zephyr" to its include path, so use that
in sof zephyr includes in the dai code.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-08-05 09:31:38 +01:00
Daniel Baluta 1641ed6cdf Revert "Audio: SRC: Increase length of internal buffer"
This reverts commit 3aff4598f7.

This commit causes pipelines that convert from 44.1khz to 48khz to
freeze, when the firmware is compiled with Xtensa toolchain.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-08-05 09:28:17 +01:00
Kai Vehmanen 8881a406af topology: add sof-rpl-nocodec.tplg
Add nocodec topology for Intel Raptor Lake.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Kai Vehmanen f2bfa2824e topology: add sof-rpl-rt711 and sof-rpl-rt711-4ch topologies
Add new topologies for Intel Raptor Lake.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Kai Vehmanen 09944bc058 topology: Add platform definition file for Intel Raptor Lake
Start with Alder Lake definitions.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-08-04 16:22:56 +01:00
Marc Herbert 8543f5c889 .github: compile-test multiple zephyr revisions + IPC4
This will show very clearly:
- upstream Zephyr regressions
- upstream Zephyr progressions / fixes

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-04 12:48:50 +01:00
Marc Herbert dfaf9b8f28 west.yml: clarify warning about ignored zephyr/west.yml changes
Fixes commit 2c9772d5ad ("Add west.yml configuring zephyr
dependencies from sof")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-04 09:46:22 +01:00
Marc Herbert 125d372b19 docker-build.sh: don't switch versions when already initialized
Restore ability to use (and test!) zephyr/docker-build.sh locally
without overwriting work in progress.

Fixes commit b371373f7d ("scripts: docker-build.sh updated with
changes from xtensa-build-zephyr.py")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-04 09:46:22 +01:00
Guennadi Liakhovetski 2cfefc1103 ipc3: connect buffers on the primary core
Connecting buffers belongs to pipeline initialisation, it can be done
completely on the master core.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 9f4def94ab host: use cached buffer access
Protect the buffer while accessing the stream address.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski e4a5359440 TGL: enable CONFIG_INCOHERENT correctly
Kconfig options with no description cannot be selected from
defconfig. They can only be selected from other Kconfig options.
This means, that CONFIG_INCOHERENT doesn't get selected on TGL. Move
it to Kconfig to fix this.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski b3e0599922 keyphrase: fix buffer acquisition in detection test
test_keyword_params() must acquire and release the source buffer
appropriately for access.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 984cf7c280 ipc: always remove freed buffers from lists
When a component or a buffer is freed, it has to be made inaccessible
from everywhere. Make sure to always delete buffers from lists in
such cases and also to use correct direction macros.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 1c10b8a54c mixer: check component pointers before dereferencing
Buffers, attached to mixers, can be remaining parts of pipelines,
being freed. Then their component pointers might no longer point to
valid components. Check them before dereferencing.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski b15a0418d4 component: delete stale pointers when freeing components
Freeing components and buffers is performed one by one from IPC
commands, sent by the host. When a component is freed, buffers,
connected to it might still exist and keep pointers to the component,
that is being freed. Then, for example if such a buffer is also
connected to a mixer from a different pipeline, that other pipeline
might still be active. Then the mixer might walk its connected
pipelines and come across the no longer existing component. Remove
those stale pointers to avoid such issues.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski b0b15e66b3 buffer: (cosmetic) remove a goto
Use a switch-case clause to remove a goto.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski fe688ddd5f buffer: remove redundant NULL check
calling_buf cannot be NULL in pipeline_comp_params_neg, don't check.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 566415e642 ipc: fix buffer cache handling during freeing
Both IPC3 and IPC4 stream termination paths use uncached buffer
addresses, which can contain stale data with core-local buffers. Fix
both to use cached buffer aliases.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 9ead82e1b8 buffer: fix cache-handling during initialisation
Buffer control structures are accessed at run-time via their cached
aliases. But buffer enumeration involves accessing list headers,
embedded in those control structures. To be able to use the standard
list traversal routines that access is performed via uncached
aliases. Therefore the life-cycle of a buffer control object looks as
follows:

- initialisation
 1. allocate memory
 2. obtain a cached alias
 3. use cached access to initialise the audio stream
 4. release cached access
 5. initialise some fields, using the uncached alias
- linking
 6. add to the list
 7. obtain a cached alias
 8. bind to a component
 9. release cached access
- run-time
10. scan buffer list
11. obtain a cached alias
12. use the buffer
13. release cached access

This patch fixes buffer object initialisation and linking to ensure
data consistency between cached and uncached accesses.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 5fee08996c cache: remove wrong component cache synchronisation
Current component object cache synchronisation is wrong. Firstly
component objects are always allocated with uncached addresses, so no
cached access ever takes place. Secondly cache manipution should be
performed via cached addresses. Thirdly if we decide to access
component objects via cached addresses we'll likely use the coferent
API to do this. Remove wrong cache manipulation to fix cases with
componentson different cores within a single pipeline.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski 1529fe52fb buffer: restore original comp_update_buffer_* names
Previously we temporarily added two functions
comp_update_buffer_cached_produce() and
comp_update_buffer_cached_consume() to be able to migrate users of
comp_update_buffer_produce() and comp_update_buffer_consume() to them
respectively. Now that all users have been migrated we can remove
original implementations and restore original names.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 22:03:44 +01:00
Guennadi Liakhovetski e135633636 zephyr: update for recent Zephyr include path changes
Zephyr removed support for header inclusion without the zephyr/ path.
Update SOF with correct paths.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-08-03 20:59:53 +01:00
Marc Herbert d6906d3aeb installer: add rpl and rpl-s aliases to tgl and tgl-h
rpl firmware is tgl but signed with a different key

This commit adds the following files and links below

$ tree installer/staging/sof |
     grep -e tgl  -e rpl -e community |
     grep -v -e adl -e ehl

├── community
│   ├── sof-rpl.ri -> sof-tgl.ri
│   ├── sof-rpl-s.ri -> sof-tgl-h.ri
│   ├── sof-tgl-h.ri
│   └── sof-tgl.ri
├── sof-rpl.ldc -> sof-tgl.ldc
├── sof-rpl.ri -> intel-signed/sof-rpl.ri
├── sof-rpl-s.ldc -> sof-tgl-h.ldc
├── sof-rpl-s.ri -> intel-signed/sof-rpl-s.ri
├── sof-tgl-h.ldc
├── sof-tgl-h.ri -> intel-signed/sof-tgl-h.ri
├── sof-tgl.ldc
└── sof-tgl.ri -> intel-signed/sof-tgl.ri

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-08-03 15:36:29 +01:00
Andrey Borisovich 70406a0db0 scripts: added versioning to xtensa-build-zephyr.py and west manifest
Added versioning to scripts/xtensa-build-zephyr.py to get version
information when incompatible changes are done to the script.
Added yml schema version number to west.yml manifest.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Andrey Borisovich b371373f7d scripts: docker-build.sh updated with changes from xtensa-build-zephyr.py
Removed old flags from python script call and replaced with
new one. Added one more working directory to zephyr-build container
now SOF is placed in /workdir/sof and west workspace in /workdir .

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Andrey Borisovich 4be98e4dc9 scripts: xtensa-build-zephyr.py removed calls over symlink
xtensa-build-zephyr.py had been using some execute_command
calls when building rimage and using rimage keys over
symlink from modules/audio/sof. Changed it so that calls are
executed now over normal sof directory and symlink is not needed
for script execution.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Andrey Borisovich 627e29f287 scripts: xtensa-build-zephyr.py west reinitialization
Added new flag for non-interactive mode that should be used
when script is invoked programmatically.
In default (interactive) mode user is asked using a prompt whether to
reinitialize west manifest if it is initialized to manifest other
than SOFs.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00
Andrey Borisovich 608833cf27 xtensa-build-zephyr.py: use west manifest
Added usage of west manifest in the script to update both
SOF and zephyr dependencies.
Renamed "clone-mode" to "update" flag - the logic where
sof dependencies and zephyr with dependencies is cloned.
Removed "point-mode" from script as it will no longer work
(west manifests require fixed directory structure).
Removed "zephyr revision" or "-z" argument as it is no longer
needed (now revision may be set in west.yml manifest).
Added "-p" pristine flag to rebuild platforms while removing build
directory.

Co-developed-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-08-03 11:43:22 +01:00