From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: broonie@kernel.org
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com
Subject: [PATCH 2/8] firmware: cs_dsp: test_bin: Run test cases with v3 file format
Date: Wed, 31 Dec 2025 10:49:50 +0000 [thread overview]
Message-ID: <20251231104956.449696-3-rf@opensource.cirrus.com> (raw)
In-Reply-To: <20251231104956.449696-1-rf@opensource.cirrus.com>
The new v3 file format has all the same functionality as the earlier
formats, so run all the existing test cases with a file type of 3.
This is only done for Halo Core because v3 files are not used with the
older ADSP cores.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
.../firmware/cirrus/test/cs_dsp_test_bin.c | 30 +++++++++++++++----
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/drivers/firmware/cirrus/test/cs_dsp_test_bin.c b/drivers/firmware/cirrus/test/cs_dsp_test_bin.c
index 163b7faecff4..4532a7e9833a 100644
--- a/drivers/firmware/cirrus/test/cs_dsp_test_bin.c
+++ b/drivers/firmware/cirrus/test/cs_dsp_test_bin.c
@@ -2149,7 +2149,8 @@ static void bin_patch_name_and_info(struct kunit *test)
KUNIT_EXPECT_EQ(test, reg_val, payload_data);
}
-static int cs_dsp_bin_test_common_init(struct kunit *test, struct cs_dsp *dsp)
+static int cs_dsp_bin_test_common_init(struct kunit *test, struct cs_dsp *dsp,
+ int wmdr_ver)
{
struct cs_dsp_test *priv;
struct cs_dsp_mock_xm_header *xm_hdr;
@@ -2197,7 +2198,7 @@ static int cs_dsp_bin_test_common_init(struct kunit *test, struct cs_dsp *dsp)
KUNIT_ASSERT_EQ(test, ret, 0);
priv->local->bin_builder =
- cs_dsp_mock_bin_init(priv, 1,
+ cs_dsp_mock_bin_init(priv, wmdr_ver,
cs_dsp_mock_xm_header_get_fw_version(xm_hdr));
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->local->bin_builder);
@@ -2227,7 +2228,7 @@ static int cs_dsp_bin_test_common_init(struct kunit *test, struct cs_dsp *dsp)
return kunit_add_action_or_reset(priv->test, _cs_dsp_remove_wrapper, dsp);
}
-static int cs_dsp_bin_test_halo_init(struct kunit *test)
+static int cs_dsp_bin_test_halo_init_common(struct kunit *test, int wmdr_ver)
{
struct cs_dsp *dsp;
@@ -2243,7 +2244,17 @@ static int cs_dsp_bin_test_halo_init(struct kunit *test)
dsp->base = cs_dsp_mock_halo_core_base;
dsp->base_sysinfo = cs_dsp_mock_halo_sysinfo_base;
- return cs_dsp_bin_test_common_init(test, dsp);
+ return cs_dsp_bin_test_common_init(test, dsp, wmdr_ver);
+}
+
+static int cs_dsp_bin_test_halo_init(struct kunit *test)
+{
+ return cs_dsp_bin_test_halo_init_common(test, 1);
+}
+
+static int cs_dsp_bin_test_halo_wmdr3_init(struct kunit *test)
+{
+ return cs_dsp_bin_test_halo_init_common(test, 3);
}
static int cs_dsp_bin_test_adsp2_32bit_init(struct kunit *test)
@@ -2262,7 +2273,7 @@ static int cs_dsp_bin_test_adsp2_32bit_init(struct kunit *test)
dsp->num_mems = cs_dsp_mock_count_regions(cs_dsp_mock_adsp2_32bit_dsp1_region_sizes);
dsp->base = cs_dsp_mock_adsp2_32bit_sysbase;
- return cs_dsp_bin_test_common_init(test, dsp);
+ return cs_dsp_bin_test_common_init(test, dsp, 1);
}
static int cs_dsp_bin_test_adsp2_16bit_init(struct kunit *test)
@@ -2281,7 +2292,7 @@ static int cs_dsp_bin_test_adsp2_16bit_init(struct kunit *test)
dsp->num_mems = cs_dsp_mock_count_regions(cs_dsp_mock_adsp2_16bit_dsp1_region_sizes);
dsp->base = cs_dsp_mock_adsp2_16bit_sysbase;
- return cs_dsp_bin_test_common_init(test, dsp);
+ return cs_dsp_bin_test_common_init(test, dsp, 1);
}
/* Parameterize on choice of XM or YM with a range of word offsets */
@@ -2539,6 +2550,12 @@ static struct kunit_suite cs_dsp_bin_test_halo = {
.test_cases = cs_dsp_bin_test_cases_halo,
};
+static struct kunit_suite cs_dsp_bin_test_halo_wmdr3 = {
+ .name = "cs_dsp_bin_halo_wmdr_v3",
+ .init = cs_dsp_bin_test_halo_wmdr3_init,
+ .test_cases = cs_dsp_bin_test_cases_halo,
+};
+
static struct kunit_suite cs_dsp_bin_test_adsp2_32bit = {
.name = "cs_dsp_bin_adsp2_32bit",
.init = cs_dsp_bin_test_adsp2_32bit_init,
@@ -2552,5 +2569,6 @@ static struct kunit_suite cs_dsp_bin_test_adsp2_16bit = {
};
kunit_test_suites(&cs_dsp_bin_test_halo,
+ &cs_dsp_bin_test_halo_wmdr3,
&cs_dsp_bin_test_adsp2_32bit,
&cs_dsp_bin_test_adsp2_16bit);
--
2.43.0
next prev parent reply other threads:[~2025-12-31 11:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-31 10:49 [PATCH 0/8] firmware: cirrus: cs_dsp: Add long-offset WMDR blocks Richard Fitzgerald
2025-12-31 10:49 ` [PATCH 1/8] firmware: cs_dsp: Handle long-offset data blocks Richard Fitzgerald
2025-12-31 10:49 ` Richard Fitzgerald [this message]
2025-12-31 10:49 ` [PATCH 3/8] firmware: cs_dsp: test_bin: Make patch function a test parameter Richard Fitzgerald
2025-12-31 10:49 ` [PATCH 4/8] firmware: cs_dsp: mock_bin: Pass offset32 to cs_dsp_mock_bin_add_raw_block() Richard Fitzgerald
2025-12-31 10:49 ` [PATCH 5/8] firmware: cs_dsp: mock_bin: Add function to create long-offset patches Richard Fitzgerald
2025-12-31 10:49 ` [PATCH 6/8] firmware: cs_dsp: test: Increase size of XM and YM on Halo Core Richard Fitzgerald
2025-12-31 10:49 ` [PATCH 7/8] firmware: cs_dsp: test_bin: Run test cases on long-offset blocks Richard Fitzgerald
2025-12-31 10:49 ` [PATCH 8/8] firmware: cirrus: test_bin: Add tests for offsets > 0xffff Richard Fitzgerald
2025-12-31 17:25 ` Richard Fitzgerald
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251231104956.449696-3-rf@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox