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