ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/mkresin.git] / target / linux / ramips / dts / mt7621_wavlink_wl-wn531a6.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 = "wavlink,wl-wn531a6", "mediatek,mt7621-soc";
10 model = "Wavlink WL-WN531A6";
11
12 aliases {
13 led-boot = &led_status_red;
14 led-failsafe = &led_status_red;
15 led-running = &led_status_blue;
16 led-upgrade = &led_status_red;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 reset {
23 label = "Reset Button";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_RESTART>;
26 };
27
28 touch { /* RH6015C touch sensor -> GPIO 14 */
29 label = "Touch Button";
30 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
31 linux,code = <BTN_0>;
32 };
33
34 turbo {
35 label = "Turbo Button";
36 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
37 linux,code = <BTN_1>;
38 };
39
40 wps {
41 label = "WPS Button";
42 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
43 linux,code = <KEY_WPS_BUTTON>;
44 };
45 };
46
47 leds {
48 compatible = "gpio-leds";
49
50 led_status_blue: status_blue {
51 label = "blue:power";
52 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
53 };
54
55 led_status_red: status_red {
56 label = "red:power";
57 gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
58 };
59
60 wifi2g {
61 label = "blue:wifi2g";
62 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "phy0tpt";
64 };
65 };
66 };
67
68 &i2c {
69 status = "okay";
70 };
71
72 &spi0 {
73 status = "okay";
74
75 flash@0 {
76 compatible = "jedec,spi-nor";
77 reg = <0>;
78 spi-max-frequency = <40000000>;
79
80 partitions {
81 compatible = "fixed-partitions";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 partition@0 {
86 label = "u-boot";
87 reg = <0x0 0x30000>;
88 read-only;
89 };
90
91 partition@30000 {
92 label = "config";
93 reg = <0x30000 0x10000>;
94 read-only;
95 };
96
97 factory: partition@40000 {
98 label = "factory";
99 reg = <0x40000 0x10000>;
100 read-only;
101 };
102
103 partition@50000 {
104 compatible = "denx,uimage";
105 label = "firmware";
106 reg = <0x50000 0xeb0000>;
107 };
108
109 partition@f00000 {
110 label = "vendor";
111 reg = <0xf00000 0x100000>;
112 read-only;
113 };
114 };
115 };
116 };
117
118 &pcie {
119 status = "okay";
120 };
121
122 &pcie0 {
123 mt76@0,0 {
124 compatible = "mediatek,mt76";
125 reg = <0x0000 0 0 0 0>;
126 mediatek,mtd-eeprom = <&factory 0x0>;
127 ieee80211-freq-limit = <2400000 2500000>;
128 };
129 };
130
131 &pcie1 {
132 mt76@0,0 {
133 compatible = "mediatek,mt76";
134 reg = <0x0000 0 0 0 0>;
135 mediatek,mtd-eeprom = <&factory 0x8000>;
136 ieee80211-freq-limit = <5000000 6000000>;
137 };
138 };
139
140 &gmac0 {
141 nvmem-cells = <&macaddr_factory_e000>;
142 nvmem-cell-names = "mac-address";
143 };
144
145 &switch0 {
146 ports {
147 port@0 {
148 status = "okay";
149 label = "lan1";
150 };
151
152 port@1 {
153 status = "okay";
154 label = "lan2";
155 };
156
157 port@2 {
158 status = "okay";
159 label = "lan3";
160 };
161
162 port@3 {
163 status = "okay";
164 label = "lan4";
165 };
166
167 port@4 {
168 status = "okay";
169 label = "wan";
170 nvmem-cells = <&macaddr_factory_e006>;
171 nvmem-cell-names = "mac-address";
172 };
173 };
174 };
175
176 &state_default {
177 gpio {
178 groups = "rgmii2", "jtag", "wdt";
179 function = "gpio";
180 };
181 };
182
183 &uartlite2 {
184 status = "okay";
185 };
186
187 &factory {
188 compatible = "nvmem-cells";
189 #address-cells = <1>;
190 #size-cells = <1>;
191
192 macaddr_factory_e000: macaddr@e000 {
193 reg = <0xe000 0x6>;
194 };
195
196 macaddr_factory_e006: macaddr@e006 {
197 reg = <0xe006 0x6>;
198 };
199 };