ramips: convert to new LED color/function format where possible
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7620n_netgear_pr2000.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620n.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 = "netgear,pr2000", "ralink,mt7620n-soc";
11 model = "Netgear PR2000";
12
13 aliases {
14 label-mac-device = &ethernet;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 internet {
21 label = "green:internet";
22 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
23 };
24
25 wifi {
26 label = "green:wifi";
27 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
28 linux,default-trigger = "phy0tpt";
29 };
30
31 usb {
32 function = LED_FUNCTION_USB;
33 color = <LED_COLOR_ID_GREEN>;
34 gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
35 trigger-sources = <&ohci_port1>, <&ehci_port1>;
36 linux,default-trigger = "usbport";
37 };
38 };
39
40 keys {
41 compatible = "gpio-keys";
42
43 reset {
44 label = "reset";
45 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
46 linux,code = <KEY_RESTART>;
47 };
48
49 wireless {
50 label = "wireless";
51 gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
52 linux,code = <BTN_0>;
53 linux,input-type = <EV_SW>;
54 };
55
56 wired {
57 label = "wired";
58 gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
59 linux,code = <BTN_0>;
60 linux,input-type = <EV_SW>;
61 };
62 };
63 };
64
65 &gpio2 {
66 status = "okay";
67 };
68
69 &gpio3 {
70 status = "okay";
71 };
72
73 &spi0 {
74 status = "okay";
75
76 flash@0 {
77 compatible = "jedec,spi-nor";
78 reg = <0>;
79 spi-max-frequency = <50000000>;
80 m25p,fast-read;
81
82 partitions {
83 compatible = "fixed-partitions";
84 #address-cells = <1>;
85 #size-cells = <1>;
86
87 partition@0 {
88 label = "u-boot";
89 reg = <0x0 0x30000>;
90 read-only;
91 };
92
93 partition@30000 {
94 label = "u-boot-env";
95 reg = <0x30000 0x10000>;
96 };
97
98 /* sercomm header for kernel starts at 0x3ffba
99 * can be safely ignored since not used by OpenWRT
100 */
101
102 partition@40000 {
103 compatible = "denx,uimage";
104 label = "firmware";
105 reg = <0x40000 0xf20000>;
106 };
107
108 factory: partition@f60000 {
109 label = "factory";
110 reg = <0xf60000 0x10000>;
111 read-only;
112
113 nvmem-layout {
114 compatible = "fixed-layout";
115 #address-cells = <1>;
116 #size-cells = <1>;
117
118 eeprom_factory_0: eeprom@0 {
119 reg = <0x0 0x200>;
120 };
121 };
122 };
123
124 board_data: partition@f70000 {
125 label = "board_data";
126 reg = <0xf70000 0x10000>;
127 read-only;
128
129 nvmem-layout {
130 compatible = "fixed-layout";
131 #address-cells = <1>;
132 #size-cells = <1>;
133
134 macaddr_board_data_b0: macaddr@b0 {
135 reg = <0xb0 0x6>;
136 };
137 };
138 };
139
140 partition@f80000 {
141 label = "POT";
142 reg = <0xf80000 0x10000>;
143 read-only;
144 };
145
146 partition@f90000 {
147 label = "Traffic Meter";
148 reg = <0xf90000 0x10000>;
149 read-only;
150 };
151
152 partition@fa0000 {
153 label = "Traffic Meter2";
154 reg = <0xfa0000 0x10000>;
155 read-only;
156 };
157
158 partition@fb0000 {
159 label = "nvram";
160 reg = <0xfb0000 0x10000>;
161 };
162
163 partition@fc0000 {
164 label = "DPF";
165 reg = <0xfc0000 0x10000>;
166 read-only;
167 };
168
169 partition@fd0000 {
170 label = "ralink_nvram";
171 reg = <0xfd0000 0x10000>;
172 read-only;
173 };
174
175 partition@fe0000 {
176 label = "reserved1";
177 reg = <0xfe0000 0x10000>;
178 read-only;
179 };
180
181 partition@ff0000 {
182 label = "reserved2";
183 reg = <0xff0000 0x10000>;
184 read-only;
185 };
186 };
187 };
188 };
189
190 &ethernet {
191 mediatek,portmap = "wllll";
192 nvmem-cells = <&macaddr_board_data_b0>;
193 nvmem-cell-names = "mac-address";
194 };
195
196 &ehci {
197 status = "okay";
198 };
199
200 &ohci {
201 status = "okay";
202 };
203
204 &wmac {
205 nvmem-cells = <&eeprom_factory_0>, <&macaddr_board_data_b0>;
206 nvmem-cell-names = "eeprom", "mac-address";
207 };
208
209 &state_default {
210 default {
211 groups = "ephy", "wled", "pa", "i2c";
212 function = "gpio";
213 };
214 };