firmware: cs_dsp: Add KUnit testing of wmfw error cases

Add tests for various types of errors and illegal values in
wmfw files. This covers buffer overflows as well as general
unsupported field values.

There are several sets of test cases to cover various different
versions of the wmfw file format.

V0 format was only used on the earlier ADSP2 devices. It does
not have algorithm blocks.

V1 format is used on all ADSP2 versions. It added algorithm
blocks and firmware coefficient descriptor blocks. Strings
are stored in fixed-length arrays.

V2 format is used on all ADSP2 versions. It is similar to V1
but space for strings is variable-length with either an 8-bit
or 16-bit length field.

V3 format is used on Halo Core DSPs and is mostly identical to
the V3 format.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-12-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Richard Fitzgerald 2024-12-12 14:37:24 +00:00 committed by Mark Brown
parent cd8c058499
commit feb5fb0615
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
2 changed files with 1348 additions and 0 deletions

View File

@ -15,6 +15,7 @@ cs_dsp_test-objs := \
cs_dsp_test_control_cache.o \
cs_dsp_test_control_rw.o \
cs_dsp_test_wmfw.o \
cs_dsp_test_wmfw_error.o \
cs_dsp_tests.o
obj-$(CONFIG_FW_CS_DSP_KUNIT_TEST_UTILS) += cs_dsp_test_utils.o

File diff suppressed because it is too large Load Diff