summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/net/cdns,macb.yaml
blob: 2c8c080a3d88151c5ceff1301bb53ed52a14f702 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/cdns,macb.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cadence MACB/GEM Ethernet controller

maintainers:
  - Nicolas Ferre <nicolas.ferre@microchip.com>
  - Claudiu Beznea <claudiu.beznea@microchip.com>

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - cdns,at91rm9200-emac  # Atmel at91rm9200 SoC
          - const: cdns,emac          # Generic

      - items:
          - enum:
              - cdns,zynq-gem         # Xilinx Zynq-7xxx SoC
              - cdns,zynqmp-gem       # Xilinx Zynq Ultrascale+ MPSoC
          - const: cdns,gem           # Generic
        deprecated: true

      - items:
          - enum:
              - xlnx,versal-gem       # Xilinx Versal
              - xlnx,zynq-gem         # Xilinx Zynq-7xxx SoC
              - xlnx,zynqmp-gem       # Xilinx Zynq Ultrascale+ MPSoC
          - const: cdns,gem           # Generic

      - items:
          - enum:
              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs
              - cdns,sam9x60-macb     # Microchip sam9x60 SoC
              - microchip,mpfs-macb   # Microchip PolarFire SoC
          - const: cdns,macb          # Generic
      - items:
          - const: microchip,pic64gx-macb # Microchip PIC64GX SoC
          - const: microchip,mpfs-macb    # Microchip PolarFire SoC
          - const: cdns,macb              # Generic
      - items:
          - enum:
              - atmel,sama5d3-macb    # 10/100Mbit IP on Atmel sama5d3 SoCs
          - enum:
              - cdns,at91sam9260-macb # Atmel at91sam9 SoCs.
          - const: cdns,macb          # Generic

      - enum:
          - atmel,sama5d2-gem         # GEM IP (10/100) on Atmel sama5d2 SoCs
          - atmel,sama5d29-gem        # GEM XL IP (10/100) on Atmel sama5d29 SoCs
          - atmel,sama5d3-gem         # Gigabit IP on Atmel sama5d3 SoCs
          - atmel,sama5d4-gem         # GEM IP (10/100) on Atmel sama5d4 SoCs
          - cdns,emac                 # Generic
          - cdns,gem                  # Generic
          - cdns,macb                 # Generic
          - cdns,np4-macb             # NP4 SoC devices
          - microchip,sama7g5-emac    # Microchip SAMA7G5 ethernet interface
          - microchip,sama7g5-gem     # Microchip SAMA7G5 gigabit ethernet interface
          - mobileye,eyeq5-gem        # Mobileye EyeQ5 SoCs
          - raspberrypi,rp1-gem       # Raspberry Pi RP1 gigabit ethernet interface
          - sifive,fu540-c000-gem     # SiFive FU540-C000 SoC

      - items:
          - enum:
              - microchip,sam9x7-gem     # Microchip SAM9X7 gigabit ethernet interface
              - microchip,sama7d65-gem   # Microchip SAMA7D65 gigabit ethernet interface
          - const: microchip,sama7g5-gem # Microchip SAMA7G5 gigabit ethernet interface

      - items:
          - const: microchip,pic64hpsc-gem # Microchip PIC64-HPSC
          - const: cdns,gem
      - items:
          - const: microchip,pic64hx-gem   # Microchip PIC64HX
          - const: microchip,pic64hpsc-gem # Microchip PIC64-HPSC
          - const: cdns,gem

  reg:
    minItems: 1
    items:
      - description: Basic register set
      - description: GEMGXL Management block registers on SiFive FU540-C000 SoC

  interrupts:
    minItems: 1
    maxItems: 8
    description: One interrupt per available hardware queue

  clocks:
    minItems: 1
    maxItems: 5

  clock-names:
    minItems: 1
    items:
      - enum: [ ether_clk, hclk, pclk ]
      - enum: [ hclk, pclk ]
      - enum: [ tx_clk, tsu_clk ]
      - enum: [ rx_clk, tsu_clk ]
      - const: tsu_clk

  local-mac-address: true

  phy-mode: true

  phy-handle: true

  phys:
    maxItems: 1

  resets:
    maxItems: 1
    description:
      Recommended with ZynqMP, specify reset control for this
      controller instance with zynqmp-reset driver.

  reset-names:
    maxItems: 1

  fixed-link: true

  iommus:
    maxItems: 1

  power-domains:
    maxItems: 1

  cdns,refclk-ext:
    type: boolean
    deprecated: true
    description: |
     This selects if the REFCLK for RMII is provided by an external source.
     For RGMII mode this selects if the 125MHz REF clock is provided by an external
     source.

     This property has been replaced by cdns,refclk-source, as it only works
     for devices that use an internal reference clock by default.

  cdns,refclk-source:
    $ref: /schemas/types.yaml#/definitions/string
    enum:
      - internal
      - external
    description:
      Select whether or not the refclk for RGMII or RMII is provided by an
      internal or external source. The default is device specific.

  cdns,rx-watermark:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      When the receive partial store and forward mode is activated,
      the receiver will only begin to forward the packet to the external
      AHB or AXI slave when enough packet data is stored in the SRAM packet buffer.
      rx-watermark corresponds to the number of SRAM buffer locations,
      that need to be filled, before the forwarding process is activated.
      Width of the SRAM is platform dependent, and can be 4, 8 or 16 bytes.

  cdns,timer-adjust:
    type: boolean
    description:
      Set when the hardware is operating in timer-adjust mode, where the timer
      is controlled by the gem_tsu_inc_ctrl and gem_tsu_ms inputs.

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  mdio:
    type: object
    description:
      Node containing PHY children. If this node is not present, then PHYs will
      be direct children.

