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