ramips: convert MT7628 EEPROM to NVMEM format
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7628an_keenetic_kn-1613.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 #include "mt7628an.dtsi"
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 / {
8 compatible = "keenetic,kn-1613", "mediatek,mt7628an-soc";
9 model = "Keenetic KN-1613";
10
11 aliases {
12 led-boot = &led_power;
13 led-failsafe = &led_power;
14 led-running = &led_power;
15 led-upgrade = &led_power;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,115200";
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 led_power: power {
26 label = "green:power";
27 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
28 };
29
30 internet {
31 label = "green:internet";
32 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
33 };
34
35 wifi2 {
36 label = "green:wifi2";
37 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
38 linux,default-trigger = "phy0tpt";
39 };
40
41 wifi5 {
42 label = "green:wifi5";
43 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
44 linux,default-trigger = "phy1tpt";
45 };
46 };
47
48 keys {
49 compatible = "gpio-keys";
50
51 fn {
52 label = "fn";
53 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
54 linux,code = <BTN_0>;
55 };
56
57 reset {
58 label = "reset";
59 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
60 linux,code = <KEY_RESTART>;
61 };
62
63 wps {
64 label = "wps";
65 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
66 linux,code = <KEY_WPS_BUTTON>;
67 };
68 };
69
70 virtual_flash {
71 compatible = "mtd-concat";
72 devices = <&firmware1 &firmware2>;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 compatible = "denx,uimage";
81 label = "firmware";
82 reg = <0x0 0x1ec0000>;
83 };
84 };
85 };
86 };
87
88 &state_default {
89 gpio {
90 groups = "i2s", "i2c", "gpio", "refclk", "wdt", "wled_an";
91 function = "gpio";
92 };
93 };
94
95 &usbphy {
96 status = "disabled";
97 };
98
99 &ehci {
100 status = "disabled";
101 };
102
103 &ohci {
104 status = "disabled";
105 };
106
107 &spi0 {
108 status = "okay";
109
110 flash@0 {
111 compatible = "jedec,spi-nor";
112 reg = <0>;
113 spi-max-frequency = <32000000>;
114
115 partitions: partitions {
116 compatible = "fixed-partitions";
117 #address-cells = <1>;
118 #size-cells = <1>;
119
120 partition@0 {
121 label = "u-boot";
122 reg = <0x0 0x30000>;
123 read-only;
124 };
125
126 partition@30000 {
127 label = "u-config";
128 reg = <0x30000 0x10000>;
129 read-only;
130 };
131
132 factory: partition@40000 {
133 compatible = "nvmem-cells";
134 label = "rf-eeprom";
135 reg = <0x40000 0x10000>;
136 #address-cells = <1>;
137 #size-cells = <1>;
138 read-only;
139
140 eeprom_factory_0: eeprom@0 {
141 reg = <0x0 0x400>;
142 };
143
144 macaddr_factory_4: macaddr@4 {
145 reg = <0x4 0x6>;
146 };
147 };
148
149 firmware1: partition@50000 {
150 label = "firmware_1";
151 reg = <0x50000 0xf60000>;
152 };
153
154 partition@fb0000 {
155 label = "config_1";
156 reg = <0xfb0000 0x40000>;
157 read-only;
158 };
159
160 partition@ff0000 {
161 label = "dump";
162 reg = <0xff0000 0x10000>;
163 read-only;
164 };
165
166 partition@1000000 {
167 label = "u-state";
168 reg = <0x1000000 0x30000>;
169 read-only;
170 };
171
172 partition@1030000 {
173 label = "u-config_res";
174 reg = <0x1030000 0x10000>;
175 read-only;
176 };
177
178 partition@1040000 {
179 label = "rf-eeprom_res";
180 reg = <0x1040000 0x10000>;
181 read-only;
182 };
183
184 firmware2: partition@1050000 {
185 label = "firmware_2";
186 reg = <0x1050000 0xf60000>;
187 };
188
189 partition@1fb0000 {
190 label = "config_2";
191 reg = <0x1fb0000 0x40000>;
192 read-only;
193 };
194 };
195 };
196 };
197
198 &ethernet {
199 nvmem-cells = <&macaddr_factory_4>;
200 nvmem-cell-names = "mac-address";
201 };
202
203 &esw {
204 mediatek,portmap = <0x3e>;
205 };
206
207 &wmac {
208 status = "okay";
209
210 nvmem-cells = <&eeprom_factory_0>;
211 nvmem-cell-names = "eeprom";
212 };
213
214 &pcie {
215 status = "okay";
216 };
217
218 &pcie0 {
219 wifi@0,0 {
220 compatible = "mediatek,mt76";
221 reg = <0x0000 0 0 0 0>;
222 mediatek,mtd-eeprom = <&factory 0x0400>;
223 ieee80211-freq-limit = <5000000 6000000>;
224 };
225 };