Lines Matching +full:ixp4xx +full:- +full:timer

1 // SPDX-License-Identifier: GPL-2.0-or-later
18 #include <linux/soc/ixp4xx/cpu.h>
46 lo = __raw_readl(&regs->systime_lo); in ixp_systime_read()
47 hi = __raw_readl(&regs->systime_hi); in ixp_systime_read()
64 __raw_writel(lo, &regs->systime_lo); in ixp_systime_write()
65 __raw_writel(hi, &regs->systime_hi); in ixp_systime_write()
75 struct ixp46x_ts_regs *regs = ixp_clock->regs; in isr()
79 val = __raw_readl(&regs->event); in isr()
83 if (ixp_clock->exts0_enabled) { in isr()
84 hi = __raw_readl(&regs->asms_hi); in isr()
85 lo = __raw_readl(&regs->asms_lo); in isr()
91 ptp_clock_event(ixp_clock->ptp_clock, &event); in isr()
97 if (ixp_clock->exts1_enabled) { in isr()
98 hi = __raw_readl(&regs->amms_hi); in isr()
99 lo = __raw_readl(&regs->amms_lo); in isr()
105 ptp_clock_event(ixp_clock->ptp_clock, &event); in isr()
113 __raw_writel(ack, &regs->event); in isr()
129 struct ixp46x_ts_regs *regs = ixp_clock->regs; in ptp_ixp_adjfreq()
133 ppb = -ppb; in ptp_ixp_adjfreq()
140 addend = neg_adj ? addend - diff : addend + diff; in ptp_ixp_adjfreq()
142 __raw_writel(addend, &regs->addend); in ptp_ixp_adjfreq()
152 struct ixp46x_ts_regs *regs = ixp_clock->regs; in ptp_ixp_adjtime()
170 struct ixp46x_ts_regs *regs = ixp_clock->regs; in ptp_ixp_gettime()
188 struct ixp46x_ts_regs *regs = ixp_clock->regs; in ptp_ixp_settime()
206 switch (rq->type) { in ptp_ixp_enable()
208 switch (rq->extts.index) { in ptp_ixp_enable()
210 ixp_clock->exts0_enabled = on ? 1 : 0; in ptp_ixp_enable()
213 ixp_clock->exts1_enabled = on ? 1 : 0; in ptp_ixp_enable()
216 return -EINVAL; in ptp_ixp_enable()
223 return -EOPNOTSUPP; in ptp_ixp_enable()
228 .name = "IXP46X timer",
250 return -EPROBE_DEFER; in ixp46x_ptp_find()
267 struct device *dev = &pdev->dev; in ptp_ixp_probe()
275 return -ENXIO; in ptp_ixp_probe()
291 __raw_writel(DEFAULT_ADDEND, &ixp_clock.regs->addend); in ptp_ixp_probe()
292 __raw_writel(1, &ixp_clock.regs->trgt_lo); in ptp_ixp_probe()
293 __raw_writel(0, &ixp_clock.regs->trgt_hi); in ptp_ixp_probe()
294 __raw_writel(TTIPEND, &ixp_clock.regs->event); in ptp_ixp_probe()
315 .compatible = "intel,ixp46x-ptp-timer",
322 .name = "ptp-ixp46x",
331 MODULE_DESCRIPTION("PTP clock using the IXP46X timer");