mediatek: convert to new LED color/function format where possible
[openwrt/staging/mans0n.git] / target / linux / mediatek / dts / mt7981b-qihoo-360t7.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 /dts-v1/;
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/leds/common.h>
7
8 #include "mt7981.dtsi"
9
10 / {
11 model = "Qihoo 360T7";
12 compatible = "qihoo,360t7", "mediatek,mt7981";
13
14 aliases {
15 serial0 = &uart0;
16 led-boot = &led_status_red;
17 led-failsafe = &led_status_red;
18 led-running = &led_status_green;
19 led-upgrade = &led_status_green;
20 };
21
22 chosen {
23 stdout-path = "serial0:115200n8";
24 };
25
26 memory {
27 reg = <0 0x40000000 0 0x10000000>;
28 };
29
30 gpio-keys {
31 compatible = "gpio-keys";
32
33 reset {
34 label = "reset";
35 linux,code = <KEY_RESTART>;
36 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
37 };
38
39 wps {
40 label = "wps";
41 linux,code = <KEY_WPS_BUTTON>;
42 gpios = <&pio 0 GPIO_ACTIVE_LOW>;
43 };
44 };
45
46 leds {
47 compatible = "gpio-leds";
48
49 led_status_red: red {
50 function = LED_FUNCTION_STATUS;
51 color = <LED_COLOR_ID_RED>;
52 gpios = <&pio 3 GPIO_ACTIVE_LOW>;
53 };
54
55 led_status_green: green {
56 function = LED_FUNCTION_STATUS;
57 color = <LED_COLOR_ID_GREEN>;
58 gpios = <&pio 7 GPIO_ACTIVE_LOW>;
59 };
60 };
61 };
62
63 &eth {
64 status = "okay";
65
66 gmac0: mac@0 {
67 compatible = "mediatek,eth-mac";
68 reg = <0>;
69 phy-mode = "2500base-x";
70
71 fixed-link {
72 speed = <2500>;
73 full-duplex;
74 pause;
75 };
76 };
77 };
78
79 &mdio_bus {
80 switch: switch@1f {
81 compatible = "mediatek,mt7531";
82 reg = <31>;
83 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
84 interrupt-controller;
85 #interrupt-cells = <1>;
86 interrupt-parent = <&pio>;
87 interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
88 };
89 };
90
91 &spi0 {
92 pinctrl-names = "default";
93 pinctrl-0 = <&spi0_flash_pins>;
94 status = "okay";
95
96 spi_nand@0 {
97 compatible = "spi-nand";
98 #address-cells = <1>;
99 #size-cells = <1>;
100 reg = <0>;
101
102 spi-max-frequency = <52000000>;
103 spi-tx-bus-width = <4>;
104 spi-rx-bus-width = <4>;
105
106 partitions {
107 compatible = "fixed-partitions";
108 #address-cells = <1>;
109 #size-cells = <1>;
110
111 partition@0 {
112 label = "bl2";
113 reg = <0x0000000 0x0100000>;
114 read-only;
115 };
116
117 partition@100000 {
118 label = "u-boot-env";
119 reg = <0x0100000 0x0080000>;
120 };
121
122 factory: partition@180000 {
123 label = "Factory";
124 reg = <0x0180000 0x0200000>;
125 read-only;
126 };
127
128 partition@380000 {
129 label = "fip";
130 reg = <0x0380000 0x0200000>;
131 read-only;
132 };
133
134 partition@580000 {
135 label = "ubi";
136 reg = <0x0580000 0x6c00000>;
137 };
138
139 partition@7180000 {
140 label = "config";
141 reg = <0x7180000 0x0100000>;
142 read-only;
143 };
144
145 partition@7280000 {
146 label = "factory";
147 reg = <0x7280000 0x0080000>;
148 read-only;
149 };
150
151 partition@7300000 {
152 label = "log";
153 reg = <0x7300000 0x0700000>;
154 read-only;
155 };
156 };
157 };
158 };
159
160 &switch {
161 ports {
162 #address-cells = <1>;
163 #size-cells = <0>;
164
165 port@0 {
166 reg = <0>;
167 label = "lan3";
168 };
169
170 port@1 {
171 reg = <1>;
172 label = "lan2";
173 };
174
175 port@2 {
176 reg = <2>;
177 label = "lan1";
178 };
179
180 port@3 {
181 reg = <3>;
182 label = "wan";
183 };
184
185 port@6 {
186 reg = <6>;
187 ethernet = <&gmac0>;
188 phy-mode = "2500base-x";
189
190 fixed-link {
191 speed = <2500>;
192 full-duplex;
193 pause;
194 };
195 };
196 };
197 };
198
199 &pio {
200 spi0_flash_pins: spi0-pins {
201 mux {
202 function = "spi";
203 groups = "spi0", "spi0_wp_hold";
204 };
205
206 conf-pu {
207 pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
208 drive-strength = <8>;
209 mediatek,pull-up-adv = <0>; /* bias-disable */
210 };
211
212 conf-pd {
213 pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
214 drive-strength = <8>;
215 mediatek,pull-up-adv = <0>; /* bias-disable */
216 };
217 };
218 };
219
220 &uart0 {
221 status = "okay";
222 };
223
224 &watchdog {
225 status = "okay";
226 };
227
228 &wifi {
229 status = "okay";
230
231 mediatek,mtd-eeprom = <&factory 0x0>;
232 };