forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/Documentation/devicetree/bindings/net/dsa/qca8k.txt
....@@ -9,13 +9,22 @@
99 - #size-cells: must be 0
1010 - #address-cells: must be 1
1111
12
+Optional properties:
13
+
14
+- reset-gpios: GPIO to be used to reset the whole device
15
+
1216 Subnodes:
1317
1418 The integrated switch subnode should be specified according to the binding
15
-described in dsa/dsa.txt. As the QCA8K switches do not have a N:N mapping of
16
-port and PHY id, each subnode describing a port needs to have a valid phandle
17
-referencing the internal PHY connected to it. The CPU port of this switch is
18
-always port 0.
19
+described in dsa/dsa.txt. If the QCA8K switch is connect to a SoC's external
20
+mdio-bus each subnode describing a port needs to have a valid phandle
21
+referencing the internal PHY it is connected to. This is because there's no
22
+N:N mapping of port and PHY id.
23
+
24
+Don't use mixed external and internal mdio-bus configurations, as this is
25
+not supported by the hardware.
26
+
27
+The CPU port of this switch is always port 0.
1928
2029 A CPU port node has the following optional node:
2130
....@@ -31,8 +40,9 @@
3140 - 'full-duplex' (boolean, optional), to indicate that full duplex is
3241 used. When absent, half duplex is assumed.
3342
34
-Example:
43
+Examples:
3544
45
+for the external mdio-bus configuration:
3646
3747 &mdio0 {
3848 phy_port1: phy@0 {
....@@ -55,12 +65,13 @@
5565 reg = <4>;
5666 };
5767
58
- switch0@0 {
68
+ switch@10 {
5969 compatible = "qca,qca8337";
6070 #address-cells = <1>;
6171 #size-cells = <0>;
6272
63
- reg = <0>;
73
+ reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
74
+ reg = <0x10>;
6475
6576 ports {
6677 #address-cells = <1>;
....@@ -108,3 +119,57 @@
108119 };
109120 };
110121 };
122
+
123
+for the internal master mdio-bus configuration:
124
+
125
+ &mdio0 {
126
+ switch@10 {
127
+ compatible = "qca,qca8337";
128
+ #address-cells = <1>;
129
+ #size-cells = <0>;
130
+
131
+ reset-gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
132
+ reg = <0x10>;
133
+
134
+ ports {
135
+ #address-cells = <1>;
136
+ #size-cells = <0>;
137
+
138
+ port@0 {
139
+ reg = <0>;
140
+ label = "cpu";
141
+ ethernet = <&gmac1>;
142
+ phy-mode = "rgmii";
143
+ fixed-link {
144
+ speed = 1000;
145
+ full-duplex;
146
+ };
147
+ };
148
+
149
+ port@1 {
150
+ reg = <1>;
151
+ label = "lan1";
152
+ };
153
+
154
+ port@2 {
155
+ reg = <2>;
156
+ label = "lan2";
157
+ };
158
+
159
+ port@3 {
160
+ reg = <3>;
161
+ label = "lan3";
162
+ };
163
+
164
+ port@4 {
165
+ reg = <4>;
166
+ label = "lan4";
167
+ };
168
+
169
+ port@5 {
170
+ reg = <5>;
171
+ label = "wan";
172
+ };
173
+ };
174
+ };
175
+ };