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