diff options
author | Richard Fitzgerald <rf@opensource.cirrus.com> | 2024-12-12 14:37:14 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-12-13 13:14:37 +0000 |
commit | d54a3fc6bf3db0db0e16cfdf7f48a8bbb803f6b0 (patch) | |
tree | 4430ba9d661c24032f27cdd71f2ccc87aafd7751 /scripts/lib/kdoc/kdoc_parser.py | |
parent | 3ce8df13f65e3ed297def63bb1e3ee6f024cbdc5 (diff) |
firmware: cs_dsp: Add mock regmap for KUnit testing
Add a mock regmap implementation to act as a simulated DSP for KUnit
testing. This is built as a utility module so that it could be used by
clients of cs_dsp to create a mock "DSP" for their own testing.
cs_dsp interacts with the DSP only through registers. Most of the
register space of the DSP is RAM. ADSP cores have a small set of control
registers. HALO Core DSPs have a much larger set of control registers but
only a small subset are used.
Most writes are "blind" in the sense that cs_dsp does not expect to
receive any sort of response from the DSP. So there isn't any need to
emulate a "DSP", only a set of registers that can be written and read
back.
The idea of the mock regmap is to use the cache to accumulate writes
which can then be tested against the values that are expected to be in
the registers.
Stray writes can be detected by dropping the cache entries for all
addresses that should have been written and then issuing a regcache_sync().
If this causes bus writes it means there were writes to unexpected
registers.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20241212143725.1381013-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions