xref: /freebsd/sys/contrib/device-tree/Bindings/net/dsa/lan9303.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotSMSC/MicroChip LAN9303 three port ethernet switch
2*c66ec88fSEmmanuel Vadot-------------------------------------------------
3*c66ec88fSEmmanuel Vadot
4*c66ec88fSEmmanuel VadotRequired properties:
5*c66ec88fSEmmanuel Vadot
6*c66ec88fSEmmanuel Vadot- compatible: should be
7*c66ec88fSEmmanuel Vadot  - "smsc,lan9303-i2c" for I2C managed mode
8*c66ec88fSEmmanuel Vadot    or
9*c66ec88fSEmmanuel Vadot  - "smsc,lan9303-mdio" for mdio managed mode
10*c66ec88fSEmmanuel Vadot
11*c66ec88fSEmmanuel VadotOptional properties:
12*c66ec88fSEmmanuel Vadot
13*c66ec88fSEmmanuel Vadot- reset-gpios: GPIO to be used to reset the whole device
14*c66ec88fSEmmanuel Vadot- reset-duration: reset duration in milliseconds, defaults to 200 ms
15*c66ec88fSEmmanuel Vadot
16*c66ec88fSEmmanuel VadotSubnodes:
17*c66ec88fSEmmanuel Vadot
18*c66ec88fSEmmanuel VadotThe integrated switch subnode should be specified according to the binding
19*c66ec88fSEmmanuel Vadotdescribed in dsa/dsa.txt. The CPU port of this switch is always port 0.
20*c66ec88fSEmmanuel Vadot
21*c66ec88fSEmmanuel VadotNote: always use 'reg = <0/1/2>;' for the three DSA ports, even if the device is
22*c66ec88fSEmmanuel Vadotconfigured to use 1/2/3 instead. This hardware configuration will be
23*c66ec88fSEmmanuel Vadotauto-detected and mapped accordingly.
24*c66ec88fSEmmanuel Vadot
25*c66ec88fSEmmanuel VadotExample:
26*c66ec88fSEmmanuel Vadot
27*c66ec88fSEmmanuel VadotI2C managed mode:
28*c66ec88fSEmmanuel Vadot
29*c66ec88fSEmmanuel Vadot	master: masterdevice@X {
30*c66ec88fSEmmanuel Vadot
31*c66ec88fSEmmanuel Vadot		fixed-link { /* RMII fixed link to LAN9303 */
32*c66ec88fSEmmanuel Vadot			speed = <100>;
33*c66ec88fSEmmanuel Vadot			full-duplex;
34*c66ec88fSEmmanuel Vadot		};
35*c66ec88fSEmmanuel Vadot	};
36*c66ec88fSEmmanuel Vadot
37*c66ec88fSEmmanuel Vadot	switch: switch@a {
38*c66ec88fSEmmanuel Vadot		compatible = "smsc,lan9303-i2c";
39*c66ec88fSEmmanuel Vadot		reg = <0xa>;
40*c66ec88fSEmmanuel Vadot		reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
41*c66ec88fSEmmanuel Vadot		reset-duration = <200>;
42*c66ec88fSEmmanuel Vadot
43*c66ec88fSEmmanuel Vadot		ports {
44*c66ec88fSEmmanuel Vadot			#address-cells = <1>;
45*c66ec88fSEmmanuel Vadot			#size-cells = <0>;
46*c66ec88fSEmmanuel Vadot
47*c66ec88fSEmmanuel Vadot			port@0 { /* RMII fixed link to master */
48*c66ec88fSEmmanuel Vadot				reg = <0>;
49*c66ec88fSEmmanuel Vadot				label = "cpu";
50*c66ec88fSEmmanuel Vadot				ethernet = <&master>;
51*c66ec88fSEmmanuel Vadot			};
52*c66ec88fSEmmanuel Vadot
53*c66ec88fSEmmanuel Vadot			port@1 { /* external port 1 */
54*c66ec88fSEmmanuel Vadot				reg = <1>;
55*c66ec88fSEmmanuel Vadot				label = "lan1";
56*c66ec88fSEmmanuel Vadot			};
57*c66ec88fSEmmanuel Vadot
58*c66ec88fSEmmanuel Vadot			port@2 { /* external port 2 */
59*c66ec88fSEmmanuel Vadot				reg = <2>;
60*c66ec88fSEmmanuel Vadot				label = "lan2";
61*c66ec88fSEmmanuel Vadot			};
62*c66ec88fSEmmanuel Vadot		};
63*c66ec88fSEmmanuel Vadot	};
64*c66ec88fSEmmanuel Vadot
65*c66ec88fSEmmanuel VadotMDIO managed mode:
66*c66ec88fSEmmanuel Vadot
67*c66ec88fSEmmanuel Vadot	master: masterdevice@X {
68*c66ec88fSEmmanuel Vadot		phy-handle = <&switch>;
69*c66ec88fSEmmanuel Vadot
70*c66ec88fSEmmanuel Vadot		mdio {
71*c66ec88fSEmmanuel Vadot			#address-cells = <1>;
72*c66ec88fSEmmanuel Vadot			#size-cells = <0>;
73*c66ec88fSEmmanuel Vadot
74*c66ec88fSEmmanuel Vadot			switch: switch-phy@0 {
75*c66ec88fSEmmanuel Vadot				compatible = "smsc,lan9303-mdio";
76*c66ec88fSEmmanuel Vadot				reg = <0>;
77*c66ec88fSEmmanuel Vadot				reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
78*c66ec88fSEmmanuel Vadot				reset-duration = <100>;
79*c66ec88fSEmmanuel Vadot
80*c66ec88fSEmmanuel Vadot				ports {
81*c66ec88fSEmmanuel Vadot					#address-cells = <1>;
82*c66ec88fSEmmanuel Vadot					#size-cells = <0>;
83*c66ec88fSEmmanuel Vadot
84*c66ec88fSEmmanuel Vadot					port@0 {
85*c66ec88fSEmmanuel Vadot						reg = <0>;
86*c66ec88fSEmmanuel Vadot						label = "cpu";
87*c66ec88fSEmmanuel Vadot						ethernet = <&master>;
88*c66ec88fSEmmanuel Vadot					};
89*c66ec88fSEmmanuel Vadot
90*c66ec88fSEmmanuel Vadot					port@1 { /* external port 1 */
91*c66ec88fSEmmanuel Vadot						reg = <1>;
92*c66ec88fSEmmanuel Vadot						label = "lan1";
93*c66ec88fSEmmanuel Vadot					};
94*c66ec88fSEmmanuel Vadot
95*c66ec88fSEmmanuel Vadot					port@2 { /* external port 2 */
96*c66ec88fSEmmanuel Vadot						reg = <2>;
97*c66ec88fSEmmanuel Vadot						label = "lan2";
98*c66ec88fSEmmanuel Vadot					};
99*c66ec88fSEmmanuel Vadot				};
100*c66ec88fSEmmanuel Vadot			};
101*c66ec88fSEmmanuel Vadot		};
102*c66ec88fSEmmanuel Vadot	};
103