ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_iodata_wn-deax1800gr.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 = "iodata,wn-deax1800gr", "mediatek,mt7621-soc";
11 model = "I-O DATA WN-DEAX1800GR";
12
13 aliases {
14 led-boot = &led_status_green;
15 led-failsafe = &led_status_red;
16 led-upgrade = &led_status_green;
17 label-mac-device = &gmac1;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_status_green: led-0 {
28 label = "green:status";
29 gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
30 color = <LED_COLOR_ID_GREEN>;
31 function = LED_FUNCTION_STATUS;
32 };
33
34 led_status_red: led-1 {
35 label = "red:status";
36 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
37 color = <LED_COLOR_ID_RED>;
38 function = LED_FUNCTION_STATUS;
39 };
40
41 led-2 {
42 label = "green:wps_wifi";
43 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
44 color = <LED_COLOR_ID_GREEN>;
45 function = LED_FUNCTION_WPS;
46 };
47
48 led-3 {
49 label = "green:power";
50 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
51 color = <LED_COLOR_ID_GREEN>;
52 function = LED_FUNCTION_POWER;
53 default-state = "on";
54 };
55
56 led-4 {
57 label = "green:router";
58 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
59 color = <LED_COLOR_ID_GREEN>;
60 function = LED_FUNCTION_INDICATOR;
61 };
62
63 led-5 {
64 label = "green:internet";
65 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
66 color = <LED_COLOR_ID_GREEN>;
67 function = LED_FUNCTION_WAN;
68 };
69 };
70
71 keys {
72 compatible = "gpio-keys";
73
74 wps {
75 label = "wps";
76 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
77 linux,code = <KEY_WPS_BUTTON>;
78 };
79
80 reset {
81 label = "reset";
82 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
83 linux,code = <KEY_RESTART>;
84 };
85
86 led_on {
87 label = "led_on";
88 gpios = <&gpio 10 GPIO_ACTIVE_HIGH>;
89 linux,code = <BTN_0>;
90 linux,input-type = <EV_SW>;
91 };
92 };
93 };
94
95 &nand {
96 status = "okay";
97
98 mediatek,nmbm;
99 mediatek,bmt-remap-range =
100 <0x0000000 0x780000>, /* u-boot - kernel1(6 MiB) */
101 <0x2f80000 0x600000>, /* kernel2 - kernel2(6 MiB) */
102 <0x5d80000 0x780000>; /* storage - working */
103
104 partitions {
105 compatible = "fixed-partitions";
106 #address-cells = <1>;
107 #size-cells = <1>;
108
109 partition@0 {
110 label = "u-boot";
111 reg = <0x0 0x80000>;
112 read-only;
113 };
114
115 partition@80000 {
116 label = "u-boot-env";
117 reg = <0x80000 0x80000>;
118 read-only;
119 };
120
121 partition@100000 {
122 label = "factory";
123 reg = <0x100000 0x80000>;
124 read-only;
125
126 nvmem-layout {
127 compatible = "fixed-layout";
128 #address-cells = <1>;
129 #size-cells = <1>;
130
131 eeprom: eeprom@0 {
132 reg = <0x0 0xe00>;
133 };
134
135 macaddr_factory_4: macaddr@4 {
136 compatible = "mac-base";
137 reg = <0x4 0x6>;
138 #nvmem-cell-cells = <1>;
139 };
140 };
141 };
142
143 partition@180000 {
144 label = "kernel";
145 reg = <0x180000 0x600000>;
146 };
147
148 partition@580000 {
149 label = "ubi";
150 reg = <0x780000 0x2800000>;
151 };
152
153 partition@2f80000 {
154 label = "firmware2";
155 reg = <0x2f80000 0x2e00000>;
156 };
157
158 partition@5d80000 {
159 label = "storage";
160 reg = <0x5d80000 0x600000>;
161 read-only;
162 };
163
164 partition@6380000 {
165 label = "idmkey";
166 reg = <0x6380000 0x100000>;
167 read-only;
168 };
169
170 partition@6480000 {
171 label = "working";
172 reg = <0x6480000 0x80000>;
173 };
174 };
175 };
176
177 &gmac0 {
178 nvmem-cells = <&macaddr_factory_4 0>;
179 nvmem-cell-names = "mac-address";
180 };
181
182 &gmac1 {
183 status = "okay";
184 label = "wan";
185 phy-handle = <&ethphy0>;
186
187 nvmem-cells = <&macaddr_factory_4 2>;
188 nvmem-cell-names = "mac-address";
189 };
190
191 &mdio {
192 ethphy0: ethernet-phy@0 {
193 reg = <0>;
194 };
195 };
196
197 &switch0 {
198 ports {
199 port@1 {
200 status = "okay";
201 label = "lan2";
202 };
203
204 port@2 {
205 status = "okay";
206 label = "lan1";
207 };
208 };
209 };
210
211 &pcie {
212 status = "okay";
213 };
214
215 /*
216 * pcie0: MT7915 HIF (14c3,7916)
217 * pcie1: MT7915 (14c3,7915)
218 */
219 &pcie1 {
220 wifi@0,0 {
221 compatible = "mediatek,mt76";
222 reg = <0x0000 0 0 0 0>;
223
224 nvmem-cells = <&eeprom>;
225 nvmem-cell-names = "eeprom";
226 };
227 };
228
229 &state_default {
230 gpio {
231 groups = "i2c", "jtag", "uart2", "uart3";
232 function = "gpio";
233 };
234 };
235
236 &xhci {
237 status = "disabled";
238 };