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