xref: /freebsd/sys/contrib/device-tree/Bindings/soc/fsl/cpm_qe/fsl,cpm1-tsa.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
1*fac71e4eSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*fac71e4eSEmmanuel Vadot%YAML 1.2
3*fac71e4eSEmmanuel Vadot---
4*fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/soc/fsl/cpm_qe/fsl,cpm1-tsa.yaml#
5*fac71e4eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*fac71e4eSEmmanuel Vadot
7*fac71e4eSEmmanuel Vadottitle: PowerQUICC CPM Time-slot assigner (TSA) controller
8*fac71e4eSEmmanuel Vadot
9*fac71e4eSEmmanuel Vadotmaintainers:
10*fac71e4eSEmmanuel Vadot  - Herve Codina <herve.codina@bootlin.com>
11*fac71e4eSEmmanuel Vadot
12*fac71e4eSEmmanuel Vadotdescription:
13*fac71e4eSEmmanuel Vadot  The TSA is the time-slot assigner that can be found on some PowerQUICC SoC.
14*fac71e4eSEmmanuel Vadot  Its purpose is to route some TDM time-slots to other internal serial
15*fac71e4eSEmmanuel Vadot  controllers.
16*fac71e4eSEmmanuel Vadot
17*fac71e4eSEmmanuel Vadotproperties:
18*fac71e4eSEmmanuel Vadot  compatible:
19*fac71e4eSEmmanuel Vadot    items:
20*fac71e4eSEmmanuel Vadot      - enum:
21*fac71e4eSEmmanuel Vadot          - fsl,mpc885-tsa
22*fac71e4eSEmmanuel Vadot          - fsl,mpc866-tsa
23*fac71e4eSEmmanuel Vadot      - const: fsl,cpm1-tsa
24*fac71e4eSEmmanuel Vadot
25*fac71e4eSEmmanuel Vadot  reg:
26*fac71e4eSEmmanuel Vadot    items:
27*fac71e4eSEmmanuel Vadot      - description: SI (Serial Interface) register base
28*fac71e4eSEmmanuel Vadot      - description: SI RAM base
29*fac71e4eSEmmanuel Vadot
30*fac71e4eSEmmanuel Vadot  reg-names:
31*fac71e4eSEmmanuel Vadot    items:
32*fac71e4eSEmmanuel Vadot      - const: si_regs
33*fac71e4eSEmmanuel Vadot      - const: si_ram
34*fac71e4eSEmmanuel Vadot
35*fac71e4eSEmmanuel Vadot  '#address-cells':
36*fac71e4eSEmmanuel Vadot    const: 1
37*fac71e4eSEmmanuel Vadot
38*fac71e4eSEmmanuel Vadot  '#size-cells':
39*fac71e4eSEmmanuel Vadot    const: 0
40*fac71e4eSEmmanuel Vadot
41*fac71e4eSEmmanuel VadotpatternProperties:
42*fac71e4eSEmmanuel Vadot  '^tdm@[0-1]$':
43*fac71e4eSEmmanuel Vadot    description:
44*fac71e4eSEmmanuel Vadot      The TDM managed by this controller
45*fac71e4eSEmmanuel Vadot    type: object
46*fac71e4eSEmmanuel Vadot
47*fac71e4eSEmmanuel Vadot    additionalProperties: false
48*fac71e4eSEmmanuel Vadot
49*fac71e4eSEmmanuel Vadot    properties:
50*fac71e4eSEmmanuel Vadot      reg:
51*fac71e4eSEmmanuel Vadot        minimum: 0
52*fac71e4eSEmmanuel Vadot        maximum: 1
53*fac71e4eSEmmanuel Vadot        description:
54*fac71e4eSEmmanuel Vadot          The TDM number for this TDM, 0 for TDMa and 1 for TDMb
55*fac71e4eSEmmanuel Vadot
56*fac71e4eSEmmanuel Vadot      fsl,common-rxtx-pins:
57*fac71e4eSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/flag
58*fac71e4eSEmmanuel Vadot        description:
59*fac71e4eSEmmanuel Vadot          The hardware can use four dedicated pins for Tx clock, Tx sync, Rx
60*fac71e4eSEmmanuel Vadot          clock and Rx sync or use only two pins, Tx/Rx clock and Tx/Rx sync.
61*fac71e4eSEmmanuel Vadot          Without the 'fsl,common-rxtx-pins' property, the four pins are used.
62*fac71e4eSEmmanuel Vadot          With the 'fsl,common-rxtx-pins' property, two pins are used.
63*fac71e4eSEmmanuel Vadot
64*fac71e4eSEmmanuel Vadot      clocks:
65*fac71e4eSEmmanuel Vadot        minItems: 2
66*fac71e4eSEmmanuel Vadot        items:
67*fac71e4eSEmmanuel Vadot          - description: External clock connected to L1RSYNC pin
68*fac71e4eSEmmanuel Vadot          - description: External clock connected to L1RCLK pin
69*fac71e4eSEmmanuel Vadot          - description: External clock connected to L1TSYNC pin
70*fac71e4eSEmmanuel Vadot          - description: External clock connected to L1TCLK pin
71*fac71e4eSEmmanuel Vadot
72*fac71e4eSEmmanuel Vadot      clock-names:
73*fac71e4eSEmmanuel Vadot        minItems: 2
74*fac71e4eSEmmanuel Vadot        items:
75*fac71e4eSEmmanuel Vadot          - const: l1rsync
76*fac71e4eSEmmanuel Vadot          - const: l1rclk
77*fac71e4eSEmmanuel Vadot          - const: l1tsync
78*fac71e4eSEmmanuel Vadot          - const: l1tclk
79*fac71e4eSEmmanuel Vadot
80*fac71e4eSEmmanuel Vadot      fsl,rx-frame-sync-delay-bits:
81*fac71e4eSEmmanuel Vadot        enum: [0, 1, 2, 3]
82*fac71e4eSEmmanuel Vadot        default: 0
83*fac71e4eSEmmanuel Vadot        description: |
84*fac71e4eSEmmanuel Vadot          Receive frame sync delay in number of bits.
85*fac71e4eSEmmanuel Vadot          Indicates the delay between the Rx sync and the first bit of the Rx
86*fac71e4eSEmmanuel Vadot          frame. 0 for no bit delay. 1, 2 or 3 for 1, 2 or 3 bits delay.
87*fac71e4eSEmmanuel Vadot
88*fac71e4eSEmmanuel Vadot      fsl,tx-frame-sync-delay-bits:
89*fac71e4eSEmmanuel Vadot        enum: [0, 1, 2, 3]
90*fac71e4eSEmmanuel Vadot        default: 0
91*fac71e4eSEmmanuel Vadot        description: |
92*fac71e4eSEmmanuel Vadot          Transmit frame sync delay in number of bits.
93*fac71e4eSEmmanuel Vadot          Indicates the delay between the Tx sync and the first bit of the Tx
94*fac71e4eSEmmanuel Vadot          frame. 0 for no bit delay. 1, 2 or 3 for 1, 2 or 3 bits delay.
95*fac71e4eSEmmanuel Vadot
96*fac71e4eSEmmanuel Vadot      fsl,clock-falling-edge:
97*fac71e4eSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/flag
98*fac71e4eSEmmanuel Vadot        description:
99*fac71e4eSEmmanuel Vadot          Data is sent on falling edge of the clock (and received on the rising
100*fac71e4eSEmmanuel Vadot          edge). If 'clock-falling-edge' is not present, data is sent on the
101*fac71e4eSEmmanuel Vadot          rising edge (and received on the falling edge).
102*fac71e4eSEmmanuel Vadot
103*fac71e4eSEmmanuel Vadot      fsl,fsync-rising-edge:
104*fac71e4eSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/flag
105*fac71e4eSEmmanuel Vadot        description:
106*fac71e4eSEmmanuel Vadot          Frame sync pulses are sampled with the rising edge of the channel
107*fac71e4eSEmmanuel Vadot          clock. If 'fsync-rising-edge' is not present, pulses are sampled with
108*fac71e4eSEmmanuel Vadot          the falling edge.
109*fac71e4eSEmmanuel Vadot
110*fac71e4eSEmmanuel Vadot      fsl,double-speed-clock:
111*fac71e4eSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/flag
112*fac71e4eSEmmanuel Vadot        description:
113*fac71e4eSEmmanuel Vadot          The channel clock is twice the data rate.
114*fac71e4eSEmmanuel Vadot
115*fac71e4eSEmmanuel Vadot    patternProperties:
116*fac71e4eSEmmanuel Vadot      '^fsl,[rt]x-ts-routes$':
117*fac71e4eSEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32-matrix
118*fac71e4eSEmmanuel Vadot        description: |
119*fac71e4eSEmmanuel Vadot          A list of tuple that indicates the Tx or Rx time-slots routes.
120*fac71e4eSEmmanuel Vadot        items:
121*fac71e4eSEmmanuel Vadot          items:
122*fac71e4eSEmmanuel Vadot            - description:
123*fac71e4eSEmmanuel Vadot                The number of time-slots
124*fac71e4eSEmmanuel Vadot              minimum: 1
125*fac71e4eSEmmanuel Vadot              maximum: 64
126*fac71e4eSEmmanuel Vadot            - description: |
127*fac71e4eSEmmanuel Vadot                The source (Tx) or destination (Rx) serial interface
128*fac71e4eSEmmanuel Vadot                (dt-bindings/soc/cpm1-fsl,tsa.h defines these values)
129*fac71e4eSEmmanuel Vadot                 - 0: No destination
130*fac71e4eSEmmanuel Vadot                 - 1: SCC2
131*fac71e4eSEmmanuel Vadot                 - 2: SCC3
132*fac71e4eSEmmanuel Vadot                 - 3: SCC4
133*fac71e4eSEmmanuel Vadot                 - 4: SMC1
134*fac71e4eSEmmanuel Vadot                 - 5: SMC2
135*fac71e4eSEmmanuel Vadot              enum: [0, 1, 2, 3, 4, 5]
136*fac71e4eSEmmanuel Vadot        minItems: 1
137*fac71e4eSEmmanuel Vadot        maxItems: 64
138*fac71e4eSEmmanuel Vadot
139*fac71e4eSEmmanuel Vadot    allOf:
140*fac71e4eSEmmanuel Vadot      # If fsl,common-rxtx-pins is present, only 2 clocks are needed.
141*fac71e4eSEmmanuel Vadot      # Else, the 4 clocks must be present.
142*fac71e4eSEmmanuel Vadot      - if:
143*fac71e4eSEmmanuel Vadot          required:
144*fac71e4eSEmmanuel Vadot            - fsl,common-rxtx-pins
145*fac71e4eSEmmanuel Vadot        then:
146*fac71e4eSEmmanuel Vadot          properties:
147*fac71e4eSEmmanuel Vadot            clocks:
148*fac71e4eSEmmanuel Vadot              maxItems: 2
149*fac71e4eSEmmanuel Vadot            clock-names:
150*fac71e4eSEmmanuel Vadot              maxItems: 2
151*fac71e4eSEmmanuel Vadot        else:
152*fac71e4eSEmmanuel Vadot          properties:
153*fac71e4eSEmmanuel Vadot            clocks:
154*fac71e4eSEmmanuel Vadot              minItems: 4
155*fac71e4eSEmmanuel Vadot            clock-names:
156*fac71e4eSEmmanuel Vadot              minItems: 4
157*fac71e4eSEmmanuel Vadot
158*fac71e4eSEmmanuel Vadot    required:
159*fac71e4eSEmmanuel Vadot      - reg
160*fac71e4eSEmmanuel Vadot      - clocks
161*fac71e4eSEmmanuel Vadot      - clock-names
162*fac71e4eSEmmanuel Vadot
163*fac71e4eSEmmanuel Vadotrequired:
164*fac71e4eSEmmanuel Vadot  - compatible
165*fac71e4eSEmmanuel Vadot  - reg
166*fac71e4eSEmmanuel Vadot  - reg-names
167*fac71e4eSEmmanuel Vadot  - '#address-cells'
168*fac71e4eSEmmanuel Vadot  - '#size-cells'
169*fac71e4eSEmmanuel Vadot
170*fac71e4eSEmmanuel VadotadditionalProperties: false
171*fac71e4eSEmmanuel Vadot
172*fac71e4eSEmmanuel Vadotexamples:
173*fac71e4eSEmmanuel Vadot  - |
174*fac71e4eSEmmanuel Vadot    #include <dt-bindings/soc/cpm1-fsl,tsa.h>
175*fac71e4eSEmmanuel Vadot
176*fac71e4eSEmmanuel Vadot    tsa@ae0 {
177*fac71e4eSEmmanuel Vadot        compatible = "fsl,mpc885-tsa", "fsl,cpm1-tsa";
178*fac71e4eSEmmanuel Vadot        reg = <0xae0 0x10>,
179*fac71e4eSEmmanuel Vadot              <0xc00 0x200>;
180*fac71e4eSEmmanuel Vadot        reg-names = "si_regs", "si_ram";
181*fac71e4eSEmmanuel Vadot
182*fac71e4eSEmmanuel Vadot        #address-cells = <1>;
183*fac71e4eSEmmanuel Vadot        #size-cells = <0>;
184*fac71e4eSEmmanuel Vadot
185*fac71e4eSEmmanuel Vadot        tdm@0 {
186*fac71e4eSEmmanuel Vadot            /* TDMa */
187*fac71e4eSEmmanuel Vadot            reg = <0>;
188*fac71e4eSEmmanuel Vadot
189*fac71e4eSEmmanuel Vadot            clocks = <&clk_l1rsynca>, <&clk_l1rclka>;
190*fac71e4eSEmmanuel Vadot            clock-names = "l1rsync", "l1rclk";
191*fac71e4eSEmmanuel Vadot
192*fac71e4eSEmmanuel Vadot            fsl,common-rxtx-pins;
193*fac71e4eSEmmanuel Vadot            fsl,fsync-rising-edge;
194*fac71e4eSEmmanuel Vadot
195*fac71e4eSEmmanuel Vadot            fsl,tx-ts-routes = <2 0>,             /* TS 0..1 */
196*fac71e4eSEmmanuel Vadot                           <24 FSL_CPM_TSA_SCC4>, /* TS 2..25 */
197*fac71e4eSEmmanuel Vadot                           <1 0>,                 /* TS 26 */
198*fac71e4eSEmmanuel Vadot                           <5 FSL_CPM_TSA_SCC3>;  /* TS 27..31 */
199*fac71e4eSEmmanuel Vadot
200*fac71e4eSEmmanuel Vadot            fsl,rx-ts-routes = <2 0>,             /* TS 0..1 */
201*fac71e4eSEmmanuel Vadot                           <24 FSL_CPM_TSA_SCC4>, /* 2..25 */
202*fac71e4eSEmmanuel Vadot                           <1 0>,                 /* TS 26 */
203*fac71e4eSEmmanuel Vadot                           <5 FSL_CPM_TSA_SCC3>;  /* TS 27..31 */
204*fac71e4eSEmmanuel Vadot        };
205*fac71e4eSEmmanuel Vadot    };
206