xref: /openbmc/linux/Documentation/devicetree/bindings/net/ti,k3-am654-cpts.yaml (revision 4786f4a08d72b7af68cfa258cb7e0abdbf13f002)
16e87ac74SGrygorii Strashko# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
26e87ac74SGrygorii Strashko%YAML 1.2
36e87ac74SGrygorii Strashko---
4b38eb47fSGrygorii Strashko$id: http://devicetree.org/schemas/net/ti,k3-am654-cpts.yaml#
56e87ac74SGrygorii Strashko$schema: http://devicetree.org/meta-schemas/core.yaml#
66e87ac74SGrygorii Strashko
76e87ac74SGrygorii Strashkotitle: The TI AM654x/J721E Common Platform Time Sync (CPTS) module Device Tree Bindings
86e87ac74SGrygorii Strashko
96e87ac74SGrygorii Strashkomaintainers:
106e87ac74SGrygorii Strashko  - Grygorii Strashko <grygorii.strashko@ti.com>
116e87ac74SGrygorii Strashko  - Sekhar Nori <nsekhar@ti.com>
126e87ac74SGrygorii Strashko
136e87ac74SGrygorii Strashkodescription: |+
146e87ac74SGrygorii Strashko  The TI AM654x/J721E CPTS module is used to facilitate host control of time
156e87ac74SGrygorii Strashko  sync operations.
166e87ac74SGrygorii Strashko  Main features of CPTS module are
176e87ac74SGrygorii Strashko  - selection of multiple external clock sources
186e87ac74SGrygorii Strashko  - Software control of time sync events via interrupt or polling
196e87ac74SGrygorii Strashko  - 64-bit timestamp mode in ns with PPM and nudge adjustment.
206e87ac74SGrygorii Strashko  - hardware timestamp push inputs (HWx_TS_PUSH)
216e87ac74SGrygorii Strashko  - timestamp counter compare output (TS_COMP)
226e87ac74SGrygorii Strashko  - timestamp counter bit output (TS_SYNC)
236e87ac74SGrygorii Strashko  - periodic Generator function outputs (TS_GENFx)
246e87ac74SGrygorii Strashko  - Ethernet Enhanced Scheduled Traffic Operations (CPTS_ESTFn) (TSN)
256e87ac74SGrygorii Strashko  - external hardware timestamp push inputs (HWx_TS_PUSH) timestamping
266e87ac74SGrygorii Strashko
276e87ac74SGrygorii Strashko   Depending on integration it enables compliance with the IEEE 1588-2008
286e87ac74SGrygorii Strashko   standard for a precision clock synchronization protocol, Ethernet Enhanced
296e87ac74SGrygorii Strashko   Scheduled Traffic Operations (CPTS_ESTFn) and PCIe Subsystem Precision Time
306e87ac74SGrygorii Strashko   Measurement (PTM).
316e87ac74SGrygorii Strashko
326e87ac74SGrygorii Strashko  TI AM654x/J721E SoCs has several similar CPTS modules integrated into the
336e87ac74SGrygorii Strashko  different parts of the system which could be synchronized with each other
346e87ac74SGrygorii Strashko  - Main CPTS
356e87ac74SGrygorii Strashko  - MCU CPSW CPTS with IEEE 1588-2008 support
366e87ac74SGrygorii Strashko  - PCIe subsystem CPTS for PTM support
376e87ac74SGrygorii Strashko
386e87ac74SGrygorii Strashko  Depending on CPTS module integration and when CPTS is integral part of
396e87ac74SGrygorii Strashko  another module (MCU CPSW for example) "compatible" and "reg" can
406e87ac74SGrygorii Strashko  be omitted - parent module is fully responsible for CPTS enabling and
416e87ac74SGrygorii Strashko  configuration.
426e87ac74SGrygorii Strashko
436e87ac74SGrygorii Strashkoproperties:
446e87ac74SGrygorii Strashko  $nodename:
45*4786f4a0SGrygorii Strashko    pattern: "^cpts@[0-9a-f]+$"
466e87ac74SGrygorii Strashko
476e87ac74SGrygorii Strashko  compatible:
486e87ac74SGrygorii Strashko    oneOf:
496e87ac74SGrygorii Strashko      - const: ti,am65-cpts
506e87ac74SGrygorii Strashko      - const: ti,j721e-cpts
516e87ac74SGrygorii Strashko
526e87ac74SGrygorii Strashko  reg:
536e87ac74SGrygorii Strashko    maxItems: 1
546e87ac74SGrygorii Strashko    description:
556e87ac74SGrygorii Strashko      The physical base address and size of CPTS IO range
566e87ac74SGrygorii Strashko
576e87ac74SGrygorii Strashko  reg-names:
586e87ac74SGrygorii Strashko    items:
596e87ac74SGrygorii Strashko      - const: cpts
606e87ac74SGrygorii Strashko
616e87ac74SGrygorii Strashko  clocks:
626e87ac74SGrygorii Strashko    description: CPTS reference clock
636e87ac74SGrygorii Strashko
646e87ac74SGrygorii Strashko  clock-names:
656e87ac74SGrygorii Strashko    items:
666e87ac74SGrygorii Strashko      - const: cpts
676e87ac74SGrygorii Strashko
68*4786f4a0SGrygorii Strashko  interrupts:
696e87ac74SGrygorii Strashko    items:
706e87ac74SGrygorii Strashko      - description: CPTS events interrupt
716e87ac74SGrygorii Strashko
726e87ac74SGrygorii Strashko  interrupt-names:
736e87ac74SGrygorii Strashko    items:
74*4786f4a0SGrygorii Strashko      - const: cpts
756e87ac74SGrygorii Strashko
766e87ac74SGrygorii Strashko  ti,cpts-ext-ts-inputs:
776e87ac74SGrygorii Strashko    allOf:
786e87ac74SGrygorii Strashko      - $ref: /schemas/types.yaml#/definitions/uint32
796e87ac74SGrygorii Strashko    maximum: 8
806e87ac74SGrygorii Strashko    description:
816e87ac74SGrygorii Strashko      Number of hardware timestamp push inputs (HWx_TS_PUSH)
826e87ac74SGrygorii Strashko
836e87ac74SGrygorii Strashko  ti,cpts-periodic-outputs:
846e87ac74SGrygorii Strashko    allOf:
856e87ac74SGrygorii Strashko      - $ref: /schemas/types.yaml#/definitions/uint32
866e87ac74SGrygorii Strashko    maximum: 8
876e87ac74SGrygorii Strashko    description:
886e87ac74SGrygorii Strashko      Number of timestamp Generator function outputs (TS_GENFx)
896e87ac74SGrygorii Strashko
906e87ac74SGrygorii Strashko  refclk-mux:
916e87ac74SGrygorii Strashko    type: object
926e87ac74SGrygorii Strashko    description: CPTS reference clock multiplexer clock
936e87ac74SGrygorii Strashko    properties:
946e87ac74SGrygorii Strashko      '#clock-cells':
956e87ac74SGrygorii Strashko        const: 0
966e87ac74SGrygorii Strashko
976e87ac74SGrygorii Strashko      clocks:
986e87ac74SGrygorii Strashko        maxItems: 8
996e87ac74SGrygorii Strashko
1006e87ac74SGrygorii Strashko      assigned-clocks:
1016e87ac74SGrygorii Strashko        maxItems: 1
1026e87ac74SGrygorii Strashko
1036e87ac74SGrygorii Strashko      assigned-clocks-parents:
1046e87ac74SGrygorii Strashko        maxItems: 1
1056e87ac74SGrygorii Strashko
1066e87ac74SGrygorii Strashko    required:
1076e87ac74SGrygorii Strashko      - clocks
1086e87ac74SGrygorii Strashko
1096e87ac74SGrygorii Strashkorequired:
110*4786f4a0SGrygorii Strashko  - compatible
111*4786f4a0SGrygorii Strashko  - reg
1126e87ac74SGrygorii Strashko  - clocks
1136e87ac74SGrygorii Strashko  - clock-names
114*4786f4a0SGrygorii Strashko  - interrupts
1156e87ac74SGrygorii Strashko  - interrupt-names
1166e87ac74SGrygorii Strashko
1176e87ac74SGrygorii StrashkoadditionalProperties: false
1186e87ac74SGrygorii Strashko
1196e87ac74SGrygorii Strashkoexamples:
1206e87ac74SGrygorii Strashko  - |
1216e87ac74SGrygorii Strashko    #include <dt-bindings/interrupt-controller/irq.h>
1226e87ac74SGrygorii Strashko    #include <dt-bindings/interrupt-controller/arm-gic.h>
1236e87ac74SGrygorii Strashko
1246e87ac74SGrygorii Strashko    cpts@310d0000 {
1256e87ac74SGrygorii Strashko         compatible = "ti,am65-cpts";
1266e87ac74SGrygorii Strashko         reg = <0x0 0x310d0000 0x0 0x400>;
1276e87ac74SGrygorii Strashko         reg-names = "cpts";
1286e87ac74SGrygorii Strashko         clocks = <&main_cpts_mux>;
1296e87ac74SGrygorii Strashko         clock-names = "cpts";
1306e87ac74SGrygorii Strashko         interrupts-extended = <&k3_irq 163 0 IRQ_TYPE_LEVEL_HIGH>;
1316e87ac74SGrygorii Strashko         interrupt-names = "cpts";
1326e87ac74SGrygorii Strashko         ti,cpts-periodic-outputs = <6>;
1336e87ac74SGrygorii Strashko         ti,cpts-ext-ts-inputs = <8>;
1346e87ac74SGrygorii Strashko
1356e87ac74SGrygorii Strashko         main_cpts_mux: refclk-mux {
1366e87ac74SGrygorii Strashko               #clock-cells = <0>;
1376e87ac74SGrygorii Strashko               clocks = <&k3_clks 118 5>, <&k3_clks 118 11>,
1386e87ac74SGrygorii Strashko                        <&k3_clks 157 91>, <&k3_clks 157 77>,
1396e87ac74SGrygorii Strashko                        <&k3_clks 157 102>, <&k3_clks 157 80>,
1406e87ac74SGrygorii Strashko                        <&k3_clks 120 3>, <&k3_clks 121 3>;
1416e87ac74SGrygorii Strashko               assigned-clocks = <&main_cpts_mux>;
1426e87ac74SGrygorii Strashko               assigned-clock-parents = <&k3_clks 118 11>;
1436e87ac74SGrygorii Strashko         };
1446e87ac74SGrygorii Strashko    };
1456e87ac74SGrygorii Strashko
146