ipq40xx: mikrotik: make RouterBoot partition writeable
[openwrt/staging/jow.git] / target / linux / ipq40xx / files / arch / arm / boot / dts / qcom-ipq4018-hap-ac2.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /* Copyright (c) 2020, Robert Marko <robimarko@gmail.com> */
3
4 #include "qcom-ipq4019.dtsi"
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/soc/qcom,tcsr.h>
8
9 / {
10 model = "MikroTik hAP ac2";
11 compatible = "mikrotik,hap-ac2";
12
13 memory {
14 device_type = "memory";
15 reg = <0x80000000 0x08000000>;
16 };
17
18 chosen {
19 stdout-path = "serial0:115200n8";
20 };
21
22 aliases {
23 led-boot = &led_user;
24 led-failsafe = &led_user;
25 led-running = &led_user;
26 led-upgrade = &led_user;
27 };
28
29 soc {
30 rng@22000 {
31 status = "okay";
32 };
33
34 counter@4a1000 {
35 compatible = "qcom,qca-gcnt";
36 reg = <0x4a1000 0x4>;
37 };
38
39 tcsr@1949000 {
40 compatible = "qcom,tcsr";
41 reg = <0x1949000 0x100>;
42 qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
43 };
44
45 tcsr@194b000 {
46 /* select hostmode */
47 compatible = "qcom,tcsr";
48 reg = <0x194b000 0x100>;
49 qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
50 status = "okay";
51 };
52
53 ess_tcsr@1953000 {
54 compatible = "qcom,tcsr";
55 reg = <0x1953000 0x1000>;
56 qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
57 };
58
59 tcsr@1957000 {
60 compatible = "qcom,tcsr";
61 reg = <0x1957000 0x100>;
62 qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
63 };
64
65 usb3@8af8800 {
66 status = "okay";
67
68 dwc3@8a00000 {
69 phys = <&usb3_hs_phy>;
70 phy-names = "usb2-phy";
71 };
72 };
73
74 crypto@8e3a000 {
75 status = "okay";
76 };
77
78 watchdog@b017000 {
79 status = "okay";
80 };
81
82 ess-switch@c000000 {
83 status = "okay";
84 };
85
86 edma@c080000 {
87 status = "okay";
88 };
89 };
90
91 keys {
92 compatible = "gpio-keys";
93
94 reset {
95 label = "reset";
96 gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
97 linux,code = <KEY_RESTART>;
98 };
99
100 mode {
101 label = "mode";
102 gpios = <&tlmm 5 GPIO_ACTIVE_LOW>;
103 linux,code = <KEY_RFKILL>;
104 };
105 };
106
107 leds {
108 compatible = "gpio-leds";
109
110 power {
111 label = "green:power";
112 gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>;
113 default-state = "keep";
114 panic-indicator;
115 };
116
117 led_user: user {
118 label = "green:user";
119 gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>;
120 };
121 };
122 };
123
124 &tlmm {
125 serial_pins: serial_pinmux {
126 mux {
127 pins = "gpio60", "gpio61";
128 function = "blsp_uart0";
129 bias-disable;
130 };
131 };
132
133 spi_0_pins: spi_0_pinmux {
134 pin {
135 function = "blsp_spi0";
136 pins = "gpio55", "gpio56", "gpio57";
137 drive-strength = <2>;
138 bias-disable;
139 };
140 pin_cs {
141 function = "gpio";
142 pins = "gpio54";
143 drive-strength = <2>;
144 bias-disable;
145 output-high;
146 };
147 };
148
149 enable-usb-power {
150 gpio-hog;
151 gpios = <2 GPIO_ACTIVE_HIGH>;
152 output-high;
153 line-name = "enable USB power";
154 };
155 };
156
157 &blsp_dma {
158 status = "okay";
159 };
160
161 &blsp1_spi1 {
162 status = "okay";
163
164 pinctrl-0 = <&spi_0_pins>;
165 pinctrl-names = "default";
166 cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>;
167
168 flash@0 {
169 reg = <0>;
170 compatible = "jedec,spi-nor";
171 spi-max-frequency = <40000000>;
172
173 partitions {
174 compatible = "fixed-partitions";
175 #address-cells = <1>;
176 #size-cells = <1>;
177
178 partition@0 {
179 label = "Qualcomm";
180 reg = <0x0 0x80000>;
181 read-only;
182 };
183
184 partition@80000 {
185 compatible = "mikrotik,routerboot-partitions";
186 #address-cells = <1>;
187 #size-cells = <1>;
188 label = "RouterBoot";
189 reg = <0x80000 0x80000>;
190
191 hard_config {
192 read-only;
193 size = <0x2000>;
194 };
195
196 dtb_config {
197 read-only;
198 };
199
200 soft_config {
201 };
202 };
203
204 partition@100000 {
205 compatible = "mikrotik,minor";
206 label = "firmware";
207 reg = <0x100000 0xf00000>;
208 };
209 };
210 };
211 };
212
213 &blsp1_uart1 {
214 status = "okay";
215
216 pinctrl-0 = <&serial_pins>;
217 pinctrl-names = "default";
218 };
219
220 &cryptobam {
221 status = "okay";
222 };
223
224 &usb3_hs_phy {
225 status = "okay";
226 };
227
228 &mdio {
229 status = "okay";
230 };
231
232 &ethphy0 {
233 qcom,single-led-1000;
234 qcom,single-led-100;
235 qcom,single-led-10;
236 };
237
238 &ethphy1 {
239 qcom,single-led-1000;
240 qcom,single-led-100;
241 qcom,single-led-10;
242 };
243
244 &ethphy2 {
245 qcom,single-led-1000;
246 qcom,single-led-100;
247 qcom,single-led-10;
248 };
249
250 &ethphy3 {
251 qcom,single-led-1000;
252 qcom,single-led-100;
253 qcom,single-led-10;
254 };
255
256 &ethphy4 {
257 qcom,single-led-1000;
258 qcom,single-led-100;
259 qcom,single-led-10;
260 };
261
262 &wifi0 {
263 status = "okay";
264
265 qcom,ath10k-calibration-variant = "MikroTik-hAP-ac2";
266 };
267
268 &wifi1 {
269 status = "okay";
270
271 qcom,ath10k-calibration-variant = "MikroTik-hAP-ac2";
272 };