Lines Matching +full:- +full:m
5 * SPDX-License-Identifier: Apache-2.0
9 * CLOCK - Clock control
12 * POWER - POWER control
15 * RESET - RESET control
49 * * The extra app core clocks are not implemented yet (Audio or 192M)
123 bs_time_t t1 = BS_MIN(c_el->Timer_CLOCK_HF, c_el->Timer_CLOCK_LF); in nhw_clock_update_master_timer()
124 bs_time_t t2 = BS_MIN(c_el->Timer_LF_cal, c_el->Timer_caltimer); in nhw_clock_update_master_timer()
146 c_el->inst = i; in nhw_clock_init()
149 c_el->CLOCK_regs = (NRF_CLOCK_Type *)&NRF_CLKPWR_regs[i]; in nhw_clock_init()
151 c_el->POWER_regs = (NRF_POWER_Type *)&NRF_CLKPWR_regs[i]; in nhw_clock_init()
154 c_el->RESET_regs = (NRF_RESET_Type *)&NRF_CLKPWR_regs[i]; in nhw_clock_init()
157 c_el->Timer_CLOCK_LF = TIME_NEVER; in nhw_clock_init()
158 c_el->Timer_CLOCK_HF = TIME_NEVER; in nhw_clock_init()
159 c_el->Timer_LF_cal = TIME_NEVER; in nhw_clock_init()
160 c_el->Timer_caltimer = TIME_NEVER; in nhw_clock_init()
162 c_el->HF_Clock_state = Stopped; in nhw_clock_init()
163 c_el->LF_Clock_state = Stopped; in nhw_clock_init()
164 c_el->LF_cal_state = Stopped; in nhw_clock_init()
165 c_el->caltimer_state = Stopped; in nhw_clock_init()
167 c_el->dppi_map = nhw_clkpwr_dppi_map[i]; in nhw_clock_init()
171 NRF_CLOCK_regs[i]->HFXODEBOUNCE = 0x00000010; in nhw_clock_init()
187 if (NRF_CLOCK_regs[inst]->EVENTS_##x \ in nhw_pwrclk_eval_interrupt()
188 && (this->INTEN & CLOCK_INTENCLR_##x##_Msk)){ \ in nhw_pwrclk_eval_interrupt()
221 NRF_CLOCK_regs[i]->EVENTS_##x = 1; \
228 NRF_CLOCK_regs[i]->EVENTS_##x = 1; \
231 NRF_CLOCK_regs[i]->PUBLISH_##x);\
256 NRF_CLOCK_Type *CLOCK_regs = this->CLOCK_regs; in nhw_clock_signal_handler()
258 CLOCK_regs->LFCLKSRCCOPY = CLOCK_regs->LFCLKSRC & CLOCK_LFCLKSRC_SRC_Msk; in nhw_clock_signal_handler()
259 CLOCK_regs->LFCLKRUN = CLOCK_LFCLKRUN_STATUS_Msk; in nhw_clock_signal_handler()
260 this->LF_Clock_state = Starting; in nhw_clock_signal_handler()
262 this->Timer_CLOCK_LF = nsi_hws_get_time(); //we assume the clock is ready in 1 delta in nhw_clock_signal_handler()
268 if ((NRF_CLOCK_regs[inst]->LFCLKSTAT & CLOCK_LFCLKRUN_STATUS_Msk) == 0) { /* LCOV_EXCL_START */ in nhw_clock_TASKS_LFCLKSTOP()
276 if ((this->LF_Clock_state == Started) || (this->LF_Clock_state == Starting)) { in nhw_clock_TASKS_LFCLKSTOP()
277 NRF_CLOCK_regs[inst]->LFCLKRUN = 0; in nhw_clock_TASKS_LFCLKSTOP()
278 this->LF_Clock_state = Stopping; in nhw_clock_TASKS_LFCLKSTOP()
279 this->Timer_CLOCK_LF = nsi_hws_get_time(); //we assume the clock is stopped in 1 delta in nhw_clock_TASKS_LFCLKSTOP()
287 if ((this->HF_Clock_state == Stopped ) || (this->HF_Clock_state == Stopping)) { in nhw_clock_TASKS_HFCLKSTART()
288 this->HF_Clock_state = Starting; in nhw_clock_TASKS_HFCLKSTART()
289 NRF_CLOCK_regs[inst]->HFCLKRUN = CLOCK_HFCLKRUN_STATUS_Msk; in nhw_clock_TASKS_HFCLKSTART()
290 this->Timer_CLOCK_HF = nsi_hws_get_time(); //we assume the clock is ready in 1 delta in nhw_clock_TASKS_HFCLKSTART()
298 if ((this->HF_Clock_state == Started) || (this->HF_Clock_state == Starting)) { in nhw_clock_TASKS_HFCLKSTOP()
299 NRF_CLOCK_regs[inst]->HFCLKRUN = 0; in nhw_clock_TASKS_HFCLKSTOP()
300 this->HF_Clock_state = Stopping; in nhw_clock_TASKS_HFCLKSTOP()
301 this->Timer_CLOCK_HF = nsi_hws_get_time(); //we assume the clock is stopped in 1 delta in nhw_clock_TASKS_HFCLKSTOP()
341 if (this->HF_Clock_state != Started) { /* LCOV_EXCL_START */ in nhw_clock_TASKS_CAL()
347 …this->LF_cal_state = Started; //We don't check for re-triggers, as we are going to be done right a… in nhw_clock_TASKS_CAL()
348 this->Timer_LF_cal = nsi_hws_get_time(); //we assume the calibration is done in 1 delta in nhw_clock_TASKS_CAL()
356 if ( this->caltimer_state == Started ) { /* LCOV_EXCL_START */ in nhw_clock_TASKS_CTSTART()
361 this->caltimer_state = Started; in nhw_clock_TASKS_CTSTART()
362 this->Timer_caltimer = nsi_hws_get_time() + (bs_time_t)NRF_CLOCK_regs[inst]->CTIV * 250000; in nhw_clock_TASKS_CTSTART()
371 if ( this->caltimer_state == Stopped ) { /* LCOV_EXCL_START */ in nhw_clock_TASKS_CTSTOP()
375 this->caltimer_state = Stopped; in nhw_clock_TASKS_CTSTOP()
376 this->Timer_caltimer = TIME_NEVER; in nhw_clock_TASKS_CTSTOP()
383 if (NRF_CLOCK_regs[i]->INTENSET) { /* LCOV_EXCL_BR_LINE */ in nhw_clock_regw_sideeffects_INTENSET()
386 this->INTEN |= NRF_CLOCK_regs[i]->INTENSET; in nhw_clock_regw_sideeffects_INTENSET()
387 NRF_CLOCK_regs[i]->INTENSET = this->INTEN; in nhw_clock_regw_sideeffects_INTENSET()
393 if (NRF_CLOCK_regs[i]->INTENCLR) { /* LCOV_EXCL_BR_LINE */ in nhw_clock_regw_sideeffects_INTENCLR()
396 this->INTEN &= ~NRF_CLOCK_regs[i]->INTENCLR; in nhw_clock_regw_sideeffects_INTENCLR()
397 NRF_CLOCK_regs[i]->INTENSET = this->INTEN; in nhw_clock_regw_sideeffects_INTENCLR()
398 NRF_CLOCK_regs[i]->INTENCLR = 0; in nhw_clock_regw_sideeffects_INTENCLR()
405 if (NRF_CLOCK_regs[i]->TASKS_##x) { /* LCOV_EXCL_BR_LINE */\
406 NRF_CLOCK_regs[i]->TASKS_##x = 0; \
435 NRF_CLOCK_Type *CLOCK_regs = this->CLOCK_regs; in nhw_clock_LFTimer_triggered()
440 if (this->LF_Clock_state == Starting) { /* LCOV_EXCL_BR_LINE */ in nhw_clock_LFTimer_triggered()
441 CLOCK_regs->LFCLKSTAT = CLOCK_LFCLKSTAT_STATE_Msk in nhw_clock_LFTimer_triggered()
442 | (CLOCK_regs->LFCLKSRCCOPY << CLOCK_LFCLKSTAT_SRC_Pos); in nhw_clock_LFTimer_triggered()
444 nhw_clock_signal_LFCLKSTARTED(this->inst); in nhw_clock_LFTimer_triggered()
447 } else if (this->LF_Clock_state == Stopping) { in nhw_clock_LFTimer_triggered()
448 this->LF_Clock_state = Stopped; in nhw_clock_LFTimer_triggered()
449 CLOCK_regs->LFCLKSTAT &= ~CLOCK_LFCLKSTAT_STATE_Msk; in nhw_clock_LFTimer_triggered()
452 this->Timer_CLOCK_LF = TIME_NEVER; in nhw_clock_LFTimer_triggered()
457 #define CLOCK_HFCLKSTAT_SRC_Xtal CLOCK_HFCLKSTAT_SRC_HFXO /* Bit name change from 52 -> 53 series b…
461 NRF_CLOCK_Type *CLOCK_regs = this->CLOCK_regs; in nhw_clock_HFTimer_triggered()
463 if ( this->HF_Clock_state == Starting ){ in nhw_clock_HFTimer_triggered()
464 this->HF_Clock_state = Started; in nhw_clock_HFTimer_triggered()
466 CLOCK_regs->HFCLKSTAT = CLOCK_HFCLKSTAT_STATE_Msk in nhw_clock_HFTimer_triggered()
469 nhw_clock_signal_HFCLKSTARTED(this->inst); in nhw_clock_HFTimer_triggered()
471 } else if ( this->HF_Clock_state == Stopping ){ in nhw_clock_HFTimer_triggered()
472 this->HF_Clock_state = Stopped; in nhw_clock_HFTimer_triggered()
473 CLOCK_regs->HFCLKSTAT = 0; in nhw_clock_HFTimer_triggered()
476 this->Timer_CLOCK_HF = TIME_NEVER; in nhw_clock_HFTimer_triggered()
481 this->LF_cal_state = Stopped; in nhw_clock_LF_cal_triggered()
482 this->Timer_LF_cal = TIME_NEVER; in nhw_clock_LF_cal_triggered()
485 nhw_clock_signal_DONE(this->inst); in nhw_clock_LF_cal_triggered()
491 if (this->caltimer_state != Started) { /* LCOV_EXCL_START */ in nhw_clock_caltimer_triggered()
494 this->caltimer_state = Stopped; in nhw_clock_caltimer_triggered()
495 this->Timer_caltimer = TIME_NEVER; in nhw_clock_caltimer_triggered()
497 nhw_clock_signal_CTTO(this->inst); in nhw_clock_caltimer_triggered()
505 if (Timer_PWRCLK == c_el->Timer_CLOCK_HF) { in nhw_pwrclk_timer_triggered()
508 } else if (Timer_PWRCLK == c_el->Timer_CLOCK_LF) { in nhw_pwrclk_timer_triggered()
511 } else if (Timer_PWRCLK == c_el->Timer_LF_cal) { in nhw_pwrclk_timer_triggered()
515 } else if (Timer_PWRCLK == c_el->Timer_caltimer) { in nhw_pwrclk_timer_triggered()
540 nhw_dppi_common_subscribe_sideeffect(this->dppi_map, \
541 this->CLOCK_regs->SUBSCRIBE_##TASK_N, \
542 &this->subscribed_##TASK_N, \