CLK_MAX_CPU_HZ is defined in platform/lib/clk.h, unmasked by posix
work that lacks the same transitive headers.
Signed-off-by: Andy Ross <andyross@google.com>
__packed and __aligned are defined in compiler_attributes.h, which
wasn't included, and when building for Zephyr that needs to include
the zephyr/toolchain.h header which is the original source of those
macros.
Transitive headers were saving this, but building for posix/fuzzing
works differently.
Signed-off-by: Andy Ross <andyross@google.com>
We assume sdw jack is always there in a sdw topology. This commit
makes it be optional to deal with the sdw amp only case.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Remove the creation or the endpoint DAI device when a copier have only a
single endpoint. Replace the usage of the endpoint device with the
copier device and remove the endpoint buffer. Amend the copier_params()
to pass the appropriate params for the DMA buffer and set the correct
processing function in the case where the valid bits and the container
size do not match.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
So that the correct op will be invoked when this function is invoked
with a copier device.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The dai_data can simply be accessed via the copier_data. There is no
copier with chain DMA anymore, so no need to special handle that case
in pipeline_comp_trigger() either.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation to remove the DAI device creation for DAI copiers, add
the dai_get_hw_params op and expose dai_zephyr_get_hw_params() for both
dai-zephyr and dai-legacy.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation to remove the DAI device creation, add the timestamping
ops for the DAI copier and expose the timestaming functions in
dai-zephyr and dai-legacy.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a module copier between the DAI copier and gain in preparation for
optimizing the single endpoint DAI copiers. This optimization will
temporarily make multiple sinks unsupported with DAI copiers. This
feature will be re-introduced in a follow up PR and the module copier
will be removed then.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In order to also use this function from the copier device without an
endpoint DAI device, modify the signature to ass both the dai_data and
the dev pointers. Also, modify the signatures of dai_assign_group() and
dai_init_llp_info() to use the passed pointers.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Expose and use the function for the single endpoint DAI coper case in
preparation to remove the creation of the DAI device.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a helper function, dai_zephyr_copy() that can also be called from a
copier device.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Pass both the dai_data and the dev pointers so that it can also be used
from the copier device.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Expose and use it in the single endpoint DAI case in the copier device
in preparation to remove the creation of dai component.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a new helper, dai_zephyr_params() to make it usable from the copier
device. Also modify the signatures of dai_playback_params() and
dai_capture_params() to use the passed dai_data and dev pointer.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
To pass both the dai_data and dev pointer and make it usable for both
the DAI device and the copier device.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
And add a new helper, dai_zephyr_position() that can also be used by the
copier device.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Modify the get_processed_data() function to use the total_processed_data
from the dai_data directly for DAI components.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Expose and use the function in the single endpoint DAI case in the
copier device in preparation to remove the creation of DAI component.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add a new helper function dai_zephyr_trigger() that can also be used by
a copier device. Also, modify the signature of the
dai_comp_trigger_internal() to pass the dai_data and device pointer.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Expose dai_zephyr_reset() and use in the copier device for the single
endpoint case in preparation for removing the creation of DAI component.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
And add a helper function, dai_zephyr_reset() that can also be used by
the copier device in the next patch.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for it to be used with both the DAI device and the copier
device, pass both the dai_data and the device pointer separately.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Rename dai_config_prepare() to add the zephyr prefix and expose both
functions and use them in the copier device in the single endpoint DAI
case.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Split the dai_prepare() function and add a new helper,
dai_zephyr_prepare() that can also be invoked from the copier device.
Also modify the dai_config_prepare() function to pass the dai_data and
device separately for use with the copier device.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Expose the dai_zephyr_new()/free() functions and use them for
creating/freeing the endpoint device when the dai_count is 1 when a
copier device is created. This is preparation to replace the endpoint
device with the copier device and eventually remove the endpoint device
itself.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for this function to be used by both a copier device and
the DAI device, modify the signature to pass both the dai_data and the
device pointer.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Split the dai_free() function to add a helper function, dai_zephyr_free()
in preparation for this to be called from both a DAI device and copier
device.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Split the dai_new() function to add a helper function, dai_zephyr_new()
in preparation for this to be called from both a DAI device and copier
device.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
In preparation for using this function for both a DAI device and a
copier device, modify the signature to pass the dai_data as the input
instead of the dev pointer.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Convert the IPC4 dummy smart_amp(smart_amp_test_ipc4.c) module to use
module adapter interface. And remove the k_mutex lock from struct
smart_amp_data since the lock is used for bind/unbind thread and process
thread. Now bind/unbind are removed, all lock reference is used in the same
thread so we don't need it anymore.
Signed-off-by: Andrula Song <andrula.song@intel.com>
Since smart_amp_test will always start feedback path firston IPC3
and the k_mute lock is added for IPC4 to support arbitrarily order
of starting source path and feedback source. So remove the k_mute
from IPC3 implementation.
Signed-off-by: Andrula Song <andrula.song@intel.com>
Split smart_amp_test.c to IPC3 version smart_amp_test_ipc3.c
and IPC4 version smart_amp_test_ipc4.c
Signed-off-by: Andrula Song <andrula.song@intel.com>
It would be better to make these dependedent on NUM_DMICS. Something to
improve in a follow up PR.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Remove one intermediate and unnecessary .ri file. Simplify the code and
the build directory. Example below with `sof-mtl.ri` for better
readability but this applies the same to `sof-imx8.ri` and every other
`sof-$platf.ri` file.
There were 3 .ri copies before this commit:
```
build-mtl/zephyr/zephyr.ri
copied to -> build-mtl/zephyr/sof-mtl.ri
copied to -> build-sof-staging/___/sof-mtl.ri
```
Only 2 left after dropping the second and pointless copy:
```
build-mtl/zephyr/zephyr.ri
copied to -> build-sof-staging/___/sof-mtl.ri
```
Fewer copies means less wondering about what is what, two identical
files in the same directory is at best pointless and at worst misleading.
The `build-mtl/` directory belongs to the zephyr build system
exclusively, this wrapper script has no business interfering with
`build-mtl`. `build-mtl/zephyr/sof-mtl.ri can even be dangerous because
it does not get cleaned. Demonstration:
```
# Compile successfully
$ ./scripts/xtensa-build-zephyr.py mtl
# Write some code and make a mistake.
# Fail to compile.
$ echo BROKEN >> ../zephyr/kernel/sched.c
$ ./scripts/xtensa-build-zephyr.py mtl
# Obsolete .ri files are still there
$ find ../build-mtl/ -name *.ri
../build-mtl/zephyr/zephyr.ri
../build-mtl/zephyr/sof-mtl.ri
$ ninja -C ../build-mtl clean
# Obsolete sof-mtl.ri is still there!
$ find ../build-mtl/ -name *.ri
../build-mtl/zephyr/sof-mtl.ri
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes audio format conversions on Host gateway between 16/16 and 24/32
(and vice versa) and between 32/32 and 24/32 (and vice versa).
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
No script changes, just unify shell script style to be
with indents with spaces instead of both tabs and spaces.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to process_test() sixth argument to run the tests
with xt-run environment with argument set to 'xt-run' or
'xt-run --turbo'.
The set and print of LD_LIBRARY_PATH is no more needed with static
testbench version.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch adds to rebuild-testbench option -x <platform> that
can be used to build testbench for xt-run execution. The enhanced
script reuses native testbench build but with CC, LD, LDFLAGS,
etc. defines to use the xt-xcc compiler for build.
Currently TGL (HiFi3) is the only supported platform. More will
be added later.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch avoids the build errors. Most of the issues are
from different types for formatted printing in gcc vs. xt-xcc.
The "__attribute__ ((fallthrough));" is not supported in xt-xcc.
The xtensa C library does not have clock_gettime() so it is
only left out from build. The cycles count and MCPS is printed
instead.
The include of dlfcn.h is not needed since the testbench no
more has dynamic libraries.
Structs within structs need to be initialized to zero in xt-xcc
with multiple brackets.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
As discussed in #6952, relying on `git describe` for defining SOF_MAJOR
and friends is very brittle and unreliable. Switch to a static
versions.json file instead.
Note the full `git describe --tags` output is _still_ present in the
binary, this is useful and left unchanged. It's just not used any more
to guess SOF_MAJOR, SOF_MINOR and SOF_MICRO.
Use JSON because CMake and pretty much every other piece of software has
a JSON parser out of the box.
This aligns with linux/Makefile, Zephyr/VERSIONS and probably many
others. - except we use JSON because we're in 2023 so we don't spend
time having fun re-implementing parsers any more.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Search and replace checkout@v2 with checkout@v3.
This finally gets rid of all warnings "Node.js 12 actions are
deprecated".
We've been using v3 in a few other places and never met any backwards
compatibility issue.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Generate MIXER topology file for i.MX8 and i.MX8MP with wm8962 codec
based on sof-imx8-wm8960-mixer.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Combine mixer topology files for i.MX8MP and i.MX8 using different
variables like RATE, SAI_INDEX, CODEC.
Based on CODEC and SAI_INDEX use the proper DAI_CONFIG or STREAM_NAME.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>