ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_dual-q_h721.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 = "dual-q,h721", "mediatek,mt7621-soc";
11 model = "Dual-Q H721";
12
13 aliases {
14 led-boot = &led_status;
15 led-failsafe = &led_status;
16 led-running = &led_status;
17 led-upgrade = &led_status;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 gpio-export {
25 compatible = "gpio-export";
26 #size-cells = <0>;
27
28 usb-30-power {
29 gpio-export,name = "usb-30-power";
30 gpio-export,output = <0>;
31 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
32 };
33
34 usb-20-power {
35 gpio-export,name = "usb-20-power";
36 gpio-export,output = <0>;
37 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
38 };
39 };
40
41 keys {
42 compatible = "gpio-keys";
43
44 reset {
45 label = "reset";
46 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
47 linux,code = <KEY_RESTART>;
48 };
49 };
50
51 leds {
52 compatible = "gpio-leds";
53
54 usb1 {
55 label = "green:usb1";
56 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
57 };
58
59 sig1 {
60 label = "green:sig1";
61 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
62 };
63
64 usb2 {
65 label = "green:usb2";
66 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
67 };
68
69 sig2 {
70 label = "green:sig2";
71 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
72 };
73
74 tf {
75 label = "green:tf";
76 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
77 };
78
79 wifi1 {
80 label = "green:wifi1";
81 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
82 };
83
84 wifi2 {
85 label = "green:wifi2";
86 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
87 };
88
89 led_status: status {
90 function = LED_FUNCTION_STATUS;
91 color = <LED_COLOR_ID_GREEN>;
92 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
93 };
94 };
95 };
96
97 &spi0 {
98 status = "okay";
99
100 flash@0 {
101 compatible = "jedec,spi-nor";
102 reg = <0>;
103 spi-max-frequency = <40000000>;
104
105 partitions {
106 compatible = "fixed-partitions";
107 #address-cells = <1>;
108 #size-cells = <1>;
109
110 partition@0 {
111 label = "bootloader";
112 reg = <0x0 0x30000>;
113 read-only;
114 };
115
116 partition@30000 {
117 label = "config";
118 reg = <0x30000 0x10000>;
119 read-only;
120 };
121
122 partition@40000 {
123 label = "factory";
124 reg = <0x40000 0x10000>;
125 read-only;
126
127 nvmem-layout {
128 compatible = "fixed-layout";
129 #address-cells = <1>;
130 #size-cells = <1>;
131
132 macaddr_factory_e000: macaddr@e000 {
133 compatible = "mac-base";
134 reg = <0xe000 0x6>;
135 #nvmem-cell-cells = <1>;
136 };
137 };
138 };
139
140 partition@50000 {
141 compatible = "denx,uimage";
142 label = "firmware";
143 reg = <0x50000 0xfb0000>;
144 };
145 };
146 };
147 };
148
149 &sdhci {
150 status = "okay";
151 };
152
153 &pcie {
154 status = "okay";
155 };
156
157 &switch0 {
158 ports {
159 port@0 {
160 status = "okay";
161 label = "lan1";
162 };
163
164 port@1 {
165 status = "okay";
166 label = "lan2";
167 };
168
169 port@2 {
170 status = "okay";
171 label = "lan3";
172 };
173
174 port@3 {
175 status = "okay";
176 label = "lan4";
177 };
178
179 port@4 {
180 status = "okay";
181 label = "wan";
182
183 nvmem-cells = <&macaddr_factory_e000 1>;
184 nvmem-cell-names = "mac-address";
185 };
186 };
187 };
188
189 &ethernet {
190 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
191 };
192
193 &gmac0 {
194 nvmem-cells = <&macaddr_factory_e000 0>;
195 nvmem-cell-names = "mac-address";
196 };
197
198 &state_default {
199 gpio {
200 groups = "jtag", "wdt", "rgmii2";
201 function = "gpio";
202 };
203 };