<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 3cf55c25453517960d72b56d1ba8f12840b1990e Mon Sep 17 00:00:00 2001
From: Samuel Holland &lt;samuel@sholland.org&gt;
Date: Sat, 9 Jul 2022 17:43:17 -0500
Subject: [PATCH 031/117] riscv: dts: allwinner: Add MangoPi MQ Pro devicetree

The MangoPi MQ Pro is a tiny SBC with a layout compatible to the
Raspberry Pi Zero. It includes the Allwinner D1 SoC, 512M or 1G of DDR3,
and an RTL8723DS-based WiFi/Bluetooth module.

The board also exposes GPIO Port E via a connector on the end of the
board, which can support either a camera or an RMII Ethernet PHY. The
additional regulators supply that connector.

Signed-off-by: Samuel Holland &lt;samuel@sholland.org&gt;
---
 arch/riscv/boot/dts/allwinner/Makefile        |   1 +
 .../allwinner/sun20i-d1-mangopi-mq-pro.dts    | 128 ++++++++++++++++++
 2 files changed, 129 insertions(+)
 create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-mangopi-mq-pro.dts

--- a/arch/riscv/boot/dts/allwinner/Makefile
+++ b/arch/riscv/boot/dts/allwinner/Makefile
@@ -3,4 +3,5 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-li
 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-720p.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-dock.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-mangopi-mq-pro.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-nezha.dtb
--- /dev/null
+++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-mangopi-mq-pro.dts
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: (GPL-2.0+ or MIT)
+// Copyright (C) 2022 Samuel Holland &lt;samuel@sholland.org&gt;
+
+/dts-v1/;
+
+#include &lt;dt-bindings/gpio/gpio.h&gt;
+
+#include "sun20i-d1.dtsi"
+#include "sun20i-d1-common-regulators.dtsi"
+
+/ {
+	model = "MangoPi MQ Pro";
+	compatible = "widora,mangopi-mq-pro", "allwinner,sun20i-d1";
+
+	aliases {
+		ethernet0 = &amp;rtl8723ds;
+		mmc0 = &amp;mmc0;
+		serial0 = &amp;uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	reg_avdd2v8: avdd2v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "avdd2v8";
+		regulator-min-microvolt = &lt;2800000&gt;;
+		regulator-max-microvolt = &lt;2800000&gt;;
+		vin-supply = &lt;&amp;reg_vcc_3v3&gt;;
+	};
+
+	reg_dvdd: dvdd {
+		compatible = "regulator-fixed";
+		regulator-name = "dvdd";
+		regulator-min-microvolt = &lt;1200000&gt;;
+		regulator-max-microvolt = &lt;1200000&gt;;
+		vin-supply = &lt;&amp;reg_vcc_3v3&gt;;
+	};
+
+	reg_vdd_cpu: vdd-cpu {
+		compatible = "regulator-fixed";
+		regulator-name = "vdd-cpu";
+		regulator-min-microvolt = &lt;1100000&gt;;
+		regulator-max-microvolt = &lt;1100000&gt;;
+		vin-supply = &lt;&amp;reg_vcc&gt;;
+	};
+
+	wifi_pwrseq: wifi-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = &lt;&amp;pio 6 17 GPIO_ACTIVE_LOW&gt;; /* PG17 */
+	};
+};
+
+&amp;cpu0 {
+	cpu-supply = &lt;&amp;reg_vdd_cpu&gt;;
+};
+
+&amp;ehci1 {
+	status = "okay";
+};
+
+&amp;mmc0 {
+	bus-width = &lt;4&gt;;
+	cd-gpios = &lt;&amp;pio 5 6 GPIO_ACTIVE_HIGH&gt;; /* PF6 */
+	disable-wp;
+	vmmc-supply = &lt;&amp;reg_vcc_3v3&gt;;
+	vqmmc-supply = &lt;&amp;reg_vcc_3v3&gt;;
+	pinctrl-0 = &lt;&amp;mmc0_pins&gt;;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&amp;mmc1 {
+	bus-width = &lt;4&gt;;
+	mmc-pwrseq = &lt;&amp;wifi_pwrseq&gt;;
+	non-removable;
+	vmmc-supply = &lt;&amp;reg_vcc_3v3&gt;;
+	vqmmc-supply = &lt;&amp;reg_vcc_3v3&gt;;
+	pinctrl-0 = &lt;&amp;mmc1_pins&gt;;
+	pinctrl-names = "default";
+	status = "okay";
+
+	rtl8723ds: wifi@1 {
+		reg = &lt;1&gt;;
+		interrupt-parent = &lt;&amp;pio&gt;;
+		interrupts = &lt;6 10 IRQ_TYPE_LEVEL_LOW&gt;; /* PG10 */
+		interrupt-names = "host-wake";
+	};
+};
+
+&amp;ohci1 {
+	status = "okay";
+};
+
+&amp;pio {
+	vcc-pe-supply = &lt;&amp;reg_avdd2v8&gt;;
+};
+
+&amp;uart0 {
+	pinctrl-0 = &lt;&amp;uart0_pb8_pins&gt;;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&amp;uart1 {
+	uart-has-rtscts;
+	pinctrl-0 = &lt;&amp;uart1_pg6_pins&gt;, &lt;&amp;uart1_pg8_rts_cts_pins&gt;;
+	pinctrl-names = "default";
+	status = "okay";
+
+	bluetooth {
+		compatible = "realtek,rtl8723ds-bt";
+		device-wake-gpios = &lt;&amp;pio 6 18 GPIO_ACTIVE_HIGH&gt;; /* PG18 */
+		enable-gpios = &lt;&amp;pio 6 15 GPIO_ACTIVE_HIGH&gt;; /* PG15 */
+		host-wake-gpios = &lt;&amp;pio 6 14 GPIO_ACTIVE_HIGH&gt;; /* PG14 */
+	};
+};
+
+&amp;usb_otg {
+	dr_mode = "peripheral";
+	status = "okay";
+};
+
+&amp;usbphy {
+	usb0_vbus-supply = &lt;&amp;reg_vcc&gt;;
+	status = "okay";
+};
</pre></body></html>