xref: /openbmc/linux/Documentation/devicetree/bindings/net/rockchip,emac.yaml (revision 5ecd39d1bc4b10df6d640c54e04b4a1c70447d13)
1*5ecd39d1SJohan Jonker# SPDX-License-Identifier: GPL-2.0
2*5ecd39d1SJohan Jonker%YAML 1.2
3*5ecd39d1SJohan Jonker---
4*5ecd39d1SJohan Jonker$id: http://devicetree.org/schemas/net/rockchip,emac.yaml#
5*5ecd39d1SJohan Jonker$schema: http://devicetree.org/meta-schemas/core.yaml#
6*5ecd39d1SJohan Jonker
7*5ecd39d1SJohan Jonkertitle: Rockchip RK3036/RK3066/RK3188 Ethernet Media Access Controller (EMAC)
8*5ecd39d1SJohan Jonker
9*5ecd39d1SJohan Jonkermaintainers:
10*5ecd39d1SJohan Jonker  - Heiko Stuebner <heiko@sntech.de>
11*5ecd39d1SJohan Jonker
12*5ecd39d1SJohan Jonkerproperties:
13*5ecd39d1SJohan Jonker  compatible:
14*5ecd39d1SJohan Jonker    enum:
15*5ecd39d1SJohan Jonker      - rockchip,rk3036-emac
16*5ecd39d1SJohan Jonker      - rockchip,rk3066-emac
17*5ecd39d1SJohan Jonker      - rockchip,rk3188-emac
18*5ecd39d1SJohan Jonker
19*5ecd39d1SJohan Jonker  reg:
20*5ecd39d1SJohan Jonker    maxItems: 1
21*5ecd39d1SJohan Jonker
22*5ecd39d1SJohan Jonker  interrupts:
23*5ecd39d1SJohan Jonker    maxItems: 1
24*5ecd39d1SJohan Jonker
25*5ecd39d1SJohan Jonker  clocks:
26*5ecd39d1SJohan Jonker    minItems: 2
27*5ecd39d1SJohan Jonker    items:
28*5ecd39d1SJohan Jonker      - description: host clock
29*5ecd39d1SJohan Jonker      - description: reference clock
30*5ecd39d1SJohan Jonker      - description: mac TX/RX clock
31*5ecd39d1SJohan Jonker
32*5ecd39d1SJohan Jonker  clock-names:
33*5ecd39d1SJohan Jonker    minItems: 2
34*5ecd39d1SJohan Jonker    items:
35*5ecd39d1SJohan Jonker      - const: hclk
36*5ecd39d1SJohan Jonker      - const: macref
37*5ecd39d1SJohan Jonker      - const: macclk
38*5ecd39d1SJohan Jonker
39*5ecd39d1SJohan Jonker  rockchip,grf:
40*5ecd39d1SJohan Jonker    $ref: /schemas/types.yaml#/definitions/phandle
41*5ecd39d1SJohan Jonker    description:
42*5ecd39d1SJohan Jonker      Phandle to the syscon GRF used to control speed and mode for the EMAC.
43*5ecd39d1SJohan Jonker
44*5ecd39d1SJohan Jonker  phy-supply:
45*5ecd39d1SJohan Jonker    description:
46*5ecd39d1SJohan Jonker      Phandle to a regulator if the PHY needs one.
47*5ecd39d1SJohan Jonker
48*5ecd39d1SJohan Jonker  mdio:
49*5ecd39d1SJohan Jonker    $ref: mdio.yaml#
50*5ecd39d1SJohan Jonker    unevaluatedProperties: false
51*5ecd39d1SJohan Jonker
52*5ecd39d1SJohan Jonkerrequired:
53*5ecd39d1SJohan Jonker  - compatible
54*5ecd39d1SJohan Jonker  - reg
55*5ecd39d1SJohan Jonker  - interrupts
56*5ecd39d1SJohan Jonker  - clocks
57*5ecd39d1SJohan Jonker  - clock-names
58*5ecd39d1SJohan Jonker  - rockchip,grf
59*5ecd39d1SJohan Jonker  - phy
60*5ecd39d1SJohan Jonker  - phy-mode
61*5ecd39d1SJohan Jonker  - mdio
62*5ecd39d1SJohan Jonker
63*5ecd39d1SJohan JonkerallOf:
64*5ecd39d1SJohan Jonker  - $ref: "ethernet-controller.yaml#"
65*5ecd39d1SJohan Jonker  - if:
66*5ecd39d1SJohan Jonker      properties:
67*5ecd39d1SJohan Jonker        compatible:
68*5ecd39d1SJohan Jonker          contains:
69*5ecd39d1SJohan Jonker            const: rockchip,rk3036-emac
70*5ecd39d1SJohan Jonker
71*5ecd39d1SJohan Jonker    then:
72*5ecd39d1SJohan Jonker      properties:
73*5ecd39d1SJohan Jonker        clocks:
74*5ecd39d1SJohan Jonker          minItems: 3
75*5ecd39d1SJohan Jonker
76*5ecd39d1SJohan Jonker        clock-names:
77*5ecd39d1SJohan Jonker          minItems: 3
78*5ecd39d1SJohan Jonker
79*5ecd39d1SJohan Jonker    else:
80*5ecd39d1SJohan Jonker      properties:
81*5ecd39d1SJohan Jonker        clocks:
82*5ecd39d1SJohan Jonker          maxItems: 2
83*5ecd39d1SJohan Jonker
84*5ecd39d1SJohan Jonker        clock-names:
85*5ecd39d1SJohan Jonker          maxItems: 2
86*5ecd39d1SJohan Jonker
87*5ecd39d1SJohan JonkerunevaluatedProperties: false
88*5ecd39d1SJohan Jonker
89*5ecd39d1SJohan Jonkerexamples:
90*5ecd39d1SJohan Jonker  - |
91*5ecd39d1SJohan Jonker    #include <dt-bindings/clock/rk3188-cru-common.h>
92*5ecd39d1SJohan Jonker    #include <dt-bindings/interrupt-controller/arm-gic.h>
93*5ecd39d1SJohan Jonker
94*5ecd39d1SJohan Jonker    ethernet@10204000 {
95*5ecd39d1SJohan Jonker      compatible = "rockchip,rk3188-emac";
96*5ecd39d1SJohan Jonker      reg = <0xc0fc2000 0x3c>;
97*5ecd39d1SJohan Jonker      interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
98*5ecd39d1SJohan Jonker      clocks = <&cru HCLK_EMAC>, <&cru SCLK_MAC>;
99*5ecd39d1SJohan Jonker      clock-names = "hclk", "macref";
100*5ecd39d1SJohan Jonker      rockchip,grf = <&grf>;
101*5ecd39d1SJohan Jonker      pinctrl-0 = <&emac_xfer>, <&emac_mdio>, <&phy_int>;
102*5ecd39d1SJohan Jonker      pinctrl-names = "default";
103*5ecd39d1SJohan Jonker      phy = <&phy0>;
104*5ecd39d1SJohan Jonker      phy-mode = "rmii";
105*5ecd39d1SJohan Jonker      phy-supply = <&vcc_rmii>;
106*5ecd39d1SJohan Jonker
107*5ecd39d1SJohan Jonker      mdio {
108*5ecd39d1SJohan Jonker        #address-cells = <1>;
109*5ecd39d1SJohan Jonker        #size-cells = <0>;
110*5ecd39d1SJohan Jonker
111*5ecd39d1SJohan Jonker        phy0: ethernet-phy@0 {
112*5ecd39d1SJohan Jonker          reg = <1>;
113*5ecd39d1SJohan Jonker        };
114*5ecd39d1SJohan Jonker      };
115*5ecd39d1SJohan Jonker    };
116