ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_humax_e10.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 #include <dt-bindings/mtd/partitions/uimage.h>
9
10 / {
11 compatible = "humax,e10", "mediatek,mt7621-soc";
12 model = "HUMAX E10";
13
14 aliases {
15 led-boot = &led_power;
16 led-failsafe = &led_power;
17 led-running = &led_power;
18 led-upgrade = &led_power;
19 label-mac-device = &gmac1;
20 };
21
22 gpio-export {
23 compatible = "gpio-export";
24
25 gpio-usb-power {
26 gpio-export,name = "power:usb";
27 gpio-export,output = <1>;
28 gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
29 };
30 };
31
32 leds {
33 compatible = "gpio-leds";
34
35 led_power: power {
36 function = LED_FUNCTION_POWER;
37 color = <LED_COLOR_ID_GREEN>;
38 gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
39 };
40
41 pairing {
42 label = "green:pairing";
43 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
44 };
45
46 wlan {
47 function = LED_FUNCTION_WLAN;
48 color = <LED_COLOR_ID_GREEN>;
49 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
50 };
51
52 wps {
53 function = LED_FUNCTION_WPS;
54 color = <LED_COLOR_ID_GREEN>;
55 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
56 };
57 };
58
59 keys {
60 compatible = "gpio-keys";
61
62 wps-reset {
63 label = "wps_reset";
64 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
65 linux,code = <KEY_RESTART>;
66 };
67 };
68 };
69
70 &spi0 {
71 status = "okay";
72
73 flash@0 {
74 compatible = "jedec,spi-nor";
75 reg = <0>;
76 spi-max-frequency = <50000000>;
77
78 partitions {
79 compatible = "fixed-partitions";
80 #address-cells = <1>;
81 #size-cells = <1>;
82
83 partition@0 {
84 label = "u-boot";
85 reg = <0x0 0x30000>;
86 read-only;
87 };
88
89 partition@30000 {
90 label = "u-boot-env";
91 reg = <0x30000 0x10000>;
92 read-only;
93 };
94
95 factory: partition@40000 {
96 label = "factory";
97 reg = <0x40000 0x30000>;
98 read-only;
99
100 nvmem-layout {
101 compatible = "fixed-layout";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 eeprom_factory_0: eeprom@0 {
106 reg = <0x0 0x4da8>;
107 };
108
109 eeprom_factory_8000: eeprom@8000 {
110 reg = <0x8000 0x4da8>;
111 };
112
113 macaddr_factory_10007: macaddr@10007 {
114 reg = <0x10007 0x6>;
115 };
116
117 macaddr_factory_1000d: macaddr@1000d {
118 reg = <0x1000d 0x6>;
119 };
120 };
121 };
122
123 partition@70000 {
124 compatible = "openwrt,uimage", "denx,uimage";
125 openwrt,offset = <FW_EDIMAX_OFFSET>;
126 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
127 label = "firmware";
128 reg = <0x70000 0xf90000>;
129 };
130 };
131 };
132 };
133
134 &pcie {
135 status = "okay";
136 };
137
138 &pcie0 {
139 wifi@0,0 {
140 compatible = "mediatek,mt76";
141 reg = <0x0000 0 0 0 0>;
142 nvmem-cells = <&eeprom_factory_0>;
143 nvmem-cell-names = "eeprom";
144 ieee80211-freq-limit = <2400000 2500000>;
145 };
146 };
147
148 &pcie1 {
149 wifi@0,0 {
150 compatible = "mediatek,mt76";
151 reg = <0x0000 0 0 0 0>;
152 nvmem-cells = <&eeprom_factory_8000>;
153 nvmem-cell-names = "eeprom";
154 ieee80211-freq-limit = <5000000 6000000>;
155 };
156 };
157
158 &gmac0 {
159 nvmem-cells = <&macaddr_factory_10007>;
160 nvmem-cell-names = "mac-address";
161 };
162
163 &gmac1 {
164 status = "okay";
165 label = "wan";
166 phy-handle = <&ethphy0>;
167
168 nvmem-cells = <&macaddr_factory_1000d>;
169 nvmem-cell-names = "mac-address";
170 };
171
172 &mdio {
173 ethphy0: ethernet-phy@0 {
174 reg = <0>;
175 };
176 };
177
178 &switch0 {
179 ports {
180 port@1 {
181 status = "okay";
182 label = "lan";
183 };
184 };
185 };
186
187 &state_default {
188 gpio {
189 groups = "jtag", "uart2", "uart3", "wdt";
190 function = "gpio";
191 };
192 };