Lines Matching refs:cycles

64 	struct cyclecounter cycles;  member
98 container_of(cc, struct mlxsw_sp_ptp_clock, cycles); in mlxsw_sp1_ptp_read_frc()
116 u64 cycles = (u64) nsec; in mlxsw_sp1_ptp_ns2cycles() local
118 cycles <<= tc->cc->shift; in mlxsw_sp1_ptp_ns2cycles()
119 cycles = div_u64(cycles, tc->cc->mult); in mlxsw_sp1_ptp_ns2cycles()
121 return cycles; in mlxsw_sp1_ptp_ns2cycles()
128 u64 next_sec, next_sec_in_nsec, cycles; in mlxsw_sp1_ptp_phc_settime() local
137 cycles = mlxsw_sp1_ptp_ns2cycles(&clock->tc, next_sec_in_nsec); in mlxsw_sp1_ptp_phc_settime()
140 mlxsw_reg_mtpps_vpin_pack(mtpps_pl, cycles); in mlxsw_sp1_ptp_phc_settime()
173 clock->cycles.mult = neg_adj ? clock->nominal_c_mult - diff : in mlxsw_sp1_ptp_adjfine()
200 u64 cycles, nsec; in mlxsw_sp1_ptp_gettimex() local
203 cycles = __mlxsw_sp1_ptp_read_frc(clock, sts); in mlxsw_sp1_ptp_gettimex()
204 nsec = timecounter_cyc2time(&clock->tc, cycles); in mlxsw_sp1_ptp_gettimex()
220 timecounter_init(&clock->tc, &clock->cycles, nsec); in mlxsw_sp1_ptp_settime()
262 clock->cycles.read = mlxsw_sp1_ptp_read_frc; in mlxsw_sp1_ptp_clock_init()
263 clock->cycles.shift = MLXSW_SP1_PTP_CLOCK_CYCLES_SHIFT; in mlxsw_sp1_ptp_clock_init()
264 clock->cycles.mult = clocksource_khz2mult(MLXSW_SP1_PTP_CLOCK_FREQ_KHZ, in mlxsw_sp1_ptp_clock_init()
265 clock->cycles.shift); in mlxsw_sp1_ptp_clock_init()
266 clock->nominal_c_mult = clock->cycles.mult; in mlxsw_sp1_ptp_clock_init()
267 clock->cycles.mask = CLOCKSOURCE_MASK(MLXSW_SP1_PTP_CLOCK_MASK); in mlxsw_sp1_ptp_clock_init()
270 timecounter_init(&clock->tc, &clock->cycles, in mlxsw_sp1_ptp_clock_init()
280 overflow_cycles = div64_u64(~0ULL >> 1, clock->cycles.mult); in mlxsw_sp1_ptp_clock_init()
281 overflow_cycles = min(overflow_cycles, div_u64(clock->cycles.mask, 3)); in mlxsw_sp1_ptp_clock_init()
283 nsec = cyclecounter_cyc2ns(&clock->cycles, overflow_cycles, 0, &frac); in mlxsw_sp1_ptp_clock_init()
350 int cycles = MLXSW_SP1_PTP_HT_GC_TIMEOUT / MLXSW_SP1_PTP_HT_GC_INTERVAL; in mlxsw_sp1_ptp_unmatched_save() local
362 unmatched->gc_cycle = mlxsw_sp->ptp_state->gc_cycle + cycles; in mlxsw_sp1_ptp_unmatched_save()