ramips: mt7621: convert to nvmem-layout
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_meig_slt866.dts
1 #include "mt7621.dtsi"
2 #include <dt-bindings/gpio/gpio.h>
3 #include <dt-bindings/input/input.h>
4 #include <dt-bindings/leds/common.h>
5
6 / {
7 compatible = "meig,slt866", "mediatek,mt7621-soc";
8 model = "MeiG SLT866";
9
10 aliases {
11 led-boot = &led_internet;
12 led-failsafe = &led_internet;
13 led-upgrade = &led_internet;
14 label-mac-device = &gmac1;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 signal4 {
21 label = "blue:signal4";
22 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
23 };
24
25 lanwan {
26 label = "blue:lanwan";
27 gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
28 };
29
30 led_internet: internet {
31 label = "blue:internet";
32 gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
33 };
34
35 wifi {
36 label = "blue:wifi";
37 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
38 linux,default-trigger = "phy0tpt";
39 };
40
41 signal3 {
42 label = "blue:signal3";
43 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
44 };
45
46 signal2 {
47 label = "blue:signal2";
48 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
49 };
50
51 signal1 {
52 label = "blue:signal1";
53 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
54 };
55 };
56
57 keys {
58 compatible = "gpio-keys";
59
60 reset {
61 label = "reset";
62 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
63 linux,code = <KEY_RESTART>;
64 };
65
66 wps {
67 label = "wps";
68 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
69 linux,code = <KEY_WPS_BUTTON>;
70 };
71 };
72
73 regulator-pa-5g {
74 compatible = "regulator-fixed";
75 regulator-name = "pa-5g";
76 regulator-min-microvolt = <5000000>;
77 regulator-max-microvolt = <5000000>;
78 gpio = <&gpio 7 GPIO_ACTIVE_HIGH>;
79 enable-active-high;
80 regulator-boot-on;
81 regulator-always-on;
82 };
83 };
84
85 &state_default {
86 gpio {
87 groups = "jtag", "uart2", "uart3", "wdt";
88 function = "gpio";
89 };
90 };
91
92 &spi0 {
93 status = "okay";
94
95 flash@0 {
96 reg = <0>;
97 compatible = "jedec,spi-nor";
98 spi-max-frequency = <20000000>;
99
100 partitions {
101 compatible = "fixed-partitions";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 partition@0 {
106 label = "Bootloader";
107 reg = <0x0 0x30000>;
108 read-only;
109 };
110
111 partition@30000 {
112 label = "Config";
113 reg = <0x30000 0x10000>;
114 };
115
116 partition@40000 {
117 label = "Factory";
118 reg = <0x40000 0x10000>;
119 read-only;
120
121 nvmem-layout {
122 compatible = "fixed-layout";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 eeprom_factory_0: eeprom@0 {
127 reg = <0x0 0x200>;
128 };
129
130 eeprom_factory_8000: eeprom@8000 {
131 reg = <0x8000 0x4da8>;
132 };
133 };
134 };
135
136 partition@50000 {
137 label = "firmware";
138 compatible = "denx,uimage";
139 reg = <0x50000 0xf90000>;
140 };
141
142 partition@fe0000 {
143 label = "m_custom";
144 reg = <0xfe0000 0x20000>;
145 read-only;
146
147 nvmem-layout {
148 compatible = "fixed-layout";
149
150 #address-cells = <1>;
151 #size-cells = <1>;
152
153 macaddr_custom_0: macaddr@0 {
154 reg = <0x0 0xc>;
155 compatible = "mac-base";
156 #nvmem-cell-cells = <1>;
157 };
158
159 macaddr_custom_40: macaddr@40 {
160 reg = <0x40 0xc>;
161 compatible = "mac-base";
162 #nvmem-cell-cells = <1>;
163 };
164
165 macaddr_custom_100: macaddr@100 {
166 reg = <0x100 0xc>;
167 compatible = "mac-base";
168 #nvmem-cell-cells = <1>;
169 };
170
171 macaddr_custom_140: macaddr@140 {
172 reg = <0x140 0xc>;
173 compatible = "mac-base";
174 #nvmem-cell-cells = <1>;
175 };
176 };
177 };
178
179 partition@1000000 {
180 label = "fota_bak";
181 reg = <0x1000000 0x1000000>;
182 read-only;
183 };
184 };
185 };
186 };
187
188 &ethernet {
189 pinctrl-names = "default";
190 pinctrl-0 = <&mdio_pins>;
191 };
192
193 &gmac0 {
194 nvmem-cells = <&macaddr_custom_40 0>;
195 nvmem-cell-names = "mac-address";
196 };
197
198 &gmac1 {
199 status = "okay";
200 label = "wan";
201 phy-handle = <&ethphy4>;
202
203 nvmem-cells = <&macaddr_custom_0 0>;
204 nvmem-cell-names = "mac-address";
205 };
206
207 &mdio {
208 ethphy4: ethernet-phy@4 {
209 reg = <4>;
210 };
211 };
212
213 &switch0 {
214 ports {
215 port@3 {
216 status = "okay";
217 label = "lan";
218 };
219 };
220 };
221
222 &pcie {
223 status = "okay";
224 };
225
226 &pcie0 {
227 mt76@0,0 {
228 compatible = "mediatek,mt76";
229 reg = <0x0000 0 0 0 0>;
230 nvmem-cells = <&eeprom_factory_0>, <&macaddr_custom_100 0>;
231 nvmem-cell-names = "eeprom", "mac-address";
232 };
233 };
234
235 &pcie1 {
236 mt76@0,0 {
237 compatible = "mediatek,mt76";
238 reg = <0x0000 0 0 0 0>;
239 ieee80211-freq-limit = <5000000 6000000>;
240 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_custom_140 0>;
241 nvmem-cell-names = "eeprom", "mac-address";
242 };
243 };