ramips: fix nvmem-cells for routers based on TP-Link Archer
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_asus_rp-ac87.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 = "asus,rp-ac87", "mediatek,mt7621-soc";
11 model = "ASUS RP-AC87";
12
13 aliases {
14 led-boot = &led_wps;
15 led-failsafe = &led_wps;
16 led-running = &led_wps;
17 led-upgrade = &led_wps;
18 label-mac-device = &gmac0;
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29
30 wps {
31 label = "wps";
32 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_WPS_BUTTON>;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 led_wps: wps {
41 function = LED_FUNCTION_WPS;
42 color = <LED_COLOR_ID_GREEN>;
43 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
44 };
45
46 rssilow-wlan0 {
47 label = "green:rssilow-wlan0";
48 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
49 };
50
51 rssimedlow-wlan0 {
52 label = "green:rssimedlow-wlan0";
53 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
54 };
55
56 rssimed-wlan0 {
57 label = "green:rssimed-wlan0";
58 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
59 };
60
61 rssihigh-wlan0 {
62 label = "green:rssihigh-wlan0";
63 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
64 };
65
66 rssilow-wlan1 {
67 label = "green:rssilow-wlan1";
68 gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
69 };
70
71 rssimedlow-wlan1 {
72 label = "green:rssimedlow-wlan1";
73 gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
74 };
75
76 rssimed-wlan1 {
77 label = "green:rssimed-wlan1";
78 gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
79 };
80
81 rssihigh-wlan1 {
82 label = "green:rssihigh-wlan1";
83 gpios = <&gpio 48 GPIO_ACTIVE_LOW>;
84 };
85 };
86 };
87
88 &spi0 {
89 status = "okay";
90
91 flash@0 {
92 compatible = "jedec,spi-nor";
93 reg = <0>;
94 spi-max-frequency = <50000000>;
95 m25p,fast-read;
96
97 partitions {
98 compatible = "fixed-partitions";
99 #address-cells = <1>;
100 #size-cells = <1>;
101
102 partition@0 {
103 label = "u-boot";
104 reg = <0x0 0x30000>;
105 read-only;
106 };
107
108 partition@30000 {
109 label = "u-boot-env";
110 reg = <0x30000 0x10000>;
111 read-only;
112 };
113
114 partition@40000 {
115 label = "factory";
116 reg = <0x40000 0x10000>;
117 read-only;
118
119 nvmem-layout {
120 compatible = "fixed-layout";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 eeprom_factory_0: eeprom@0 {
125 reg = <0x0 0x4da8>;
126 };
127
128 eeprom_factory_8000: eeprom@8000 {
129 reg = <0x8000 0x4da8>;
130 };
131
132 macaddr_factory_8004: macaddr@8004 {
133 reg = <0x8004 0x6>;
134 };
135 };
136 };
137
138 partition@50000 {
139 compatible = "denx,uimage";
140 label = "firmware";
141 reg = <0x50000 0xfb0000>;
142 };
143 };
144 };
145 };
146
147 &pcie {
148 status = "okay";
149 };
150
151 &pcie0 {
152 wifi@0,0 {
153 compatible = "mediatek,mt76";
154 reg = <0x0000 0 0 0 0>;
155 nvmem-cells = <&eeprom_factory_0>;
156 nvmem-cell-names = "eeprom";
157 ieee80211-freq-limit = <2400000 2500000>;
158 };
159 };
160
161 &pcie1 {
162 wifi@0,0 {
163 compatible = "mediatek,mt76";
164 reg = <0x0000 0 0 0 0>;
165 nvmem-cells = <&eeprom_factory_8000>;
166 nvmem-cell-names = "eeprom";
167 ieee80211-freq-limit = <5000000 6000000>;
168 };
169 };
170
171 &gmac0 {
172 nvmem-cells = <&macaddr_factory_8004>;
173 nvmem-cell-names = "mac-address";
174 };
175
176 &switch0 {
177 ports {
178 port@4 {
179 status = "okay";
180 label = "lan";
181 };
182 };
183 };
184
185 &xhci {
186 status = "disabled";
187 };