ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/mkresin.git] / target / linux / ramips / dts / mt7621_netgear_sercomm_bzv.dtsi
1 // SPDX-License-Identifier: GPL-2.0-only
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "mediatek,mt7621-soc";
10
11 aliases {
12 label-mac-device = &gmac0;
13 led-boot = &led_power_white;
14 led-failsafe = &led_power_orange;
15 led-running = &led_power_white;
16 led-upgrade = &led_power_orange;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 wps {
23 label = "wps";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_WPS_BUTTON>;
26 };
27
28 rfkill {
29 label = "rfkill";
30 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RFKILL>;
32 };
33
34 reset {
35 label = "reset";
36 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RESTART>;
38 };
39 };
40
41 leds: leds {
42 compatible = "gpio-leds";
43
44 led_power_orange: power_orange {
45 gpios = <&gpio_expander 0 GPIO_ACTIVE_LOW>;
46 label = "orange:power";
47 };
48
49 led_power_white: power_white {
50 gpios = <&gpio_expander 1 GPIO_ACTIVE_LOW>;
51 label = "white:power";
52 };
53
54 wan_orange {
55 gpios = <&gpio_expander 2 GPIO_ACTIVE_LOW>;
56 label = "orange:wan";
57 };
58
59 wan_white {
60 gpios = <&gpio_expander 3 GPIO_ACTIVE_LOW>;
61 label = "white:wan";
62 };
63
64 wlan2g {
65 gpios = <&gpio_expander 4 GPIO_ACTIVE_LOW>;
66 label = "white:wlan2g";
67 linux,default-trigger = "phy0radio";
68 };
69
70 wlan5g {
71 gpios = <&gpio_expander 5 GPIO_ACTIVE_LOW>;
72 label = "white:wlan5g";
73 linux,default-trigger = "phy1radio";
74 };
75
76 usb3 {
77 gpios = <&gpio_expander 7 GPIO_ACTIVE_LOW>;
78 label = "white:usb3";
79 linux,default-trigger = "usbport";
80 trigger-sources = <&xhci_ehci_port1>;
81 };
82
83 lan1_orange {
84 gpios = <&gpio_expander 8 GPIO_ACTIVE_LOW>;
85 label = "orange:lan1";
86 };
87
88 lan1_white {
89 gpios = <&gpio_expander 9 GPIO_ACTIVE_LOW>;
90 label = "white:lan1";
91 };
92
93 lan2_orange {
94 gpios = <&gpio_expander 10 GPIO_ACTIVE_LOW>;
95 label = "orange:lan2";
96 };
97
98 lan2_white {
99 gpios = <&gpio_expander 11 GPIO_ACTIVE_LOW>;
100 label = "white:lan2";
101 };
102
103 lan3_orange {
104 gpios = <&gpio_expander 12 GPIO_ACTIVE_LOW>;
105 label = "orange:lan3";
106 };
107
108 lan3_white {
109 gpios = <&gpio_expander 13 GPIO_ACTIVE_LOW>;
110 label = "white:lan3";
111 };
112
113 lan4_orange {
114 gpios = <&gpio_expander 14 GPIO_ACTIVE_LOW>;
115 label = "orange:lan4";
116 };
117
118 lan4_white {
119 gpios = <&gpio_expander 15 GPIO_ACTIVE_LOW>;
120 label = "white:lan4";
121 };
122
123 wps {
124 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
125 label = "white:wps";
126 };
127
128 wlan {
129 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
130 label = "white:wlan";
131 };
132 };
133 };
134
135 &state_default {
136 gpio {
137 groups = "uart3", "uart2", "jtag", "wdt";
138 function = "gpio";
139 };
140 };
141
142 &pcie {
143 status = "okay";
144 };
145
146 &pcie0 {
147 wifi@0,0 {
148 compatible = "mediatek,mt76";
149 reg = <0x0 0 0 0 0>;
150 mediatek,mtd-eeprom = <&factory 0x0>;
151 ieee80211-freq-limit = <2400000 2500000>;
152 };
153 };
154
155 &pcie1 {
156 wifi@0,0 {
157 compatible = "mediatek,mt76";
158 reg = <0x0 0 0 0 0>;
159 mediatek,mtd-eeprom = <&factory 0x8000>;
160 ieee80211-freq-limit = <5000000 6000000>;
161 };
162 };
163
164 &gmac0 {
165 nvmem-cells = <&macaddr_factory_4>;
166 nvmem-cell-names = "mac-address";
167 };
168
169 &switch0 {
170 ports {
171 port@0 {
172 status = "okay";
173 label = "lan4";
174 };
175
176 port@1 {
177 status = "okay";
178 label = "lan3";
179 };
180
181 port@2 {
182 status = "okay";
183 label = "lan2";
184 };
185
186 port@3 {
187 status = "okay";
188 label = "lan1";
189 };
190
191 port@4 {
192 status = "okay";
193 label = "wan";
194 nvmem-cells = <&macaddr_factory_4>;
195 nvmem-cell-names = "mac-address";
196 mac-address-increment = <2>;
197 };
198 };
199 };
200
201 &i2c {
202 status = "okay";
203
204 gpio_expander: i2c0gpio-expander@20{
205 #gpio-cells = <2>;
206 #interrupt-cells = <2>;
207 compatible = "semtech,sx1503q";
208 reg = <0x20>;
209
210 gpio-controller;
211 };
212 };
213
214 &nand {
215 status = "okay";
216
217 partitions {
218 compatible = "fixed-partitions";
219 #address-cells = <1>;
220 #size-cells = <1>;
221
222 partition@0 {
223 label = "u-boot";
224 reg = <0x0 0x100000>;
225 read-only;
226 };
227
228 partition@100000 {
229 label = "SC PART_MAP";
230 reg = <0x100000 0x100000>;
231 read-only;
232 };
233
234 partition@200000 {
235 label = "kernel";
236 reg = <0x200000 0x400000>;
237 };
238
239 partition@600000 {
240 label = "ubi";
241 reg = <0x600000 0x2800000>;
242 };
243
244 partition@2e00000 {
245 label = "reserved0";
246 reg = <0x2e00000 0x1800000>;
247 read-only;
248 };
249
250 factory: partition@4600000 {
251 label = "factory";
252 reg = <0x4600000 0x200000>;
253 read-only;
254 };
255
256 partition@4800000 {
257 label = "reserved1";
258 reg = <0x4800000 0x3800000>;
259 read-only;
260 };
261 };
262 };
263
264 &factory {
265 compatible = "nvmem-cells";
266 #address-cells = <1>;
267 #size-cells = <1>;
268
269 macaddr_factory_4: macaddr@4 {
270 reg = <0x4 0x6>;
271 };
272 };