ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_asus_rt-ac57u-v1.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,rt-ac57u-v1", "mediatek,mt7621-soc";
11 model = "ASUS RT-AC57U v1";
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_BLUE>;
26 gpios = <&gpio 48 GPIO_ACTIVE_LOW>;
27 };
28
29 usb {
30 function = LED_FUNCTION_USB;
31 color = <LED_COLOR_ID_BLUE>;
32 gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
33 trigger-sources = <&ehci_port2>;
34 linux,default-trigger = "usbport";
35 };
36 };
37
38 keys {
39 compatible = "gpio-keys";
40
41 wps {
42 label = "wps";
43 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
44 linux,code = <KEY_WPS_BUTTON>;
45 debounce-interval = <60>;
46 };
47
48 reset {
49 label = "reset";
50 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
51 linux,code = <KEY_RESTART>;
52 debounce-interval = <60>;
53 };
54 };
55
56 led-regulator {
57 compatible = "regulator-fixed";
58 regulator-name = "LED-Power";
59 gpio = <&gpio 46 GPIO_ACTIVE_LOW>;
60 regulator-min-microvolt = <3300000>;
61 regulator-max-microvolt = <3300000>;
62 regulator-always-on;
63 };
64 };
65
66 &spi0 {
67 status = "okay";
68
69 flash@0 {
70 compatible = "jedec,spi-nor";
71 reg = <0>;
72 spi-max-frequency = <10000000>;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 label = "u-boot";
81 reg = <0x0 0x30000>;
82 read-only;
83 };
84
85 partition@30000 {
86 label = "config";
87 reg = <0x30000 0x10000>;
88 read-only;
89 };
90
91 factory: partition@40000 {
92 label = "factory";
93 reg = <0x40000 0x10000>;
94 read-only;
95
96 nvmem-layout {
97 compatible = "fixed-layout";
98 #address-cells = <1>;
99 #size-cells = <1>;
100
101 eeprom_factory_0: eeprom@0 {
102 reg = <0x0 0x400>;
103 };
104
105 eeprom_factory_8000: eeprom@8000 {
106 reg = <0x8000 0x200>;
107 };
108
109 macaddr_factory_e000: macaddr@e000 {
110 reg = <0xe000 0x6>;
111 };
112
113 macaddr_factory_e006: macaddr@e006 {
114 reg = <0xe006 0x6>;
115 };
116 };
117 };
118
119 partition@50000 {
120 compatible = "denx,uimage";
121 label = "firmware";
122 reg = <0x50000 0xfb0000>;
123 };
124 };
125 };
126 };
127
128 &pcie {
129 status = "okay";
130 };
131
132 &pcie0 {
133 wifi@0,0 {
134 compatible = "mediatek,mt76";
135 reg = <0x0000 0 0 0 0>;
136 nvmem-cells = <&eeprom_factory_8000>;
137 nvmem-cell-names = "eeprom";
138
139 led {
140 led-sources = <2>;
141 led-active-low;
142 };
143 };
144 };
145
146 &pcie1 {
147 wifi@0,0 {
148 compatible = "mediatek,mt76";
149 reg = <0x0000 0 0 0 0>;
150 nvmem-cells = <&eeprom_factory_0>;
151 nvmem-cell-names = "eeprom";
152
153 led {
154 led-active-low;
155 };
156 };
157 };
158
159 &gmac0 {
160 nvmem-cells = <&macaddr_factory_e000>;
161 nvmem-cell-names = "mac-address";
162 };
163
164 &gmac1 {
165 status = "okay";
166 label = "wan";
167 phy-handle = <&ethphy0>;
168
169 nvmem-cells = <&macaddr_factory_e006>;
170 nvmem-cell-names = "mac-address";
171 };
172
173 &mdio {
174 ethphy0: ethernet-phy@0 {
175 reg = <0>;
176 };
177 };
178
179 &switch0 {
180 ports {
181 port@1 {
182 status = "okay";
183 label = "lan1";
184 };
185
186 port@2 {
187 status = "okay";
188 label = "lan2";
189 };
190
191 port@3 {
192 status = "okay";
193 label = "lan3";
194 };
195
196 port@4 {
197 status = "okay";
198 label = "lan4";
199 };
200 };
201 };
202
203 &state_default {
204 gpio {
205 groups = "sdhci";
206 function = "gpio";
207 };
208 };