Commit Graph

8642 Commits

Author SHA1 Message Date
Ranjani Sridharan c9127207ca bdw: use legacy conp drv interface for volume
Use the legacy interface for volume component.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-06-17 10:08:04 +01:00
Pierre-Louis Bossart 3315681c69 cmake: make sure sha1 is computed without filters
Local filters in ~/gitconfig, such as

[core]
	autocrlf = input

can impact the result of git hash-object. Make sure no filters are
used so that the hash value remains unmodified across user setups.

BugLink: https://github.com/thesofproject/sof/issues/5917
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-06-16 20:17:27 +01:00
Jaska Uimonen 015ec63c4d zephyr: add glue code to use zephyr dai drivers
This patch adds a mechanism to load and use dai driver from zephyr
instead of xtos driver.

Patch includes following changes:
- dai-zephyr.c calls directly zephyr driver methods
- include/lib/dai.h is divided into dai-legacy.h and dai-zephyr.h
- use zephyr dais by configuring CONFIG_ZEPHYR_NATIVE_DRIVERS=y

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
2022-06-16 20:15:59 +01:00
Jyri Sarha f66a81678b probe: revert back to use of dma_copy_to_host_nowait()
It appears that the probes do not work too well with the BLOCKING
flag, so let's go back to the resurrected the dma_copy_to_host_nowait()-
function.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-06-16 19:15:28 +01:00
Jyri Sarha 6fad8b8bd7 dma: Resurrect dma_copy_to_host_nowait()
Resurrect dma_copy_to_host_nowait() since the probes do not appear to
work without it. This version implements also non blocking version for
non CONFIG_DMA_GW case. Earlier the function was called nowait, despite
the DMA_COPY_BLOCKING flag given to dma_copy_legacy().

Fixes: 443b21de4b ("dma-trace: Fix potential race issue by using blocking DMA copy")

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-06-16 19:15:28 +01:00
Jyri Sarha c19fd4e6e5 probe: Initialize probe_dma_init() config stack variable
Initialize probe_dma_init() config stack variable. Not all used
members are initialized member by member so those members got their
values from what ever there was in the stack.

Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
2022-06-16 19:15:28 +01:00
Jaska Uimonen 1083bc2a39 dai: groups: Add group ifdef also to ipc4 dai
ipc4 dai is missing the group ifdef, thus add it there.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-06-15 19:35:57 +01:00
Jaska Uimonen 5ded7f8ce2 host-zephyr: add zephyr logging support
Add zephyr logging register to host as it doesn't compile otherwise when
zephyr logging is enabled.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-06-15 15:01:04 +01:00
Balakishorepati 83ee5b49a9 dai: support for amd specific hs dai id
Add support for hs i2s instance on rembrandt
platform.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-06-15 14:52:59 +01:00
Balakishorepati e7cce06f97 platform: Add support for amd rembrandt platform
This adds support for platform drivers (dai, dma, clk)
and general platform initialization.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-06-15 14:52:59 +01:00
Balakishorepati bf01ad7ceb drivers: amd: rembrandt: Add drivers for amd/rembrandt
Add drivers for:
            * timer, ipc, interrupt - amd specific implementation
            * DMA, for copying data between HOST and DSP
            * BT DAI,SP DAI, HS DAI for Audio interface
            * I2S DMA, Controller for BT,SP and HS

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-06-15 14:52:59 +01:00
Balakishorepati c7fc085bd5 scripts: add rembrandt support
Add rembrandt build support.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-06-15 14:52:59 +01:00
Balakishorepati 38e4018c26 rembrandt: Add support for AMD rembrandt platform
Add rembrandt platform support to build fw image.
Add rembrandt_defconfig for rembrandt platform.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-06-15 14:52:59 +01:00
Guennadi Liakhovetski 418b188260 module-adapter: fix prohibitively verbose log message
module_adapter_copy() is typically called every millisecond for each
copy. Issuing an "info"-level log statement with that frequency
floods the log. Replace it with a "comp_dbg()."

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-15 14:11:18 +01:00
Jaska Uimonen b4886bebbe module_adapter: add zephyr logging support
Add zephyr logging declares to module_adapter as it doesn't
compile otherwise when zephyr logging is enabled.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-06-14 15:56:33 +01:00
Guennadi Liakhovetski 2e197711b4 buffer: fix wrong coherent_shared() call
Buffer objects are always handled in thread context, only the
_thread() set of the coherent API functions must be used with them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-14 14:19:28 +01:00
Guennadi Liakhovetski 8871bb3087 coherent: add a missing coherent_shared_thread() implementation
Under Zephyr when CONFIG_INCOHERENT isn't selected,
coherent_shared_thread() is undefined, add a missing implementation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-14 14:19:28 +01:00
Guennadi Liakhovetski dff5c1bbc8 coherent: coherent_shared() must hold the lock
Even when CONFIG_INCOHERENT isn't selected, coherent_shared() must
hold the lock when setting the flag.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-14 14:19:28 +01:00
CY Kuei e9442e04c6 module_adpater: change the buffer size of waves_codec
Change the buffer size of waves_codec from 2ms to SCHEDULE_PERIOD

