@@ -38,7 +38,7 @@ const struct nrf_clock_spec test_clk_specs_hsfll[] = {
3838};
3939#endif
4040
41- #if CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP
41+ #if defined( CONFIG_TEST_FLL16M )
4242const struct nrf_clock_spec test_clk_specs_fll16m [] = {
4343 {
4444 .frequency = MHZ (16 ),
@@ -85,15 +85,19 @@ static const struct test_clk_context invalid_fll16m_test_clk_contexts[] = {
8585 .clk_specs_size = ARRAY_SIZE (invalid_test_clk_specs_fll16m ),
8686 },
8787};
88+ #endif
8889
90+ #if defined(CONFIG_TEST_HSFLL_APP )
8991static const struct test_clk_context cpuapp_hsfll_test_clk_contexts [] = {
9092 {
9193 .clk_dev = DEVICE_DT_GET (DT_NODELABEL (cpuapp_hsfll )),
9294 .clk_specs = test_clk_specs_hsfll ,
9395 .clk_specs_size = ARRAY_SIZE (test_clk_specs_hsfll ),
9496 },
9597};
96- #elif defined(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD )
98+ #endif
99+
100+ #if defined(CONFIG_TEST_HSFLL_RAD )
97101static const struct test_clk_context cpurad_hsfll_test_clk_contexts [] = {
98102 {
99103 .clk_dev = DEVICE_DT_GET (DT_NODELABEL (cpurad_hsfll )),
@@ -273,18 +277,23 @@ static void test_clock_control_request(const struct test_clk_context *clk_contex
273277 }
274278}
275279
276- #if CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP
277280ZTEST (nrf2_clock_control , test_cpuapp_hsfll_control )
278281{
282+ Z_TEST_SKIP_IFNDEF (CONFIG_TEST_HSFLL_APP );
283+ #if defined(CONFIG_TEST_HSFLL_APP )
279284 TC_PRINT ("APPLICATION DOMAIN HSFLL test\n" );
280285 test_clock_control_request (cpuapp_hsfll_test_clk_contexts ,
281286 ARRAY_SIZE (cpuapp_hsfll_test_clk_contexts ));
287+ #endif
282288}
283289
284290ZTEST (nrf2_clock_control , test_fll16m_control )
285291{
292+ Z_TEST_SKIP_IFNDEF (CONFIG_TEST_FLL16M );
293+ #if defined(CONFIG_TEST_FLL16M )
286294 TC_PRINT ("FLL16M test\n" );
287295 test_clock_control_request (fll16m_test_clk_contexts , ARRAY_SIZE (fll16m_test_clk_contexts ));
296+ #endif
288297}
289298
290299ZTEST (nrf2_clock_control , test_invalid_fll16m_clock_spec_response )
@@ -297,6 +306,8 @@ ZTEST(nrf2_clock_control, test_invalid_fll16m_clock_spec_response)
297306 const struct device * clk_dev ;
298307 const struct nrf_clock_spec * clk_spec ;
299308
309+ Z_TEST_SKIP_IFNDEF (CONFIG_TEST_FLL16M );
310+ #if defined(CONFIG_TEST_FLL16M )
300311 TC_PRINT ("FLL16M invalid clock specification test\n" );
301312
302313 for (size_t i = 0 ; i < ARRAY_SIZE (invalid_fll16m_test_clk_contexts ); i ++ ) {
@@ -323,32 +334,36 @@ ZTEST(nrf2_clock_control, test_invalid_fll16m_clock_spec_response)
323334 zassert_ok (res );
324335 }
325336 }
337+ #endif
326338}
327- #elif defined( CONFIG_BOARD_NRF54H20DK_NRF54H20_CPURAD )
339+
328340ZTEST (nrf2_clock_control , test_cpurad_hsfll_control )
329341{
342+ Z_TEST_SKIP_IFNDEF (CONFIG_TEST_HSFLL_RAD );
343+ #if defined(CONFIG_TEST_HSFLL_RAD )
330344 TC_PRINT ("RADIO DOMAIN HSFLL test\n" );
331345 test_clock_control_request (cpurad_hsfll_test_clk_contexts ,
332346 ARRAY_SIZE (cpurad_hsfll_test_clk_contexts ));
333- }
334347#endif
348+ }
335349
336-
337-
338- #if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL )
339350ZTEST (nrf2_clock_control , test_global_hsfll_control )
340351{
352+ Z_TEST_SKIP_IFNDEF (CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL );
353+ #if defined(CONFIG_CLOCK_CONTROL_NRF_HSFLL_GLOBAL )
341354 TC_PRINT ("Global HSFLL test\n" );
342355 test_clock_control_request (global_hsfll_test_clk_contexts ,
343356 ARRAY_SIZE (global_hsfll_test_clk_contexts ));
344- }
345357#endif
358+ }
346359
347- #if defined(CONFIG_CLOCK_CONTROL_NRF_LFCLK )
348360ZTEST (nrf2_clock_control , test_lfclk_control )
349361{
362+ Z_TEST_SKIP_IFNDEF (CONFIG_CLOCK_CONTROL_NRF_LFCLK );
363+ #if defined(CONFIG_CLOCK_CONTROL_NRF_LFCLK )
350364 TC_PRINT ("LFCLK test\n" );
351365 test_clock_control_request (lfclk_test_clk_contexts , ARRAY_SIZE (lfclk_test_clk_contexts ));
366+ #endif
352367}
353368
354369ZTEST (nrf2_clock_control , test_safe_request_cancellation )
@@ -360,6 +375,8 @@ ZTEST(nrf2_clock_control, test_safe_request_cancellation)
360375 const struct device * clk_dev = clk_context -> clk_dev ;
361376 const struct nrf_clock_spec * clk_spec = & test_clk_specs_lfclk [0 ];
362377
378+ Z_TEST_SKIP_IFNDEF (CONFIG_CLOCK_CONTROL_NRF_LFCLK );
379+ #if defined(CONFIG_CLOCK_CONTROL_NRF_LFCLK )
363380 zassert_true (device_is_ready (clk_dev ),
364381 "%s is not ready" , clk_dev -> name );
365382
@@ -374,21 +391,22 @@ ZTEST(nrf2_clock_control, test_safe_request_cancellation)
374391 ret = nrf_clock_control_cancel_or_release (clk_dev , clk_spec , & cli );
375392 TC_PRINT ("Clock control safe cancellation return value: %d\n" , ret );
376393 zassert_between_inclusive (ret , ONOFF_STATE_ON , ONOFF_STATE_TO_ON );
377- }
378394#endif
395+ }
379396
380- #if defined(CONFIG_CLOCK_CONTROL_NRF_AUXPLL )
381397ZTEST (nrf2_clock_control , test_auxpll_control )
382398{
399+ Z_TEST_SKIP_IFNDEF (CONFIG_CLOCK_CONTROL_NRF_AUXPLL );
400+ #if defined(CONFIG_CLOCK_CONTROL_NRF_AUXPLL )
383401 TC_PRINT ("AUXPLL control test\n" );
384402 test_clock_control_request (auxpll_test_clk_contexts ,
385403 ARRAY_SIZE (auxpll_test_clk_contexts ));
386- }
387404#endif
405+ }
388406
389407static void * setup (void )
390408{
391- #if defined(CONFIG_BOARD_NRF54H20DK_NRF54H20_CPUAPP )
409+ #if defined(CONFIG_TEST_DVFS_INIT )
392410 const struct device * clk_dev = DEVICE_DT_GET (DT_NODELABEL (cpuapp_hsfll ));
393411 const struct nrf_clock_spec clk_spec = {
394412 .frequency = MHZ (64 ),
0 commit comments