ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_iodata_wn-xx-xr.dtsi
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 aliases {
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 label-mac-device = &gmac1;
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 wps {
22 function = LED_FUNCTION_WPS;
23 color = <LED_COLOR_ID_GREEN>;
24 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
25 };
26
27 led_power: power {
28 function = LED_FUNCTION_POWER;
29 color = <LED_COLOR_ID_GREEN>;
30 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
31 };
32 };
33
34 keys {
35 compatible = "gpio-keys";
36
37 reset {
38 label = "reset";
39 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
40 linux,code = <KEY_RESTART>;
41 };
42
43 repeater {
44 label = "repeater";
45 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
46 linux,code = <BTN_0>;
47 linux,input-type = <EV_SW>;
48 };
49
50 wps {
51 label = "wps";
52 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_WPS_BUTTON>;
54 };
55 };
56 };
57
58 &nand {
59 status = "okay";
60
61 mediatek,bbt;
62 mediatek,bmt-remap-range =
63 <0x0000000 0x0800000>,
64 <0x3600000 0x4980000>;
65
66 partitions: partitions {
67 compatible = "fixed-partitions";
68 #address-cells = <1>;
69 #size-cells = <1>;
70
71 partition@0 {
72 label = "u-boot";
73 reg = <0x0 0x0100000>;
74 read-only;
75 };
76
77 partition@100000 {
78 label = "u-boot-env";
79 reg = <0x0100000 0x0100000>;
80 read-only;
81 };
82
83 factory: partition@200000 {
84 label = "factory";
85 reg = <0x0200000 0x0100000>;
86
87 nvmem-layout {
88 compatible = "fixed-layout";
89 #address-cells = <1>;
90 #size-cells = <1>;
91
92 eeprom_factory_0: eeprom@0 {
93 reg = <0x0 0x400>;
94 };
95
96 eeprom_factory_8000: eeprom@8000 {
97 reg = <0x8000 0x4da8>;
98 };
99
100 macaddr_factory_e000: macaddr@e000 {
101 reg = <0xe000 0x6>;
102 };
103
104 macaddr_factory_e006: macaddr@e006 {
105 reg = <0xe006 0x6>;
106 };
107 };
108 };
109
110 partition@300000 {
111 label = "SecondBoot";
112 reg = <0x0300000 0x0100000>;
113 read-only;
114 };
115
116 partition@400000 {
117 label = "kernel";
118 reg = <0x0400000 0x0400000>;
119 };
120
121 partition@800000 {
122 label = "ubi";
123 reg = <0x0800000 0x2e00000>;
124 };
125
126 partition@3600000 {
127 label = "Config";
128 reg = <0x3600000 0x0100000>;
129 read-only;
130 };
131
132 partition@3700000 {
133 label = "firmware_2";
134 reg = <0x3700000 0x3200000>;
135 };
136
137 partition@6900000 {
138 label = "Config_2";
139 reg = <0x6900000 0x0100000>;
140 read-only;
141 };
142
143 partition@6a00000 {
144 label = "persist";
145 reg = <0x6a00000 0x0100000>;
146 };
147 };
148 };
149
150 &gmac0 {
151 nvmem-cells = <&macaddr_factory_e000>;
152 nvmem-cell-names = "mac-address";
153 };
154
155 &gmac1 {
156 status = "okay";
157 label = "wan";
158 phy-handle = <&ethphy0>;
159
160 nvmem-cells = <&macaddr_factory_e006>;
161 nvmem-cell-names = "mac-address";
162 };
163
164 &mdio {
165 ethphy0: ethernet-phy@0 {
166 reg = <0>;
167 };
168 };
169
170 &switch0 {
171 ports {
172 port@1 {
173 status = "okay";
174 label = "lan4";
175 };
176
177 port@2 {
178 status = "okay";
179 label = "lan3";
180 };
181
182 port@3 {
183 status = "okay";
184 label = "lan2";
185 };
186
187 port@4 {
188 status = "okay";
189 label = "lan1";
190 };
191 };
192 };
193
194 &pcie {
195 status = "okay";
196 };
197
198 &state_default {
199 gpio {
200 groups = "uart2", "uart3", "wdt";
201 function = "gpio";
202 };
203 };
204
205 &xhci {
206 status = "disabled";
207 };