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