@@ -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+
4063const 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+
100139static 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+
154211int 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 }
0 commit comments