Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

firmware: cs_dsp: test_bin: Run test cases with v3 file format

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>
Link: https://patch.msgid.link/20251231172711.450024-3-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Richard Fitzgerald and committed by
Mark Brown
afcbb046 bc0305cb

+24 -6
+24 -6
drivers/firmware/cirrus/test/cs_dsp_test_bin.c
··· 2149 2149 KUNIT_EXPECT_EQ(test, reg_val, payload_data); 2150 2150 } 2151 2151 2152 - static int cs_dsp_bin_test_common_init(struct kunit *test, struct cs_dsp *dsp) 2152 + static int cs_dsp_bin_test_common_init(struct kunit *test, struct cs_dsp *dsp, 2153 + int wmdr_ver) 2153 2154 { 2154 2155 struct cs_dsp_test *priv; 2155 2156 struct cs_dsp_mock_xm_header *xm_hdr; ··· 2198 2197 KUNIT_ASSERT_EQ(test, ret, 0); 2199 2198 2200 2199 priv->local->bin_builder = 2201 - cs_dsp_mock_bin_init(priv, 1, 2200 + cs_dsp_mock_bin_init(priv, wmdr_ver, 2202 2201 cs_dsp_mock_xm_header_get_fw_version(xm_hdr)); 2203 2202 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, priv->local->bin_builder); 2204 2203 ··· 2228 2227 return kunit_add_action_or_reset(priv->test, _cs_dsp_remove_wrapper, dsp); 2229 2228 } 2230 2229 2231 - static int cs_dsp_bin_test_halo_init(struct kunit *test) 2230 + static int cs_dsp_bin_test_halo_init_common(struct kunit *test, int wmdr_ver) 2232 2231 { 2233 2232 struct cs_dsp *dsp; 2234 2233 ··· 2244 2243 dsp->base = cs_dsp_mock_halo_core_base; 2245 2244 dsp->base_sysinfo = cs_dsp_mock_halo_sysinfo_base; 2246 2245 2247 - return cs_dsp_bin_test_common_init(test, dsp); 2246 + return cs_dsp_bin_test_common_init(test, dsp, wmdr_ver); 2247 + } 2248 + 2249 + static int cs_dsp_bin_test_halo_init(struct kunit *test) 2250 + { 2251 + return cs_dsp_bin_test_halo_init_common(test, 1); 2252 + } 2253 + 2254 + static int cs_dsp_bin_test_halo_wmdr3_init(struct kunit *test) 2255 + { 2256 + return cs_dsp_bin_test_halo_init_common(test, 3); 2248 2257 } 2249 2258 2250 2259 static int cs_dsp_bin_test_adsp2_32bit_init(struct kunit *test) ··· 2273 2262 dsp->num_mems = cs_dsp_mock_count_regions(cs_dsp_mock_adsp2_32bit_dsp1_region_sizes); 2274 2263 dsp->base = cs_dsp_mock_adsp2_32bit_sysbase; 2275 2264 2276 - return cs_dsp_bin_test_common_init(test, dsp); 2265 + return cs_dsp_bin_test_common_init(test, dsp, 1); 2277 2266 } 2278 2267 2279 2268 static int cs_dsp_bin_test_adsp2_16bit_init(struct kunit *test) ··· 2292 2281 dsp->num_mems = cs_dsp_mock_count_regions(cs_dsp_mock_adsp2_16bit_dsp1_region_sizes); 2293 2282 dsp->base = cs_dsp_mock_adsp2_16bit_sysbase; 2294 2283 2295 - return cs_dsp_bin_test_common_init(test, dsp); 2284 + return cs_dsp_bin_test_common_init(test, dsp, 1); 2296 2285 } 2297 2286 2298 2287 /* Parameterize on choice of XM or YM with a range of word offsets */ ··· 2550 2539 .test_cases = cs_dsp_bin_test_cases_halo, 2551 2540 }; 2552 2541 2542 + static struct kunit_suite cs_dsp_bin_test_halo_wmdr3 = { 2543 + .name = "cs_dsp_bin_halo_wmdr_v3", 2544 + .init = cs_dsp_bin_test_halo_wmdr3_init, 2545 + .test_cases = cs_dsp_bin_test_cases_halo, 2546 + }; 2547 + 2553 2548 static struct kunit_suite cs_dsp_bin_test_adsp2_32bit = { 2554 2549 .name = "cs_dsp_bin_adsp2_32bit", 2555 2550 .init = cs_dsp_bin_test_adsp2_32bit_init, ··· 2569 2552 }; 2570 2553 2571 2554 kunit_test_suites(&cs_dsp_bin_test_halo, 2555 + &cs_dsp_bin_test_halo_wmdr3, 2572 2556 &cs_dsp_bin_test_adsp2_32bit, 2573 2557 &cs_dsp_bin_test_adsp2_16bit);