ramips: convert MT7603 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_beeline_smartbox-turbo-plus.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-turbo-plus", "mediatek,mt7621-soc";
11 model = "Beeline SmartBox TURBO+";
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-0 {
26 label = "blue:wan";
27 color = <LED_COLOR_ID_BLUE>;
28 function = LED_FUNCTION_WAN;
29 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
30 };
31
32 led_status_green: led-1 {
33 label = "green:status";
34 color = <LED_COLOR_ID_GREEN>;
35 function = LED_FUNCTION_STATUS;
36 gpios = <&gpio 15 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 16 GPIO_ACTIVE_HIGH>;
44 };
45 };
46
47 keys {
48 compatible = "gpio-keys";
49
50 wps {
51 label = "wps";
52 gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
53 linux,code = <KEY_WPS_BUTTON>;
54 };
55
56 reset {
57 label = "reset";
58 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
59 linux,code = <KEY_RESTART>;
60 };
61 };
62
63 ubi-concat {
64 compatible = "mtd-concat";
65 devices = <&ubiconcat0 &ubiconcat1 &ubiconcat2>;
66
67 partitions {
68 compatible = "fixed-partitions";
69 #address-cells = <1>;
70 #size-cells = <1>;
71
72 partition@0 {
73 label = "ubi";
74 reg = <0x0 0x4f80000>;
75 };
76 };
77 };
78 };
79
80 &nand {
81 status = "okay";
82
83 partitions {
84 compatible = "sercomm,sc-partitions", "fixed-partitions";
85 #address-cells = <1>;
86 #size-cells = <1>;
87
88 partition@0 {
89 label = "u-boot";
90 reg = <0x0 0x100000>;
91 sercomm,scpart-id = <0>;
92 read-only;
93 };
94
95 partition@100000 {
96 label = "dynamic partition map";
97 reg = <0x100000 0x100000>;
98 sercomm,scpart-id = <1>;
99 read-only;
100 };
101
102 factory: partition@200000 {
103 compatible = "nvmem-cells";
104 label = "Factory";
105 reg = <0x200000 0x100000>;
106 #address-cells = <1>;
107 #size-cells = <1>;
108 sercomm,scpart-id = <2>;
109 read-only;
110
111 eeprom_factory_0: eeprom@0 {
112 reg = <0x0 0x400>;
113 };
114
115 macaddr_factory_21000: macaddr@21000 {
116 reg = <0x21000 0x6>;
117 };
118 };
119
120 partition@300000 {
121 label = "Boot Flag";
122 reg = <0x300000 0x100000>;
123 sercomm,scpart-id = <3>;
124 };
125
126 partition@400000 {
127 label = "kernel";
128 reg = <0x400000 0x600000>;
129 sercomm,scpart-id = <4>;
130 };
131
132 partition@a00000 {
133 label = "Kernel 2";
134 reg = <0xa00000 0x600000>;
135 sercomm,scpart-id = <5>;
136 read-only;
137 };
138
139 ubiconcat0: partition@1000000 {
140 label = "File System 1";
141 reg = <0x1000000 0x2000000>;
142 sercomm,scpart-id = <6>;
143 };
144
145 partition@3000000 {
146 label = "File System 2";
147 reg = <0x3000000 0x2000000>;
148 sercomm,scpart-id = <7>;
149 read-only;
150 };
151
152 ubiconcat1: partition@5000000 {
153 label = "Configuration/log";
154 reg = <0x5000000 0x1400000>;
155 sercomm,scpart-id = <8>;
156 };
157
158 ubiconcat2: partition@6400000 {
159 label = "application tmp buffer (Ftool)";
160 reg = <0x6400000 0x1b80000>;
161 sercomm,scpart-id = <9>;
162 };
163 };
164 };
165
166 &pcie {
167 status = "okay";
168 };
169
170 &pcie0 {
171 wifi@0,0 {
172 compatible = "mediatek,mt76";
173 reg = <0x0000 0 0 0 0>;
174 mediatek,mtd-eeprom = <&factory 0x8000>;
175 ieee80211-freq-limit = <5000000 6000000>;
176
177 nvmem-cells = <&macaddr_factory_21000>;
178 nvmem-cell-names = "mac-address";
179 mac-address-increment = <(5)>;
180 };
181 };
182
183 &pcie1 {
184 wifi@0,0 {
185 compatible = "mediatek,mt76";
186 reg = <0x0000 0 0 0 0>;
187 ieee80211-freq-limit = <2400000 2500000>;
188
189 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>;
190 nvmem-cell-names = "eeprom", "mac-address";
191 mac-address-increment = <(4)>;
192 };
193 };
194
195 &gmac0 {
196 nvmem-cells = <&macaddr_factory_21000>;
197 nvmem-cell-names = "mac-address";
198 };
199
200 &gmac1 {
201 status = "okay";
202 label = "wan";
203 phy-handle = <&ethphy0>;
204
205 nvmem-cells = <&macaddr_factory_21000>;
206 nvmem-cell-names = "mac-address";
207 mac-address-increment = <(1)>;
208 };
209
210 &mdio {
211 ethphy0: ethernet-phy@0 {
212 reg = <0>;
213 };
214 };
215
216 &switch0 {
217 ports {
218 port@1 {
219 status = "okay";
220 label = "lan1";
221 };
222
223 port@2 {
224 status = "okay";
225 label = "lan2";
226 };
227
228 port@3 {
229 status = "okay";
230 label = "lan3";
231 };
232
233 port@4 {
234 status = "okay";
235 label = "lan4";
236 };
237 };
238 };
239
240 &uartlite3 {
241 status = "okay";
242 current-speed = <57600>;
243 };
244
245 &state_default {
246 gpio {
247 groups = "i2c", "jtag";
248 function = "gpio";
249 };
250 };