Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: ptp: Convert ptp-qoirq to yaml format

Convert ptp-qoirq from txt to yaml format.

Additional change:
- Fixed example interrupts proptery. Need only 1 irq by check MPC8313 spec.
- Move Reference clock context under clk,sel.
- Interrupts is not required property.
- Use low case for hex value.
- Check reference manual of MPC8313, p1010 and so on, which dts use more
than 1 irqs. Only 1 irq for each ptp device. Check driver code
(drivers/ptp/ptp_qoriq.c) and only 1 irq used. So original description is
wrong.
- Remove comments for compatible string.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20240618-ls_fman-v2-1-f00a82623d8e@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Frank Li and committed by
Jakub Kicinski
01479f1b 08f116c9

+147 -90
+1 -1
Documentation/devicetree/bindings/net/fsl-fman.txt
··· 237 237 ============================================================================ 238 238 FMan IEEE 1588 Node 239 239 240 - Refer to Documentation/devicetree/bindings/ptp/ptp-qoriq.txt 240 + Refer to Documentation/devicetree/bindings/ptp/fsl,ptp.yaml 241 241 242 242 ============================================================================= 243 243 FMan MDIO Node
+1 -1
Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
··· 86 86 87 87 * Gianfar PTP clock nodes 88 88 89 - Refer to Documentation/devicetree/bindings/ptp/ptp-qoriq.txt 89 + Refer to Documentation/devicetree/bindings/ptp/fsl,ptp.yaml
+144
Documentation/devicetree/bindings/ptp/fsl,ptp.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/ptp/fsl,ptp.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Freescale QorIQ 1588 timer based PTP clock 8 + 9 + maintainers: 10 + - Frank Li <Frank.Li@nxp.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - fsl,etsec-ptp 16 + - fsl,fman-ptp-timer 17 + - fsl,dpaa2-ptp 18 + - fsl,enetc-ptp 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + interrupts: 24 + maxItems: 1 25 + 26 + clocks: 27 + maxItems: 1 28 + 29 + fsl,cksel: 30 + $ref: /schemas/types.yaml#/definitions/uint32 31 + description: | 32 + Timer reference clock source. 33 + 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 + 39 + For eTSEC, 40 + <0> - external high precision timer reference clock (TSEC_TMR_CLK 41 + input is used for this purpose); 42 + <1> - eTSEC system clock; 43 + <2> - eTSEC1 transmit clock; 44 + <3> - RTC clock input. 45 + 46 + For DPAA FMan, 47 + <0> - external high precision timer reference clock (TMR_1588_CLK) 48 + <1> - MAC system clock (1/2 FMan clock) 49 + <2> - reserved 50 + <3> - RTC clock oscillator 51 + 52 + fsl,tclk-period: 53 + $ref: /schemas/types.yaml#/definitions/uint32 54 + description: Timer reference clock period in nanoseconds. 55 + 56 + fsl,tmr-prsc: 57 + $ref: /schemas/types.yaml#/definitions/uint32 58 + description: Prescaler, divides the output clock. 59 + 60 + fsl,tmr-add: 61 + $ref: /schemas/types.yaml#/definitions/uint32 62 + description: Frequency compensation value. 63 + 64 + fsl,tmr-fiper1: 65 + $ref: /schemas/types.yaml#/definitions/uint32 66 + description: Fixed interval period pulse generator. 67 + 68 + fsl,tmr-fiper2: 69 + $ref: /schemas/types.yaml#/definitions/uint32 70 + description: Fixed interval period pulse generator. 71 + 72 + fsl,tmr-fiper3: 73 + $ref: /schemas/types.yaml#/definitions/uint32 74 + description: 75 + Fixed interval period pulse generator. 76 + Supported only on DPAA2 and ENETC hardware. 77 + 78 + fsl,max-adj: 79 + $ref: /schemas/types.yaml#/definitions/uint32 80 + description: | 81 + Maximum frequency adjustment in parts per billion. 82 + 83 + These properties set the operational parameters for the PTP 84 + clock. You must choose these carefully for the clock to work right. 85 + Here is how to figure good values: 86 + 87 + TimerOsc = selected reference clock MHz 88 + tclk_period = desired clock period nanoseconds 89 + NominalFreq = 1000 / tclk_period MHz 90 + FreqDivRatio = TimerOsc / NominalFreq (must be greater that 1.0) 91 + tmr_add = ceil(2^32 / FreqDivRatio) 92 + OutputClock = NominalFreq / tmr_prsc MHz 93 + PulseWidth = 1 / OutputClock microseconds 94 + FiperFreq1 = desired frequency in Hz 95 + FiperDiv1 = 1000000 * OutputClock / FiperFreq1 96 + tmr_fiper1 = tmr_prsc * tclk_period * FiperDiv1 - tclk_period 97 + max_adj = 1000000000 * (FreqDivRatio - 1.0) - 1 98 + 99 + The calculation for tmr_fiper2 is the same as for tmr_fiper1. The 100 + driver expects that tmr_fiper1 will be correctly set to produce a 1 101 + Pulse Per Second (PPS) signal, since this will be offered to the PPS 102 + subsystem to synchronize the Linux clock. 103 + 104 + When this attribute is not used, the IEEE 1588 timer reference clock 105 + will use the eTSEC system clock (for Gianfar) or the MAC system 106 + clock (for DPAA). 107 + 108 + fsl,extts-fifo: 109 + $ref: /schemas/types.yaml#/definitions/flag 110 + description: 111 + The presence of this property indicates hardware 112 + support for the external trigger stamp FIFO 113 + 114 + little-endian: 115 + $ref: /schemas/types.yaml#/definitions/flag 116 + description: 117 + The presence of this property indicates the 1588 timer 118 + support for the external trigger stamp FIFO. 119 + IP block is little-endian mode. The default endian mode 120 + is big-endian. 121 + 122 + required: 123 + - compatible 124 + - reg 125 + 126 + additionalProperties: false 127 + 128 + examples: 129 + - | 130 + #include <dt-bindings/interrupt-controller/irq.h> 131 + 132 + phc@24e00 { 133 + compatible = "fsl,etsec-ptp"; 134 + reg = <0x24e00 0xb0>; 135 + interrupts = <12 IRQ_TYPE_LEVEL_LOW>; 136 + interrupt-parent = <&ipic>; 137 + fsl,cksel = <1>; 138 + fsl,tclk-period = <10>; 139 + fsl,tmr-prsc = <100>; 140 + fsl,tmr-add = <0x999999a4>; 141 + fsl,tmr-fiper1 = <0x3b9ac9f6>; 142 + fsl,tmr-fiper2 = <0x00018696>; 143 + fsl,max-adj = <659999998>; 144 + };
-87
Documentation/devicetree/bindings/ptp/ptp-qoriq.txt
··· 1 - * Freescale QorIQ 1588 timer based PTP clock 2 - 3 - General 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 - 13 - Clock 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,tmr-fiper3 Fixed interval period pulse generator. 22 - Supported only on DPAA2 and ENETC hardware. 23 - - fsl,max-adj Maximum frequency adjustment in parts per billion. 24 - - fsl,extts-fifo The presence of this property indicates hardware 25 - support for the external trigger stamp FIFO. 26 - - little-endian The presence of this property indicates the 1588 timer 27 - IP block is little-endian mode. The default endian mode 28 - is big-endian. 29 - 30 - These properties set the operational parameters for the PTP 31 - clock. You must choose these carefully for the clock to work right. 32 - Here is how to figure good values: 33 - 34 - TimerOsc = selected reference clock MHz 35 - tclk_period = desired clock period nanoseconds 36 - NominalFreq = 1000 / tclk_period MHz 37 - FreqDivRatio = TimerOsc / NominalFreq (must be greater that 1.0) 38 - tmr_add = ceil(2^32 / FreqDivRatio) 39 - OutputClock = NominalFreq / tmr_prsc MHz 40 - PulseWidth = 1 / OutputClock microseconds 41 - FiperFreq1 = desired frequency in Hz 42 - FiperDiv1 = 1000000 * OutputClock / FiperFreq1 43 - tmr_fiper1 = tmr_prsc * tclk_period * FiperDiv1 - tclk_period 44 - max_adj = 1000000000 * (FreqDivRatio - 1.0) - 1 45 - 46 - The calculation for tmr_fiper2 is the same as for tmr_fiper1. The 47 - driver expects that tmr_fiper1 will be correctly set to produce a 1 48 - Pulse Per Second (PPS) signal, since this will be offered to the PPS 49 - subsystem to synchronize the Linux clock. 50 - 51 - Reference clock source is determined by the value, which is holded 52 - in CKSEL bits in TMR_CTRL register. "fsl,cksel" property keeps the 53 - value, which will be directly written in those bits, that is why, 54 - according to reference manual, the next clock sources can be used: 55 - 56 - For eTSEC, 57 - <0> - external high precision timer reference clock (TSEC_TMR_CLK 58 - input is used for this purpose); 59 - <1> - eTSEC system clock; 60 - <2> - eTSEC1 transmit clock; 61 - <3> - RTC clock input. 62 - 63 - For DPAA FMan, 64 - <0> - external high precision timer reference clock (TMR_1588_CLK) 65 - <1> - MAC system clock (1/2 FMan clock) 66 - <2> - reserved 67 - <3> - RTC clock oscillator 68 - 69 - When this attribute is not used, the IEEE 1588 timer reference clock 70 - will use the eTSEC system clock (for Gianfar) or the MAC system 71 - clock (for DPAA). 72 - 73 - Example: 74 - 75 - ptp_clock@24e00 { 76 - compatible = "fsl,etsec-ptp"; 77 - reg = <0x24E00 0xB0>; 78 - interrupts = <12 0x8 13 0x8>; 79 - interrupt-parent = < &ipic >; 80 - fsl,cksel = <1>; 81 - fsl,tclk-period = <10>; 82 - fsl,tmr-prsc = <100>; 83 - fsl,tmr-add = <0x999999A4>; 84 - fsl,tmr-fiper1 = <0x3B9AC9F6>; 85 - fsl,tmr-fiper2 = <0x00018696>; 86 - fsl,max-adj = <659999998>; 87 - };
+1 -1
MAINTAINERS
··· 8816 8816 M: Yangbo Lu <yangbo.lu@nxp.com> 8817 8817 L: netdev@vger.kernel.org 8818 8818 S: Maintained 8819 - F: Documentation/devicetree/bindings/ptp/ptp-qoriq.txt 8819 + F: Documentation/devicetree/bindings/ptp/fsl,ptp.yaml 8820 8820 F: drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp* 8821 8821 F: drivers/net/ethernet/freescale/dpaa2/dprtc* 8822 8822 F: drivers/net/ethernet/freescale/enetc/enetc_ptp.c