Skip to content

Commit 8a1d9ae

Browse files
nordic-baminordic-piks
authored andcommitted
tests: benchmarks: Increase coverage for Clock Control
Perform tests with additional clock devices Signed-off-by: Bartosz Miller <[email protected]>
1 parent e808fbf commit 8a1d9ae

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed

tests/benchmarks/multicore/idle_clock_control/Kconfig.sysbuild

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
88

99
config REMOTE_BOARD
10-
string "The board used for remote target"
10+
string
11+
default "$(BOARD)/nrf54h20/cpurad" if SOC_NRF54H20_CPUAPP

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

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,29 @@ const struct nrf_clock_spec test_clk_specs_hsfll[] = {
3737
},
3838
};
3939

40+
const struct nrf_clock_spec test_clk_specs_global_hsfll[] = {
41+
{
42+
.frequency = MHZ(320),
43+
},
44+
{
45+
.frequency = MHZ(256),
46+
},
47+
{
48+
.frequency = MHZ(128),
49+
},
50+
{
51+
.frequency = MHZ(64),
52+
},
53+
};
54+
55+
static const struct test_clk_ctx global_hsfll_test_clk_ctx[] = {
56+
{
57+
.clk_dev = DEVICE_DT_GET(DT_NODELABEL(hsfll120)),
58+
.clk_specs = test_clk_specs_global_hsfll,
59+
.clk_specs_size = ARRAY_SIZE(test_clk_specs_global_hsfll),
60+
},
61+
};
62+
4063
const struct nrf_clock_spec test_clk_specs_fll16m[] = {
4164
{
4265
.frequency = MHZ(16),
@@ -97,6 +120,22 @@ static const struct test_clk_ctx lfclk_test_clk_ctx[] = {
97120
},
98121
};
99122

123+
const struct nrf_clock_spec test_clk_specs_hfxo[] = {
124+
{
125+
.frequency = MHZ(32),
126+
.accuracy = 0,
127+
.precision = NRF_CLOCK_CONTROL_PRECISION_DEFAULT,
128+
},
129+
};
130+
131+
static const struct test_clk_ctx hfxo_test_clk_ctx[] = {
132+
{
133+
.clk_dev = DEVICE_DT_GET(DT_NODELABEL(hfxo)),
134+
.clk_specs = test_clk_specs_hfxo,
135+
.clk_specs_size = ARRAY_SIZE(test_clk_specs_hfxo),
136+
},
137+
};
138+
100139
static void test_request_release_clock_spec(const struct device *clk_dev,
101140
const struct nrf_clock_spec *clk_spec)
102141
{
@@ -151,12 +190,34 @@ static void test_clock_control_request(const struct test_clk_ctx *clk_contexts,
151190
}
152191
}
153192

193+
static void test_auxpll_control(const struct device *clk_dev)
194+
{
195+
int err;
196+
enum clock_control_status clk_status;
197+
198+
err = clock_control_on(clk_dev, NULL);
199+
LOG_INF("Auxpll: %s ON request, status: %d", clk_dev->name, err);
200+
k_msleep(10);
201+
clk_status = clock_control_get_status(clk_dev, NULL);
202+
__ASSERT_NO_MSG(clk_status == CLOCK_CONTROL_STATUS_ON);
203+
err = clock_control_off(clk_dev, NULL);
204+
LOG_INF("Auxpll: %s OFF request, status: %d", clk_dev->name, err);
205+
k_msleep(10);
206+
clk_status = clock_control_get_status(clk_dev, NULL);
207+
__ASSERT_NO_MSG(clk_status == CLOCK_CONTROL_STATUS_OFF);
208+
k_msleep(1000);
209+
}
210+
154211
int main(void)
155212
{
156213
LOG_INF("Idle clock_control, %s", CONFIG_BOARD_TARGET);
157214
k_msleep(100);
158215
while (1) {
216+
test_auxpll_control(DEVICE_DT_GET(DT_NODELABEL(canpll)));
217+
test_clock_control_request(hfxo_test_clk_ctx, ARRAY_SIZE(hfxo_test_clk_ctx));
159218
test_clock_control_request(hsfll_test_clk_ctx, ARRAY_SIZE(hsfll_test_clk_ctx));
219+
test_clock_control_request(global_hsfll_test_clk_ctx,
220+
ARRAY_SIZE(hsfll_test_clk_ctx));
160221
test_clock_control_request(fll16m_test_clk_ctx, ARRAY_SIZE(fll16m_test_clk_ctx));
161222
test_clock_control_request(lfclk_test_clk_ctx, ARRAY_SIZE(lfclk_test_clk_ctx));
162223
}

tests/benchmarks/multicore/idle_clock_control/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/benchmarks/multicore/idle_clock_control/testcase.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ tests:
99
- nrf54h20dk/nrf54h20/cpuapp
1010
integration_platforms:
1111
- nrf54h20dk/nrf54h20/cpuapp
12-
extra_args:
13-
- SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf
1412
harness_config:
1513
fixture: ppk_power_measure
1614
pytest_root:

0 commit comments

Comments
 (0)