xref: /freebsd/sys/contrib/device-tree/Bindings/net/dsa/qca8k.txt (revision 5956d97f4b3204318ceb6aa9c77bd0bc6ea87a41)
1c66ec88fSEmmanuel Vadot* Qualcomm Atheros QCA8xxx switch family
2c66ec88fSEmmanuel Vadot
3c66ec88fSEmmanuel VadotRequired properties:
4c66ec88fSEmmanuel Vadot
5c66ec88fSEmmanuel Vadot- compatible: should be one of:
6*5956d97fSEmmanuel Vadot    "qca,qca8327"
7c66ec88fSEmmanuel Vadot    "qca,qca8334"
8c66ec88fSEmmanuel Vadot    "qca,qca8337"
9c66ec88fSEmmanuel Vadot
10c66ec88fSEmmanuel Vadot- #size-cells: must be 0
11c66ec88fSEmmanuel Vadot- #address-cells: must be 1
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel VadotOptional properties:
14c66ec88fSEmmanuel Vadot
15c66ec88fSEmmanuel Vadot- reset-gpios: GPIO to be used to reset the whole device
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel VadotSubnodes:
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel VadotThe integrated switch subnode should be specified according to the binding
20c66ec88fSEmmanuel Vadotdescribed in dsa/dsa.txt. If the QCA8K switch is connect to a SoC's external
21c66ec88fSEmmanuel Vadotmdio-bus each subnode describing a port needs to have a valid phandle
22c66ec88fSEmmanuel Vadotreferencing the internal PHY it is connected to. This is because there's no
23c66ec88fSEmmanuel VadotN:N mapping of port and PHY id.
24*5956d97fSEmmanuel VadotTo declare the internal mdio-bus configuration, declare a mdio node in the
25*5956d97fSEmmanuel Vadotswitch node and declare the phandle for the port referencing the internal
26*5956d97fSEmmanuel VadotPHY is connected to. In this config a internal mdio-bus is registered and
27*5956d97fSEmmanuel Vadotthe mdio MASTER is used as communication.
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel VadotDon't use mixed external and internal mdio-bus configurations, as this is
30c66ec88fSEmmanuel Vadotnot supported by the hardware.
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel VadotThe CPU port of this switch is always port 0.
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel VadotA CPU port node has the following optional node:
35c66ec88fSEmmanuel Vadot
36c66ec88fSEmmanuel Vadot- fixed-link            : Fixed-link subnode describing a link to a non-MDIO
37c66ec88fSEmmanuel Vadot                          managed entity. See
38c66ec88fSEmmanuel Vadot                          Documentation/devicetree/bindings/net/fixed-link.txt
39c66ec88fSEmmanuel Vadot                          for details.
40c66ec88fSEmmanuel Vadot
41c66ec88fSEmmanuel VadotFor QCA8K the 'fixed-link' sub-node supports only the following properties:
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot- 'speed' (integer, mandatory), to indicate the link speed. Accepted
44c66ec88fSEmmanuel Vadot  values are 10, 100 and 1000
45c66ec88fSEmmanuel Vadot- 'full-duplex' (boolean, optional), to indicate that full duplex is
46c66ec88fSEmmanuel Vadot  used. When absent, half duplex is assumed.
47c66ec88fSEmmanuel Vadot
48c66ec88fSEmmanuel VadotExamples:
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadotfor the external mdio-bus configuration:
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot	&mdio0 {
53c66ec88fSEmmanuel Vadot		phy_port1: phy@0 {
54c66ec88fSEmmanuel Vadot			reg = <0>;
55c66ec88fSEmmanuel Vadot		};
56c66ec88fSEmmanuel Vadot
57c66ec88fSEmmanuel Vadot		phy_port2: phy@1 {
58c66ec88fSEmmanuel Vadot			reg = <1>;
59c66ec88fSEmmanuel Vadot		};
60c66ec88fSEmmanuel Vadot
61c66ec88fSEmmanuel Vadot		phy_port3: phy@2 {
62c66ec88fSEmmanuel Vadot			reg = <2>;
63c66ec88fSEmmanuel Vadot		};
64c66ec88fSEmmanuel Vadot
65c66ec88fSEmmanuel Vadot		phy_port4: phy@3 {
66c66ec88fSEmmanuel Vadot			reg = <3>;
67c66ec88fSEmmanuel Vadot		};
68c66ec88fSEmmanuel Vadot
69c66ec88fSEmmanuel Vadot		phy_port5: phy@4 {
70c66ec88fSEmmanuel Vadot			reg = <4>;
71c66ec88fSEmmanuel Vadot		};
72c66ec88fSEmmanuel Vadot
73c66ec88fSEmmanuel Vadot		switch@10 {
74c66ec88fSEmmanuel Vadot			compatible = "qca,qca8337";
75c66ec88fSEmmanuel Vadot			#address-cells = <1>;
76c66ec88fSEmmanuel Vadot			#size-cells = <0>;
77c66ec88fSEmmanuel Vadot
78c66ec88fSEmmanuel Vadot			reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
79c66ec88fSEmmanuel Vadot			reg = <0x10>;
80c66ec88fSEmmanuel Vadot
81c66ec88fSEmmanuel Vadot			ports {
82c66ec88fSEmmanuel Vadot				#address-cells = <1>;
83c66ec88fSEmmanuel Vadot				#size-cells = <0>;
84c66ec88fSEmmanuel Vadot				port@0 {
85c66ec88fSEmmanuel Vadot					reg = <0>;
86c66ec88fSEmmanuel Vadot					label = "cpu";
87c66ec88fSEmmanuel Vadot					ethernet = <&gmac1>;
88c66ec88fSEmmanuel Vadot					phy-mode = "rgmii";
89c66ec88fSEmmanuel Vadot					fixed-link {
90c66ec88fSEmmanuel Vadot						speed = 1000;
91c66ec88fSEmmanuel Vadot						full-duplex;
92c66ec88fSEmmanuel Vadot					};
93c66ec88fSEmmanuel Vadot				};
94c66ec88fSEmmanuel Vadot
95c66ec88fSEmmanuel Vadot				port@1 {
96c66ec88fSEmmanuel Vadot					reg = <1>;
97c66ec88fSEmmanuel Vadot					label = "lan1";
98c66ec88fSEmmanuel Vadot					phy-handle = <&phy_port1>;
99c66ec88fSEmmanuel Vadot				};
100c66ec88fSEmmanuel Vadot
101c66ec88fSEmmanuel Vadot				port@2 {
102c66ec88fSEmmanuel Vadot					reg = <2>;
103c66ec88fSEmmanuel Vadot					label = "lan2";
104c66ec88fSEmmanuel Vadot					phy-handle = <&phy_port2>;
105c66ec88fSEmmanuel Vadot				};
106c66ec88fSEmmanuel Vadot
107c66ec88fSEmmanuel Vadot				port@3 {
108c66ec88fSEmmanuel Vadot					reg = <3>;
109c66ec88fSEmmanuel Vadot					label = "lan3";
110c66ec88fSEmmanuel Vadot					phy-handle = <&phy_port3>;
111c66ec88fSEmmanuel Vadot				};
112c66ec88fSEmmanuel Vadot
113c66ec88fSEmmanuel Vadot				port@4 {
114c66ec88fSEmmanuel Vadot					reg = <4>;
115c66ec88fSEmmanuel Vadot					label = "lan4";
116c66ec88fSEmmanuel Vadot					phy-handle = <&phy_port4>;
117c66ec88fSEmmanuel Vadot				};
118c66ec88fSEmmanuel Vadot
119c66ec88fSEmmanuel Vadot				port@5 {
120c66ec88fSEmmanuel Vadot					reg = <5>;
121c66ec88fSEmmanuel Vadot					label = "wan";
122c66ec88fSEmmanuel Vadot					phy-handle = <&phy_port5>;
123c66ec88fSEmmanuel Vadot				};
124c66ec88fSEmmanuel Vadot			};
125c66ec88fSEmmanuel Vadot		};
126c66ec88fSEmmanuel Vadot	};
127c66ec88fSEmmanuel Vadot
128c66ec88fSEmmanuel Vadotfor the internal master mdio-bus configuration:
129c66ec88fSEmmanuel Vadot
130c66ec88fSEmmanuel Vadot	&mdio0 {
131c66ec88fSEmmanuel Vadot		switch@10 {
132c66ec88fSEmmanuel Vadot			compatible = "qca,qca8337";
133c66ec88fSEmmanuel Vadot			#address-cells = <1>;
134c66ec88fSEmmanuel Vadot			#size-cells = <0>;
135c66ec88fSEmmanuel Vadot
136c66ec88fSEmmanuel Vadot			reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
137c66ec88fSEmmanuel Vadot			reg = <0x10>;
138c66ec88fSEmmanuel Vadot
139c66ec88fSEmmanuel Vadot			ports {
140c66ec88fSEmmanuel Vadot				#address-cells = <1>;
141c66ec88fSEmmanuel Vadot				#size-cells = <0>;
142c66ec88fSEmmanuel Vadot
143c66ec88fSEmmanuel Vadot				port@0 {
144c66ec88fSEmmanuel Vadot					reg = <0>;
145c66ec88fSEmmanuel Vadot					label = "cpu";
146c66ec88fSEmmanuel Vadot					ethernet = <&gmac1>;
147c66ec88fSEmmanuel Vadot					phy-mode = "rgmii";
148c66ec88fSEmmanuel Vadot					fixed-link {
149c66ec88fSEmmanuel Vadot						speed = 1000;
150c66ec88fSEmmanuel Vadot						full-duplex;
151c66ec88fSEmmanuel Vadot					};
152c66ec88fSEmmanuel Vadot				};
153c66ec88fSEmmanuel Vadot
154c66ec88fSEmmanuel Vadot				port@1 {
155c66ec88fSEmmanuel Vadot					reg = <1>;
156c66ec88fSEmmanuel Vadot					label = "lan1";
157*5956d97fSEmmanuel Vadot					phy-mode = "internal";
158*5956d97fSEmmanuel Vadot					phy-handle = <&phy_port1>;
159c66ec88fSEmmanuel Vadot				};
160c66ec88fSEmmanuel Vadot
161c66ec88fSEmmanuel Vadot				port@2 {
162c66ec88fSEmmanuel Vadot					reg = <2>;
163c66ec88fSEmmanuel Vadot					label = "lan2";
164*5956d97fSEmmanuel Vadot					phy-mode = "internal";
165*5956d97fSEmmanuel Vadot					phy-handle = <&phy_port2>;
166c66ec88fSEmmanuel Vadot				};
167c66ec88fSEmmanuel Vadot
168c66ec88fSEmmanuel Vadot				port@3 {
169c66ec88fSEmmanuel Vadot					reg = <3>;
170c66ec88fSEmmanuel Vadot					label = "lan3";
171*5956d97fSEmmanuel Vadot					phy-mode = "internal";
172*5956d97fSEmmanuel Vadot					phy-handle = <&phy_port3>;
173c66ec88fSEmmanuel Vadot				};
174c66ec88fSEmmanuel Vadot
175c66ec88fSEmmanuel Vadot				port@4 {
176c66ec88fSEmmanuel Vadot					reg = <4>;
177c66ec88fSEmmanuel Vadot					label = "lan4";
178*5956d97fSEmmanuel Vadot					phy-mode = "internal";
179*5956d97fSEmmanuel Vadot					phy-handle = <&phy_port4>;
180c66ec88fSEmmanuel Vadot				};
181c66ec88fSEmmanuel Vadot
182c66ec88fSEmmanuel Vadot				port@5 {
183c66ec88fSEmmanuel Vadot					reg = <5>;
184c66ec88fSEmmanuel Vadot					label = "wan";
185*5956d97fSEmmanuel Vadot					phy-mode = "internal";
186*5956d97fSEmmanuel Vadot					phy-handle = <&phy_port5>;
187*5956d97fSEmmanuel Vadot				};
188*5956d97fSEmmanuel Vadot			};
189*5956d97fSEmmanuel Vadot
190*5956d97fSEmmanuel Vadot			mdio {
191*5956d97fSEmmanuel Vadot				#address-cells = <1>;
192*5956d97fSEmmanuel Vadot				#size-cells = <0>;
193*5956d97fSEmmanuel Vadot
194*5956d97fSEmmanuel Vadot				phy_port1: phy@0 {
195*5956d97fSEmmanuel Vadot					reg = <0>;
196*5956d97fSEmmanuel Vadot				};
197*5956d97fSEmmanuel Vadot
198*5956d97fSEmmanuel Vadot				phy_port2: phy@1 {
199*5956d97fSEmmanuel Vadot					reg = <1>;
200*5956d97fSEmmanuel Vadot				};
201*5956d97fSEmmanuel Vadot
202*5956d97fSEmmanuel Vadot				phy_port3: phy@2 {
203*5956d97fSEmmanuel Vadot					reg = <2>;
204*5956d97fSEmmanuel Vadot				};
205*5956d97fSEmmanuel Vadot
206*5956d97fSEmmanuel Vadot				phy_port4: phy@3 {
207*5956d97fSEmmanuel Vadot					reg = <3>;
208*5956d97fSEmmanuel Vadot				};
209*5956d97fSEmmanuel Vadot
210*5956d97fSEmmanuel Vadot				phy_port5: phy@4 {
211*5956d97fSEmmanuel Vadot					reg = <4>;
212c66ec88fSEmmanuel Vadot				};
213c66ec88fSEmmanuel Vadot			};
214c66ec88fSEmmanuel Vadot		};
215c66ec88fSEmmanuel Vadot	};
216