patternProperties:
  "^ethernet-phy@[0-9a-f]$":
    type: object
    $ref: ethernet-phy.yaml#

    properties:
      reset-gpios: true

      magic-packet:
        type: boolean
        deprecated: true
        description:
          Indicates that the hardware supports waking up via magic packet.

    unevaluatedProperties: false

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - phy-mode

allOf:
  - $ref: ethernet-controller.yaml#

  - if:
      not:
        properties:
          compatible:
            contains:
              const: sifive,fu540-c000-gem
    then:
      properties:
        reg:
          maxItems: 1
  - if:
      not:
        properties:
          compatible:
            contains:
              const: microchip,mpfs-macb
    then:
      properties:
        cdns,timer-adjust: false

  - if:
      properties:
        compatible:
          contains:
            const: mobileye,eyeq5-gem
    then:
      required:
        - phys

  - if:
      properties:
        compatible:
          contains:
            const: microchip,pic64hpsc-gem
    then:
      patternProperties:
        "^ethernet-phy@[0-9a-f]$": false
      properties:
        mdio: false

  - if:
      not:
        properties:
          compatible:
            contains:
              enum:
                - microchip,sama7g5-gem
                - microchip,sama7g5-emac
    then:
      properties:
        cdns,refclk-source: false

  - if:
      not:
        properties:
          compatible:
            contains:
              const: microchip,sama7g5-gem
    then:
      properties:
        cdns,refclk-ext: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - microchip,sama7g5-emac
    then:
      properties:
        cdns,refclk-source:
          default: external
    else:
      properties:
        cdns,refclk-source:
          default: internal

unevaluatedProperties: false

examples:
  - |
    macb0: ethernet@fffc4000 {
            compatible = "cdns,macb";
            reg = <0xfffc4000 0x4000>;
            interrupts = <21>;
            cdns,rx-watermark = <0x44>;
            phy-mode = "rmii";
            local-mac-address = [3a 0e 03 04 05 06];
            clock-names = "pclk", "hclk", "tx_clk";
            clocks = <&clkc 30>, <&clkc 30>, <&clkc 13>;
            #address-cells = <1>;
            #size-cells = <0>;

            ethernet-phy@1 {
                    reg = <0x1>;
                    reset-gpios = <&pioE 6 1>;
            };
    };

  - |
    #include <dt-bindings/power/xlnx-zynqmp-power.h>
    #include <dt-bindings/reset/xlnx-zynqmp-resets.h>
    #include <dt-bindings/phy/phy.h>

    bus {
            #address-cells = <2>;
            #size-cells = <2>;
            gem1: ethernet@ff0c0000 {
                    compatible = "xlnx,zynqmp-gem", "cdns,gem";
                    interrupt-parent = <&gic>;
                    interrupts = <0 59 4>, <0 59 4>;
                    reg = <0x0 0xff0c0000 0x0 0x1000>;
                    clocks = <&zynqmp_clk 31>, <&zynqmp_clk 105>,
                             <&zynqmp_clk 51>, <&zynqmp_clk 50>,
                             <&zynqmp_clk 44>;
                    clock-names = "pclk", "hclk", "tx_clk", "rx_clk", "tsu_clk";
                    #address-cells = <1>;
                    #size-cells = <0>;
                    iommus = <&smmu 0x875>;
                    power-domains = <&zynqmp_firmware PD_ETH_1>;
                    resets = <&zynqmp_reset ZYNQMP_RESET_GEM1>;
                    reset-names = "gem1_rst";
                    phy-mode = "sgmii";
                    phys = <&psgtr 1 PHY_TYPE_SGMII 1 1>;
                    fixed-link {
                            speed = <1000>;
                            full-duplex;
                            pause;
                    };
            };
    };