xref: /freebsd/sys/contrib/device-tree/Bindings/net/fsl,gianfar.yaml (revision 8ccc0d235c226d84112561d453c49904398d085c)
1*8ccc0d23SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2*8ccc0d23SEmmanuel Vadot%YAML 1.2
3*8ccc0d23SEmmanuel Vadot---
4*8ccc0d23SEmmanuel Vadot$id: http://devicetree.org/schemas/net/fsl,gianfar.yaml#
5*8ccc0d23SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*8ccc0d23SEmmanuel Vadot
7*8ccc0d23SEmmanuel Vadottitle: Freescale Three-Speed Ethernet Controller (TSEC), "Gianfar"
8*8ccc0d23SEmmanuel Vadot
9*8ccc0d23SEmmanuel Vadotmaintainers:
10*8ccc0d23SEmmanuel Vadot  - J. Neuschäfer <j.ne@posteo.net>
11*8ccc0d23SEmmanuel Vadot
12*8ccc0d23SEmmanuel Vadot# This is needed to distinguish gianfar.yaml and gianfar-mdio.yaml, because
13*8ccc0d23SEmmanuel Vadot# both use compatible = "gianfar" (with different device_type values)
14*8ccc0d23SEmmanuel Vadotselect:
15*8ccc0d23SEmmanuel Vadot  oneOf:
16*8ccc0d23SEmmanuel Vadot    - properties:
17*8ccc0d23SEmmanuel Vadot        compatible:
18*8ccc0d23SEmmanuel Vadot          contains:
19*8ccc0d23SEmmanuel Vadot            const: gianfar
20*8ccc0d23SEmmanuel Vadot        device_type:
21*8ccc0d23SEmmanuel Vadot          const: network
22*8ccc0d23SEmmanuel Vadot      required:
23*8ccc0d23SEmmanuel Vadot        - device_type
24*8ccc0d23SEmmanuel Vadot
25*8ccc0d23SEmmanuel Vadot    - properties:
26*8ccc0d23SEmmanuel Vadot        compatible:
27*8ccc0d23SEmmanuel Vadot          const: fsl,etsec2
28*8ccc0d23SEmmanuel Vadot
29*8ccc0d23SEmmanuel Vadot  required:
30*8ccc0d23SEmmanuel Vadot    - compatible
31*8ccc0d23SEmmanuel Vadot
32*8ccc0d23SEmmanuel Vadotproperties:
33*8ccc0d23SEmmanuel Vadot  compatible:
34*8ccc0d23SEmmanuel Vadot    enum:
35*8ccc0d23SEmmanuel Vadot      - gianfar
36*8ccc0d23SEmmanuel Vadot      - fsl,etsec2
37*8ccc0d23SEmmanuel Vadot
38*8ccc0d23SEmmanuel Vadot  device_type:
39*8ccc0d23SEmmanuel Vadot    const: network
40*8ccc0d23SEmmanuel Vadot
41*8ccc0d23SEmmanuel Vadot  model:
42*8ccc0d23SEmmanuel Vadot    enum:
43*8ccc0d23SEmmanuel Vadot      - FEC
44*8ccc0d23SEmmanuel Vadot      - TSEC
45*8ccc0d23SEmmanuel Vadot      - eTSEC
46*8ccc0d23SEmmanuel Vadot
47*8ccc0d23SEmmanuel Vadot  reg:
48*8ccc0d23SEmmanuel Vadot    maxItems: 1
49*8ccc0d23SEmmanuel Vadot
50*8ccc0d23SEmmanuel Vadot  ranges: true
51*8ccc0d23SEmmanuel Vadot
52*8ccc0d23SEmmanuel Vadot  "#address-cells":
53*8ccc0d23SEmmanuel Vadot    enum: [ 1, 2 ]
54*8ccc0d23SEmmanuel Vadot
55*8ccc0d23SEmmanuel Vadot  "#size-cells":
56*8ccc0d23SEmmanuel Vadot    enum: [ 1, 2 ]
57*8ccc0d23SEmmanuel Vadot
58*8ccc0d23SEmmanuel Vadot  cell-index:
59*8ccc0d23SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
60*8ccc0d23SEmmanuel Vadot
61*8ccc0d23SEmmanuel Vadot  interrupts:
62*8ccc0d23SEmmanuel Vadot    minItems: 1
63*8ccc0d23SEmmanuel Vadot    items:
64*8ccc0d23SEmmanuel Vadot      - description: Transmit interrupt or single combined interrupt
65*8ccc0d23SEmmanuel Vadot      - description: Receive interrupt
66*8ccc0d23SEmmanuel Vadot      - description: Error interrupt
67*8ccc0d23SEmmanuel Vadot
68*8ccc0d23SEmmanuel Vadot  dma-coherent: true
69*8ccc0d23SEmmanuel Vadot
70*8ccc0d23SEmmanuel Vadot  fsl,magic-packet:
71*8ccc0d23SEmmanuel Vadot    type: boolean
72*8ccc0d23SEmmanuel Vadot    description:
73*8ccc0d23SEmmanuel Vadot      If present, indicates that the hardware supports waking up via magic packet.
74*8ccc0d23SEmmanuel Vadot
75*8ccc0d23SEmmanuel Vadot  fsl,wake-on-filer:
76*8ccc0d23SEmmanuel Vadot    type: boolean
77*8ccc0d23SEmmanuel Vadot    description:
78*8ccc0d23SEmmanuel Vadot      If present, indicates that the hardware supports waking up by Filer
79*8ccc0d23SEmmanuel Vadot      General Purpose Interrupt (FGPI) asserted on the Rx int line. This is
80*8ccc0d23SEmmanuel Vadot      an advanced power management capability allowing certain packet types
81*8ccc0d23SEmmanuel Vadot      (user) defined by filer rules to wake up the system.
82*8ccc0d23SEmmanuel Vadot
83*8ccc0d23SEmmanuel Vadot  bd-stash:
84*8ccc0d23SEmmanuel Vadot    type: boolean
85*8ccc0d23SEmmanuel Vadot    description:
86*8ccc0d23SEmmanuel Vadot      If present, indicates that the hardware supports stashing buffer
87*8ccc0d23SEmmanuel Vadot      descriptors in the L2.
88*8ccc0d23SEmmanuel Vadot
89*8ccc0d23SEmmanuel Vadot  rx-stash-len:
90*8ccc0d23SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
91*8ccc0d23SEmmanuel Vadot    description:
92*8ccc0d23SEmmanuel Vadot      Denotes the number of bytes of a received buffer to stash in the L2.
93*8ccc0d23SEmmanuel Vadot
94*8ccc0d23SEmmanuel Vadot  rx-stash-idx:
95*8ccc0d23SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
96*8ccc0d23SEmmanuel Vadot    description:
97*8ccc0d23SEmmanuel Vadot      Denotes the index of the first byte from the received buffer to stash in
98*8ccc0d23SEmmanuel Vadot      the L2.
99*8ccc0d23SEmmanuel Vadot
100*8ccc0d23SEmmanuel Vadot  fsl,num_rx_queues:
101*8ccc0d23SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
102*8ccc0d23SEmmanuel Vadot    description: Number of receive queues
103*8ccc0d23SEmmanuel Vadot    const: 8
104*8ccc0d23SEmmanuel Vadot
105*8ccc0d23SEmmanuel Vadot  fsl,num_tx_queues:
106*8ccc0d23SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
107*8ccc0d23SEmmanuel Vadot    description: Number of transmit queues
108*8ccc0d23SEmmanuel Vadot    const: 8
109*8ccc0d23SEmmanuel Vadot
110*8ccc0d23SEmmanuel Vadot  tbi-handle:
111*8ccc0d23SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
112*8ccc0d23SEmmanuel Vadot    description: Reference (phandle) to the TBI node
113*8ccc0d23SEmmanuel Vadot
114*8ccc0d23SEmmanuel Vadotrequired:
115*8ccc0d23SEmmanuel Vadot  - compatible
116*8ccc0d23SEmmanuel Vadot  - model
117*8ccc0d23SEmmanuel Vadot
118*8ccc0d23SEmmanuel VadotpatternProperties:
119*8ccc0d23SEmmanuel Vadot  "^mdio@[0-9a-f]+$":
120*8ccc0d23SEmmanuel Vadot    $ref: /schemas/net/fsl,gianfar-mdio.yaml#
121*8ccc0d23SEmmanuel Vadot
122*8ccc0d23SEmmanuel VadotallOf:
123*8ccc0d23SEmmanuel Vadot  - $ref: ethernet-controller.yaml#
124*8ccc0d23SEmmanuel Vadot
125*8ccc0d23SEmmanuel Vadot  # eTSEC2 controller nodes have "queue group" subnodes and don't need a "reg"
126*8ccc0d23SEmmanuel Vadot  # property.
127*8ccc0d23SEmmanuel Vadot  - if:
128*8ccc0d23SEmmanuel Vadot      properties:
129*8ccc0d23SEmmanuel Vadot        compatible:
130*8ccc0d23SEmmanuel Vadot          contains:
131*8ccc0d23SEmmanuel Vadot            const: fsl,etsec2
132*8ccc0d23SEmmanuel Vadot    then:
133*8ccc0d23SEmmanuel Vadot      patternProperties:
134*8ccc0d23SEmmanuel Vadot        "^queue-group@[0-9a-f]+$":
135*8ccc0d23SEmmanuel Vadot          type: object
136*8ccc0d23SEmmanuel Vadot
137*8ccc0d23SEmmanuel Vadot          properties:
138*8ccc0d23SEmmanuel Vadot            reg:
139*8ccc0d23SEmmanuel Vadot              maxItems: 1
140*8ccc0d23SEmmanuel Vadot
141*8ccc0d23SEmmanuel Vadot            interrupts:
142*8ccc0d23SEmmanuel Vadot              items:
143*8ccc0d23SEmmanuel Vadot                - description: Transmit interrupt
144*8ccc0d23SEmmanuel Vadot                - description: Receive interrupt
145*8ccc0d23SEmmanuel Vadot                - description: Error interrupt
146*8ccc0d23SEmmanuel Vadot
147*8ccc0d23SEmmanuel Vadot          required:
148*8ccc0d23SEmmanuel Vadot            - reg
149*8ccc0d23SEmmanuel Vadot            - interrupts
150*8ccc0d23SEmmanuel Vadot
151*8ccc0d23SEmmanuel Vadot          additionalProperties: false
152*8ccc0d23SEmmanuel Vadot    else:
153*8ccc0d23SEmmanuel Vadot      required:
154*8ccc0d23SEmmanuel Vadot        - reg
155*8ccc0d23SEmmanuel Vadot
156*8ccc0d23SEmmanuel Vadot  # TSEC and eTSEC devices require three interrupts
157*8ccc0d23SEmmanuel Vadot  - if:
158*8ccc0d23SEmmanuel Vadot      properties:
159*8ccc0d23SEmmanuel Vadot        model:
160*8ccc0d23SEmmanuel Vadot          contains:
161*8ccc0d23SEmmanuel Vadot            enum: [ TSEC, eTSEC ]
162*8ccc0d23SEmmanuel Vadot    then:
163*8ccc0d23SEmmanuel Vadot      properties:
164*8ccc0d23SEmmanuel Vadot        interrupts:
165*8ccc0d23SEmmanuel Vadot          items:
166*8ccc0d23SEmmanuel Vadot            - description: Transmit interrupt
167*8ccc0d23SEmmanuel Vadot            - description: Receive interrupt
168*8ccc0d23SEmmanuel Vadot            - description: Error interrupt
169*8ccc0d23SEmmanuel Vadot
170*8ccc0d23SEmmanuel Vadot
171*8ccc0d23SEmmanuel Vadot
172*8ccc0d23SEmmanuel VadotunevaluatedProperties: false
173*8ccc0d23SEmmanuel Vadot
174*8ccc0d23SEmmanuel Vadotexamples:
175*8ccc0d23SEmmanuel Vadot  - |
176*8ccc0d23SEmmanuel Vadot    ethernet@24000 {
177*8ccc0d23SEmmanuel Vadot        device_type = "network";
178*8ccc0d23SEmmanuel Vadot        model = "TSEC";
179*8ccc0d23SEmmanuel Vadot        compatible = "gianfar";
180*8ccc0d23SEmmanuel Vadot        reg = <0x24000 0x1000>;
181*8ccc0d23SEmmanuel Vadot        local-mac-address = [ 00 00 00 00 00 00 ];
182*8ccc0d23SEmmanuel Vadot        interrupts = <29 2>, <30 2>, <34 2>;
183*8ccc0d23SEmmanuel Vadot        interrupt-parent = <&mpic>;
184*8ccc0d23SEmmanuel Vadot        phy-handle = <&phy0>;
185*8ccc0d23SEmmanuel Vadot    };
186*8ccc0d23SEmmanuel Vadot
187*8ccc0d23SEmmanuel Vadot  - |
188*8ccc0d23SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
189*8ccc0d23SEmmanuel Vadot
190*8ccc0d23SEmmanuel Vadot    ethernet@24000 {
191*8ccc0d23SEmmanuel Vadot        compatible = "gianfar";
192*8ccc0d23SEmmanuel Vadot        reg = <0x24000 0x1000>;
193*8ccc0d23SEmmanuel Vadot        ranges = <0x0 0x24000 0x1000>;
194*8ccc0d23SEmmanuel Vadot        #address-cells = <1>;
195*8ccc0d23SEmmanuel Vadot        #size-cells = <1>;
196*8ccc0d23SEmmanuel Vadot        cell-index = <0>;
197*8ccc0d23SEmmanuel Vadot        device_type = "network";
198*8ccc0d23SEmmanuel Vadot        model = "eTSEC";
199*8ccc0d23SEmmanuel Vadot        local-mac-address = [ 00 00 00 00 00 00 ];
200*8ccc0d23SEmmanuel Vadot        interrupts = <32 IRQ_TYPE_LEVEL_LOW>,
201*8ccc0d23SEmmanuel Vadot                     <33 IRQ_TYPE_LEVEL_LOW>,
202*8ccc0d23SEmmanuel Vadot                     <34 IRQ_TYPE_LEVEL_LOW>;
203*8ccc0d23SEmmanuel Vadot        interrupt-parent = <&ipic>;
204*8ccc0d23SEmmanuel Vadot
205*8ccc0d23SEmmanuel Vadot        mdio@520 {
206*8ccc0d23SEmmanuel Vadot            #address-cells = <1>;
207*8ccc0d23SEmmanuel Vadot            #size-cells = <0>;
208*8ccc0d23SEmmanuel Vadot            compatible = "fsl,gianfar-mdio";
209*8ccc0d23SEmmanuel Vadot            reg = <0x520 0x20>;
210*8ccc0d23SEmmanuel Vadot        };
211*8ccc0d23SEmmanuel Vadot    };
212*8ccc0d23SEmmanuel Vadot
213*8ccc0d23SEmmanuel Vadot  - |
214*8ccc0d23SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
215*8ccc0d23SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
216*8ccc0d23SEmmanuel Vadot
217*8ccc0d23SEmmanuel Vadot    bus {
218*8ccc0d23SEmmanuel Vadot        #address-cells = <2>;
219*8ccc0d23SEmmanuel Vadot        #size-cells = <2>;
220*8ccc0d23SEmmanuel Vadot
221*8ccc0d23SEmmanuel Vadot        ethernet {
222*8ccc0d23SEmmanuel Vadot            compatible = "fsl,etsec2";
223*8ccc0d23SEmmanuel Vadot            ranges;
224*8ccc0d23SEmmanuel Vadot            device_type = "network";
225*8ccc0d23SEmmanuel Vadot            #address-cells = <2>;
226*8ccc0d23SEmmanuel Vadot            #size-cells = <2>;
227*8ccc0d23SEmmanuel Vadot            interrupt-parent = <&gic>;
228*8ccc0d23SEmmanuel Vadot            model = "eTSEC";
229*8ccc0d23SEmmanuel Vadot            fsl,magic-packet;
230*8ccc0d23SEmmanuel Vadot            dma-coherent;
231*8ccc0d23SEmmanuel Vadot
232*8ccc0d23SEmmanuel Vadot            queue-group@2d10000 {
233*8ccc0d23SEmmanuel Vadot                reg = <0x0 0x2d10000 0x0 0x1000>;
234*8ccc0d23SEmmanuel Vadot                interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>,
235*8ccc0d23SEmmanuel Vadot                             <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>,
236*8ccc0d23SEmmanuel Vadot                             <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
237*8ccc0d23SEmmanuel Vadot            };
238*8ccc0d23SEmmanuel Vadot
239*8ccc0d23SEmmanuel Vadot            queue-group@2d14000  {
240*8ccc0d23SEmmanuel Vadot                reg = <0x0 0x2d14000 0x0 0x1000>;
241*8ccc0d23SEmmanuel Vadot                interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
242*8ccc0d23SEmmanuel Vadot                             <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>,
243*8ccc0d23SEmmanuel Vadot                             <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
244*8ccc0d23SEmmanuel Vadot            };
245*8ccc0d23SEmmanuel Vadot        };
246*8ccc0d23SEmmanuel Vadot    };
247*8ccc0d23SEmmanuel Vadot
248*8ccc0d23SEmmanuel Vadot...
249