d1: add new target
[openwrt/staging/mans0n.git] / target / linux / d1 / patches-6.1 / 0031-riscv-dts-allwinner-Add-MangoPi-MQ-Pro-devicetree.patch
1 From 3cf55c25453517960d72b56d1ba8f12840b1990e Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Sat, 9 Jul 2022 17:43:17 -0500
4 Subject: [PATCH 031/117] riscv: dts: allwinner: Add MangoPi MQ Pro devicetree
5
6 The MangoPi MQ Pro is a tiny SBC with a layout compatible to the
7 Raspberry Pi Zero. It includes the Allwinner D1 SoC, 512M or 1G of DDR3,
8 and an RTL8723DS-based WiFi/Bluetooth module.
9
10 The board also exposes GPIO Port E via a connector on the end of the
11 board, which can support either a camera or an RMII Ethernet PHY. The
12 additional regulators supply that connector.
13
14 Signed-off-by: Samuel Holland <samuel@sholland.org>
15 ---
16 arch/riscv/boot/dts/allwinner/Makefile | 1 +
17 .../allwinner/sun20i-d1-mangopi-mq-pro.dts | 128 ++++++++++++++++++
18 2 files changed, 129 insertions(+)
19 create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-mangopi-mq-pro.dts
20
21 --- a/arch/riscv/boot/dts/allwinner/Makefile
22 +++ b/arch/riscv/boot/dts/allwinner/Makefile
23 @@ -3,4 +3,5 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-li
24 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-720p.dtb
25 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-dock.dtb
26 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv.dtb
27 +dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-mangopi-mq-pro.dtb
28 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-nezha.dtb
29 --- /dev/null
30 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-mangopi-mq-pro.dts
31 @@ -0,0 +1,128 @@
32 +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
33 +// Copyright (C) 2022 Samuel Holland <samuel@sholland.org>
34 +
35 +/dts-v1/;
36 +
37 +#include <dt-bindings/gpio/gpio.h>
38 +
39 +#include "sun20i-d1.dtsi"
40 +#include "sun20i-d1-common-regulators.dtsi"
41 +
42 +/ {
43 + model = "MangoPi MQ Pro";
44 + compatible = "widora,mangopi-mq-pro", "allwinner,sun20i-d1";
45 +
46 + aliases {
47 + ethernet0 = &rtl8723ds;
48 + mmc0 = &mmc0;
49 + serial0 = &uart0;
50 + };
51 +
52 + chosen {
53 + stdout-path = "serial0:115200n8";
54 + };
55 +
56 + reg_avdd2v8: avdd2v8 {
57 + compatible = "regulator-fixed";
58 + regulator-name = "avdd2v8";
59 + regulator-min-microvolt = <2800000>;
60 + regulator-max-microvolt = <2800000>;
61 + vin-supply = <&reg_vcc_3v3>;
62 + };
63 +
64 + reg_dvdd: dvdd {
65 + compatible = "regulator-fixed";
66 + regulator-name = "dvdd";
67 + regulator-min-microvolt = <1200000>;
68 + regulator-max-microvolt = <1200000>;
69 + vin-supply = <&reg_vcc_3v3>;
70 + };
71 +
72 + reg_vdd_cpu: vdd-cpu {
73 + compatible = "regulator-fixed";
74 + regulator-name = "vdd-cpu";
75 + regulator-min-microvolt = <1100000>;
76 + regulator-max-microvolt = <1100000>;
77 + vin-supply = <&reg_vcc>;
78 + };
79 +
80 + wifi_pwrseq: wifi-pwrseq {
81 + compatible = "mmc-pwrseq-simple";
82 + reset-gpios = <&pio 6 17 GPIO_ACTIVE_LOW>; /* PG17 */
83 + };
84 +};
85 +
86 +&cpu0 {
87 + cpu-supply = <&reg_vdd_cpu>;
88 +};
89 +
90 +&ehci1 {
91 + status = "okay";
92 +};
93 +
94 +&mmc0 {
95 + bus-width = <4>;
96 + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
97 + disable-wp;
98 + vmmc-supply = <&reg_vcc_3v3>;
99 + vqmmc-supply = <&reg_vcc_3v3>;
100 + pinctrl-0 = <&mmc0_pins>;
101 + pinctrl-names = "default";
102 + status = "okay";
103 +};
104 +
105 +&mmc1 {
106 + bus-width = <4>;
107 + mmc-pwrseq = <&wifi_pwrseq>;
108 + non-removable;
109 + vmmc-supply = <&reg_vcc_3v3>;
110 + vqmmc-supply = <&reg_vcc_3v3>;
111 + pinctrl-0 = <&mmc1_pins>;
112 + pinctrl-names = "default";
113 + status = "okay";
114 +
115 + rtl8723ds: wifi@1 {
116 + reg = <1>;
117 + interrupt-parent = <&pio>;
118 + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 */
119 + interrupt-names = "host-wake";
120 + };
121 +};
122 +
123 +&ohci1 {
124 + status = "okay";
125 +};
126 +
127 +&pio {
128 + vcc-pe-supply = <&reg_avdd2v8>;
129 +};
130 +
131 +&uart0 {
132 + pinctrl-0 = <&uart0_pb8_pins>;
133 + pinctrl-names = "default";
134 + status = "okay";
135 +};
136 +
137 +&uart1 {
138 + uart-has-rtscts;
139 + pinctrl-0 = <&uart1_pg6_pins>, <&uart1_pg8_rts_cts_pins>;
140 + pinctrl-names = "default";
141 + status = "okay";
142 +
143 + bluetooth {
144 + compatible = "realtek,rtl8723ds-bt";
145 + device-wake-gpios = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 */
146 + enable-gpios = <&pio 6 15 GPIO_ACTIVE_HIGH>; /* PG15 */
147 + host-wake-gpios = <&pio 6 14 GPIO_ACTIVE_HIGH>; /* PG14 */
148 + };
149 +};
150 +
151 +&usb_otg {
152 + dr_mode = "peripheral";
153 + status = "okay";
154 +};
155 +
156 +&usbphy {
157 + usb0_vbus-supply = <&reg_vcc>;
158 + status = "okay";
159 +};