ramips: convert MT7915 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_arcadyan_wg4xx223.dtsi
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 aliases {
11 led-boot = &led_status_red;
12 led-failsafe = &led_status_red;
13 led-running = &led_status_green;
14 led-upgrade = &led_status_red;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 led_status_green: led-1 {
21 label = "green:status";
22 color = <LED_COLOR_ID_GREEN>;
23 function = LED_FUNCTION_STATUS;
24 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
25 };
26
27 led_status_red: led-2 {
28 label = "red:status";
29 color = <LED_COLOR_ID_RED>;
30 function = LED_FUNCTION_STATUS;
31 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
32 };
33 };
34
35 keys {
36 compatible = "gpio-keys";
37
38 reset {
39 label = "reset";
40 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_RESTART>;
42 };
43 };
44
45 ubi-concat {
46 compatible = "mtd-concat";
47 devices = <&ubiconcat0 &ubiconcat1>;
48
49 partitions {
50 compatible = "fixed-partitions";
51 #address-cells = <1>;
52 #size-cells = <1>;
53
54 partition@0 {
55 label = "ubi";
56 reg = <0x0 0x5240000>;
57 };
58 };
59 };
60 };
61
62 &nand {
63 status = "okay";
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 partition@0 {
71 label = "u-boot";
72 reg = <0x0 0x100000>;
73 read-only;
74 };
75
76 partition@100000 {
77 label = "u-boot-env";
78 reg = <0x100000 0x100000>;
79 };
80
81 factory: partition@200000 {
82 compatible = "nvmem-cells";
83 label = "Factory";
84 reg = <0x200000 0x100000>;
85 #address-cells = <1>;
86 #size-cells = <1>;
87 read-only;
88
89 eeprom_factory_0: eeprom@0 {
90 reg = <0x0 0x4da8>;
91 };
92
93 /* We keep the block below to prevent eth0 MAC
94 * from randomization. Unique WAN, LAN, WLAN MACs
95 * are stored in u-boot-env.
96 */
97
98 /* Default Ralink MAC (00:0c:43:28:80:xx) */
99 macaddr_factory_fff0: macaddr@fff0 {
100 reg = <0xfff0 0x6>;
101 };
102 };
103
104 partition@300000 {
105 label = "firmware";
106 reg = <0x300000 0x2000000>;
107
108 compatible = "fixed-partitions";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 partition@0 {
113 label = "kernel";
114 reg = <0x0 0x440000>;
115 };
116
117 ubiconcat0: partition@400000 {
118 label = "ubiconcat0";
119 reg = <0x440000 0x1bc0000>;
120 };
121 };
122
123 partition@2300000 {
124 label = "Firmware2";
125 reg = <0x2300000 0x2000000>;
126 read-only;
127 };
128
129 partition@4300000 {
130 label = "glbcfg";
131 reg = <0x4300000 0x200000>;
132 read-only;
133 };
134
135 partition@4500000 {
136 label = "board_data";
137 reg = <0x4500000 0x100000>;
138 read-only;
139 };
140
141 partition@4600000 {
142 label = "glbcfg2";
143 reg = <0x4600000 0x200000>;
144 read-only;
145 };
146
147 partition@4800000 {
148 label = "board_data2";
149 reg = <0x4800000 0x100000>;
150 read-only;
151 };
152
153 ubiconcat1: partition@4900000 {
154 label = "ubiconcat1";
155 reg = <0x4900000 0x3680000>;
156 };
157 };
158 };
159
160 &pcie {
161 status = "okay";
162 };
163
164 &pcie1 {
165 wifi@0,0 {
166 compatible = "mediatek,mt76";
167 reg = <0x0000 0 0 0 0>;
168 nvmem-cells = <&eeprom_factory_0>;
169 nvmem-cell-names = "eeprom";
170 };
171 };
172
173 &gmac0 {
174 nvmem-cells = <&macaddr_factory_fff0>;
175 nvmem-cell-names = "mac-address";
176 };
177
178 &gmac1 {
179 status = "okay";
180 label = "wan";
181 phy-handle = <&ethphy4>;
182
183 nvmem-cells = <&macaddr_factory_fff0>;
184 nvmem-cell-names = "mac-address";
185 };
186
187 &mdio {
188 ethphy4: ethernet-phy@4 {
189 reg = <4>;
190 };
191 };
192
193 &switch0 {
194 ports {
195 port@2 {
196 status = "okay";
197 label = "lan2";
198 };
199
200 port@3 {
201 status = "okay";
202 label = "lan1";
203 };
204 };
205 };
206
207 &state_default {
208 gpio {
209 groups = "i2c", "jtag";
210 function = "gpio";
211 };
212 };