mediatek: Fix amount of memory on U7623
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.14 / 0227-arm-dts-Add-Unielec-U7623-DTS.patch
1 From 004eb24e939b5b31f828333f37fb5cb2a877d6f2 Mon Sep 17 00:00:00 2001
2 From: Kristian Evensen <kristian.evensen@gmail.com>
3 Date: Sun, 17 Jun 2018 14:41:47 +0200
4 Subject: [PATCH] arm: dts: Add Unielec U7623 DTS
5
6 ---
7 arch/arm/boot/dts/Makefile | 1 +
8 .../dts/mt7623a-unielec-u7623-02-emmc-512M.dts | 18 +
9 .../boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi | 366 +++++++++++++++++++++
10 3 files changed, 385 insertions(+)
11 create mode 100644 arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512M.dts
12 create mode 100644 arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi
13
14 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
15 index 3fec84fa0..e685ce9a4 100644
16 --- a/arch/arm/boot/dts/Makefile
17 +++ b/arch/arm/boot/dts/Makefile
18 @@ -1062,6 +1062,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
19 mt6589-aquaris5.dtb \
20 mt6592-evb.dtb \
21 mt7623a-rfb-emmc.dtb \
22 + mt7623a-unielec-u7623-02-emmc-512M.dtb \
23 mt7623n-rfb-nand.dtb \
24 mt7623n-bananapi-bpi-r2.dtb \
25 mt8127-moose.dtb \
26 diff --git a/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512M.dts b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512M.dts
27 new file mode 100644
28 index 000000000..857d440d0
29 --- /dev/null
30 +++ b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc-512M.dts
31 @@ -0,0 +1,18 @@
32 +/*
33 + * Copyright 2018 Kristian Evensen <kristian.evensen@gmail.com>
34 + *
35 + * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
36 + */
37 +
38 +/dts-v1/;
39 +#include "mt7623a-unielec-u7623-02-emmc.dtsi"
40 +
41 +/ {
42 + model = "UniElec U7623-02 eMMC (512M RAM)";
43 + compatible = "unielec,u7623-02-emmc-512m", "unielec,u7623-02-emmc", "mediatek,mt7623";
44 +
45 + memory@80000000 {
46 + device_type = "memory";
47 + reg = <0 0x80000000 0 0x20000000>;
48 + };
49 +};
50 diff --git a/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi
51 new file mode 100644
52 index 000000000..adc91266e
53 --- /dev/null
54 +++ b/arch/arm/boot/dts/mt7623a-unielec-u7623-02-emmc.dtsi
55 @@ -0,0 +1,366 @@
56 +/*
57 + * Copyright 2018 Kristian Evensen <kristian.evensen@gmail.com>
58 + *
59 + * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
60 + */
61 +
62 +#include <dt-bindings/input/input.h>
63 +#include "mt7623.dtsi"
64 +#include "mt6323.dtsi"
65 +
66 +/ {
67 + compatible = "unielec,u7623-02-emmc", "mediatek,mt7623";
68 +
69 + aliases {
70 + serial2 = &uart2;
71 + };
72 +
73 + chosen {
74 + bootargs = "root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs";
75 + stdout-path = "serial2:115200n8";
76 + };
77 +
78 + cpus {
79 + cpu@0 {
80 + proc-supply = <&mt6323_vproc_reg>;
81 + };
82 +
83 + cpu@1 {
84 + proc-supply = <&mt6323_vproc_reg>;
85 + };
86 +
87 + cpu@2 {
88 + proc-supply = <&mt6323_vproc_reg>;
89 + };
90 +
91 + cpu@3 {
92 + proc-supply = <&mt6323_vproc_reg>;
93 + };
94 + };
95 +
96 + reg_1p8v: regulator-1p8v {
97 + compatible = "regulator-fixed";
98 + regulator-name = "fixed-1.8V";
99 + regulator-min-microvolt = <1800000>;
100 + regulator-max-microvolt = <1800000>;
101 + regulator-boot-on;
102 + regulator-always-on;
103 + };
104 +
105 + reg_3p3v: regulator-3p3v {
106 + compatible = "regulator-fixed";
107 + regulator-name = "fixed-3.3V";
108 + regulator-min-microvolt = <3300000>;
109 + regulator-max-microvolt = <3300000>;
110 + regulator-boot-on;
111 + regulator-always-on;
112 + };
113 +
114 + reg_5v: regulator-5v {
115 + compatible = "regulator-fixed";
116 + regulator-name = "fixed-5V";
117 + regulator-min-microvolt = <5000000>;
118 + regulator-max-microvolt = <5000000>;
119 + regulator-boot-on;
120 + regulator-always-on;
121 + };
122 +
123 + gpio-keys {
124 + compatible = "gpio-keys";
125 + pinctrl-names = "default";
126 + pinctrl-0 = <&key_pins_a>;
127 +
128 + factory {
129 + label = "factory";
130 + linux,code = <KEY_RESTART>;
131 + gpios = <&pio 256 GPIO_ACTIVE_LOW>;
132 + };
133 + };
134 +
135 + leds {
136 + compatible = "gpio-leds";
137 + pinctrl-names = "default";
138 + pinctrl-0 = <&led_pins_unielec>;
139 +
140 + led3 {
141 + label = "u7623-01:green:led3";
142 + gpios = <&pio 14 GPIO_ACTIVE_LOW>;
143 + default-state = "off";
144 + };
145 +
146 + led4 {
147 + label = "u7623-01:green:led4";
148 + gpios = <&pio 15 GPIO_ACTIVE_LOW>;
149 + default-state = "off";
150 + };
151 + };
152 +
153 + mt7530: switch@0 {
154 + compatible = "mediatek,mt7530";
155 + #address-cells = <1>;
156 + #size-cells = <0>;
157 + };
158 +};
159 +
160 +&crypto {
161 + status = "okay";
162 +};
163 +
164 +&eth {
165 + status = "okay";
166 +
167 + gmac0: mac@0 {
168 + compatible = "mediatek,eth-mac";
169 + reg = <0>;
170 + phy-mode = "trgmii";
171 +
172 + fixed-link {
173 + speed = <1000>;
174 + full-duplex;
175 + pause;
176 + };
177 + };
178 +
179 + mdio: mdio-bus {
180 + #address-cells = <1>;
181 + #size-cells = <0>;
182 + phy5: ethernet-phy@5 {
183 + reg = <5>;
184 + phy-mode = "rgmii-rxid";
185 + };
186 + };
187 +};
188 +
189 +&mt7530 {
190 + compatible = "mediatek,mt7530";
191 + #address-cells = <1>;
192 + #size-cells = <0>;
193 + reg = <0>;
194 + pinctrl-names = "default";
195 + mediatek,mcm;
196 + resets = <&ethsys 2>;
197 + reset-names = "mcm";
198 + core-supply = <&mt6323_vpa_reg>;
199 + io-supply = <&mt6323_vemc3v3_reg>;
200 +
201 + dsa,mii-bus = <&mdio>;
202 +
203 + ports {
204 + #address-cells = <1>;
205 + #size-cells = <0>;
206 + reg = <0>;
207 +
208 + port@0 {
209 + reg = <0>;
210 + label = "lan0";
211 + cpu = <&cpu_port0>;
212 + };
213 +
214 + port@1 {
215 + reg = <1>;
216 + label = "lan1";
217 + cpu = <&cpu_port0>;
218 + };
219 +
220 + port@2 {
221 + reg = <2>;
222 + label = "lan2";
223 + cpu = <&cpu_port0>;
224 + };
225 +
226 + port@3 {
227 + reg = <3>;
228 + label = "lan3";
229 + cpu = <&cpu_port0>;
230 + };
231 +
232 + port@4 {
233 + reg = <4>;
234 + label = "wan";
235 + cpu = <&cpu_port0>;
236 + };
237 +
238 + cpu_port0: port@6 {
239 + reg = <6>;
240 + label = "cpu";
241 + ethernet = <&gmac0>;
242 + phy-mode = "trgmii";
243 +
244 + fixed-link {
245 + speed = <1000>;
246 + full-duplex;
247 + };
248 + };
249 + };
250 +};
251 +
252 +&mmc0 {
253 + pinctrl-names = "default", "state_uhs";
254 + pinctrl-0 = <&mmc0_pins_default>;
255 + pinctrl-1 = <&mmc0_pins_uhs>;
256 + status = "okay";
257 + bus-width = <8>;
258 + max-frequency = <50000000>;
259 + cap-mmc-highspeed;
260 + vmmc-supply = <&reg_3p3v>;
261 + vqmmc-supply = <&reg_1p8v>;
262 + non-removable;
263 +};
264 +
265 +&pio {
266 + key_pins_a: keys-alt {
267 + pins-keys {
268 + pinmux = <MT7623_PIN_256_GPIO256_FUNC_GPIO256>,
269 + <MT7623_PIN_257_GPIO257_FUNC_GPIO257>;
270 + input-enable;
271 + };
272 + };
273 +
274 + led_pins_unielec: leds-unielec {
275 + pins-leds {
276 + pinmux = <MT7623_PIN_14_GPIO14_FUNC_GPIO14>,
277 + <MT7623_PIN_15_GPIO15_FUNC_GPIO15>;
278 + };
279 + };
280 +
281 + mmc0_pins_default: mmc0default {
282 + pins_cmd_dat {
283 + pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
284 + <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
285 + <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
286 + <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
287 + <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
288 + <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
289 + <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
290 + <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
291 + <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
292 + input-enable;
293 + bias-pull-up;
294 + };
295 +
296 + pins_clk {
297 + pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
298 + bias-pull-down;
299 + };
300 +
301 + pins_rst {
302 + pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
303 + bias-pull-up;
304 + };
305 + };
306 +
307 + mmc0_pins_uhs: mmc0 {
308 + pins_cmd_dat {
309 + pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
310 + <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
311 + <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
312 + <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
313 + <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
314 + <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
315 + <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
316 + <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
317 + <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
318 + input-enable;
319 + drive-strength = <MTK_DRIVE_2mA>;
320 + bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
321 + };
322 +
323 + pins_clk {
324 + pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
325 + drive-strength = <MTK_DRIVE_2mA>;
326 + bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
327 + };
328 +
329 + pins_rst {
330 + pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
331 + bias-pull-up;
332 + };
333 + };
334 +
335 + pwm_pins_a: pwm@0 {
336 + pins_pwm {
337 + pinmux = <MT7623_PIN_203_PWM0_FUNC_PWM0>,
338 + <MT7623_PIN_204_PWM1_FUNC_PWM1>,
339 + <MT7623_PIN_205_PWM2_FUNC_PWM2>,
340 + <MT7623_PIN_206_PWM3_FUNC_PWM3>,
341 + <MT7623_PIN_207_PWM4_FUNC_PWM4>;
342 + };
343 + };
344 +
345 + uart2_pins_b: uart@2 {
346 + pins_dat {
347 + pinmux = <MT7623_PIN_200_URXD2_FUNC_URXD2>,
348 + <MT7623_PIN_201_UTXD2_FUNC_UTXD2>;
349 + };
350 + };
351 +
352 + pcie_default: pcie_pin_default {
353 + pins_cmd_dat {
354 + pinmux = <MT7623_PIN_208_AUD_EXT_CK1_FUNC_PCIE0_PERST_N>,
355 + <MT7623_PIN_209_AUD_EXT_CK2_FUNC_PCIE1_PERST_N>;
356 + bias-disable;
357 + };
358 + };
359 +};
360 +
361 +&pwm {
362 + pinctrl-names = "default";
363 + pinctrl-0 = <&pwm_pins_a>;
364 + status = "okay";
365 +};
366 +
367 +&pwrap {
368 + mt6323 {
369 + mt6323led: led {
370 + compatible = "mediatek,mt6323-led";
371 + #address-cells = <1>;
372 + #size-cells = <0>;
373 +
374 + led@0 {
375 + reg = <0>;
376 + label = "led0";
377 + default-state = "off";
378 + };
379 + };
380 + };
381 +};
382 +
383 +&uart2 {
384 + pinctrl-names = "default";
385 + pinctrl-0 = <&uart2_pins_b>;
386 + status = "okay";
387 +};
388 +
389 +&usb1 {
390 + vusb33-supply = <&reg_3p3v>;
391 + vbus-supply = <&reg_3p3v>;
392 + status = "okay";
393 +};
394 +
395 +&u3phy1 {
396 + status = "okay";
397 +};
398 +
399 +&u3phy2 {
400 + status = "okay";
401 + mediatek,phy-switch = <&hifsys>;
402 +};
403 +
404 +&pcie {
405 + pinctrl-names = "default";
406 + pinctrl-0 = <&pcie_default>;
407 + status = "okay";
408 +
409 + pcie@1,0 {
410 + status = "okay";
411 + };
412 +
413 + pcie@2,0 {
414 + status = "okay";
415 + };
416 +};
417 +
418 +&pcie1_phy {
419 + status = "okay";
420 +};
421 +
422 --
423 2.14.1
424