1* Freescale QorIQ 1588 timer based PTP clock 2 3General Properties: 4 5 - compatible Should be "fsl,etsec-ptp" for eTSEC 6 Should be "fsl,fman-ptp-timer" for DPAA FMan 7 Should be "fsl,dpaa2-ptp" for DPAA2 8 Should be "fsl,enetc-ptp" for ENETC 9 - reg Offset and length of the register set for the device 10 - interrupts There should be at least two interrupts. Some devices 11 have as many as four PTP related interrupts. 12 13Clock Properties: 14 15 - fsl,cksel Timer reference clock source. 16 - fsl,tclk-period Timer reference clock period in nanoseconds. 17 - fsl,tmr-prsc Prescaler, divides the output clock. 18 - fsl,tmr-add Frequency compensation value. 19 - fsl,tmr-fiper1 Fixed interval period pulse generator. 20 - fsl,tmr-fiper2 Fixed interval period pulse generator. 21 - fsl,max-adj Maximum frequency adjustment in parts per billion. 22 - fsl,extts-fifo The presence of this property indicates hardware 23 support for the external trigger stamp FIFO. 24 - little-endian The presence of this property indicates the 1588 timer 25 IP block is little-endian mode. The default endian mode 26 is big-endian. 27 28 These properties set the operational parameters for the PTP 29 clock. You must choose these carefully for the clock to work right. 30 Here is how to figure good values: 31 32 TimerOsc = selected reference clock MHz 33 tclk_period = desired clock period nanoseconds 34 NominalFreq = 1000 / tclk_period MHz 35 FreqDivRatio = TimerOsc / NominalFreq (must be greater that 1.0) 36 tmr_add = ceil(2^32 / FreqDivRatio) 37 OutputClock = NominalFreq / tmr_prsc MHz 38 PulseWidth = 1 / OutputClock microseconds 39 FiperFreq1 = desired frequency in Hz 40 FiperDiv1 = 1000000 * OutputClock / FiperFreq1 41 tmr_fiper1 = tmr_prsc * tclk_period * FiperDiv1 - tclk_period 42 max_adj = 1000000000 * (FreqDivRatio - 1.0) - 1 43 44 The calculation for tmr_fiper2 is the same as for tmr_fiper1. The 45 driver expects that tmr_fiper1 will be correctly set to produce a 1 46 Pulse Per Second (PPS) signal, since this will be offered to the PPS 47 subsystem to synchronize the Linux clock. 48 49 Reference clock source is determined by the value, which is holded 50 in CKSEL bits in TMR_CTRL register. "fsl,cksel" property keeps the 51 value, which will be directly written in those bits, that is why, 52 according to reference manual, the next clock sources can be used: 53 54 For eTSEC, 55 <0> - external high precision timer reference clock (TSEC_TMR_CLK 56 input is used for this purpose); 57 <1> - eTSEC system clock; 58 <2> - eTSEC1 transmit clock; 59 <3> - RTC clock input. 60 61 For DPAA FMan, 62 <0> - external high precision timer reference clock (TMR_1588_CLK) 63 <1> - MAC system clock (1/2 FMan clock) 64 <2> - reserved 65 <3> - RTC clock oscillator 66 67 When this attribute is not used, the IEEE 1588 timer reference clock 68 will use the eTSEC system clock (for Gianfar) or the MAC system 69 clock (for DPAA). 70 71Example: 72 73 ptp_clock@24e00 { 74 compatible = "fsl,etsec-ptp"; 75 reg = <0x24E00 0xB0>; 76 interrupts = <12 0x8 13 0x8>; 77 interrupt-parent = < &ipic >; 78 fsl,cksel = <1>; 79 fsl,tclk-period = <10>; 80 fsl,tmr-prsc = <100>; 81 fsl,tmr-add = <0x999999A4>; 82 fsl,tmr-fiper1 = <0x3B9AC9F6>; 83 fsl,tmr-fiper2 = <0x00018696>; 84 fsl,max-adj = <659999998>; 85 }; 86