ramips: convert mtd-mac-address to nvmem implementation
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_alfa-network_quad-e4g.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
8 / {
9 compatible = "alfa-network,quad-e4g", "mediatek,mt7621-soc";
10 model = "ALFA Network Quad-E4G";
11
12 aliases {
13 label-mac-device = &gmac0;
14 led-boot = &led_system;
15 led-failsafe = &led_system;
16 led-running = &led_system;
17 led-upgrade = &led_system;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 gpio-export {
25 compatible = "gpio-export";
26 #size-cells = <0>;
27
28 m2-enable {
29 gpio-export,name = "m2-enable";
30 gpio-export,output = <1>;
31 gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
32 };
33
34 minipcie0-enable {
35 gpio-export,name = "minipcie0-enable";
36 gpio-export,output = <1>;
37 gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
38 };
39
40 minipcie0-reset {
41 gpio-export,name = "minipcie0-reset";
42 gpio-export,output = <0>;
43 gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
44 };
45
46 minipcie1-enable {
47 gpio-export,name = "minipcie1-enable";
48 gpio-export,output = <1>;
49 gpios = <&gpio 30 GPIO_ACTIVE_HIGH>;
50 };
51
52 minipcie1-reset {
53 gpio-export,name = "minipcie1-reset";
54 gpio-export,output = <0>;
55 gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
56 };
57
58 minipcie2-enable {
59 gpio-export,name = "minipcie2-enable";
60 gpio-export,output = <1>;
61 gpios = <&gpio 31 GPIO_ACTIVE_HIGH>;
62 };
63
64 minipcie2-reset {
65 gpio-export,name = "minipcie2-reset";
66 gpio-export,output = <0>;
67 gpios = <&gpio 25 GPIO_ACTIVE_HIGH>;
68 };
69
70 pcie-perst-disable {
71 gpio-export,name = "pcie-perst-enable";
72 gpio-export,output = <0>;
73 gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
74 };
75
76 sim-select {
77 gpio-export,name = "sim-select";
78 gpio-export,output = <1>;
79 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
80 };
81
82 watchdog-enable {
83 gpio-export,name = "watchdog-enable";
84 gpio-export,output = <1>;
85 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
86 };
87 };
88
89 keys {
90 compatible = "gpio-keys";
91
92 reset {
93 label = "reset";
94 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
95 linux,code = <KEY_RESTART>;
96 };
97
98 user1 {
99 label = "user1";
100 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
101 linux,code = <BTN_0>;
102 };
103
104 user2 {
105 label = "user2";
106 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
107 linux,code = <BTN_1>;
108 };
109 };
110
111 leds {
112 compatible = "gpio-leds";
113
114 led_system: system {
115 label = "red:system";
116 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
117 default-state = "keep";
118 };
119
120 m2 {
121 label = "orange:m2";
122 gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
123 };
124
125 minipcie0 {
126 label = "orange:minipcie0";
127 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
128 };
129
130 minipcie1 {
131 label = "orange:minipcie1";
132 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
133 };
134
135 minipcie2 {
136 label = "orange:minipcie2";
137 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
138 };
139 };
140
141 watchdog {
142 compatible = "linux,wdt-gpio";
143 gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
144 hw_algo = "toggle";
145 hw_margin_ms = <25000>;
146 always-running;
147 };
148 };
149
150 &gmac0 {
151 nvmem-cells = <&macaddr_factory_e000>;
152 nvmem-cell-names = "mac-address";
153 };
154
155 &switch0 {
156 ports {
157 port@0 {
158 status = "okay";
159 label = "lan4";
160 };
161
162 port@1 {
163 status = "okay";
164 label = "lan3";
165 };
166
167 port@2 {
168 status = "okay";
169 label = "lan2";
170 };
171
172 port@3 {
173 status = "okay";
174 label = "lan1";
175 };
176
177 port@4 {
178 status = "okay";
179 label = "wan";
180 nvmem-cells = <&macaddr_factory_e006>;
181 nvmem-cell-names = "mac-address";
182 };
183 };
184 };
185
186 &i2c {
187 status = "okay";
188
189 rtc@68 {
190 compatible = "ti,bq32000";
191 reg = <0x68>;
192 };
193 };
194
195 &pcie {
196 status = "okay";
197 };
198
199 &state_default {
200 gpio {
201 groups = "jtag", "rgmii2", "wdt";
202 function = "gpio";
203 };
204 };
205
206 &sdhci {
207 status = "okay";
208 };
209
210 &spi0 {
211 status = "okay";
212
213 flash@0 {
214 compatible = "jedec,spi-nor";
215 reg = <0>;
216 spi-max-frequency = <50000000>;
217 m25p,fast-read;
218
219 partitions {
220 compatible = "fixed-partitions";
221 #address-cells = <1>;
222 #size-cells = <1>;
223
224 partition@0 {
225 label = "u-boot";
226 reg = <0x0 0x30000>;
227 };
228
229 partition@30000 {
230 label = "u-boot-env";
231 reg = <0x30000 0x1000>;
232 };
233
234 partition@31000 {
235 label = "config";
236 reg = <0x31000 0xf000>;
237 read-only;
238 };
239
240 factory: partition@40000 {
241 label = "factory";
242 reg = <0x40000 0x10000>;
243 read-only;
244 };
245
246 partition@50000 {
247 compatible = "denx,uimage";
248 label = "firmware";
249 reg = <0x50000 0xfb0000>;
250 };
251 };
252 };
253 };
254
255 &uartlite2 {
256 status = "okay";
257 };
258
259 &uartlite3 {
260 status = "okay";
261 };
262
263 &factory {
264 compatible = "nvmem-cells";
265 #address-cells = <1>;
266 #size-cells = <1>;
267
268 macaddr_factory_e000: macaddr@e000 {
269 reg = <0xe000 0x6>;
270 };
271
272 macaddr_factory_e006: macaddr@e006 {
273 reg = <0xe006 0x6>;
274 };
275 };