ramips: mt7621: convert to nvmem-layout
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_etisalat_s3.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 = "etisalat,s3", "mediatek,mt7621-soc";
11 model = "Etisalat S3";
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 label = "Factory";
104 reg = <0x200000 0x100000>;
105 sercomm,scpart-id = <2>;
106 read-only;
107
108 nvmem-layout {
109 compatible = "fixed-layout";
110 #address-cells = <1>;
111 #size-cells = <1>;
112
113 eeprom_factory_0: eeprom@0 {
114 reg = <0x0 0x400>;
115 };
116
117 eeprom_factory_8000: eeprom@8000 {
118 reg = <0x8000 0x4da8>;
119 };
120
121 macaddr_factory_21000: macaddr@21000 {
122 reg = <0x21000 0x6>;
123 };
124 };
125 };
126
127 partition@300000 {
128 label = "Boot Flag";
129 reg = <0x300000 0x100000>;
130 sercomm,scpart-id = <3>;
131 };
132
133 partition@400000 {
134 label = "kernel";
135 reg = <0x400000 0x600000>;
136 sercomm,scpart-id = <4>;
137 };
138
139 partition@a00000 {
140 label = "Kernel 2";
141 reg = <0xa00000 0x600000>;
142 sercomm,scpart-id = <5>;
143 read-only;
144 };
145
146 ubiconcat0: partition@1000000 {
147 label = "File System 1";
148 reg = <0x1000000 0x2000000>;
149 sercomm,scpart-id = <6>;
150 };
151
152 partition@3000000 {
153 label = "File System 2";
154 reg = <0x3000000 0x2000000>;
155 sercomm,scpart-id = <7>;
156 read-only;
157 };
158
159 ubiconcat1: partition@5000000 {
160 label = "Configuration/log";
161 reg = <0x5000000 0x1400000>;
162 sercomm,scpart-id = <8>;
163 };
164
165 ubiconcat2: partition@6400000 {
166 label = "application tmp buffer (Ftool)";
167 reg = <0x6400000 0x1b80000>;
168 sercomm,scpart-id = <9>;
169 };
170 };
171 };
172
173 &pcie {
174 status = "okay";
175 };
176
177 &pcie0 {
178 wifi@0,0 {
179 compatible = "mediatek,mt76";
180 reg = <0x0000 0 0 0 0>;
181 ieee80211-freq-limit = <5000000 6000000>;
182
183 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_21000>;
184 nvmem-cell-names = "eeprom", "mac-address";
185 mac-address-increment = <(3)>;
186 };
187 };
188
189 &pcie1 {
190 wifi@0,0 {
191 compatible = "mediatek,mt76";
192 reg = <0x0000 0 0 0 0>;
193 ieee80211-freq-limit = <2400000 2500000>;
194
195 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_21000>;
196 nvmem-cell-names = "eeprom", "mac-address";
197 mac-address-increment = <(2)>;
198 };
199 };
200
201 &gmac0 {
202 nvmem-cells = <&macaddr_factory_21000>;
203 nvmem-cell-names = "mac-address";
204 };
205
206 &gmac1 {
207 status = "okay";
208 label = "wan";
209 phy-handle = <&ethphy0>;
210
211 nvmem-cells = <&macaddr_factory_21000>;
212 nvmem-cell-names = "mac-address";
213 mac-address-increment = <(11)>;
214 };
215
216 &mdio {
217 ethphy0: ethernet-phy@0 {
218 reg = <0>;
219 };
220 };
221
222 &switch0 {
223 ports {
224 port@1 {
225 status = "okay";
226 label = "lan1";
227 };
228
229 port@2 {
230 status = "okay";
231 label = "lan2";
232 };
233
234 port@3 {
235 status = "okay";
236 label = "lan3";
237 };
238
239 port@4 {
240 status = "okay";
241 label = "lan4";
242 };
243 };
244 };
245
246 &uartlite3 {
247 status = "okay";
248 };
249
250 &state_default {
251 gpio {
252 groups = "i2c", "jtag";
253 function = "gpio";
254 };
255 };