aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ptp
diff options
context:
space:
mode:
authorJonathan Lemon <jonathan.lemon@gmail.com>2021-08-05 12:52:44 -0700
committerDavid S. Miller <davem@davemloft.net>2021-08-06 10:41:27 +0100
commit0d43d4f26cb2b051ad430629d2f0c5866822656a (patch)
tree59781a4983178d265f052b800998856920a14b1a /drivers/ptp
parentptp: ocp: Fix the error handling path for the class device. (diff)
downloadlinux-dev-0d43d4f26cb2b051ad430629d2f0c5866822656a.tar.xz
linux-dev-0d43d4f26cb2b051ad430629d2f0c5866822656a.zip
ptp: ocp: Add the mapping for the external PPS registers.
There are two PPS blocks: one handles the external PPS signal output, with the other handling the PPS signal input to the internal clock. Add controls for the external PPS block. Rename the fields so they match their function. Add cable_delay to the register definitions. Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp')
-rw-r--r--drivers/ptp/ptp_ocp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 261713c6e9a7..8804e79477cd 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -113,6 +113,8 @@ struct ts_reg {
struct pps_reg {
u32 ctrl;
u32 status;
+ u32 __pad0[6];
+ u32 cable_delay;
};
#define PPS_STATUS_FILTER_ERR BIT(0)
@@ -149,7 +151,8 @@ struct ptp_ocp {
spinlock_t lock;
struct ocp_reg __iomem *reg;
struct tod_reg __iomem *tod;
- struct pps_reg __iomem *pps_monitor;
+ struct pps_reg __iomem *pps_to_ext;
+ struct pps_reg __iomem *pps_to_clk;
struct ptp_ocp_ext_src *pps;
struct ptp_ocp_ext_src *ts0;
struct ptp_ocp_ext_src *ts1;
@@ -251,7 +254,11 @@ static struct ocp_resource ocp_fb_resource[] = {
},
},
{
- OCP_MEM_RESOURCE(pps_monitor),
+ OCP_MEM_RESOURCE(pps_to_ext),
+ .offset = 0x01030000, .size = 0x10000,
+ },
+ {
+ OCP_MEM_RESOURCE(pps_to_clk),
.offset = 0x01040000, .size = 0x10000,
},
{
@@ -537,10 +544,10 @@ ptp_ocp_watchdog(struct timer_list *t)
unsigned long flags;
u32 status;
- status = ioread32(&bp->pps_monitor->status);
+ status = ioread32(&bp->pps_to_clk->status);
if (status & PPS_STATUS_SUPERV_ERR) {
- iowrite32(status, &bp->pps_monitor->status);
+ iowrite32(status, &bp->pps_to_clk->status);
if (!bp->gps_lost) {
spin_lock_irqsave(&bp->lock, flags);
__ptp_ocp_clear_drift_locked(bp);