ptp-qoriq.txt 2.9 KB

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