b9357632e1ac78aa4064c19f65db407a545d5418
[openwrt/staging/hauke.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 compatible = "nvmem-cells";
123 label = "factory";
124 reg = <0x100000 0x80000>;
125 read-only;
126
127 nvmem-layout {
128 compatible = "fixed-layout";
129 #address-cells = <1>;
130 #size-cells = <1>;
131
132 eeprom: eeprom@0 {
133 reg = <0x0 0xe00>;
134 };
135
136 macaddr_factory_4: macaddr@4 {
137 compatible = "mac-base";
138 reg = <0x4 0x6>;
139 #nvmem-cell-cells = <1>;
140 };
141 };
142 };
143
144 partition@180000 {
145 label = "kernel";
146 reg = <0x180000 0x600000>;
147 };
148
149 partition@580000 {
150 label = "ubi";
151 reg = <0x780000 0x2800000>;
152 };
153
154 partition@2f80000 {
155 label = "firmware2";
156 reg = <0x2f80000 0x2e00000>;
157 };
158
159 partition@5d80000 {
160 label = "storage";
161 reg = <0x5d80000 0x600000>;
162 read-only;
163 };
164
165 partition@6380000 {
166 label = "idmkey";
167 reg = <0x6380000 0x100000>;
168 read-only;
169 };
170
171 partition@6480000 {
172 label = "working";
173 reg = <0x6480000 0x80000>;
174 };
175 };
176 };
177
178 &gmac0 {
179 nvmem-cells = <&macaddr_factory_4 0>;
180 nvmem-cell-names = "mac-address";
181 };
182
183 &gmac1 {
184 status = "okay";
185 label = "wan";
186 phy-handle = <&ethphy0>;
187
188 nvmem-cells = <&macaddr_factory_4 2>;
189 nvmem-cell-names = "mac-address";
190 };
191
192 &mdio {
193 ethphy0: ethernet-phy@0 {
194 reg = <0>;
195 };
196 };
197
198 &switch0 {
199 ports {
200 port@1 {
201 status = "okay";
202 label = "lan2";
203 };
204
205 port@2 {
206 status = "okay";
207 label = "lan1";
208 };
209 };
210 };
211
212 &pcie {
213 status = "okay";
214 };
215
216 /*
217 * pcie0: MT7915 HIF (14c3,7916)
218 * pcie1: MT7915 (14c3,7915)
219 */
220 &pcie1 {
221 wifi@0,0 {
222 compatible = "mediatek,mt76";
223 reg = <0x0000 0 0 0 0>;
224
225 nvmem-cells = <&eeprom>;
226 nvmem-cell-names = "eeprom";
227 };
228 };
229
230 &state_default {
231 gpio {
232 groups = "i2c", "jtag", "uart2", "uart3";
233 function = "gpio";
234 };
235 };
236
237 &xhci {
238 status = "disabled";
239 };