ramips: add support for Sercomm CPJ routers
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_beeline_smartbox-giga.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "beeline,smartbox-giga", "mediatek,mt7621-soc";
11 model = "Beeline SmartBox GIGA";
12
13 aliases {
14 label-mac-device = &gmac0;
15
16 led-boot = &led_status_green;
17 led-failsafe = &led_status_red;
18 led-running = &led_status_green;
19 led-upgrade = &led_status_red;
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 led_status_green: led-0 {
26 label = "green:status";
27 color = <LED_COLOR_ID_GREEN>;
28 function = LED_FUNCTION_STATUS;
29 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
30 };
31
32 led-1 {
33 label = "blue:wan";
34 color = <LED_COLOR_ID_BLUE>;
35 function = LED_FUNCTION_WAN;
36 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
37 };
38
39 led_status_red: led-2 {
40 label = "red:status";
41 color = <LED_COLOR_ID_RED>;
42 function = LED_FUNCTION_STATUS;
43 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
44 };
45 };
46
47 keys {
48 compatible = "gpio-keys";
49
50 reset {
51 label = "reset";
52 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_RESTART>;
54 };
55 };
56
57 ubi-concat {
58 compatible = "mtd-concat";
59 devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2 \
60 &ubiconcat3>;
61
62 partitions {
63 compatible = "fixed-partitions";
64 #address-cells = <1>;
65 #size-cells = <1>;
66
67 partition@0 {
68 label = "ubi";
69 reg = <0x0 0x5400000>;
70 };
71 };
72 };
73 };
74
75 &nand {
76 status = "okay";
77
78 partitions {
79 compatible = "sercomm,sc-partitions", "fixed-partitions";
80 #address-cells = <1>;
81 #size-cells = <1>;
82
83 partition@0 {
84 label = "u-boot";
85 reg = <0x0 0x100000>;
86 sercomm,scpart-id = <0>;
87 read-only;
88 };
89
90 partition@100000 {
91 label = "dynamic partition map";
92 reg = <0x100000 0x100000>;
93 sercomm,scpart-id = <1>;
94 };
95
96 factory: partition@200000 {
97 compatible = "nvmem-cells";
98 label = "Factory";
99 reg = <0x200000 0x100000>;
100 #address-cells = <1>;
101 #size-cells = <1>;
102 sercomm,scpart-id = <2>;
103 read-only;
104
105 eeprom_factory_0: eeprom@0 {
106 reg = <0x0 0x400>;
107 };
108
109 eeprom_factory_8000: eeprom@8000 {
110 reg = <0x8000 0x4da8>;
111 };
112
113 macaddr_factory_21000: macaddr@21000 {
114 reg = <0x21000 0x6>;
115 };
116 };
117
118 partition@300000 {
119 label = "Boot Flag";
120 reg = <0x300000 0x100000>;
121 sercomm,scpart-id = <3>;
122 };
123
124 partition@400000 {
125 label = "kernel";
126 reg = <0x400000 0x600000>;
127 sercomm,scpart-id = <4>;
128 };
129
130 partition@a00000 {
131 label = "Kernel 2";
132 reg = <0xa00000 0x600000>;
133 sercomm,scpart-id = <5>;
134 read-only;
135 };
136
137 ubiconcat0: partition@1000000 {
138 label = "File System 1";
139 reg = <0x1000000 0x1800000>;
140 sercomm,scpart-id = <6>;
141 };
142
143 partition@2800000 {
144 label = "File System 2";
145 reg = <0x2800000 0x1800000>;
146 sercomm,scpart-id = <7>;
147 read-only;
148 };
149
150 ubiconcat1: partition@4000000 {
151 label = "Configuration/log";
152 reg = <0x4000000 0x800000>;
153 sercomm,scpart-id = <8>;
154 };
155
156 ubiconcat2: partition@4800000 {
157 label = "application tmp buffer (Ftool)";
158 reg = <0x4800000 0xc00000>;
159 sercomm,scpart-id = <9>;
160 };
161
162 ubiconcat3: partition@5400000 {
163 label = "container";
164 reg = <0x5400000 0x2800000>;
165 sercomm,scpart-id = <10>;
166 };
167
168 partition@7c00000 {
169 label = "bad block reserved";
170 reg = <0x7c00000 0x380000>;
171 sercomm,scpart-id = <11>;
172 read-only;
173 };
174 };
175 };
176
177 &pcie {
178 status = "okay";
179 };
180
181 &pcie0 {
182 wifi@0,0 {
183 compatible = "mediatek,mt76";
184 reg = <0x0000 0 0 0 0>;
185 ieee80211-freq-limit = <5000000 6000000>;
186
187 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000>;
188 nvmem-cell-names = "eeprom", "mac-address";
189 mac-address-increment = <(5)>;
190 };
191 };
192
193 &pcie1 {
194 wifi@0,0 {
195 compatible = "mediatek,mt76";
196 reg = <0x0000 0 0 0 0>;
197 ieee80211-freq-limit = <2400000 2500000>;
198
199 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>;
200 nvmem-cell-names = "eeprom", "mac-address";
201 mac-address-increment = <(4)>;
202 };
203 };
204
205 &gmac0 {
206 nvmem-cells = <&macaddr_factory_21000>;
207 nvmem-cell-names = "mac-address";
208 };
209
210 &gmac1 {
211 status = "okay";
212 label = "wan";
213 phy-handle = <&ethphy0>;
214
215 nvmem-cells = <&macaddr_factory_21000>;
216 nvmem-cell-names = "mac-address";
217 mac-address-increment = <(1)>;
218 };
219
220 &mdio {
221 ethphy0: ethernet-phy@0 {
222 reg = <0>;
223 };
224 };
225
226 &switch0 {
227 ports {
228 port@1 {
229 status = "okay";
230 label = "lan1";
231 };
232
233 port@2 {
234 status = "okay";
235 label = "lan2";
236 };
237 };
238 };
239
240 &uartlite3 {
241 status = "okay";
242 };
243
244 &state_default {
245 gpio {
246 groups = "i2c", "jtag";
247 function = "gpio";
248 };
249 };