xref: /freebsd/sys/contrib/device-tree/Bindings/net/altr,socfpga-stmmac.yaml (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1*833e5d42SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2*833e5d42SEmmanuel Vadot%YAML 1.2
3*833e5d42SEmmanuel Vadot---
4*833e5d42SEmmanuel Vadot$id: http://devicetree.org/schemas/net/altr,socfpga-stmmac.yaml#
5*833e5d42SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*833e5d42SEmmanuel Vadot
7*833e5d42SEmmanuel Vadottitle: Altera SOCFPGA SoC DWMAC controller
8*833e5d42SEmmanuel Vadot
9*833e5d42SEmmanuel Vadotmaintainers:
10*833e5d42SEmmanuel Vadot  - Matthew Gerlach <matthew.gerlach@altera.com>
11*833e5d42SEmmanuel Vadot
12*833e5d42SEmmanuel Vadotdescription:
13*833e5d42SEmmanuel Vadot  This binding describes the Altera SOCFPGA SoC implementation of the
14*833e5d42SEmmanuel Vadot  Synopsys DWMAC for the Cyclone5, Arria5, Stratix10, Agilex5 and Agilex7
15*833e5d42SEmmanuel Vadot  families of chips.
16*833e5d42SEmmanuel Vadot  # TODO: Determine how to handle the Arria10 reset-name, stmmaceth-ocp, that
17*833e5d42SEmmanuel Vadot  # does not validate against net/snps,dwmac.yaml.
18*833e5d42SEmmanuel Vadot
19*833e5d42SEmmanuel Vadotselect:
20*833e5d42SEmmanuel Vadot  properties:
21*833e5d42SEmmanuel Vadot    compatible:
22*833e5d42SEmmanuel Vadot      contains:
23*833e5d42SEmmanuel Vadot        enum:
24*833e5d42SEmmanuel Vadot          - altr,socfpga-stmmac
25*833e5d42SEmmanuel Vadot          - altr,socfpga-stmmac-a10-s10
26*833e5d42SEmmanuel Vadot          - altr,socfpga-stmmac-agilex5
27*833e5d42SEmmanuel Vadot
28*833e5d42SEmmanuel Vadot  required:
29*833e5d42SEmmanuel Vadot    - compatible
30*833e5d42SEmmanuel Vadot
31*833e5d42SEmmanuel Vadotproperties:
32*833e5d42SEmmanuel Vadot  compatible:
33*833e5d42SEmmanuel Vadot    oneOf:
34*833e5d42SEmmanuel Vadot      - items:
35*833e5d42SEmmanuel Vadot          - const: altr,socfpga-stmmac
36*833e5d42SEmmanuel Vadot          - const: snps,dwmac-3.70a
37*833e5d42SEmmanuel Vadot          - const: snps,dwmac
38*833e5d42SEmmanuel Vadot      - items:
39*833e5d42SEmmanuel Vadot          - const: altr,socfpga-stmmac-a10-s10
40*833e5d42SEmmanuel Vadot          - const: snps,dwmac-3.72a
41*833e5d42SEmmanuel Vadot          - const: snps,dwmac
42*833e5d42SEmmanuel Vadot      - items:
43*833e5d42SEmmanuel Vadot          - const: altr,socfpga-stmmac-a10-s10
44*833e5d42SEmmanuel Vadot          - const: snps,dwmac-3.74a
45*833e5d42SEmmanuel Vadot          - const: snps,dwmac
46*833e5d42SEmmanuel Vadot      - items:
47*833e5d42SEmmanuel Vadot          - const: altr,socfpga-stmmac-agilex5
48*833e5d42SEmmanuel Vadot          - const: snps,dwxgmac-2.10
49*833e5d42SEmmanuel Vadot
50*833e5d42SEmmanuel Vadot  clocks:
51*833e5d42SEmmanuel Vadot    minItems: 1
52*833e5d42SEmmanuel Vadot    items:
53*833e5d42SEmmanuel Vadot      - description: GMAC main clock
54*833e5d42SEmmanuel Vadot      - description:
55*833e5d42SEmmanuel Vadot          PTP reference clock. This clock is used for programming the
56*833e5d42SEmmanuel Vadot          Timestamp Addend Register. If not passed then the system
57*833e5d42SEmmanuel Vadot          clock will be used and this is fine on some platforms.
58*833e5d42SEmmanuel Vadot
59*833e5d42SEmmanuel Vadot  clock-names:
60*833e5d42SEmmanuel Vadot    minItems: 1
61*833e5d42SEmmanuel Vadot    items:
62*833e5d42SEmmanuel Vadot      - const: stmmaceth
63*833e5d42SEmmanuel Vadot      - const: ptp_ref
64*833e5d42SEmmanuel Vadot
65*833e5d42SEmmanuel Vadot  iommus:
66*833e5d42SEmmanuel Vadot    minItems: 1
67*833e5d42SEmmanuel Vadot    maxItems: 2
68*833e5d42SEmmanuel Vadot
69*833e5d42SEmmanuel Vadot  phy-mode:
70*833e5d42SEmmanuel Vadot    enum:
71*833e5d42SEmmanuel Vadot      - gmii
72*833e5d42SEmmanuel Vadot      - mii
73*833e5d42SEmmanuel Vadot      - rgmii
74*833e5d42SEmmanuel Vadot      - rgmii-id
75*833e5d42SEmmanuel Vadot      - rgmii-rxid
76*833e5d42SEmmanuel Vadot      - rgmii-txid
77*833e5d42SEmmanuel Vadot      - sgmii
78*833e5d42SEmmanuel Vadot      - 1000base-x
79*833e5d42SEmmanuel Vadot
80*833e5d42SEmmanuel Vadot  rxc-skew-ps:
81*833e5d42SEmmanuel Vadot    description: Skew control of RXC pad
82*833e5d42SEmmanuel Vadot
83*833e5d42SEmmanuel Vadot  rxd0-skew-ps:
84*833e5d42SEmmanuel Vadot    description: Skew control of RX data 0 pad
85*833e5d42SEmmanuel Vadot
86*833e5d42SEmmanuel Vadot  rxd1-skew-ps:
87*833e5d42SEmmanuel Vadot    description: Skew control of RX data 1 pad
88*833e5d42SEmmanuel Vadot
89*833e5d42SEmmanuel Vadot  rxd2-skew-ps:
90*833e5d42SEmmanuel Vadot    description: Skew control of RX data 2 pad
91*833e5d42SEmmanuel Vadot
92*833e5d42SEmmanuel Vadot  rxd3-skew-ps:
93*833e5d42SEmmanuel Vadot    description: Skew control of RX data 3 pad
94*833e5d42SEmmanuel Vadot
95*833e5d42SEmmanuel Vadot  rxdv-skew-ps:
96*833e5d42SEmmanuel Vadot    description: Skew control of RX CTL pad
97*833e5d42SEmmanuel Vadot
98*833e5d42SEmmanuel Vadot  txc-skew-ps:
99*833e5d42SEmmanuel Vadot    description: Skew control of TXC pad
100*833e5d42SEmmanuel Vadot
101*833e5d42SEmmanuel Vadot  txen-skew-ps:
102*833e5d42SEmmanuel Vadot    description: Skew control of TXC pad
103*833e5d42SEmmanuel Vadot
104*833e5d42SEmmanuel Vadot  altr,emac-splitter:
105*833e5d42SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
106*833e5d42SEmmanuel Vadot    description:
107*833e5d42SEmmanuel Vadot      Should be the phandle to the emac splitter soft IP node if DWMAC
108*833e5d42SEmmanuel Vadot      controller is connected an emac splitter.
109*833e5d42SEmmanuel Vadot
110*833e5d42SEmmanuel Vadot  altr,f2h_ptp_ref_clk:
111*833e5d42SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
112*833e5d42SEmmanuel Vadot    description:
113*833e5d42SEmmanuel Vadot      Phandle to Precision Time Protocol reference clock. This clock is
114*833e5d42SEmmanuel Vadot      common to gmac instances and defaults to osc1.
115*833e5d42SEmmanuel Vadot
116*833e5d42SEmmanuel Vadot  altr,gmii-to-sgmii-converter:
117*833e5d42SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
118*833e5d42SEmmanuel Vadot    description:
119*833e5d42SEmmanuel Vadot      Should be the phandle to the gmii to sgmii converter soft IP.
120*833e5d42SEmmanuel Vadot
121*833e5d42SEmmanuel Vadot  altr,sysmgr-syscon:
122*833e5d42SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle-array
123*833e5d42SEmmanuel Vadot    description:
124*833e5d42SEmmanuel Vadot      Should be the phandle to the system manager node that encompass
125*833e5d42SEmmanuel Vadot      the glue register, the register offset, and the register shift.
126*833e5d42SEmmanuel Vadot      On Cyclone5/Arria5, the register shift represents the PHY mode
127*833e5d42SEmmanuel Vadot      bits, while on the Arria10/Stratix10/Agilex platforms, the
128*833e5d42SEmmanuel Vadot      register shift represents bit for each emac to enable/disable
129*833e5d42SEmmanuel Vadot      signals from the FPGA fabric to the EMAC modules.
130*833e5d42SEmmanuel Vadot    items:
131*833e5d42SEmmanuel Vadot      - items:
132*833e5d42SEmmanuel Vadot          - description: phandle to the system manager node
133*833e5d42SEmmanuel Vadot          - description: offset of the control register
134*833e5d42SEmmanuel Vadot          - description: shift within the control register
135*833e5d42SEmmanuel Vadot
136*833e5d42SEmmanuel VadotpatternProperties:
137*833e5d42SEmmanuel Vadot  "^mdio[0-9]$":
138*833e5d42SEmmanuel Vadot    type: object
139*833e5d42SEmmanuel Vadot
140*833e5d42SEmmanuel Vadotrequired:
141*833e5d42SEmmanuel Vadot  - compatible
142*833e5d42SEmmanuel Vadot  - clocks
143*833e5d42SEmmanuel Vadot  - clock-names
144*833e5d42SEmmanuel Vadot  - altr,sysmgr-syscon
145*833e5d42SEmmanuel Vadot
146*833e5d42SEmmanuel VadotallOf:
147*833e5d42SEmmanuel Vadot  - $ref: snps,dwmac.yaml#
148*833e5d42SEmmanuel Vadot
149*833e5d42SEmmanuel VadotunevaluatedProperties: false
150*833e5d42SEmmanuel Vadot
151*833e5d42SEmmanuel Vadotexamples:
152*833e5d42SEmmanuel Vadot
153*833e5d42SEmmanuel Vadot  - |
154*833e5d42SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
155*833e5d42SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
156*833e5d42SEmmanuel Vadot    soc {
157*833e5d42SEmmanuel Vadot        #address-cells = <1>;
158*833e5d42SEmmanuel Vadot        #size-cells = <1>;
159*833e5d42SEmmanuel Vadot        ethernet@ff700000 {
160*833e5d42SEmmanuel Vadot            compatible = "altr,socfpga-stmmac", "snps,dwmac-3.70a",
161*833e5d42SEmmanuel Vadot            "snps,dwmac";
162*833e5d42SEmmanuel Vadot            altr,sysmgr-syscon = <&sysmgr 0x60 0>;
163*833e5d42SEmmanuel Vadot            reg = <0xff700000 0x2000>;
164*833e5d42SEmmanuel Vadot            interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
165*833e5d42SEmmanuel Vadot            interrupt-names = "macirq";
166*833e5d42SEmmanuel Vadot            mac-address = [00 00 00 00 00 00]; /* Filled in by U-Boot */
167*833e5d42SEmmanuel Vadot            clocks = <&emac_0_clk>;
168*833e5d42SEmmanuel Vadot            clock-names = "stmmaceth";
169*833e5d42SEmmanuel Vadot            phy-mode = "sgmii";
170*833e5d42SEmmanuel Vadot        };
171*833e5d42SEmmanuel Vadot    };
172