mediatek: add support for Confiabits MT7981
[openwrt/staging/blocktrron.git] / target / linux / mediatek / dts / mt7981b-confiabits-mt7981.dts
1 /dts-v1/;
2
3 #include "mt7981.dtsi"
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/leds/common.h>
7
8 / {
9 model = "Confiabits MT7981";
10 compatible = "confiabits,mt7981", "mediatek,mt7981";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 serial0 = &uart0;
18 };
19
20 chosen {
21 stdout-path = "serial0:115200n8";
22 };
23
24 gpio-keys {
25 compatible = "gpio-keys";
26
27 button-mesh {
28 label = "mesh";
29 linux,input-type = <EV_SW>;
30 linux,code = <BTN_0>;
31 gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
32 debounce-interval = <60>;
33 };
34
35 button-reset {
36 label = "reset";
37 linux,code = <KEY_RESTART>;
38 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
39 };
40 };
41
42 leds {
43 compatible = "gpio-leds";
44
45 led-wlan5g {
46 color = <LED_COLOR_ID_RED>;
47 function = LED_FUNCTION_WLAN;
48 function-enumerator = <5>;
49 gpios = <&pio 5 GPIO_ACTIVE_LOW>;
50 linux,default-trigger = "phy1tpt";
51 };
52
53 led-wan-red {
54 color = <LED_COLOR_ID_RED>;
55 function = LED_FUNCTION_WAN;
56 gpios = <&pio 6 GPIO_ACTIVE_LOW>;
57 };
58
59 led_power: led-power {
60 label = "blue:power"; // can be removed once #13837 is merged
61 color = <LED_COLOR_ID_BLUE>;
62 function = LED_FUNCTION_POWER;
63 gpios = <&pio 7 GPIO_ACTIVE_LOW>;
64 };
65
66 led-lan1 {
67 color = <LED_COLOR_ID_BLUE>;
68 function = LED_FUNCTION_LAN;
69 function-enumerator = <1>;
70 gpios = <&pio 9 GPIO_ACTIVE_LOW>;
71 };
72
73 led-lan2 {
74 color = <LED_COLOR_ID_BLUE>;
75 function = LED_FUNCTION_LAN;
76 function-enumerator = <2>;
77 gpios = <&pio 10 GPIO_ACTIVE_LOW>;
78 };
79
80 led-lan3 {
81 color = <LED_COLOR_ID_BLUE>;
82 function = LED_FUNCTION_LAN;
83 function-enumerator = <3>;
84 gpios = <&pio 11 GPIO_ACTIVE_LOW>;
85 };
86
87 led-wan-blue {
88 color = <LED_COLOR_ID_BLUE>;
89 function = LED_FUNCTION_WAN;
90 gpios = <&pio 12 GPIO_ACTIVE_LOW>;
91 };
92
93 led-wlan2g {
94 color = <LED_COLOR_ID_RED>;
95 function = LED_FUNCTION_WLAN;
96 function-enumerator = <2>;
97 gpios = <&pio 34 GPIO_ACTIVE_LOW>;
98 linux,default-trigger = "phy0tpt";
99 };
100
101 led-mesh {
102 color = <LED_COLOR_ID_BLUE>;
103 function = "mesh"; // no LED_FUNCTION_MESH yet
104 gpios = <&pio 35 GPIO_ACTIVE_LOW>;
105 };
106 };
107 };
108
109 &uart0 {
110 status = "okay";
111 };
112
113 &watchdog {
114 status = "okay";
115 };
116
117 &eth {
118 pinctrl-names = "default";
119 pinctrl-0 = <&mdio_pins>;
120
121 status = "okay";
122
123 gmac0: mac@0 {
124 compatible = "mediatek,eth-mac";
125 reg = <0>;
126 phy-mode = "2500base-x";
127
128 nvmem-cell-names = "mac-address";
129 nvmem-cells = <&macaddr_factory_4 0>;
130
131 fixed-link {
132 speed = <2500>;
133 full-duplex;
134 pause;
135 };
136 };
137 };
138
139
140 &mdio_bus {
141 #address-cells = <1>;
142 #size-cells = <0>;
143
144 switch: switch@1f {
145 compatible = "mediatek,mt7531";
146 reg = <31>;
147 reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
148 };
149 };
150
151 &switch {
152 ports {
153 #address-cells = <1>;
154 #size-cells = <0>;
155
156 port@0 {
157 reg = <0>;
158 label = "lan1";
159 };
160
161 port@2 {
162 reg = <2>;
163 label = "lan2";
164 };
165
166 port@3 {
167 reg = <3>;
168 label = "lan3";
169 };
170
171 port@4 {
172 reg = <4>;
173 label = "wan";
174
175 nvmem-cell-names = "mac-address";
176 nvmem-cells = <&macaddr_factory_4 1>;
177 };
178
179 port@6 {
180 reg = <6>;
181 label = "cpu";
182 ethernet = <&gmac0>;
183 phy-mode = "2500base-x";
184
185 fixed-link {
186 speed = <2500>;
187 full-duplex;
188 pause;
189 };
190 };
191 };
192 };
193
194 &spi0 {
195 pinctrl-names = "default";
196 pinctrl-0 = <&spi0_flash_pins>;
197 status = "okay";
198
199 spi_nand: flash@0 {
200 #address-cells = <1>;
201 #size-cells = <1>;
202 compatible = "spi-nand";
203 reg = <0>;
204 spi-max-frequency = <52000000>;
205
206 spi-cal-enable;
207 spi-cal-mode = "read-data";
208 spi-cal-datalen = <7>;
209 spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>;
210 spi-cal-addrlen = <5>;
211 spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>;
212
213 spi-tx-buswidth = <4>;
214 spi-rx-buswidth = <4>;
215 mediatek,nmbm;
216 mediatek,bmt-max-ratio = <1>;
217 mediatek,bmt-max-reserved-blocks = <64>;
218
219 partitions {
220 compatible = "fixed-partitions";
221 #address-cells = <1>;
222 #size-cells = <1>;
223
224 partition@0 {
225 label = "BL2";
226 reg = <0x00000 0x0100000>;
227 read-only;
228 };
229
230 partition@100000 {
231 label = "u-boot-env";
232 reg = <0x0100000 0x0080000>;
233 read-only;
234 };
235
236 factory: partition@180000 {
237 label = "Factory";
238 reg = <0x180000 0x0200000>;
239 read-only;
240
241 nvmem-layout {
242 compatible = "fixed-layout";
243 #address-cells = <1>;
244 #size-cells = <1>;
245
246 eeprom_factory_0: eeprom@0 {
247 reg = <0x0 0x1000>;
248 };
249
250 macaddr_factory_4: macaddr@4 {
251 compatible = "mac-base";
252 reg = <0x4 0x6>;
253 #nvmem-cell-cells = <1>;
254 };
255 };
256 };
257
258 partition@380000 {
259 label = "FIP";
260 reg = <0x380000 0x0200000>;
261 read-only;
262 };
263
264 partition@580000 {
265 label = "ubi";
266 reg = <0x580000 0x4000000>;
267 compatible = "linux,ubi";
268 };
269 };
270 };
271 };
272
273 &pio {
274 spi0_flash_pins: spi0-pins {
275 mux {
276 function = "spi";
277 groups = "spi0", "spi0_wp_hold";
278 };
279 };
280
281 };
282
283 &usb_phy {
284 status = "okay";
285 };
286
287 &xhci {
288 status = "okay";
289 mediatek,u3p-dis-msk = <0x1>;
290 };
291
292 &wifi {
293 status = "okay";
294 nvmem-cells = <&eeprom_factory_0>;
295 nvmem-cell-names = "eeprom";
296 };