Skip to content

Commit 5c86326

Browse files
nordic-baminordic-piks
authored andcommitted
tests: benchmarks: Add AUDIOPLL control to 'idle_clock_control' test
Request different AUDIOPLL frequencies in the test. Signed-off-by: Bartosz Miller <[email protected]>
1 parent c308510 commit 5c86326

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

tests/benchmarks/multicore/idle_clock_control/boards/nrf54h20dk_nrf54h20_cpuapp.overlay

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@
1212
};
1313

1414
/delete-node/ &led1;
15+
16+
&audiopll {
17+
status = "okay";
18+
};

tests/benchmarks/multicore/idle_clock_control/src/main.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,27 @@ static const struct test_clk_ctx hfxo_test_clk_ctx[] = {
153153
.clk_specs_size = ARRAY_SIZE(test_clk_specs_hfxo),
154154
},
155155
};
156+
157+
const struct nrf_clock_spec test_clk_spec_audiopll[] = {
158+
{
159+
.frequency = MHZ(12),
160+
.accuracy = 0,
161+
.precision = 0,
162+
},
163+
{
164+
.frequency = MHZ(11),
165+
.accuracy = 0,
166+
.precision = 0,
167+
},
168+
};
169+
170+
static const struct test_clk_ctx audiopll_test_clk_ctx[] = {
171+
{
172+
.clk_dev = DEVICE_DT_GET(DT_NODELABEL(audiopll)),
173+
.clk_specs = test_clk_spec_audiopll,
174+
.clk_specs_size = ARRAY_SIZE(test_clk_spec_audiopll),
175+
},
176+
};
156177
#endif /* CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP */
157178

158179
static void test_request_release_clock_spec(const struct device *clk_dev,
@@ -166,7 +187,7 @@ static void test_request_release_clock_spec(const struct device *clk_dev,
166187
LOG_INF("Clock under test: %s", clk_dev->name);
167188
sys_notify_init_spinwait(&cli.notify);
168189
ret = nrf_clock_control_request(clk_dev, clk_spec, &cli);
169-
__ASSERT_NO_MSG(ret == 0);
190+
__ASSERT_NO_MSG((ret >= 0) || (ret <= 2));
170191
do {
171192
ret = sys_notify_fetch_result(&cli.notify, &res);
172193
k_yield();
@@ -236,6 +257,7 @@ void run_tests(void)
236257
test_auxpll_control(DEVICE_DT_GET(DT_NODELABEL(canpll)));
237258
test_clock_control_request(hfxo_test_clk_ctx, ARRAY_SIZE(hfxo_test_clk_ctx));
238259
test_clock_control_request(hsfll_test_clk_ctx, ARRAY_SIZE(hsfll_test_clk_ctx));
260+
test_clock_control_request(audiopll_test_clk_ctx, ARRAY_SIZE(audiopll_test_clk_ctx));
239261
#endif /* CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP */
240262
test_clock_control_request(global_hsfll_test_clk_ctx,
241263
ARRAY_SIZE(global_hsfll_test_clk_ctx));

0 commit comments

Comments
 (0)