firmware: cs_dsp: Add mock DSP memory map for KUnit testing
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Thu, 12 Dec 2024 14:37:15 +0000 (14:37 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 13 Dec 2024 13:14:38 +0000 (13:14 +0000)
commit41e78c0f44f97c958afcda3f82b23f4f4a05b968
tree16ffce4dfef0727c02aa6f5e6be5c41ce688008f
parentd54a3fc6bf3db0db0e16cfdf7f48a8bbb803f6b0
firmware: cs_dsp: Add mock DSP memory map for KUnit testing

Add helper functions to implement an emulation of the DSP memory map.

There are three main groups of functionality:

1. Define a mock cs_dsp_region table.
2. Calculate the addresses of memory and algorithms from the firmware
   header in XM.
3. Build a mock XM header in emulated XM.

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