ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_iptime_a6004ns-m.dtsi
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 aliases {
11 led-boot = &led_cpu;
12 led-failsafe = &led_cpu;
13 led-running = &led_cpu;
14 led-upgrade = &led_cpu;
15 label-mac-device = &gmac0;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 usb {
22 function = LED_FUNCTION_USB;
23 color = <LED_COLOR_ID_BLUE>;
24 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
25 trigger-sources = <&xhci_ehci_port1>;
26 linux,default-trigger = "usbport";
27 };
28
29 wlan5g {
30 label = "blue:wlan5g";
31 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
32 linux,default-trigger = "phy0radio";
33 };
34
35 wlan2g {
36 label = "blue:wlan2g";
37 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
38 linux,default-trigger = "phy1radio";
39 };
40
41 led_cpu: cpu {
42 function = LED_FUNCTION_CPU;
43 color = <LED_COLOR_ID_BLUE>;
44 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
45 };
46 };
47
48 keys {
49 compatible = "gpio-keys";
50
51 wps {
52 label = "wps";
53 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_WPS_BUTTON>;
55 };
56
57 reset {
58 label = "reset";
59 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
60 linux,code = <KEY_RESTART>;
61 };
62 };
63 };
64
65 &spi0 {
66 status = "okay";
67
68 flash@0 {
69 compatible = "jedec,spi-nor";
70 reg = <0>;
71 spi-max-frequency = <80000000>;
72 m25p,fast-read;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 uboot: partition@0 {
80 label = "u-boot";
81 reg = <0x0 0x20000>;
82 read-only;
83
84 nvmem-layout {
85 compatible = "fixed-layout";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 macaddr_uboot_1fc20: macaddr@1fc20 {
90 reg = <0x1fc20 0x6>;
91 };
92
93 macaddr_uboot_1fc40: macaddr@1fc40 {
94 reg = <0x1fc40 0x6>;
95 };
96 };
97 };
98
99 partition@20000 {
100 label = "config";
101 reg = <0x20000 0x10000>;
102 read-only;
103 };
104
105 factory: partition@30000 {
106 label = "factory";
107 reg = <0x30000 0x10000>;
108 read-only;
109
110 nvmem-layout {
111 compatible = "fixed-layout";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 eeprom_factory_0: eeprom@0 {
116 reg = <0x0 0x4da8>;
117 };
118
119 eeprom_factory_8000: eeprom@8000 {
120 reg = <0x8000 0x4da8>;
121 };
122 };
123 };
124
125 partition@40000 {
126 compatible = "denx,uimage";
127 label = "firmware";
128 reg = <0x40000 0xfc0000>;
129 };
130 };
131 };
132 };
133
134 &state_default {
135 gpio {
136 groups = "i2c", "uart3", "jtag", "wdt";
137 function = "gpio";
138 };
139 };
140
141 &gmac0 {
142 nvmem-cells = <&macaddr_uboot_1fc20>;
143 nvmem-cell-names = "mac-address";
144 };
145
146 &gmac1 {
147 status = "okay";
148 label = "wan";
149 phy-handle = <&ethphy0>;
150
151 nvmem-cells = <&macaddr_uboot_1fc40>;
152 nvmem-cell-names = "mac-address";
153 };
154
155 &mdio {
156 ethphy0: ethernet-phy@0 {
157 reg = <0>;
158 };
159 };
160
161 &switch0 {
162 ports {
163 port@1 {
164 status = "okay";
165 label = "lan1";
166 };
167
168 port@2 {
169 status = "okay";
170 label = "lan2";
171 };
172
173 port@3 {
174 status = "okay";
175 label = "lan3";
176 };
177
178 port@4 {
179 status = "okay";
180 label = "lan4";
181 };
182 };
183 };
184
185 &pcie {
186 status = "okay";
187 };
188
189 &pcie0 {
190 wifi@0,0 {
191 compatible = "mediatek,mt76";
192 reg = <0x0000 0 0 0 0>;
193 nvmem-cells = <&eeprom_factory_0>;
194 nvmem-cell-names = "eeprom";
195 ieee80211-freq-limit = <5000000 6000000>;
196 };
197 };
198
199 &pcie1 {
200 wifi@0,0 {
201 compatible = "mediatek,mt76";
202 reg = <0x0000 0 0 0 0>;
203 nvmem-cells = <&eeprom_factory_8000>;
204 nvmem-cell-names = "eeprom";
205 ieee80211-freq-limit = <2400000 2500000>;
206 };
207 };