Lines Matching defs:ocelot

9 #include <soc/mscc/ocelot.h>
13 struct ocelot *ocelot = container_of(ptp, struct ocelot, ptp_info);
19 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
21 val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
24 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
26 s = ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_MSB, TOD_ACC_PIN) & 0xffff;
28 s += ocelot_read_rix(ocelot, PTP_PIN_TOD_SEC_LSB, TOD_ACC_PIN);
29 ns = ocelot_read_rix(ocelot, PTP_PIN_TOD_NSEC, TOD_ACC_PIN);
31 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
48 struct ocelot *ocelot = container_of(ptp, struct ocelot, ptp_info);
52 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
54 val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
58 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
60 ocelot_write_rix(ocelot, lower_32_bits(ts->tv_sec), PTP_PIN_TOD_SEC_LSB,
62 ocelot_write_rix(ocelot, upper_32_bits(ts->tv_sec), PTP_PIN_TOD_SEC_MSB,
64 ocelot_write_rix(ocelot, ts->tv_nsec, PTP_PIN_TOD_NSEC, TOD_ACC_PIN);
66 val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
70 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
72 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
80 struct ocelot *ocelot = container_of(ptp, struct ocelot,
85 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
87 val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
92 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
94 ocelot_write_rix(ocelot, 0, PTP_PIN_TOD_SEC_LSB, TOD_ACC_PIN);
95 ocelot_write_rix(ocelot, 0, PTP_PIN_TOD_SEC_MSB, TOD_ACC_PIN);
96 ocelot_write_rix(ocelot, delta, PTP_PIN_TOD_NSEC, TOD_ACC_PIN);
98 val = ocelot_read_rix(ocelot, PTP_PIN_CFG, TOD_ACC_PIN);
103 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, TOD_ACC_PIN);
105 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
124 struct ocelot *ocelot = container_of(ptp, struct ocelot, ptp_info);
129 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
153 ocelot_write(ocelot, unit | adj, PTP_CLK_CFG_ADJ_FREQ);
154 ocelot_write(ocelot, PTP_CFG_CLK_ADJ_CFG_ENA | direction,
157 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
161 ocelot_write(ocelot, 0, PTP_CLK_CFG_ADJ_CFG);
163 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
186 struct ocelot *ocelot = container_of(ptp, struct ocelot, ptp_info);
203 pin = ptp_find_pin(ocelot->ptp_clock, PTP_PF_PEROUT,
224 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
226 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, ptp_pin);
227 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
240 dev_warn(ocelot->dev,
242 dev_warn(ocelot->dev,
269 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
270 ocelot_write_rix(ocelot, ts_phase.tv_nsec,
272 ocelot_write_rix(ocelot, wf_high,
276 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, ptp_pin);
277 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
287 spin_lock_irqsave(&ocelot->ptp_clock_lock, flags);
288 ocelot_write_rix(ocelot, wf_low, PTP_PIN_WF_LOW_PERIOD,
290 ocelot_write_rix(ocelot, wf_high, PTP_PIN_WF_HIGH_PERIOD,
293 ocelot_write_rix(ocelot, val, PTP_PIN_CFG, ptp_pin);
294 spin_unlock_irqrestore(&ocelot->ptp_clock_lock, flags);
303 int ocelot_init_timestamp(struct ocelot *ocelot,
309 ocelot->ptp_info = *info;
312 struct ptp_pin_desc *p = &ocelot->ptp_pins[i];
319 ocelot->ptp_info.pin_config = &ocelot->ptp_pins[0];
321 ptp_clock = ptp_clock_register(&ocelot->ptp_info, ocelot->dev);
328 ocelot->ptp_clock = ptp_clock;
330 ocelot_write(ocelot, SYS_PTP_CFG_PTP_STAMP_WID(30), SYS_PTP_CFG);
331 ocelot_write(ocelot, 0xffffffff, ANA_TABLES_PTP_ID_LOW);
332 ocelot_write(ocelot, 0xffffffff, ANA_TABLES_PTP_ID_HIGH);
334 ocelot_write(ocelot, PTP_CFG_MISC_PTP_EN, PTP_CFG_MISC);
339 ocelot->hwtstamp_config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
345 int ocelot_deinit_timestamp(struct ocelot *ocelot)
347 if (ocelot->ptp_clock)
348 ptp_clock_unregister(ocelot->ptp_clock);