Signed-off-by: CY Kuei <cyk@waves.com>
2022-06-13 15:24:08 +01:00
Guennadi Liakhovetski 42eccb306b component: comp_make_shared() only needs to mark the component
comp_make_shared() only makes sense and is only called in multi-core
configurations. In such configurations components are allocated from
uncached memory, from the SOF_MEM_ZONE_RUNTIME_SHARED zone. So they
are always uncached and there is no need to flush cached or relink
lists. We only need to set a flag, indicating, that this component
is used on multiple cores.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-13 15:23:37 +01:00
Liam Girdwood 2798398f5c cht: defconfig: trim fat and remove unused options.
Not used on CHT so remove.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-06-10 20:27:31 +01:00
Liam Girdwood 2e8fb0a0dd byt: defconfig: trim fat and remove unused options.
Not used on BYT so remove.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-06-10 20:27:31 +01:00
Liam Girdwood b77149cff3 cpu: single core: Give the compiler some hints to save memory.
Save memory when only a single core is enabled. Compiler can now see
always false/true conditions and optimise out unused TEXT.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-06-10 20:27:31 +01:00
Liam Girdwood d4af413687 dai: groups: Add a Kconfig option for the DAI groups
Save memory when not used.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-06-10 20:27:31 +01:00
Liam Girdwood e327f09250 ipc: blob: Add a Kconfig option for the blob loader
Save memory when not used.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-06-10 20:27:31 +01:00
Guennadi Liakhovetski e56e88dcca dmic: move gain ramping to DAI .copy() context
Currently the DMIC driver uses a separate task to implement its gain
ramping. This creates a race during driver clean up. Avoid an
additional asynchronous context by performing the ramping in DAI's
.copy() context. Use the DAI's .copy() method for that.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:18:25 +01:00
Guennadi Liakhovetski 193f9118e8 dai: let DAI drivers access the underlying component object
DAI drivers sometimes need to access the underlying component object.
Make this possible by adding a pointer to struct dai_data into struct
dai and to struct comp_dev into struct dai_data and by assigning
those pointers accordingly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:18:25 +01:00
Guennadi Liakhovetski 8f9b769af8 dai: add a DAI operations copy method
Add a DAI copy method to be called before dma_copy().

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:18:25 +01:00
Guennadi Liakhovetski 097a633995 pcm_converter: fix mismatching function types
pcm_converter_func and dma_process_func are used interchangeably,
they must be identical.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:15:31 +01:00
Guennadi Liakhovetski 7e588899ec component: fix a function prototype
Sparse annotations must be used consistently in function definitions
and in declarations.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:15:31 +01:00
Guennadi Liakhovetski a51d535e83 pipeline: always acquire buffers for access
Buffers must always be acquired before access.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:15:31 +01:00
Guennadi Liakhovetski 360343e8de dai: always acquire buffers for access
Buffers must always be acquired before access.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:15:31 +01:00
Guennadi Liakhovetski df576da380 host: always acquire buffers for access
Buffers must always be acquired before access.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:15:31 +01:00
Guennadi Liakhovetski 084f8ccc42 dma: dma_buffer_copy_*() functions should use cached buffer objects
dma_buffer_copy_to() and dma_buffer_copy_from() should be called on
properly acquired buffer objects.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:15:31 +01:00
Guennadi Liakhovetski e3e4ced1f7 ipc3: use comp_buffer_connect() instead of open-coding it
ipc_comp_to_buffer_connect() and ipc_buffer_to_comp_connect() open-
code contents of the comp_buffer_connect() function. Remove redundant
code and call the function directly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:15:31 +01:00
Guennadi Liakhovetski b7ca65938a ipc: use __sparse_cache sparse annotation
Add the __sparse_cache sparse annotation to ipc-helper.c

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-06-10 16:15:31 +01:00
Tomasz Leman b5d7fc61b5 ipc4: setdx: message completion delay
During transition from D0 to D3, IPC processing completion is done
during power down procedure (file power_down.S).

