09d5aff0fee49637897ba78745599c57e3e32456
[openwrt/openwrt.git] / target / linux / rtl838x / dts / rtl8382_allnet_all-sg8208m.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /dts-v1/;
3
4 #include "rtl838x.dtsi"
5
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/gpio/gpio.h>
8
9 / {
10 compatible = "allnet,all-sg8208m", "realtek,rtl838x-soc";
11 model = "ALLNET ALL-SG8208M";
12
13 aliases {
14 led-boot = &led_sys;
15 led-failsafe = &led_sys;
16 led-running = &led_sys;
17 led-upgrade = &led_sys;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys-polled";
26 poll-interval = <20>;
27
28 reset {
29 label = "reset";
30 gpios = <&gpio0 67 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33 };
34
35 leds {
36 compatible = "gpio-leds";
37
38 led_sys: sys {
39 label = "all-sg8208m:green:sys";
40 gpios = <&gpio0 47 GPIO_ACTIVE_HIGH>;
41 };
42 // GPIO 25: power on/off all port leds
43 };
44 };
45
46 &gpio0 {
47 indirect-access-bus-id = <0>;
48 };
49
50 &spi0 {
51 status = "okay";
52
53 flash@0 {
54 compatible = "jedec,spi-nor";
55 reg = <0>;
56 spi-max-frequency = <10000000>;
57
58 partitions {
59 compatible = "fixed-partitions";
60 #address-cells = <1>;
61 #size-cells = <1>;
62
63 partition@0 {
64 label = "u-boot";
65 reg = <0x0 0x80000>;
66 read-only;
67 };
68
69 partition@80000 {
70 label = "u-boot-env";
71 reg = <0x80000 0x10000>;
72 read-only;
73 };
74
75 partition@90000 {
76 label = "u-boot-env2";
77 reg = <0x90000 0x10000>;
78 read-only;
79 };
80
81 partition@a0000 {
82 label = "jffs";
83 reg = <0xa0000 0x100000>;
84 };
85
86 partition@1a0000 {
87 label = "jffs2";
88 reg = <0x1a0000 0x100000>;
89 };
90
91 partition@2a0000 {
92 label = "firmware";
93 reg = <0x2a0000 0xd60000>;
94 compatible = "allnet,uimage";
95 };
96 };
97 };
98 };
99
100 &ethernet0 {
101 mdio: mdio-bus {
102 compatible = "realtek,rtl838x-mdio";
103 regmap = <&ethernet0>;
104 #address-cells = <1>;
105 #size-cells = <0>;
106
107 /* Internal phy */
108 phy8: ethernet-phy@8 {
109 reg = <8>;
110 compatible = "ethernet-phy-ieee802.3-c22";
111 };
112
113 phy9: ethernet-phy@9 {
114 reg = <9>;
115 compatible = "ethernet-phy-ieee802.3-c22";
116 };
117
118 phy10: ethernet-phy@10 {
119 reg = <10>;
120 compatible = "ethernet-phy-ieee802.3-c22";
121 };
122
123 phy11: ethernet-phy@11 {
124 reg = <11>;
125 compatible = "ethernet-phy-ieee802.3-c22";
126 };
127
128 phy12: ethernet-phy@12 {
129 reg = <12>;
130 compatible = "ethernet-phy-ieee802.3-c22";
131 };
132
133 phy13: ethernet-phy@13 {
134 reg = <13>;
135 compatible = "ethernet-phy-ieee802.3-c22";
136 };
137
138 phy14: ethernet-phy@14 {
139 reg = <14>;
140 compatible = "ethernet-phy-ieee802.3-c22";
141 };
142
143 phy15: ethernet-phy@15 {
144 reg = <15>;
145 compatible = "ethernet-phy-ieee802.3-c22";
146 };
147 };
148 };
149
150 &switch0 {
151 ports {
152 #address-cells = <1>;
153 #size-cells = <0>;
154
155 port@0 {
156 reg = <8>;
157 label = "lan1";
158 phy-handle = <&phy8>;
159 phy-mode = "internal";
160 };
161
162 port@1 {
163 reg = <9>;
164 label = "lan2";
165 phy-handle = <&phy9>;
166 phy-mode = "internal";
167 };
168
169 port@2 {
170 reg = <10>;
171 label = "lan3";
172 phy-handle = <&phy10>;
173 phy-mode = "internal";
174 };
175
176 port@3 {
177 reg = <11>;
178 label = "lan4";
179 phy-handle = <&phy11>;
180 phy-mode = "internal";
181 };
182
183 port@4 {
184 reg = <12>;
185 label = "lan5";
186 phy-handle = <&phy12>;
187 phy-mode = "internal";
188 };
189
190 port@5 {
191 reg = <13>;
192 label = "lan6";
193 phy-handle = <&phy13>;
194 phy-mode = "internal";
195 };
196
197 port@6 {
198 reg = <14>;
199 label = "lan7";
200 phy-handle = <&phy14>;
201 phy-mode = "internal";
202 };
203
204 port@7 {
205 reg = <15>;
206 label = "lan8";
207 phy-handle = <&phy15>;
208 phy-mode = "internal";
209 };
210
211 port@28 {
212 ethernet = <&ethernet0>;
213 reg = <28>;
214 phy-mode = "internal";
215 fixed-link {
216 speed = <1000>;
217 full-duplex;
218 };
219 };
220 };
221 };