ath79: support ZTE MF286
[openwrt/staging/hauke.git] / target / linux / ath79 / dts / qca9563_zte_mf286.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 // Copyright (c) 2021 Cezary Jackiewicz
3 // Copyright (c) 2021, 2022 Lech Perczak
4 #include "qca956x.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8 #include <dt-bindings/leds/common.h>
9
10 / {
11 model = "ZTE MF286";
12 compatible = "zte,mf286", "qca,qca9563";
13
14 aliases {
15 led-boot = &led_debug;
16 led-failsafe = &led_debug;
17 led-running = &led_debug;
18 led-upgrade = &led_debug;
19 label-mac-device = &eth0;
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 /* Hidden green SMD LED below signal strength LEDs
26 * Visible through slits underside of the case,
27 * and slightly through the case below signal state LEDs */
28 led_debug: led-0 {
29 color = <LED_COLOR_ID_GREEN>;
30 function = LED_FUNCTION_DEBUG;
31 label = "green:debug";
32 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
33 default-state = "on";
34 };
35 };
36
37 keys {
38 compatible = "gpio-keys";
39
40 reset {
41 label = "reset";
42 linux,code = <KEY_RESTART>;
43 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
44 debounce-interval = <60>;
45 };
46
47 wps {
48 label = "wps";
49 linux,code = <KEY_WPS_BUTTON>;
50 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
51 debounce-interval = <60>;
52 };
53
54 wifi {
55 label = "wifi";
56 linux,code = <KEY_RFKILL>;
57 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
58 debounce-interval = <60>;
59 };
60 };
61
62 /* This GPIO is used to reset whole board _including_ the modem */
63 gpio-restart {
64 compatible = "gpio-restart";
65 gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
66 active-delay = <3000>;
67 inactive-delay = <1000>;
68 };
69
70 ubi-concat {
71 compatible = "mtd-concat";
72 devices = <&ubiconcat0 &ubiconcat1>;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 reg = <0x0 0x7840000>;
81 label = "ubi";
82 };
83 };
84 };
85 };
86
87 &gpio {
88 /* GPIO19 is used as a mask to enable WLAN LED
89 * in stock firmware, which is controlled directly
90 * by 5GHz Wi-Fi chip, which currently is inactive
91 * in OpenWrt */
92 led-wlan {
93 gpio-hog;
94 gpios = <19 GPIO_ACTIVE_LOW>;
95 output-high;
96 line-name = "led:wlan";
97 };
98 };
99
100 &spi {
101 status = "okay";
102
103 flash@0 {
104 compatible = "jedec,spi-nor";
105 reg = <0>;
106 spi-max-frequency = <25000000>;
107
108 partitions {
109 compatible = "fixed-partitions";
110 #address-cells = <1>;
111 #size-cells = <1>;
112
113 partition@0 {
114 label = "u-boot";
115 reg = <0x000000 0x080000>;
116 read-only;
117 };
118
119 partition@80000 {
120 label = "u-boot-env";
121 reg = <0x080000 0x020000>;
122 read-only;
123 };
124 };
125 };
126
127 flash@1 {
128 compatible = "spi-nand";
129 reg = <1>;
130 spi-max-frequency = <25000000>;
131
132 partitions {
133 compatible = "fixed-partitions";
134 #address-cells = <1>;
135 #size-cells = <1>;
136
137 partition@0 {
138 label = "fota-flag";
139 reg = <0x000000 0x140000>;
140 read-only;
141 };
142
143 caldata: partition@140000 {
144 label = "caldata";
145 reg = <0x140000 0x140000>;
146 read-only;
147
148 compatible = "nvmem-cells";
149 #address-cells = <1>;
150 #size-cells = <1>;
151
152 cal_caldata_1000: cal@1000 {
153 reg = <0x1000 0x440>;
154 };
155
156 cal_caldata_5000: cal@5000 {
157 reg = <0x5000 0x844>;
158 };
159 };
160
161 mac: partition@280000 {
162 label = "mac";
163 reg = <0x280000 0x140000>;
164 read-only;
165
166 compatible = "nvmem-cells";
167 #address-cells = <1>;
168 #size-cells = <1>;
169
170 macaddr_mac_0: macaddr@0 {
171 reg = <0x0 0x6>;
172 };
173 };
174
175 /* This encompasses stock cfg-param, oops, web partitions,
176 * which can be overwritten safely */
177 ubiconcat0: partition@3c0000 {
178 label = "ubiconcat0";
179 reg = <0x3c0000 0xf40000>;
180 };
181
182 /* Kernel MTD size is increased to 4MB from stock 3MB */
183 partition@1300000 {
184 label = "kernel";
185 reg = <0x1300000 0x400000>;
186 };
187
188 /* This encompasses stock rootfs, data, fota partitions,
189 * which can be overwritten safely */
190 ubiconcat1: partition@1600000 {
191 label = "ubiconcat1";
192 reg = <0x1700000 0x6900000>;
193 };
194 };
195 };
196 };
197
198 &mdio0 {
199 status = "okay";
200
201 phy-mask = <0>;
202 phy0: ethernet-phy@0 {
203 reg = <0>;
204 phy-mode = "sgmii";
205
206 qca,ar8327-initvals = <
207 0x04 0x00080080 /* PORT0 PAD MODE CTRL */
208 0x7c 0x0000007e /* PORT0_STATUS */
209 >;
210 };
211 };
212
213 &eth0 {
214 status = "okay";
215
216 nvmem-cells = <&macaddr_mac_0>;
217 nvmem-cell-names = "mac-address";
218 phy-mode = "sgmii";
219 phy-handle = <&phy0>;
220 };
221
222 &pcie {
223 status = "okay";
224
225 wifi@0,0 {
226 compatible = "qcom,ath10k";
227 reg = <0x0 0 0 0 0>;
228
229 nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_5000>;
230 nvmem-cell-names = "mac-address", "calibration";
231 mac-address-increment = <1>;
232 };
233 };
234
235 &wmac {
236 status = "okay";
237
238 nvmem-cells = <&macaddr_mac_0>, <&cal_caldata_1000>;
239 nvmem-cell-names = "mac-address", "calibration";
240 };
241
242 &usb_phy0 {
243 status = "okay";
244 };
245
246 &usb0 {
247 status = "okay";
248 };
249
250 &usb_phy1 {
251 status = "okay";
252 };
253
254 &usb1 {
255 status = "okay";
256 };