FW build based on XTOS never exit from ipc_do_cmd() and will not enter
ipc_complete_cmd(). Zephyr based FW on other hand will execute power
down procedure after enering idle,  when IPC processing task is
completed. Therefore it should be skipped here.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-06-10 14:48:30 +01:00
Ranjani Sridharan f7663de1f4 volume: use the new module interface
Move the volume component inside the module_adapter folder and use the
module interface API instead of the component driver interface. Also fix
the volume cmocka tests to use the modified scale_vol function.

Also, add kconfig option for keeping the legacy comp_drv interface for platforms
that are limited in text region memory size, such as
BYT/CHT/APL/JSL/ICL.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-06-10 09:50:08 +01:00
Ranjani Sridharan 5958e7cd99 module_adapter: optimize for modules that produce period_bytes
Optimize the copy() function for modules that have only 1 source/sink
buffer and produce only period bytes every period. There is no need to
allocate intermediate buffers to hold the processed samples. Also, pass
the buffer stream pointers directly so that there no extra copies.

Introduce a new field, simple_copy in struct processing_module that can
be set by modules that do not need deep buffering and produce exactly
period worth of data in every copy().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-06-10 09:50:08 +01:00
Ranjani Sridharan c40743ec8d testbench: add support for parsing UUID
In preparation for comverting the volume component to use the module
interface, add support for parsing the UUID from topology when parsing
the PGA widget in testbench.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-06-10 09:50:08 +01:00
Ranjani Sridharan 1c78031889 copier: remove get_attribute op
The get_attribute op for copier is used to determine whether the
direction has already been set or not so that the handler can skip
resetting the direction for host/dai components. Remove the op and use
the new fieldm direction_set in struct comp_dev to determine whether the
direction should be updated or not. Also, set the direction_set flag for
host/dai copier when it is created.

This change is in preparation to convert the copier module to use the
module interface instead of the comp_drv ops.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-06-10 09:47:22 +01:00
Marc Herbert 9d2e82adf0 xtensa-build-zephyr.py: fix find_west_workspace() to return west topdir
When neither -c nor -p is passed, the script defaults to '-p
SOF_TOP/zephyrproject', initializing the `west_top` global with
that. When everything is already cloned, this becomes
zephyrproject/modules/audio/sof/zephyrproject which is really not a
`west topdir`. Then west is pointed at:
 real_west_top/modules/audio/sof/zephyrproject/zephyr/samples/subsys/audio/sof
which obviously fails.

This was found while testing
https://thesofproject.github.io/latest/getting_started/build-guide/build-with-zephyr.html
and trying (and failing) to switch away from the older .sh script.

Fix find_west_workspace() to return the output of `west topdir` and use
that to update the `west_top` global.

This bug was introduced from the very start when the script was
converted from shell to python. The shell script did not have this
problem because it could be used without using neither -c nor -p. This
logical difference was mentioned in the code review:
https://github.com/thesofproject/sof/pull/5299#discussion_r801158177

Also remove a couple of accidental creations of a sof/zephyrproject/
directory when sof is already inside a higher zephyrproject.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-06-09 16:53:20 +01:00
mengdonglin 0d5bac87d3 xtensa-build-zephyr.py: avoid showing wrong layout of installed files
If each platform has its own output subdirectory, each platform output
subdirectory will include a key subdirectory with same name. Function
show_installed_files() can fail to find the correct parent for a node
as it only compares the subdir name that can no longer be unique.

