summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.cirrus.com>2025-12-31 17:27:11 +0000
committerMark Brown <broonie@kernel.org>2026-01-05 13:18:31 +0000
commit211243b69533e968cc6f0259fb80ffee02fbe0ca (patch)
tree08df2f8d8bdb28b6f908e8b207548919fb956ff5 /drivers
parent7fecf0bf1202599920d929704a3787291fc068db (diff)
firmware: cs_dsp: test_bin: Add tests for offsets > 0xffff
Add test cases for using the new long-offset block types to patch memory that is >0xffff from the algorithm base. This is just adding entries to the parameter data that have larger offset values. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://patch.msgid.link/20251231172711.450024-9-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/firmware/cirrus/test/cs_dsp_test_bin.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/firmware/cirrus/test/cs_dsp_test_bin.c b/drivers/firmware/cirrus/test/cs_dsp_test_bin.c
index 67af7da4f8c1..99148ea22df3 100644
--- a/drivers/firmware/cirrus/test/cs_dsp_test_bin.c
+++ b/drivers/firmware/cirrus/test/cs_dsp_test_bin.c
@@ -2326,6 +2326,7 @@ static const struct bin_test_param x_or_y_and_offset_param_cases[] = {
};
static const struct bin_test_param x_or_y_and_long_offset_param_cases[] = {
+ /* Offset < 0xffff in long-offset block type */
{ .mem_type = WMFW_ADSP2_XM, .offset_words = 0, WMDR_PATCH_LONG },
{ .mem_type = WMFW_ADSP2_XM, .offset_words = 1, WMDR_PATCH_LONG },
{ .mem_type = WMFW_ADSP2_XM, .offset_words = 2, WMDR_PATCH_LONG },
@@ -2336,6 +2337,7 @@ static const struct bin_test_param x_or_y_and_long_offset_param_cases[] = {
{ .mem_type = WMFW_ADSP2_XM, .offset_words = 21, WMDR_PATCH_LONG },
{ .mem_type = WMFW_ADSP2_XM, .offset_words = 20, WMDR_PATCH_LONG },
+ /* Offset < 0xffff in long-offset block type */
{ .mem_type = WMFW_ADSP2_YM, .offset_words = 0, WMDR_PATCH_LONG },
{ .mem_type = WMFW_ADSP2_YM, .offset_words = 1, WMDR_PATCH_LONG },
{ .mem_type = WMFW_ADSP2_YM, .offset_words = 2, WMDR_PATCH_LONG },
@@ -2345,6 +2347,28 @@ static const struct bin_test_param x_or_y_and_long_offset_param_cases[] = {
{ .mem_type = WMFW_ADSP2_YM, .offset_words = 22, WMDR_PATCH_LONG },
{ .mem_type = WMFW_ADSP2_YM, .offset_words = 21, WMDR_PATCH_LONG },
{ .mem_type = WMFW_ADSP2_YM, .offset_words = 20, WMDR_PATCH_LONG },
+
+ /* Offset > 0xffff in long-offset block type */
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x10000, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x10001, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x10002, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x10003, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x10004, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x2f003, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x2f002, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x2f001, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_XM, .offset_words = 0x2f000, WMDR_PATCH_LONG },
+
+ /* Offset > 0xffff in long-offset block type */
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x10000, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x10001, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x10002, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x10003, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x10004, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x2f003, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x2f002, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x2f001, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_ADSP2_YM, .offset_words = 0x2f000, WMDR_PATCH_LONG },
};
/* Parameterize on ZM with a range of word offsets */
@@ -2374,15 +2398,31 @@ static const struct bin_test_param packed_x_or_y_and_offset_param_cases[] = {
};
static const struct bin_test_param packed_x_or_y_and_long_offset_param_cases[] = {
+ /* Offset < 0xffff in long-offset block type */
{ .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 0, WMDR_PATCH_LONG },
{ .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 4, WMDR_PATCH_LONG },
{ .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 8, WMDR_PATCH_LONG },
{ .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 12, WMDR_PATCH_LONG },
+ /* Offset < 0xffff in long-offset block type */
{ .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 0, WMDR_PATCH_LONG },
{ .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 4, WMDR_PATCH_LONG },
{ .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 8, WMDR_PATCH_LONG },
{ .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 12, WMDR_PATCH_LONG },
+
+ /* Offset > 0xffff in long-offset block type */
+ { .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 0x10000, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 0x10004, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 0x10008, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 0x2f000, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_HALO_XM_PACKED, .offset_words = 0x2f004, WMDR_PATCH_LONG },
+
+ /* Offset > 0xffff in long-offset block type */
+ { .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 0x10000, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 0x10004, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 0x10008, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 0x2f000, WMDR_PATCH_LONG },
+ { .mem_type = WMFW_HALO_YM_PACKED, .offset_words = 0x2f004, WMDR_PATCH_LONG },
};
static void x_or_y_or_z_and_offset_param_desc(const struct bin_test_param *param,
@@ -2449,6 +2489,7 @@ static const struct bin_test_param offset_param_cases[] = {
};
static const struct bin_test_param long_offset_param_cases[] = {
+ /* Offset < 0xffff in long-offset block type */
{ .offset_words = 0, WMDR_PATCH_LONG },
{ .offset_words = 1, WMDR_PATCH_LONG },
{ .offset_words = 2, WMDR_PATCH_LONG },
@@ -2458,6 +2499,17 @@ static const struct bin_test_param long_offset_param_cases[] = {
{ .offset_words = 22, WMDR_PATCH_LONG },
{ .offset_words = 21, WMDR_PATCH_LONG },
{ .offset_words = 20, WMDR_PATCH_LONG },
+
+ /* Offset > 0xffff in long-offset block type */
+ { .offset_words = 0x10000, WMDR_PATCH_LONG },
+ { .offset_words = 0x10001, WMDR_PATCH_LONG },
+ { .offset_words = 0x10002, WMDR_PATCH_LONG },
+ { .offset_words = 0x10003, WMDR_PATCH_LONG },
+ { .offset_words = 0x10004, WMDR_PATCH_LONG },
+ { .offset_words = 0x2f000, WMDR_PATCH_LONG },
+ { .offset_words = 0x2f001, WMDR_PATCH_LONG },
+ { .offset_words = 0x2f002, WMDR_PATCH_LONG },
+ { .offset_words = 0x2f003, WMDR_PATCH_LONG },
};
static void offset_param_desc(const struct bin_test_param *param, char *desc)