ramips: convert to new LED color/function format where possible
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_winstars_ws-wn583a6.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 = "winstars,ws-wn583a6", "mediatek,mt7621-soc";
11 model = "Winstars WS-WN583A6";
12
13 aliases {
14 led-boot = &led_status_red;
15 led-failsafe = &led_status_red;
16 led-running = &led_status_blue;
17 led-upgrade = &led_status_red;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 night_light_white {
24 label = "white:night_light";
25 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
26 };
27
28 led_status_blue: status_blue {
29 function = LED_FUNCTION_STATUS;
30 color = <LED_COLOR_ID_BLUE>;
31 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
32 };
33
34 status_amber {
35 function = LED_FUNCTION_STATUS;
36 color = <LED_COLOR_ID_AMBER>;
37 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
38 };
39
40 led_status_red: status_red {
41 function = LED_FUNCTION_STATUS;
42 color = <LED_COLOR_ID_RED>;
43 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
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 13 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 = <104000000>;
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 0x400>;
102 };
103
104 eeprom_factory_8000: eeprom@8000 {
105 reg = <0x8000 0x4da8>;
106 };
107
108 macaddr_factory_e000: macaddr@e000 {
109 reg = <0xe000 0x6>;
110 };
111
112 macaddr_factory_e006: macaddr@e006 {
113 reg = <0xe006 0x6>;
114 };
115 };
116 };
117
118 partition@50000 {
119 compatible = "denx,uimage";
120 label = "firmware";
121 reg = <0x50000 0x7b0000>;
122 };
123 };
124 };
125 };
126
127 &pcie {
128 status = "okay";
129 };
130
131 &pcie0 {
132 wifi@0,0 {
133 compatible = "mediatek,mt76";
134 reg = <0x0000 0 0 0 0>;
135 nvmem-cells = <&eeprom_factory_0>;
136 nvmem-cell-names = "eeprom";
137 };
138 };
139
140 &pcie1 {
141 wifi@0,0 {
142 compatible = "mediatek,mt76";
143 reg = <0x0000 0 0 0 0>;
144 nvmem-cells = <&eeprom_factory_8000>;
145 nvmem-cell-names = "eeprom";
146 };
147 };
148
149 &ethernet {
150 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
151 };
152
153 &gmac0 {
154 nvmem-cells = <&macaddr_factory_e000>;
155 nvmem-cell-names = "mac-address";
156 };
157
158 &switch0 {
159 ports {
160 port@0 {
161 status = "okay";
162 label = "wan";
163 nvmem-cells = <&macaddr_factory_e006>;
164 nvmem-cell-names = "mac-address";
165 };
166
167 port@1 {
168 status = "okay";
169 label = "lan";
170 };
171 };
172 };
173
174 &state_default {
175 gpio {
176 groups = "jtag", "wdt", "rgmii2";
177 function = "gpio";
178 };
179 };
180
181 &xhci {
182 status = "disabled";
183 };