ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_domywifi.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.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_system_amber;
12 led-failsafe = &led_system_amber;
13 led-running = &led_system_green;
14 led-upgrade = &led_system_amber;
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 reset {
21 label = "reset";
22 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
23 linux,code = <KEY_RESTART>;
24 };
25 };
26
27 leds {
28 compatible = "gpio-leds";
29
30 led_system_green: system_green {
31 label = "green:system";
32 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
33 };
34
35 led_system_amber: system_amber {
36 label = "amber:system";
37 gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
38 };
39
40 internet_green {
41 label = "green:internet";
42 gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
43 };
44
45 internet_amber {
46 label = "amber:internet";
47 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
48 };
49
50 lan1 {
51 label = "amber:lan1";
52 gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
53 };
54
55 lan2 {
56 label = "amber:lan2";
57 gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
58 };
59
60 lan3 {
61 label = "amber:lan3";
62 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
63 };
64
65 lan4 {
66 label = "amber:lan4";
67 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
68 };
69
70 wan {
71 function = LED_FUNCTION_WAN;
72 color = <LED_COLOR_ID_AMBER>;
73 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
74 };
75
76 wlan2g {
77 label = "green:wlan2g";
78 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
79 linux,default-trigger = "phy1tpt";
80 };
81 };
82 };
83
84 &gpio1 {
85 status = "okay";
86 };
87
88 &gpio3 {
89 status = "okay";
90 };
91
92 &spi0 {
93 status = "okay";
94
95 flash@0 {
96 compatible = "jedec,spi-nor";
97 reg = <0>;
98 spi-max-frequency = <80000000>;
99 m25p,fast-read;
100
101 partitions {
102 compatible = "fixed-partitions";
103 #address-cells = <1>;
104 #size-cells = <1>;
105
106 partition@0 {
107 label = "bootloader";
108 reg = <0x0 0x30000>;
109 read-only;
110 };
111
112 partition@30000 {
113 label = "config";
114 reg = <0x30000 0x10000>;
115 read-only;
116 };
117
118 factory: partition@40000 {
119 label = "factory";
120 reg = <0x40000 0x10000>;
121 read-only;
122
123 nvmem-layout {
124 compatible = "fixed-layout";
125 #address-cells = <1>;
126 #size-cells = <1>;
127
128 eeprom_factory_0: eeprom@0 {
129 reg = <0x0 0x200>;
130 };
131
132 eeprom_factory_8000: eeprom@8000 {
133 reg = <0x8000 0x200>;
134 };
135
136 macaddr_factory_28: macaddr@28 {
137 reg = <0x28 0x6>;
138 };
139 };
140 };
141
142 partition@50000 {
143 compatible = "denx,uimage";
144 label = "firmware";
145 reg = <0x50000 0xfb0000>;
146 };
147 };
148 };
149 };
150
151 &state_default {
152 gpio {
153 groups = "uartf", "rgmii1", "wled";
154 function = "gpio";
155 };
156 };
157
158 &ethernet {
159 pinctrl-names = "default";
160 pinctrl-0 = <&ephy_pins>;
161
162 mediatek,portmap = "wllll";
163
164 nvmem-cells = <&macaddr_factory_28>;
165 nvmem-cell-names = "mac-address";
166 };
167
168 &sdhci {
169 status = "okay";
170 };
171
172 &ehci {
173 status = "okay";
174 };
175
176 &ohci {
177 status = "okay";
178 };
179
180 &pcie {
181 status = "okay";
182 };
183
184 &pcie0 {
185 wifi@0,0 {
186 reg = <0x0000 0 0 0 0>;
187 nvmem-cells = <&eeprom_factory_8000>;
188 nvmem-cell-names = "eeprom";
189 ieee80211-freq-limit = <5000000 6000000>;
190
191 led {
192 led-sources = <0>;
193 led-active-low;
194 };
195 };
196 };
197
198 &wmac {
199 nvmem-cells = <&eeprom_factory_0>;
200 nvmem-cell-names = "eeprom";
201 };