ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_dlink_dap-x1860-a1.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 = "dlink,dap-x1860-a1", "mediatek,mt7621-soc";
11 model = "D-Link DAP-X1860 A1";
12
13 chosen {
14 bootargs = "console=ttyS0,115200";
15 };
16
17 aliases {
18 label-mac-device = &gmac0;
19 led-boot = &led_power_green;
20 led-failsafe = &led_power_red;
21 led-running = &led_power_green;
22 led-upgrade = &led_power_red;
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 wps {
29 label = "wps";
30 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_WPS_BUTTON>;
32 };
33
34 reset {
35 label = "reset";
36 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RESTART>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led_power_green: power_green {
45 function = LED_FUNCTION_POWER;
46 color = <LED_COLOR_ID_GREEN>;
47 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
48 default-state = "on";
49 };
50
51 led_power_red: power_red {
52 function = LED_FUNCTION_POWER;
53 color = <LED_COLOR_ID_RED>;
54 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
55 };
56
57 power_orange {
58 function = LED_FUNCTION_POWER;
59 color = <LED_COLOR_ID_ORANGE>;
60 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
61 };
62
63 rssihigh {
64 label = "green:rssihigh";
65 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
66 };
67
68 rssimedium {
69 label = "green:rssimedium";
70 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
71 };
72
73 rssilow_orange {
74 label = "orange:rssilow";
75 gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
76 };
77
78 rssilow_green {
79 label = "green:rssilow";
80 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
81 };
82 };
83
84 virtual_flash {
85 compatible = "mtd-concat";
86
87 devices = <&fwconcat0 &fwconcat1>;
88
89 partitions {
90 compatible = "fixed-partitions";
91 #address-cells = <1>;
92 #size-cells = <1>;
93
94 partition@0 {
95 label = "ubi";
96 reg = <0x0 0x0>;
97 };
98 };
99 };
100 };
101
102 &nand {
103 status = "okay";
104
105 mediatek,nmbm;
106 /* rsvd = Remapping Range / NAND Erase-Size */
107 /* rsvd = 0x800000 / 0x20000 */
108 mediatek,bmt-max-reserved-blocks = <64>;
109 /* Remapping should include raw-nand we operate upon without UBI layer. */
110 /* This includes (at least) the kernel which has to be loaded by U-Boot.*/
111 mediatek,bmt-remap-range =
112 <0x0 0x980000>;
113
114 partitions {
115 compatible = "fixed-partitions";
116 #address-cells = <1>;
117 #size-cells = <1>;
118
119 partition@0 {
120 label = "bootloader";
121 reg = <0x0 0x80000>;
122 read-only;
123 };
124
125 partition@80000 {
126 label = "config";
127 reg = <0x80000 0x80000>;
128 read-only;
129 };
130
131 factory: partition@100000 {
132 label = "factory";
133 reg = <0x100000 0x80000>;
134 read-only;
135
136 nvmem-layout {
137 compatible = "fixed-layout";
138 #address-cells = <1>;
139 #size-cells = <1>;
140
141 eeprom_factory_0: eeprom@0 {
142 reg = <0x0 0xe00>;
143 };
144
145 macaddr_factory_4: macaddr@4 {
146 reg = <0x4 0x6>;
147 };
148
149 precal_factory_e10: precal@e10 {
150 reg = <0xe10 0x19c10>;
151 };
152 };
153 };
154
155 partition@180000 {
156 label = "kernel";
157 reg = <0x180000 0x0800000>;
158 };
159
160 fwconcat0: partition@980000 {
161 label = "fwconcat0";
162 reg = <0x980000 0x2c00000>;
163 };
164
165 partition@3580000 {
166 label = "manufacture";
167 reg = <0x3580000 0x400000>;
168 read-only;
169 };
170
171 partition@3980000 {
172 label = "storage";
173 reg = <0x3980000 0x680000>;
174 read-only;
175 };
176
177 fwconcat1: partition@4000000 {
178 label = "fwconcat1";
179 reg = <0x4000000 0x3800000>;
180 };
181 };
182 };
183
184 &pcie {
185 status = "okay";
186 };
187
188 &pcie1 {
189 wifi@0,0 {
190 compatible = "mediatek,mt76";
191 reg = <0x0000 0 0 0 0>;
192 nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
193 nvmem-cell-names = "eeprom", "precal";
194 mediatek,disable-radar-background;
195 };
196 };
197
198 &ethernet {
199 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
200 };
201
202 &gmac0 {
203 nvmem-cells = <&macaddr_factory_4>;
204 nvmem-cell-names = "mac-address";
205 };
206
207 &switch0 {
208 gpio-controller;
209 #gpio-cells = <2>;
210
211 ports {
212 port@0 {
213 status = "okay";
214 label = "lan";
215 };
216 };
217 };
218
219 &state_default {
220 gpio {
221 groups = "uart2";
222 function = "gpio";
223 };
224 };