ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.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 &ethernet {
151 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
152 };
153
154 &gmac0 {
155 nvmem-cells = <&macaddr_factory_e000>;
156 nvmem-cell-names = "mac-address";
157 };
158
159 &switch0 {
160 ports {
161 port@0 {
162 status = "okay";
163 label = "lan4";
164 };
165
166 port@1 {
167 status = "okay";
168 label = "lan3";
169 };
170
171 port@2 {
172 status = "okay";
173 label = "lan2";
174 };
175
176 port@3 {
177 status = "okay";
178 label = "lan1";
179 };
180
181 port@4 {
182 status = "okay";
183 label = "wan";
184 nvmem-cells = <&macaddr_factory_e006>;
185 nvmem-cell-names = "mac-address";
186 };
187 };
188 };
189
190 &i2c {
191 status = "okay";
192
193 rtc@68 {
194 compatible = "ti,bq32000";
195 reg = <0x68>;
196 };
197 };
198
199 &pcie {
200 status = "okay";
201 };
202
203 &state_default {
204 gpio {
205 groups = "jtag", "rgmii2", "wdt";
206 function = "gpio";
207 };
208 };
209
210 &sdhci {
211 status = "okay";
212 };
213
214 &spi0 {
215 status = "okay";
216
217 flash@0 {
218 compatible = "jedec,spi-nor";
219 reg = <0>;
220 spi-max-frequency = <50000000>;
221 m25p,fast-read;
222
223 partitions {
224 compatible = "fixed-partitions";
225 #address-cells = <1>;
226 #size-cells = <1>;
227
228 partition@0 {
229 label = "u-boot";
230 reg = <0x0 0x30000>;
231 };
232
233 partition@30000 {
234 label = "u-boot-env";
235 reg = <0x30000 0x1000>;
236 };
237
238 partition@31000 {
239 label = "config";
240 reg = <0x31000 0xf000>;
241 read-only;
242 };
243
244 factory: partition@40000 {
245 label = "factory";
246 reg = <0x40000 0x10000>;
247 read-only;
248
249 nvmem-layout {
250 compatible = "fixed-layout";
251 #address-cells = <1>;
252 #size-cells = <1>;
253
254 macaddr_factory_e000: macaddr@e000 {
255 reg = <0xe000 0x6>;
256 };
257
258 macaddr_factory_e006: macaddr@e006 {
259 reg = <0xe006 0x6>;
260 };
261 };
262 };
263
264 partition@50000 {
265 compatible = "denx,uimage";
266 label = "firmware";
267 reg = <0x50000 0xfb0000>;
268 };
269 };
270 };
271 };
272
273 &uartlite2 {
274 status = "okay";
275 };
276
277 &uartlite3 {
278 status = "okay";
279 };