ramips: fix nvmem-cells for routers based on TP-Link Archer
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_sercomm_na502.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
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 = "sercomm,na502", "mediatek,mt7621-soc";
11 model = "SERCOMM NA502";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 led_power: power {
24 function = LED_FUNCTION_POWER;
25 color = <LED_COLOR_ID_GREEN>;
26 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
27 };
28
29 internet {
30 label = "green:internet";
31 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
32 };
33
34 wifi {
35 label = "green:wifi";
36 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
37 linux,default-trigger = "phy0tpt";
38 };
39
40 zwave {
41 label = "green:zwave";
42 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
43 };
44
45 service {
46 label = "green:service";
47 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
48 };
49
50 zigbee {
51 label = "green:zigbee";
52 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
53 };
54
55 bluetooth {
56 function = LED_FUNCTION_BLUETOOTH;
57 color = <LED_COLOR_ID_GREEN>;
58 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
59 };
60 };
61
62 keys {
63 compatible = "gpio-keys";
64
65 reset {
66 label = "reset";
67 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
68 linux,code = <KEY_RESTART>;
69 };
70
71 select {
72 label = "select";
73 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
74 linux,code = <BTN_0>;
75 };
76
77 sync {
78 label = "sync";
79 gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
80 linux,code = <KEY_RFKILL>;
81 };
82 };
83
84 gpio-export {
85 compatible = "gpio-export";
86
87 zwave_reset {
88 gpio-export,name = "zwave_reset";
89 gpio-export,output = <1>;
90 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
91 };
92
93 zigbee_reset {
94 gpio-export,name = "zigbee_reset";
95 gpio-export,output = <1>;
96 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
97 };
98 };
99 };
100
101 &ethernet {
102 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
103 };
104
105 &gmac0 {
106 nvmem-cells = <&macaddr_factory_e000 0>;
107 nvmem-cell-names = "mac-address";
108 };
109
110 &nand {
111 status = "okay";
112
113 partitions {
114 compatible = "fixed-partitions";
115 #address-cells = <1>;
116 #size-cells = <1>;
117
118 partition@0 {
119 label = "u-boot";
120 reg = <0x0 0x80000>;
121 read-only;
122 };
123
124 partition@80000 {
125 label = "config";
126 reg = <0x80000 0x80000>;
127 read-only;
128 };
129
130 partition@100000 {
131 label = "factory";
132 reg = <0x100000 0x40000>;
133
134 nvmem-layout {
135 compatible = "fixed-layout";
136 #address-cells = <1>;
137 #size-cells = <1>;
138
139 eeprom_factory_0: eeprom@0 {
140 reg = <0x0 0x400>;
141 };
142
143 eeprom_factory_8000: eeprom@8000 {
144 reg = <0x8000 0x200>;
145 };
146
147 macaddr_factory_e000: macaddr@e000 {
148 compatible = "mac-base";
149 reg = <0xe000 0x6>;
150 #nvmem-cell-cells = <1>;
151 };
152 };
153 };
154
155 partition@140000 {
156 label = "kernel1";
157 reg = <0x140000 0x1400000>;
158 };
159
160 partition@1540000 {
161 label = "kernel";
162 reg = <0x1540000 0x400000>;
163 };
164
165 partition@1940000 {
166 label = "ubi";
167 reg = <0x1940000 0x1000000>;
168 };
169
170 partition@2940000 {
171 label = "user_storage";
172 reg = <0x2940000 0x100000>;
173 };
174
175 partition@2a40000 {
176 label = "data";
177 reg = <0x2a40000 0x1000000>;
178 };
179
180 partition@3a40000 {
181 label = "storage";
182 reg = <0x3a40000 0x3200000>;
183 };
184
185 partition@6c40000 {
186 label = "backup";
187 reg = <0x6c40000 0x1340000>;
188 };
189 };
190 };
191
192 &pcie {
193 status = "okay";
194 };
195
196 &pcie0 {
197 wifi@0,0 {
198 compatible = "mediatek,mt76";
199 reg = <0x0000 0 0 0 0>;
200 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000 1>;
201 nvmem-cell-names = "eeprom", "mac-address";
202 ieee80211-freq-limit = <5000000 6000000>;
203 };
204 };
205
206 &pcie1 {
207 wifi@0,0 {
208 compatible = "mediatek,mt76";
209 reg = <0x0 0 0 0 0>;
210 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000 2>;
211 nvmem-cell-names = "eeprom", "mac-address";
212 ieee80211-freq-limit = <2400000 2500000>;
213 };
214 };
215
216 &state_default {
217 gpio {
218 groups = "jtag", "rgmii2";
219 function = "gpio";
220 };
221 };
222
223 &switch0 {
224 ports {
225 port@4 {
226 status = "okay";
227 label = "lan";
228 };
229 };
230 };
231
232 &uartlite2 {
233 status = "okay";
234 };
235
236 &uartlite3 {
237 status = "okay";
238 };