ramips: mt7621: convert to nvmem-layout
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7621_dlink_dir-3060-a1.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 = "dlink,dir-3060-a1", "mediatek,mt7621-soc";
10 model = "D-Link DIR-3060 A1";
11
12 aliases {
13 label-mac-device = &gmac0;
14 led-boot = &led_power_orange;
15 led-failsafe = &led_power_white;
16 led-running = &led_power_white;
17 led-upgrade = &led_net_orange;
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 reset {
24 label = "reset";
25 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_RESTART>;
27 };
28
29 wps {
30 label = "wps";
31 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_WPS_BUTTON>;
33 };
34 };
35
36 leds {
37 compatible = "gpio-leds";
38
39 led_power_orange: power_orange {
40 label = "orange:power";
41 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
42 };
43
44 led_power_white: power_white {
45 label = "white:power";
46 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
47 };
48
49 led_net_orange: net_orange {
50 label = "orange:net";
51 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
52 };
53
54 net_white {
55 label = "white:net";
56 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
57 };
58
59 usb2_white {
60 label = "white:usb2";
61 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
62 trigger-sources = <&ehci_port2>;
63 linux,default-trigger = "usbport";
64 };
65
66 usb3_white {
67 label = "white:usb3";
68 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
69 trigger-sources = <&xhci_ehci_port1>;
70 linux,default-trigger = "usbport";
71 };
72
73 wlan2g {
74 label = "white:wlan2g";
75 gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
76 linux,default-trigger = "phy0radio";
77 };
78
79 wlan5glb {
80 label = "white:wlan5glb";
81 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
82 linux,default-trigger = "phy1radio";
83 };
84
85 wlan5ghb {
86 label = "white:wlan5ghb";
87 gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
88 linux,default-trigger = "phy2radio";
89 };
90 };
91 };
92
93 &nand {
94 status = "okay";
95
96 partitions {
97 compatible = "fixed-partitions";
98 #address-cells = <1>;
99 #size-cells = <1>;
100
101 partition@0 {
102 label = "Bootloader";
103 reg = <0x0 0x80000>;
104 read-only;
105 };
106
107 partition@80000 {
108 label = "config";
109 reg = <0x80000 0x80000>;
110 read-only;
111 };
112
113 factory: partition@100000 {
114 label = "factory";
115 reg = <0x100000 0x40000>;
116 read-only;
117
118 nvmem-layout {
119 compatible = "fixed-layout";
120 #address-cells = <1>;
121 #size-cells = <1>;
122
123 eeprom_factory_0: eeprom@0 {
124 reg = <0x0 0x4da8>;
125 };
126
127 eeprom_factory_8000: eeprom@8000 {
128 reg = <0x8000 0x4da8>;
129 };
130
131 macaddr_factory_e000: macaddr@e000 {
132 reg = <0xe000 0x6>;
133 };
134
135 macaddr_factory_e006: macaddr@e006 {
136 reg = <0xe006 0x6>;
137 };
138 };
139 };
140
141 partition@140000 {
142 label = "config2";
143 reg = <0x140000 0x40000>;
144 read-only;
145 };
146
147 partition@180000 {
148 label = "firmware";
149 compatible = "openwrt,uimage", "denx,uimage";
150 openwrt,padding = <96>;
151 reg = <0x180000 0x2800000>;
152 };
153
154 partition@2980000 {
155 label = "private";
156 reg = <0x2980000 0x2000000>;
157 read-only;
158 };
159
160 partition@4980000 {
161 label = "firmware2";
162 reg = <0x4980000 0x2800000>;
163 read-only;
164 };
165
166 partition@7180000 {
167 label = "mydlink";
168 reg = <0x7180000 0x600000>;
169 read-only;
170 };
171
172 partition@7780000 {
173 label = "reserved";
174 reg = <0x7780000 0x880000>;
175 read-only;
176 };
177 };
178 };
179
180 &pcie {
181 status = "okay";
182 };
183
184 &pcie0 {
185 wifi0: wifi@0,0 {
186 compatible = "mediatek,mt76";
187 reg = <0x0000 0 0 0 0>;
188 ieee80211-freq-limit = <2400000 6000000>;
189 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_e000>;
190 nvmem-cell-names = "eeprom", "mac-address";
191 mac-address-increment = <1>;
192 };
193 };
194
195 &pcie1 {
196 wifi1: wifi@0,0 {
197 compatible = "mediatek,mt76";
198 reg = <0x0000 0 0 0 0>;
199 ieee80211-freq-limit = <5000000 6000000>;
200 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_e000>;
201 nvmem-cell-names = "eeprom", "mac-address";
202 mac-address-increment = <3>;
203 };
204 };
205
206 &gmac0 {
207 nvmem-cells = <&macaddr_factory_e000>;
208 nvmem-cell-names = "mac-address";
209 };
210
211 &switch0 {
212 ports {
213 port@0 {
214 status = "okay";
215 label = "lan4";
216 };
217
218 port@1 {
219 status = "okay";
220 label = "lan3";
221 };
222
223 port@2 {
224 status = "okay";
225 label = "lan2";
226 };
227
228 port@3 {
229 status = "okay";
230 label = "lan1";
231 };
232
233 port@4 {
234 status = "okay";
235 label = "wan";
236 nvmem-cells = <&macaddr_factory_e006>;
237 nvmem-cell-names = "mac-address";
238 };
239 };
240 };
241
242 &state_default {
243 gpio {
244 groups = "i2c", "uart3", "jtag", "wdt";
245 function = "gpio";
246 };
247 };