Lines Matching +full:max +full:- +full:load +full:- +full:value
4 * SPDX-License-Identifier: Apache-2.0
67 * pcrs property at index 0 is register index into array of 32-bit PCR SLP_EN,
77 /* Mask off bits[31:28] of 32-bit count */
86 /* max number of ticks we can load into the timer in one shot */
118 ECIA_XEC_REGS->GIRQ[girq - 8].SRC = BIT(bitpos); in girq_src_clr()
127 ECIA_XEC_REGS->GIRQ[girq - 8].EN_SET = BIT(bitpos); in girq_src_en()
136 ECIA_XEC_REGS->GIRQ[girq - 8].EN_CLR = BIT(bitpos); in girq_src_dis()
141 TIMER_REGS->CTRL = 0U; in timer_restart()
142 TIMER_REGS->CTRL = MCHP_RTMR_CTRL_BLK_EN; in timer_restart()
143 TIMER_REGS->PRLD = countdown; in timer_restart()
144 TIMER_REGS->CTRL = TIMER_START_VAL; in timer_restart()
154 * was on. We detect the timer is in the load state by checking the read-only
157 * process of moving the preload register value into the count register.
161 uint32_t ccr = TIMER_REGS->CNT; in timer_count()
163 if ((ccr == 0) && (TIMER_REGS->CTRL & MCHP_RTMR_CTRL_START)) { in timer_count()
181 * RTMR counter register is read-only and is loaded from the preload
182 * register by a 0->1 transition of the control register start bit.
183 * Writing a new value to preload only takes effect once the count
198 * global objects safe from pre-emption? in sys_clock_set_timeout()
200 TIMER_REGS->CTRL = 0U; /* stop timer */ in sys_clock_set_timeout()
208 full_ticks = MAX_TICKS - 1; in sys_clock_set_timeout()
210 full_ticks = n - 1; in sys_clock_set_timeout()
220 TIMER_REGS->CTRL = 0u; in sys_clock_set_timeout()
225 temp += (cached_icr - ccr); in sys_clock_set_timeout()
229 partial_cycles = CYCLES_PER_TICK - (total_cycles % CYCLES_PER_TICK); in sys_clock_set_timeout()
234 temp -= TIMER_ADJUST_CYCLES; in sys_clock_set_timeout()
245 * We must make sure bit[31] is 0 in the return value.
258 elapsed = (int32_t)total_cycles - (int32_t)last_announcement; in sys_clock_elapsed()
260 elapsed = -1 * elapsed; in sys_clock_elapsed()
263 ticks += cached_icr - ccr; in sys_clock_elapsed()
292 /* handle wrap by using (power of 2) - 1 mask */ in xec_rtos_timer_isr()
293 ticks = total_cycles - last_announcement; in xec_rtos_timer_isr()
305 /* Non-tickless kernel build. */
336 * 1. Kernel call to k_cycle_get_32() -> arch_k_cycle_get_32() -> here.
340 * z_impl_k_busy_wait calls here. This code path uses the value as uint32_t.
351 ret = (total_cycles + (cached_icr - ccr)) & TIMER_COUNT_MASK; in sys_clock_cycle_get_32()
368 TIMER_REGS->CTRL = 0U; in sys_clock_disable()
380 * 32-bit basic timer 0 configured for 1MHz count up, auto-reload,
389 uint32_t start = BTMR32_0_REGS->CNT; in arch_busy_wait()
392 uint32_t curr = BTMR32_0_REGS->CNT; in arch_busy_wait()
394 if ((curr - start) >= usec_to_wait) { in arch_busy_wait()
408 TIMER_REGS->CTRL = 0u; in sys_clock_driver_init()
426 PCR_XEC_REGS->SLP_EN[BTMR32_0_PCR_REG_IDX] &= ~BIT(BTMR32_0_PCR_BITPOS); in sys_clock_driver_init()
428 BTMR32_0_REGS->CTRL = MCHP_BTMR_CTRL_SOFT_RESET; in sys_clock_driver_init()
429 BTMR32_0_REGS->CTRL = btmr_ctrl; in sys_clock_driver_init()
430 BTMR32_0_REGS->PRLD = UINT32_MAX; in sys_clock_driver_init()
434 /* wait for RTOS timer to load count register from preload */ in sys_clock_driver_init()
435 while (TIMER_REGS->CNT == 0) { in sys_clock_driver_init()
439 BTMR32_0_REGS->CTRL = btmr_ctrl; in sys_clock_driver_init()