summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2019-02-11 23:24:01 -0500
committerDavid S. Miller <davem@davemloft.net>2019-02-12 12:58:48 -0500
commitd4e176870bffde373d9688c54aad8f92b3394ba6 (patch)
tree0c1f8d48175cce7a0a19142bca0d1892b7bc49e2
parent2843bf518579e9fa357ba58708c7cff96946d084 (diff)
ptp_qoriq: fix register memory map
The 1588 timer on eTSEC Ethernet controller uses different register memory map with DPAA Ethernet controller. Now the new ENETC Ethernet controller uses same reigster memory map with DPAA. To support ENETC, let's use register memory map of DPAA/ENETC in default. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/ptp/ptp_qoriq.c11
-rw-r--r--include/linux/fsl/ptp_qoriq.h18
2 files changed, 15 insertions, 14 deletions
diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index ed4dc398c57b..42d3654f77f0 100644
--- a/drivers/ptp/ptp_qoriq.c
+++ b/drivers/ptp/ptp_qoriq.c
@@ -504,11 +504,12 @@ int ptp_qoriq_init(struct ptp_qoriq *ptp_qoriq, void __iomem *base,
504 ptp_qoriq->write = qoriq_write_be; 504 ptp_qoriq->write = qoriq_write_be;
505 } 505 }
506 506
507 if (of_device_is_compatible(node, "fsl,fman-ptp-timer")) { 507 /* The eTSEC uses differnt memory map with DPAA/ENETC */
508 ptp_qoriq->regs.ctrl_regs = base + FMAN_CTRL_REGS_OFFSET; 508 if (of_device_is_compatible(node, "fsl,etsec-ptp")) {
509 ptp_qoriq->regs.alarm_regs = base + FMAN_ALARM_REGS_OFFSET; 509 ptp_qoriq->regs.ctrl_regs = base + ETSEC_CTRL_REGS_OFFSET;
510 ptp_qoriq->regs.fiper_regs = base + FMAN_FIPER_REGS_OFFSET; 510 ptp_qoriq->regs.alarm_regs = base + ETSEC_ALARM_REGS_OFFSET;
511 ptp_qoriq->regs.etts_regs = base + FMAN_ETTS_REGS_OFFSET; 511 ptp_qoriq->regs.fiper_regs = base + ETSEC_FIPER_REGS_OFFSET;
512 ptp_qoriq->regs.etts_regs = base + ETSEC_ETTS_REGS_OFFSET;
512 } else { 513 } else {
513 ptp_qoriq->regs.ctrl_regs = base + CTRL_REGS_OFFSET; 514 ptp_qoriq->regs.ctrl_regs = base + CTRL_REGS_OFFSET;
514 ptp_qoriq->regs.alarm_regs = base + ALARM_REGS_OFFSET; 515 ptp_qoriq->regs.alarm_regs = base + ALARM_REGS_OFFSET;
diff --git a/include/linux/fsl/ptp_qoriq.h b/include/linux/fsl/ptp_qoriq.h
index 1f8bb6a6a121..f127adb71041 100644
--- a/include/linux/fsl/ptp_qoriq.h
+++ b/include/linux/fsl/ptp_qoriq.h
@@ -58,15 +58,15 @@ struct ptp_qoriq_registers {
58}; 58};
59 59
60/* Offset definitions for the four register groups */ 60/* Offset definitions for the four register groups */
61#define CTRL_REGS_OFFSET 0x0 61#define ETSEC_CTRL_REGS_OFFSET 0x0
62#define ALARM_REGS_OFFSET 0x40 62#define ETSEC_ALARM_REGS_OFFSET 0x40
63#define FIPER_REGS_OFFSET 0x80 63#define ETSEC_FIPER_REGS_OFFSET 0x80
64#define ETTS_REGS_OFFSET 0xa0 64#define ETSEC_ETTS_REGS_OFFSET 0xa0
65 65
66#define FMAN_CTRL_REGS_OFFSET 0x80 66#define CTRL_REGS_OFFSET 0x80
67#define FMAN_ALARM_REGS_OFFSET 0xb8 67#define ALARM_REGS_OFFSET 0xb8
68#define FMAN_FIPER_REGS_OFFSET 0xd0 68#define FIPER_REGS_OFFSET 0xd0
69#define FMAN_ETTS_REGS_OFFSET 0xe0 69#define ETTS_REGS_OFFSET 0xe0
70 70
71 71
72/* Bit definitions for the TMR_CTRL register */ 72/* Bit definitions for the TMR_CTRL register */