ramips: mt7620n: convert to nvmem-layout
[openwrt/staging/hauke.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 label = "factory";
108 reg = <0xf60000 0x10000>;
109 read-only;
110
111 nvmem-layout {
112 compatible = "fixed-layout";
113 #address-cells = <1>;
114 #size-cells = <1>;
115
116 eeprom_factory_0: eeprom@0 {
117 reg = <0x0 0x200>;
118 };
119 };
120 };
121
122 board_data: partition@f70000 {
123 label = "board_data";
124 reg = <0xf70000 0x10000>;
125 read-only;
126
127 nvmem-layout {
128 compatible = "fixed-layout";
129 #address-cells = <1>;
130 #size-cells = <1>;
131
132 macaddr_board_data_b0: macaddr@b0 {
133 reg = <0xb0 0x6>;
134 };
135 };
136 };
137
138 partition@f80000 {
139 label = "POT";
140 reg = <0xf80000 0x10000>;
141 read-only;
142 };
143
144 partition@f90000 {
145 label = "Traffic Meter";
146 reg = <0xf90000 0x10000>;
147 read-only;
148 };
149
150 partition@fa0000 {
151 label = "Traffic Meter2";
152 reg = <0xfa0000 0x10000>;
153 read-only;
154 };
155
156 partition@fb0000 {
157 label = "nvram";
158 reg = <0xfb0000 0x10000>;
159 };
160
161 partition@fc0000 {
162 label = "DPF";
163 reg = <0xfc0000 0x10000>;
164 read-only;
165 };
166
167 partition@fd0000 {
168 label = "ralink_nvram";
169 reg = <0xfd0000 0x10000>;
170 read-only;
171 };
172
173 partition@fe0000 {
174 label = "reserved1";
175 reg = <0xfe0000 0x10000>;
176 read-only;
177 };
178
179 partition@ff0000 {
180 label = "reserved2";
181 reg = <0xff0000 0x10000>;
182 read-only;
183 };
184 };
185 };
186 };
187
188 &ethernet {
189 mediatek,portmap = "wllll";
190 nvmem-cells = <&macaddr_board_data_b0>;
191 nvmem-cell-names = "mac-address";
192 };
193
194 &ehci {
195 status = "okay";
196 };
197
198 &ohci {
199 status = "okay";
200 };
201
202 &wmac {
203 nvmem-cells = <&eeprom_factory_0>, <&macaddr_board_data_b0>;
204 nvmem-cell-names = "eeprom", "mac-address";
205 };
206
207 &state_default {
208 default {
209 groups = "ephy", "wled", "pa", "i2c";
210 function = "gpio";
211 };
212 };