xref: /freebsd/sys/contrib/device-tree/Bindings/net/dsa/lan9303.txt (revision 7ef62cebc2f965b0f640263e179276928885e33d)
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				ethernet = <&master>;
50*c66ec88fSEmmanuel Vadot			};
51*c66ec88fSEmmanuel Vadot
52*c66ec88fSEmmanuel Vadot			port@1 { /* external port 1 */
53*c66ec88fSEmmanuel Vadot				reg = <1>;
54*c66ec88fSEmmanuel Vadot				label = "lan1";
55*c66ec88fSEmmanuel Vadot			};
56*c66ec88fSEmmanuel Vadot
57*c66ec88fSEmmanuel Vadot			port@2 { /* external port 2 */
58*c66ec88fSEmmanuel Vadot				reg = <2>;
59*c66ec88fSEmmanuel Vadot				label = "lan2";
60*c66ec88fSEmmanuel Vadot			};
61*c66ec88fSEmmanuel Vadot		};
62*c66ec88fSEmmanuel Vadot	};
63*c66ec88fSEmmanuel Vadot
64*c66ec88fSEmmanuel VadotMDIO managed mode:
65*c66ec88fSEmmanuel Vadot
66*c66ec88fSEmmanuel Vadot	master: masterdevice@X {
67*c66ec88fSEmmanuel Vadot		phy-handle = <&switch>;
68*c66ec88fSEmmanuel Vadot
69*c66ec88fSEmmanuel Vadot		mdio {
70*c66ec88fSEmmanuel Vadot			#address-cells = <1>;
71*c66ec88fSEmmanuel Vadot			#size-cells = <0>;
72*c66ec88fSEmmanuel Vadot
73*c66ec88fSEmmanuel Vadot			switch: switch-phy@0 {
74*c66ec88fSEmmanuel Vadot				compatible = "smsc,lan9303-mdio";
75*c66ec88fSEmmanuel Vadot				reg = <0>;
76*c66ec88fSEmmanuel Vadot				reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
77*c66ec88fSEmmanuel Vadot				reset-duration = <100>;
78*c66ec88fSEmmanuel Vadot
79*c66ec88fSEmmanuel Vadot				ports {
80*c66ec88fSEmmanuel Vadot					#address-cells = <1>;
81*c66ec88fSEmmanuel Vadot					#size-cells = <0>;
82*c66ec88fSEmmanuel Vadot
83*c66ec88fSEmmanuel Vadot					port@0 {
84*c66ec88fSEmmanuel Vadot						reg = <0>;
85*c66ec88fSEmmanuel Vadot						ethernet = <&master>;
86*c66ec88fSEmmanuel Vadot					};
87*c66ec88fSEmmanuel Vadot
88*c66ec88fSEmmanuel Vadot					port@1 { /* external port 1 */
89*c66ec88fSEmmanuel Vadot						reg = <1>;
90*c66ec88fSEmmanuel Vadot						label = "lan1";
91*c66ec88fSEmmanuel Vadot					};
92*c66ec88fSEmmanuel Vadot
93*c66ec88fSEmmanuel Vadot					port@2 { /* external port 2 */
94*c66ec88fSEmmanuel Vadot						reg = <2>;
95*c66ec88fSEmmanuel Vadot						label = "lan2";
96*c66ec88fSEmmanuel Vadot					};
97*c66ec88fSEmmanuel Vadot				};
98*c66ec88fSEmmanuel Vadot			};
99*c66ec88fSEmmanuel Vadot		};
100*c66ec88fSEmmanuel Vadot	};
101