This patch uses Anynode to replace Node class to define a new
attribute 'long_name' for a node to store its unique relative path
from the output staging directory (e.g. 'sof/apl/community') and
search for its parent.

The attribute 'name' is still used to store the subdir or file name
for a node (e.g. 'community'), and to display the layout of the
installed firmware files.

Signed-off-by: mengdonglin <mengdong.lin@intel.com>
2022-06-09 14:47:18 +01:00
mengdonglin be007d14ab xtensa-build-zephyr.py: add option to use an output subdirectory for each platform
All firmware files are installed in the same staging directory by default.

This patch adds an option --use-platform-subdir to create an output
subdirectory for each platform.

e.g. $scripts/xtensa-build-zephyr.py apl jsl tgl --use-platform-subdir
The layout of installed files will be like this:

build-sof-staging
├── sof
│   ├── apl
│   │   ├── community
│   │   │   └── sof-apl.ri
│   │   └── sof-apl.ldc
│   ├── tgl
│   │   ├── community
│   │   │   └── sof-tgl.ri
│   │   └── sof-tgl.ldc
│   └── jsl
│       ├── sof-jsl.ldc
│       └── community
│           └── sof-jsl.ri
└── tools
    ├── sof-logger
    └── cavstool.py

Signed-off-by: mengdonglin <mengdong.lin@intel.com>
2022-06-09 14:47:18 +01:00
mengdonglin 85a4c56d92 xtensa-build-zephyr.py: add option to specify key type subdir for output
Add argument option --key-type-subdir <key_type> to choose the output
subdirectory name based on the type of rimage signing key.

User can choose subdirectory name from 'community','dbgkey' and 'none'.
The default one is 'community', the type of default rimage signing key.
We can extend the list later.

When the key type is 'community' or 'dbgkey', the layout of SOF output
directory will be like:
build-sof-staging
├── sof
│   ├── sof-platform1.ldc
│   ├── sof-platform2.ldc
│   ├── ...
│   └── <key_type>
│       ├── sof-platform1.ri
│       ├── sof-platform2.ri
│       └── ...
└── tools
    ├── sof-logger
    └── cavstool.py

When the key type is 'none', there will be no key type subdirectory:
build-sof-staging
├── sof
│   ├── sof-platform1.ldc
│   ├── sof-platform1.ri
│   ├── sof-platform2.ldc
│   ├── sof-platform2.ri
│   └── ...
└── tools
    ├── sof-logger
    └── cavstool.py

Signed-off-by: mengdonglin <mengdong.lin@intel.com>
2022-06-09 14:47:18 +01:00
Krzysztof Frydryk a1f6fd3bb6 DAI: Add sampling frequency to ipc_config_dai
For some of the dai devices, sampling frequency is not passed as a part
of IPC4 blob. Added this value to ipc_config_dai, so during
configuration devices can access it through their common_config
argument.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-06-09 14:44:16 +01:00
Pierre-Louis Bossart 51f2b1fe8e topology2: cavs: cavs-mixin-mixout-hda: use macro for DAI name
The copier 'stream_name' and dai 'name' need to match, use macro to
enforce consistency.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-06-09 14:41:40 +01:00
Pierre-Louis Bossart 1ef9979c73 topology2/cavs/cavs-mixin-mixout-hda: remove pipeline object from widget
The pipeline stream_name is not used at all, and as a consequence we
can remove the pipeline from the Widget objects

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-06-09 14:41:40 +01:00
Pierre-Louis Bossart e21649c109 topology2: cavs: use macro for PCM devices
The same 'Analog Playback' string is used for the copier stream_name
and PCM caps name. This is not a coincidence but a requirement to
match PCM and widgets. Same for 'Analog Capture'

Use a macro to make sure this 1:1 mapping is not broken.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-06-09 14:41:40 +01:00
Pierre-Louis Bossart 80c1cb0deb topology2: cavs: rename mixin-capture as dai-copier-gain-mixin-capture
Be exhaustive on pipeline contents.

Also remove Windows references and copy/pasted comments

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-06-09 14:41:40 +01:00