Merge tag 'mt76-for-kvalo-2021-01-29' of https://github.com/nbd168/wireless
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / net / ti,k3-am654-cpts.yaml
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/net/ti,k3-am654-cpts.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: The TI AM654x/J721E Common Platform Time Sync (CPTS) module Device Tree Bindings
8
9 maintainers:
10   - Grygorii Strashko <grygorii.strashko@ti.com>
11   - Sekhar Nori <nsekhar@ti.com>
12
13 description: |+
14   The TI AM654x/J721E CPTS module is used to facilitate host control of time
15   sync operations.
16   Main features of CPTS module are
17   - selection of multiple external clock sources
18   - Software control of time sync events via interrupt or polling
19   - 64-bit timestamp mode in ns with PPM and nudge adjustment.
20   - hardware timestamp push inputs (HWx_TS_PUSH)
21   - timestamp counter compare output (TS_COMP)
22   - timestamp counter bit output (TS_SYNC)
23   - periodic Generator function outputs (TS_GENFx)
24   - Ethernet Enhanced Scheduled Traffic Operations (CPTS_ESTFn) (TSN)
25   - external hardware timestamp push inputs (HWx_TS_PUSH) timestamping
26
27    Depending on integration it enables compliance with the IEEE 1588-2008
28    standard for a precision clock synchronization protocol, Ethernet Enhanced
29    Scheduled Traffic Operations (CPTS_ESTFn) and PCIe Subsystem Precision Time
30    Measurement (PTM).
31
32   TI AM654x/J721E SoCs has several similar CPTS modules integrated into the
33   different parts of the system which could be synchronized with each other
34   - Main CPTS
35   - MCU CPSW CPTS with IEEE 1588-2008 support
36   - PCIe subsystem CPTS for PTM support
37
38   Depending on CPTS module integration and when CPTS is integral part of
39   another module (MCU CPSW for example) "compatible" and "reg" can
40   be omitted - parent module is fully responsible for CPTS enabling and
41   configuration.
42
43 properties:
44   $nodename:
45     pattern: "^cpts@[0-9a-f]+$"
46
47   compatible:
48     oneOf:
49       - const: ti,am65-cpts
50       - const: ti,j721e-cpts
51
52   reg:
53     maxItems: 1
54     description:
55       The physical base address and size of CPTS IO range
56
57   reg-names:
58     items:
59       - const: cpts
60
61   clocks:
62     description: CPTS reference clock
63
64   clock-names:
65     items:
66       - const: cpts
67
68   interrupts:
69     items:
70       - description: CPTS events interrupt
71
72   interrupt-names:
73     items:
74       - const: cpts
75
76   assigned-clock-parents: true
77
78   assigned-clocks: true
79
80   power-domains:
81     maxItems: 1
82
83   ti,cpts-ext-ts-inputs:
84     $ref: /schemas/types.yaml#/definitions/uint32
85     maximum: 8
86     description:
87       Number of hardware timestamp push inputs (HWx_TS_PUSH)
88
89   ti,cpts-periodic-outputs:
90     $ref: /schemas/types.yaml#/definitions/uint32
91     maximum: 8
92     description:
93       Number of timestamp Generator function outputs (TS_GENFx)
94
95   refclk-mux:
96     type: object
97     description: CPTS reference clock multiplexer clock
98     properties:
99       '#clock-cells':
100         const: 0
101
102       clocks:
103         maxItems: 8
104
105       assigned-clocks:
106         maxItems: 1
107
108       assigned-clocks-parents:
109         maxItems: 1
110
111     required:
112       - clocks
113
114 required:
115   - compatible
116   - reg
117   - clocks
118   - clock-names
119   - interrupts
120   - interrupt-names
121
122 additionalProperties: false
123
124 examples:
125   - |
126     #include <dt-bindings/interrupt-controller/irq.h>
127     #include <dt-bindings/interrupt-controller/arm-gic.h>
128
129     cpts@310d0000 {
130          compatible = "ti,am65-cpts";
131          reg = <0x310d0000 0x400>;
132          reg-names = "cpts";
133          clocks = <&main_cpts_mux>;
134          clock-names = "cpts";
135          interrupts-extended = <&k3_irq 163 0 IRQ_TYPE_LEVEL_HIGH>;
136          interrupt-names = "cpts";
137          ti,cpts-periodic-outputs = <6>;
138          ti,cpts-ext-ts-inputs = <8>;
139
140          main_cpts_mux: refclk-mux {
141                #clock-cells = <0>;
142                clocks = <&k3_clks 118 5>, <&k3_clks 118 11>,
143                         <&k3_clks 157 91>, <&k3_clks 157 77>,
144                         <&k3_clks 157 102>, <&k3_clks 157 80>,
145                         <&k3_clks 120 3>, <&k3_clks 121 3>;
146                assigned-clocks = <&main_cpts_mux>;
147                assigned-clock-parents = <&k3_clks 118 11>;
148          };
149     };
150