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