summaryrefslogtreecommitdiff
path: root/drivers/ptp/idt8a340_reg.h
diff options
context:
space:
mode:
authorVincent Cheng <vincent.cheng.xh@renesas.com>2021-02-17 08:42:12 +0300
committerDavid S. Miller <davem@davemloft.net>2021-02-18 00:49:25 +0300
commit797d3186544fcd5bfd7a03b9ef3e20c1db3802b8 (patch)
treee6e42ecdfd4a9c36826d3d68b201f081be2cfce4 /drivers/ptp/idt8a340_reg.h
parent857490807368026116a16306ab89e9b71cad60ab (diff)
downloadlinux-797d3186544fcd5bfd7a03b9ef3e20c1db3802b8.tar.xz
ptp: ptp_clockmatrix: Add wait_for_sys_apll_dpll_lock.
Part of the device initialization aligns the rising edge of the output clock to the internal 1 PPS clock. If the system APLL and DPLL is not locked, then the alignment will fail and there will be a fixed offset between the internal 1 PPS clock and the output clock. After loading the device firmware, poll the system APLL and DPLL for locked state prior to initialization, timing out after 2 seconds. Signed-off-by: Vincent Cheng <vincent.cheng.xh@renesas.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ptp/idt8a340_reg.h')
-rw-r--r--drivers/ptp/idt8a340_reg.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/ptp/idt8a340_reg.h b/drivers/ptp/idt8a340_reg.h
index a664dfe5fd2f..ac524cf0f31f 100644
--- a/drivers/ptp/idt8a340_reg.h
+++ b/drivers/ptp/idt8a340_reg.h
@@ -122,6 +122,8 @@
#define OTP_SCSR_CONFIG_SELECT 0x0022
#define STATUS 0xc03c
+#define DPLL_SYS_STATUS 0x0020
+#define DPLL_SYS_APLL_STATUS 0x0021
#define USER_GPIO0_TO_7_STATUS 0x008a
#define USER_GPIO8_TO_15_STATUS 0x008b
@@ -707,4 +709,12 @@
/* Bit definitions for the DPLL_CTRL_COMBO_MASTER_CFG register */
#define COMBO_MASTER_HOLD BIT(0)
+/* Bit definitions for DPLL_SYS_STATUS register */
+#define DPLL_SYS_STATE_MASK (0xf)
+
+/* Bit definitions for SYS_APLL_STATUS register */
+#define SYS_APLL_LOSS_LOCK_LIVE_MASK BIT(0)
+#define SYS_APLL_LOSS_LOCK_LIVE_LOCKED 0
+#define SYS_APLL_LOSS_LOCK_LIVE_UNLOCKED 1
+
#endif