ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_iodata_wnpr2600g.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
8 / {
9 compatible = "iodata,wnpr2600g", "mediatek,mt7621-soc";
10 model = "I-O DATA WNPR2600G";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_power: power {
23 label = "green:power";
24 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
25 default-state = "on";
26 };
27
28 notification {
29 label = "green:notification";
30 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
31 };
32
33 wlan2g {
34 label = "green:wlan2g";
35 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
36 linux,default-trigger = "phy0radio";
37 };
38
39 wlan5g {
40 label = "green:wlan5g";
41 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
42 linux,default-trigger = "phy1radio";
43 };
44 };
45
46 keys {
47 compatible = "gpio-keys";
48
49 auto {
50 label = "auto";
51 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
52 linux,code = <BTN_0>;
53 linux,input-type = <EV_SW>;
54 };
55
56 reset {
57 label = "reset";
58 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
59 linux,code = <KEY_RESTART>;
60 };
61
62 wps {
63 label = "wps";
64 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
65 linux,code = <KEY_WPS_BUTTON>;
66 };
67 };
68 };
69
70 &spi0 {
71 status = "okay";
72
73 flash@0 {
74 compatible = "jedec,spi-nor";
75 reg = <0>;
76 spi-max-frequency = <40000000>;
77
78 partitions {
79 compatible = "fixed-partitions";
80 #address-cells = <1>;
81 #size-cells = <1>;
82
83 partition@0 {
84 label = "u-boot";
85 reg = <0x000000 0x030000>;
86 read-only;
87 };
88
89 partition@30000 {
90 label = "u-boot-env";
91 reg = <0x030000 0x010000>;
92 read-only;
93 };
94
95 factory: partition@40000 {
96 label = "factory";
97 reg = <0x040000 0x010000>;
98 read-only;
99
100 nvmem-layout {
101 compatible = "fixed-layout";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 eeprom_factory_0: eeprom@0 {
106 reg = <0x0 0x4da8>;
107 };
108
109 eeprom_factory_8000: eeprom@8000 {
110 reg = <0x8000 0x4da8>;
111 };
112
113 macaddr_factory_4: macaddr@4 {
114 reg = <0x4 0x6>;
115 };
116 };
117 };
118
119 partition@50000 {
120 compatible = "denx,uimage";
121 label = "firmware";
122 reg = <0x050000 0xda0000>;
123 };
124
125 partition@df0000 {
126 label = "manufacture";
127 reg = <0xdf0000 0x190000>;
128 read-only;
129 };
130
131 partition@f80000 {
132 label = "storage";
133 reg = <0xf80000 0x080000>;
134 read-only;
135 };
136 };
137 };
138 };
139
140 &gmac0 {
141 nvmem-cells = <&macaddr_factory_4>;
142 nvmem-cell-names = "mac-address";
143 };
144
145 &gmac1 {
146 status = "okay";
147 label = "wan";
148 phy-handle = <&ethphy0>;
149
150 nvmem-cells = <&macaddr_factory_4>;
151 nvmem-cell-names = "mac-address";
152 };
153
154 &mdio {
155 ethphy0: ethernet-phy@0 {
156 reg = <0>;
157 };
158 };
159
160 &switch0 {
161 ports {
162 port@1 {
163 status = "okay";
164 label = "lan4";
165 };
166
167 port@2 {
168 status = "okay";
169 label = "lan3";
170 };
171
172 port@3 {
173 status = "okay";
174 label = "lan2";
175 };
176
177 port@4 {
178 status = "okay";
179 label = "lan1";
180 };
181 };
182 };
183
184 &state_default {
185 gpio {
186 groups = "uart2", "uart3", "jtag", "wdt";
187 function = "gpio";
188 };
189 };
190
191 &pcie {
192 status = "okay";
193 };
194
195 &pcie0 {
196 wifi@0,0 {
197 compatible = "mediatek,mt76";
198 reg = <0x0000 0 0 0 0>;
199 nvmem-cells = <&eeprom_factory_0>;
200 nvmem-cell-names = "eeprom";
201 ieee80211-freq-limit = <2400000 2500000>;
202 };
203 };
204
205 &pcie1 {
206 wifi@0,0 {
207 compatible = "mediatek,mt76";
208 reg = <0x0000 0 0 0 0>;
209 nvmem-cells = <&eeprom_factory_8000>;
210 nvmem-cell-names = "eeprom";
211 ieee80211-freq-limit = <5000000 6000000>;
212 };
213 };
214
215 &xhci {
216 status = "disabled";
217 };