From nobody Sun Sep 7 13:36:07 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDC94C001DB for ; Sat, 5 Aug 2023 23:38:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229710AbjHEXiU (ORCPT ); Sat, 5 Aug 2023 19:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbjHEXiR (ORCPT ); Sat, 5 Aug 2023 19:38:17 -0400 Received: from mail.croughan.sh (mail.croughan.sh [IPv6:2a01:4f9:c011:cb0::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 322562120; Sat, 5 Aug 2023 16:38:15 -0700 (PDT) From: Matthew Croughan DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nix.how; s=mail; t=1691278693; bh=2DZlbwxyrwSkLVnCD2OL6/PMldNs7f5UNXEqVfXqL9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Jei7ru5cIC4KLZ2F4SLtJA7heuAZ8vIQ2IKn+APPfjCPioB7LOnin8nERbGBJlbZl qoLaSMWncxCBOykY1I6szZs1/LAjT2uc3koYohSIAAgGuO483d4/izqoMHXH9O2PQN Zh7fIusMRhLonHzKLo7uu7xfCyeRT9Evnl/JZTX0= To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard Cc: Matthew Croughan , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v6 1/2] dt-bindings: arm: sunxi: add Mango Pi MQ-Quad binding Date: Sun, 6 Aug 2023 00:34:55 +0100 Message-ID: <20230805233715.1216456-2-matthew.croughan@nix.how> In-Reply-To: <20230805233715.1216456-1-matthew.croughan@nix.how> References: <20230805233715.1216456-1-matthew.croughan@nix.how> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Document board compatible names for Mango Pi MQ-Quad Signed-off-by: Matthew Croughan Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/arm/sunxi.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/arm/sunxi.yaml b/Documentati= on/devicetree/bindings/arm/sunxi.yaml index ee8fdd2da869..2dee815fd45e 100644 --- a/Documentation/devicetree/bindings/arm/sunxi.yaml +++ b/Documentation/devicetree/bindings/arm/sunxi.yaml @@ -862,6 +862,11 @@ properties: - const: wexler,tab7200 - const: allwinner,sun7i-a20 =20 + - description: MangoPi MQ-Quad + items: + - const: widora,mangopi-mq-quad + - const: allwinner,sun50i-h616 + - description: MangoPi MQ-R board items: - const: widora,mangopi-mq-r-t113 --=20 2.41.0 From nobody Sun Sep 7 13:36:07 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94C3EC04A94 for ; Sat, 5 Aug 2023 23:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbjHEXi0 (ORCPT ); Sat, 5 Aug 2023 19:38:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbjHEXiX (ORCPT ); Sat, 5 Aug 2023 19:38:23 -0400 Received: from mail.croughan.sh (mail.croughan.sh [135.181.193.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0792212D; Sat, 5 Aug 2023 16:38:21 -0700 (PDT) From: Matthew Croughan DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nix.how; s=mail; t=1691278699; bh=j8Ex3P9gUvSbzz5ZfJ4rugGr8cfWoSUIVvrIlfDnzEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dIgyPWVpA9u1eDXGAu64Itq3wAY12V6NlJwRnStVMtD7X9nd+yYPWwNtFjXpO+Ap9 MICjdI4JUSNPz//0eccmGn1gffuY1pEWDDF1Hft8Fx4WPZc1M1vDvKM+S/ETi7Onv+ 09+RC32WPUHYAz9t2+n7gmzgU9QaBlULBqRIG09c= To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Matthew Croughan , Andre Przywara , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v6 2/2] arm64: dts: allwinner: h616: Add Mango Pi MQ-Quad DTS Date: Sun, 6 Aug 2023 00:34:56 +0100 Message-ID: <20230805233715.1216456-3-matthew.croughan@nix.how> In-Reply-To: <20230805233715.1216456-1-matthew.croughan@nix.how> References: <20230805233715.1216456-1-matthew.croughan@nix.how> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Mango Pi MQ Quad is a H616 based SBC, add basic support for the board and its peripherals Signed-off-by: Matthew Croughan Reviewed-by: Andre Przywara --- arch/arm64/boot/dts/allwinner/Makefile | 1 + .../allwinner/sun50i-h616-mangopi-mq-quad.dts | 187 ++++++++++++++++++ 2 files changed, 188 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-mangopi-mq-qu= ad.dts diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/a= llwinner/Makefile index 6a96494a2e0a..06c5b97dbfc3 100644 --- a/arch/arm64/boot/dts/allwinner/Makefile +++ b/arch/arm64/boot/dts/allwinner/Makefile @@ -38,5 +38,6 @@ dtb-$(CONFIG_ARCH_SUNXI) +=3D sun50i-h6-pine-h64.dtb dtb-$(CONFIG_ARCH_SUNXI) +=3D sun50i-h6-pine-h64-model-b.dtb dtb-$(CONFIG_ARCH_SUNXI) +=3D sun50i-h6-tanix-tx6.dtb dtb-$(CONFIG_ARCH_SUNXI) +=3D sun50i-h6-tanix-tx6-mini.dtb +dtb-$(CONFIG_ARCH_SUNXI) +=3D sun50i-h616-mangopi-mq-quad.dtb dtb-$(CONFIG_ARCH_SUNXI) +=3D sun50i-h616-orangepi-zero2.dtb dtb-$(CONFIG_ARCH_SUNXI) +=3D sun50i-h616-x96-mate.dtb diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-mangopi-mq-quad.dts = b/arch/arm64/boot/dts/allwinner/sun50i-h616-mangopi-mq-quad.dts new file mode 100644 index 000000000000..6121c14bc66b --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-mangopi-mq-quad.dts @@ -0,0 +1,187 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) + * Copyright (C) 2020 Arm Ltd. + * + * Copyright (C) 2023 Matthew Croughan + */ + +/dts-v1/; + +#include "sun50i-h616.dtsi" + +#include +#include +#include + +/ { + model =3D "MangoPi MQ-Quad"; + compatible =3D "widora,mangopi-mq-quad", "allwinner,sun50i-h616"; + + aliases { + serial0 =3D &uart0; + }; + + chosen { + stdout-path =3D "serial0:115200n8"; + }; + + leds { + compatible =3D "gpio-leds"; + + led-0 { + function =3D LED_FUNCTION_STATUS; + color =3D ; + gpios =3D <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */ + }; + }; + + reg_vcc5v: vcc5v { + /* board wide 5V supply directly from the USB-C socket */ + compatible =3D "regulator-fixed"; + regulator-name =3D "vcc-5v"; + regulator-min-microvolt =3D <5000000>; + regulator-max-microvolt =3D <5000000>; + regulator-always-on; + }; + + reg_vcc3v3: vcc3v3 { + /* board wide 3V3 supply directly from SY8008 regulator */ + compatible =3D "regulator-fixed"; + regulator-name =3D "vcc-3v3"; + regulator-min-microvolt =3D <3300000>; + regulator-max-microvolt =3D <3300000>; + regulator-always-on; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible =3D "mmc-pwrseq-simple"; + reset-gpios =3D <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ + }; +}; + +&ehci1 { + status =3D "okay"; +}; + +&pio { + vcc-pc-supply =3D <®_vcc3v3>; + vcc-pg-supply =3D <®_vcc3v3>; + vcc-pi-supply =3D <®_vcc3v3>; +}; + +/* USB 2 & 3 are on headers only. */ + +&mmc0 { + vmmc-supply =3D <®_vcc3v3>; + cd-gpios =3D <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + bus-width =3D <4>; + status =3D "okay"; +}; + +&mmc1 { + bus-width =3D <4>; + mmc-pwrseq =3D <&wifi_pwrseq>; + non-removable; + vmmc-supply =3D <®_vcc3v3>; + vqmmc-supply =3D <®_vcc3v3>; + pinctrl-0 =3D <&mmc1_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; + + rtl8723ds: wifi@1 { + reg =3D <1>; + interrupt-parent =3D <&pio>; + interrupts =3D <6 15 IRQ_TYPE_LEVEL_LOW>; /* PG15 */ + interrupt-names =3D "host-wake"; + }; +}; + + +&uart1 { + uart-has-rtscts; + pinctrl-0 =3D <&uart1_pins>, <&uart1_rts_cts_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; + + bluetooth { + compatible =3D "realtek,rtl8723ds-bt"; + device-wake-gpios =3D <&pio 6 17 GPIO_ACTIVE_HIGH>; /* PG17 */ + enable-gpios =3D <&pio 6 19 GPIO_ACTIVE_HIGH>; /* PG19 */ + host-wake-gpios =3D <&pio 6 16 GPIO_ACTIVE_HIGH>; /* PG16 */ + }; +}; + +&ohci1 { + status =3D "okay"; +}; + +&r_i2c { + status =3D "okay"; + + axp313a: pmic@36 { + compatible =3D "x-powers,axp313a"; + interrupt-controller; + #interrupt-cells =3D <1>; + reg =3D <0x36>; + regulators { + /* + * ALDO1 is feeding both VCC-PLL and VCC-DCXO, always-on is required, + * as removing power would cut the 1.8v supply for the RAM + */ + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt =3D <1800000>; + regulator-max-microvolt =3D <1800000>; + regulator-name =3D "vcc-1v8"; + }; + + reg_dcdc1: dcdc1 { + regulator-always-on; + regulator-min-microvolt =3D <810000>; + regulator-max-microvolt =3D <990000>; + regulator-name =3D "vdd-gpu-sys"; + }; + + reg_dcdc2: dcdc2 { + regulator-always-on; + regulator-min-microvolt =3D <810000>; + regulator-max-microvolt =3D <1100000>; + regulator-name =3D "vdd-cpu"; + }; + + reg_dcdc3: dcdc3 { + regulator-always-on; + regulator-min-microvolt =3D <1500000>; + regulator-max-microvolt =3D <1500000>; + regulator-name =3D "vdd-dram"; + }; + + }; + }; +}; + +&uart0 { + pinctrl-names =3D "default"; + pinctrl-0 =3D <&uart0_ph_pins>; + status =3D "okay"; +}; + +&usbotg { + /* + * PHY0 pins are connected to a USB-C socket, but a role switch + * is not implemented: both CC pins are pulled to GND. + * The VBUS pins power the device, so a fixed peripheral mode + * is the best choice. + * The board can be powered via GPIOs, in this case port0 *can* + * act as a host (with a cable/adapter ignoring CC), as VBUS is + * then provided by the GPIOs. Any user of this setup would + * need to adjust the DT accordingly: dr_mode set to "host", + * enabling OHCI0 and EHCI0. + */ + dr_mode =3D "peripheral"; + status =3D "okay"; +}; + +&usbphy { + usb1_vbus-supply =3D <®_vcc5v>; + status =3D "okay"; +}; --=20 2.41.0