]> www.infradead.org Git - users/jedix/linux-maple.git/commit
firmware: cs_dsp: Add KUnit testing of control cache
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Thu, 12 Dec 2024 14:37:21 +0000 (14:37 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 13 Dec 2024 13:14:44 +0000 (13:14 +0000)
commit9b33a4fc500cedc1adc9c0ee01e30ffd50e5887a
tree5cee4e96a4018895aee4252dee376692d3976f49
parent83baecd92e7c2a44ac963fab8fd4476c71e19ddd
firmware: cs_dsp: Add KUnit testing of control cache

Add KUnit test cases for the caching of control content.

The test cases can be divided into four groups:
1) The cache is correctly initialized when the firmware is first
   downloaded.
2) Reads return the correct data.
3) Writes update the registers and cache.
4) If a value has been written to the control it is retained in
   the cache and written out to the registers when the firmware
   is started.

There are multiple test suites to cover:
 - V1 and V2 format files on 16-bit and 32-bit ADSP2.
 - V3 format files on Halo Core DSPs.

V1 format files, and some V2 format files, didn't provide access
flags for the controls. There are a couple of test cases for
unspecified flags to ensure backwards compatibility with the
original implementation of these older firmware versions.

The obsolete V0 format does not have controls, so no testing of
that format is needed.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-9-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/firmware/cirrus/test/Makefile
drivers/firmware/cirrus/test/cs_dsp_test_control_cache.c [new file with mode: 0644]