ramips: mt7621: convert to nvmem-layout
[openwrt/staging/stintel.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 label = "factory";
140 reg = <0x40000 0x10000>;
141 read-only;
142
143 nvmem-layout {
144 compatible = "fixed-layout";
145 #address-cells = <1>;
146 #size-cells = <1>;
147
148 eeprom_factory_0: eeprom@0 {
149 reg = <0x0 0x400>;
150 };
151
152 eeprom_factory_8000: eeprom@8000 {
153 reg = <0x8000 0x200>;
154 };
155
156 macaddr_factory_4: macaddr@4 {
157 reg = <0x4 0x6>;
158 };
159 };
160 };
161
162 partition@50000 {
163 compatible = "denx,uimage";
164 label = "firmware";
165 reg = <0x50000 0xfa0000>;
166 };
167
168 radio: partition@ff0000 {
169 label = "radio";
170 reg = <0xff0000 0x10000>;
171 read-only;
172 };
173 };
174 };
175 };
176
177 &state_default {
178 gpio {
179 groups = "uart2";
180 function = "gpio";
181 };
182 };
183
184 &pinctrl {
185 i2s_pins: i2s {
186 i2s {
187 groups = "uart3";
188 function = "i2s";
189 };
190 };
191 };
192
193 &pcie {
194 status = "okay";
195 };
196
197 &pcie0 {
198 wifi@0,0 {
199 compatible = "mediatek,mt76";
200 reg = <0x0000 0 0 0 0>;
201 nvmem-cells = <&eeprom_factory_0>;
202 nvmem-cell-names = "eeprom";
203 ieee80211-freq-limit = <2400000 2500000>;
204 };
205 };
206
207 &pcie1 {
208 wifi@0,0 {
209 compatible = "mediatek,mt76";
210 reg = <0x0000 0 0 0 0>;
211 nvmem-cells = <&eeprom_factory_8000>;
212 nvmem-cell-names = "eeprom";
213 ieee80211-freq-limit = <5000000 6000000>;
214 };
215 };
216
217 &gmac0 {
218 nvmem-cells = <&macaddr_factory_4>;
219 nvmem-cell-names = "mac-address";
220 };
221
222 &switch0 {
223 ports {
224 port@0 {
225 status = "okay";
226 label = "lan";
227 };
228 };
229 };
230
231 &xhci {
232 status = "disabled";
233 };
234
235 &i2c {
236 status = "okay";
237
238 codec: wm8960@18 {
239 #sound-dai-cells = <0>;
240 compatible = "wlf,wm8960";
241 reg = <0x18>;
242 wlf,shared-lrclk;
243 };
244 };
245
246 &gdma {
247 status = "okay";
248 };
249
250 &i2s {
251 #sound-dai-cells = <0>;
252 status = "okay";
253 pinctrl-names = "default";
254 pinctrl-0 = <&i2s_pins>;
255 };