ramips: mt7621: convert to nvmem-layout
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_arcadyan_we420223-99.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 model = "Arcadyan WE420223-99";
11 compatible = "arcadyan,we420223-99", "mediatek,mt7621-soc";
12
13 aliases {
14 led-boot = &led_power_green;
15 led-failsafe = &led_power_red;
16 led-running = &led_power_green;
17 led-upgrade = &led_wps_green;
18 led-wifi = &led_wifi_green;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,57600 ubi.mtd=5 root=/dev/ubiblock0_0";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 reset {
29 label = "reset";
30 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33
34 wps {
35 label = "wps";
36 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_WPS_BUTTON>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led_power_green: power_green {
45 label = "green:power";
46 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
47 color = <LED_COLOR_ID_GREEN>;
48 function = LED_FUNCTION_POWER;
49 default-state = "on";
50 };
51
52 led_power_red: power_red {
53 label = "red:power";
54 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
55 color = <LED_COLOR_ID_RED>;
56 function = LED_FUNCTION_FAULT;
57 };
58
59 led_wifi_blue: wifi_blue {
60 label = "blue:wifi";
61 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
62 color = <LED_COLOR_ID_BLUE>;
63 function = LED_FUNCTION_WLAN;
64 };
65
66 led_wifi_green: wifi_green {
67 label = "green:wifi";
68 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
69 color = <LED_COLOR_ID_GREEN>;
70 function = LED_FUNCTION_WLAN;
71 };
72
73 led_wps_red: wps_red {
74 label = "red:wps";
75 gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
76 color = <LED_COLOR_ID_RED>;
77 function = LED_FUNCTION_WPS;
78 };
79
80 led_wps_green: wps_green {
81 label = "green:wps";
82 gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
83 color = <LED_COLOR_ID_GREEN>;
84 function = LED_FUNCTION_WPS;
85 };
86
87 led_followme_r: followme_red {
88 label = "red:followme";
89 gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
90 color = <LED_COLOR_ID_RED>;
91 };
92
93 led_followme_g: followme_green {
94 label = "green:followme";
95 gpios = <&gpio 48 GPIO_ACTIVE_LOW>;
96 color = <LED_COLOR_ID_GREEN>;
97 };
98 };
99 };
100
101 &spi0 {
102 status = "okay";
103
104 flash@0 {
105 compatible = "jedec,spi-nor";
106
107 reg = <0>;
108 spi-max-frequency = <70000000>;
109
110 partitions {
111 compatible = "fixed-partitions";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 partition@0 {
116 label = "ALL";
117 reg = <0x0 0x2000000>;
118 read-only;
119 };
120
121 partition@1 {
122 label = "Bootloader";
123 reg = <0x0 0x30000>;
124 read-only;
125 };
126
127 partition@30000 {
128 label = "Config";
129 reg = <0x30000 0x10000>;
130 };
131
132 factory: partition@40000 {
133 label = "Factory";
134 reg = <0x40000 0x10000>;
135 read-only;
136
137 nvmem-layout {
138 compatible = "fixed-layout";
139 #address-cells = <1>;
140 #size-cells = <1>;
141
142 eeprom_factory_0: eeprom@0 {
143 reg = <0x0 0x4da8>;
144 };
145 };
146 };
147
148 partition@50000 {
149 label = "kernel";
150 reg = <0x50000 0x1f60000>;
151 };
152
153 partition@490000 {
154 label = "rootfs";
155 reg = <0x490000 0x1b20000>;
156 };
157
158 partition@1000000 {
159 label = "Kernel2";
160 reg = <0x1000000 0xfb0000>;
161 };
162
163 partition@1440000 {
164 label = "RootFS2";
165 reg = <0x1440000 0xb70000>;
166 };
167
168 partition@1fb0000 {
169 label = "glbcfg";
170 reg = <0x1fb0000 0x10000>;
171 read-only;
172 };
173
174 partition@1fc0000 {
175 label = "board_data";
176 reg = <0x1fc0000 0x10000>;
177 read-only;
178 };
179
180 partition@1fd0000 {
181 label = "glbcfg2";
182 reg = <0x1fd0000 0x10000>;
183 read-only;
184 };
185
186 partition@1fe0000 {
187 label = "board_data2";
188 reg = <0x1fe0000 0x10000>;
189 read-only;
190 };
191 };
192 };
193 };
194
195 &xhci {
196 status = "disabled";
197 };
198
199 &switch0 {
200 ports {
201 port@1 {
202 status = "okay";
203 label = "swp1";
204 };
205 };
206 };
207
208 &gmac1 {
209 status = "okay";
210 label = "swp0";
211 phy-handle = <&ethphy0>;
212 };
213
214 &mdio {
215 ethphy0: ethernet-phy@0 {
216 reg = <0>;
217 };
218 };
219
220 &pcie {
221 status = "okay";
222 };
223
224 &pcie1 {
225 mt76@0,0 {
226 reg = <0x0000 0 0 0 0>;
227 nvmem-cells = <&eeprom_factory_0>;
228 nvmem-cell-names = "eeprom";
229 };
230 };