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