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