Fuzzing produces (by design) an endless flood of protocol errors.
Quiet the top level ones when in use, because otherwise the log output
takes up most of the CPU time available that we'd rather spend on
fuzzing. Same trick from IPC3.
Signed-off-by: Andy Ross <andyross@google.com>
Don't use the IPC3 protocol whiteboxing for IPC4, the formats are
different.
Also IPC4 seems to send a LOT of zero-length empty replies. Those are
causing spurious errors (memcmp_s fails when you pass it a null
destination pointer, even when the length is zero), where the Intel
IPC driver will just drop them. Suppress handling to match behavior,
though this is probably a buglet worth investigating.
Signed-off-by: Andy Ross <andyross@google.com>
Add new APIs needed for CONFIG_IPC_MAJOR_4=y builds. Note that many
of these are fairly Intel-specific, meaning they probably don't belong
in the platform layer. But in this case (fuzzing) it's probably
worthwhile to enable as much code as possible vs. refactoring for
purity. Future IPC4 hardware platforms will need to do that
refactoring for us anyway.
Signed-off-by: Andy Ross <andyross@google.com>
The component model for IPC4 seems to be based on an array of manifest
headers at the start of the firmware image. Those are rimage data,
and not all platforms (in particular the fuzzer) are packing their
output with rimage.
Just stub this for now. In the source tree as it exists, there don't
seem to be any extra components to build, nor is there any support I
can see at the linker/rimage level to get them included anyway.
Signed-off-by: Andy Ross <andyross@google.com>
This was trying to read hardware registers, which obviously doesn't
work on other platforms. Stub with zeros for now.
Longer term: this whole message ("basefw_mem_state_info") might want
some rework. In addition to being heavily hardware-specific, it seems
like a comparatively large block without self-describing data
(e.g. id/val pairs), nor with a struct definition to specify it, nor
with any documentation that I can find.
Signed-off-by: Andy Ross <andyross@google.com>
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>