ramips: convert MT7603 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_asus_rp-ac56.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
8 / {
9 compatible = "asus,rp-ac56", "mediatek,mt7621-soc";
10 model = "Asus RP-AC56";
11
12 aliases {
13 led-boot = &led_power_orange;
14 led-failsafe = &led_power_orange;
15 led-running = &led_power_white;
16 led-upgrade = &led_power_blue;
17 label-mac-device = &gmac0;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 wlan2g_red {
24 label = "red:wlan2g";
25 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
26 };
27
28 wlan2g_blue {
29 label = "blue:wlan2g";
30 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
31 };
32
33 wlan2g_green {
34 label = "green:wlan2g";
35 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
36 linux,default-trigger = "phy0tpt";
37 };
38
39 wlan5g_red {
40 label = "red:wlan5g";
41 gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
42 };
43
44 wlan5g_blue {
45 label = "blue:wlan5g";
46 gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
47 };
48
49 wlan5g_green {
50 label = "green:wlan5g";
51 gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
52 linux,default-trigger = "phy1tpt";
53 };
54
55 led_power_white: power_white {
56 label = "white:power";
57 gpios = <&gpio 48 GPIO_ACTIVE_HIGH>;
58 };
59
60 led_power_orange: power_orange {
61 label = "orange:power";
62 gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
63 };
64
65 led_power_blue: power_blue {
66 label = "blue:power";
67 gpios = <&gpio 46 GPIO_ACTIVE_HIGH>;
68 };
69 };
70
71 keys {
72 compatible = "gpio-keys";
73
74 wps {
75 label = "wps";
76 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
77 linux,code = <KEY_WPS_BUTTON>;
78 };
79
80 reset {
81 label = "reset";
82 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
83 linux,code = <KEY_RESTART>;
84 };
85 };
86
87 sound {
88 compatible = "simple-audio-card";
89 simple-audio-card,name = "Audio-I2S";
90 simple-audio-card,format = "i2s";
91 simple-audio-card,bitclock-master = <&dailink0_master>;
92 simple-audio-card,frame-master = <&dailink0_master>;
93 simple-audio-card,routing =
94 "Headphone Jack", "HP_L",
95 "Headphone Jack", "HP_R";
96 simple-audio-card,mclk-fs = <256>;
97
98 simple-audio-card,cpu {
99 sound-dai = <&i2s>;
100 };
101
102 dailink0_master: simple-audio-card,codec {
103 sound-dai = <&codec>;
104 };
105 };
106 };
107
108 &gpio {
109 status = "okay";
110 };
111
112 &spi0 {
113 status = "okay";
114
115 flash@0 {
116 compatible = "jedec,spi-nor";
117 reg = <0>;
118 spi-max-frequency = <50000000>;
119 m25p,fast-read;
120
121 partitions {
122 compatible = "fixed-partitions";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 partition@0 {
127 label = "u-boot";
128 reg = <0x0 0x30000>;
129 read-only;
130 };
131
132 partition@30000 {
133 label = "nvram";
134 reg = <0x30000 0x10000>;
135 read-only;
136 };
137
138 factory: partition@40000 {
139 compatible = "nvmem-cells";
140 label = "factory";
141 reg = <0x40000 0x10000>;
142 #address-cells = <1>;
143 #size-cells = <1>;
144 read-only;
145
146 eeprom_factory_0: eeprom@0 {
147 reg = <0x0 0x400>;
148 };
149
150 macaddr_factory_4: macaddr@4 {
151 reg = <0x4 0x6>;
152 };
153 };
154
155 partition@50000 {
156 compatible = "denx,uimage";
157 label = "firmware";
158 reg = <0x50000 0xfa0000>;
159 };
160
161 radio: partition@ff0000 {
162 label = "radio";
163 reg = <0xff0000 0x10000>;
164 read-only;
165 };
166 };
167 };
168 };
169
170 &state_default {
171 gpio {
172 groups = "uart2";
173 function = "gpio";
174 };
175 };
176
177 &pinctrl {
178 i2s_pins: i2s {
179 i2s {
180 groups = "uart3";
181 function = "i2s";
182 };
183 };
184 };
185
186 &pcie {
187 status = "okay";
188 };
189
190 &pcie0 {
191 wifi@0,0 {
192 compatible = "mediatek,mt76";
193 reg = <0x0000 0 0 0 0>;
194 nvmem-cells = <&eeprom_factory_0>;
195 nvmem-cell-names = "eeprom";
196 ieee80211-freq-limit = <2400000 2500000>;
197 };
198 };
199
200 &pcie1 {
201 wifi@0,0 {
202 compatible = "mediatek,mt76";
203 reg = <0x0000 0 0 0 0>;
204 mediatek,mtd-eeprom = <&factory 0x8000>;
205 ieee80211-freq-limit = <5000000 6000000>;
206 };
207 };
208
209 &gmac0 {
210 nvmem-cells = <&macaddr_factory_4>;
211 nvmem-cell-names = "mac-address";
212 };
213
214 &switch0 {
215 ports {
216 port@0 {
217 status = "okay";
218 label = "lan";
219 };
220 };
221 };
222
223 &xhci {
224 status = "disabled";
225 };
226
227 &i2c {
228 status = "okay";
229
230 codec: wm8960@18 {
231 #sound-dai-cells = <0>;
232 compatible = "wlf,wm8960";
233 reg = <0x18>;
234 wlf,shared-lrclk;
235 };
236 };
237
238 &gdma {
239 status = "okay";
240 };
241
242 &i2s {
243 #sound-dai-cells = <0>;
244 status = "okay";
245 pinctrl-names = "default";
246 pinctrl-0 = <&i2s_pins>;
247 };