Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11503889rwb; Fri, 25 Nov 2022 16:55:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf50IqbdO2Xo5ilFQvGVJ3fEN9+VBsrvIdx+bpeo97RfmIyzIBPGyD4gYTjoFhfvA8SDuPIF X-Received: by 2002:a63:f214:0:b0:477:f449:3644 with SMTP id v20-20020a63f214000000b00477f4493644mr2006766pgh.484.1669424145027; Fri, 25 Nov 2022 16:55:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669424145; cv=none; d=google.com; s=arc-20160816; b=vpLnWq2FAftFonwHVhWQe4Vcn4VY+7+QIUymWE2shFaFPP7jBPIkklAA6U7oaXTr2c 017UtCXL9IM6GQSfUOMGZGcinJX+y8suThOBQLxUrQXi7FOOonRnPT/rtbuPAhWUhxMR JDsCfM8SF9dP9cdNSCwHYZuM+ca3bftctO7T/GW4etAze2P8QxViwsotLGbe8jO0nUmC kLYCx6N3nl7svEJyNYNcCKE7QnpXkM5Es04ptlGqeijZ7fmtkoac6N1IlPJhKMug8Mbg kDUfaXFAzWbipOe6oAdN8c1Dool7gG+2BI+2EzFOectWwVsKdaA62tHWqimGHWlLkaI4 MhmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tVYscDoRICYKOFSkR14LLOAW3we7EMk6W7XdGC8aHYU=; b=ouxcdK0COGeI6UCJcEO3C4NtKPgQj18BjKPvXRlNWphCFrM048aUS/Lpdt6gA3JxQf do2rtL6C7v5qgzTqOlDGAXYyAbCgwX1xYv7S15woV8iujgUo/80IV+zMkb7/eaGwVMd8 JNbFtWe3IllF7RSNy2o1TEBILCAgLxscqTfcdf0uPqbuTc/xQrJwhsYZfrv4cO1AY0ag Iz/SLkQmSFXAflxThrZrsZcilYNjkqQ1U0S+yrMFhkNLgLUVeCmfEmJ++RrZwUMM5iSC o/2ysuFYZXPp3AetE3LwPM2amc8wc0zd0DpnzCO5LabU11gDCJRaVZCFW7NQwW/CXLVa GhIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KG0FrXcA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q185-20020a632ac2000000b0046b19725686si5284324pgq.775.2022.11.25.16.55.34; Fri, 25 Nov 2022 16:55:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KG0FrXcA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbiKZAUq (ORCPT + 85 others); Fri, 25 Nov 2022 19:20:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230042AbiKZAUZ (ORCPT ); Fri, 25 Nov 2022 19:20:25 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A06F52899; Fri, 25 Nov 2022 16:20:24 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 28DDE61184; Sat, 26 Nov 2022 00:20:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83478C4314B; Sat, 26 Nov 2022 00:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669422023; bh=OOEUFuq/lGcx5pNyP6gYHvWUv+2ek5XQSDRdwhndMDc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KG0FrXcAUyDqd82nTxtbRlSrHuHsuZhP2G/zuYt9nElsGIKZh9Hdywe5IvZxFX5Sr 6a7zLOWR8XZ0kKa8MR1WyXipr7obL0uGGqgQvb5qoGRHI8qZ7ac+rsfONNYSt+WGhy IL9vTWiODOA3PC8FbB/kk19JgAtpO+7y+iKcl7CI33lhqWW9dajfV2wkzNbUTW3Z1/ VYDNPwxmhK3ZVDs9c92obijGNThmWyVaxBaxpxHdWQNxPNSyVx7b//FbHlKkurwlMb CG0jerfMdCKw+IUBj77flp4ICxex11NkQbClmq7l4Dmt7qKy9f4eBHO51aRl10Io9t VSDvsVcLFNhcg== Received: by mail-ed1-f46.google.com with SMTP id x102so8335393ede.0; Fri, 25 Nov 2022 16:20:23 -0800 (PST) X-Gm-Message-State: ANoB5plJNo+9vJR4sXXrolFtAwokh+9/DBRy9PnjSQ4iuO2aLiiKJ3Cd /O/6BNe1CiddyuBE3+Z01GH/x4ZCSuVaYy935HQ= X-Received: by 2002:aa7:db91:0:b0:458:bd09:1b20 with SMTP id u17-20020aa7db91000000b00458bd091b20mr38282559edt.176.1669422021688; Fri, 25 Nov 2022 16:20:21 -0800 (PST) MIME-Version: 1.0 References: <20221125234656.47306-1-samuel@sholland.org> <20221125234656.47306-6-samuel@sholland.org> In-Reply-To: <20221125234656.47306-6-samuel@sholland.org> From: Guo Ren Date: Sat, 26 Nov 2022 08:20:10 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 05/12] riscv: dts: allwinner: Add MangoPi MQ devicetree To: Samuel Holland Cc: Chen-Yu Tsai , Jernej Skrabec , linux-sunxi@lists.linux.dev, Palmer Dabbelt , Conor Dooley , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, Krzysztof Kozlowski , Rob Herring , Heiko Stuebner , Jisheng Zhang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andre Przywara , Albert Ou , Anup Patel , Atish Patra , Christian Hewitt , Conor Dooley , Heinrich Schuchardt , Linus Walleij , Paul Walmsley , Stanislav Jakubek Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reviewed-by: Guo Ren On Sat, Nov 26, 2022 at 7:47 AM Samuel Holland wrote: > > The MangoPi MQ is a tiny SBC built around the Allwinner D1s. Its > onboard peripherals include two USB Type-C ports (1 device, 1 host) > and RTL8189FTV WLAN. > > A MangoPi MQ-R variant of the board also exists. The MQ-R has a > different form factor, but the onboard peripherals are the same. > > Most D1 and D1s boards use a similar power tree, with the 1.8V rail > powered by the SoC's internal LDOA, analog domains powered by ALDO, > and the rest of the board powered by always-on fixed regulators. To > avoid duplication, factor out the regulator information that is > common across boards. > > The board also exposes GPIO Port E via a FPC connector, which can > support either a camera or an RMII Ethernet PHY. The additional > regulators supply that connector. > > Signed-off-by: Samuel Holland > --- > > Changes in v2: > - New patch for v2 > > arch/riscv/boot/dts/Makefile | 1 + > arch/riscv/boot/dts/allwinner/Makefile | 2 + > .../allwinner/sun20i-common-regulators.dtsi | 35 +++++ > .../dts/allwinner/sun20i-d1s-mangopi-mq.dts | 135 ++++++++++++++++++ > 4 files changed, 173 insertions(+) > create mode 100644 arch/riscv/boot/dts/allwinner/Makefile > create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-common-regulators.dtsi > create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1s-mangopi-mq.dts > > diff --git a/arch/riscv/boot/dts/Makefile b/arch/riscv/boot/dts/Makefile > index ff174996cdfd..f292e31bdb2c 100644 > --- a/arch/riscv/boot/dts/Makefile > +++ b/arch/riscv/boot/dts/Makefile > @@ -1,4 +1,5 @@ > # SPDX-License-Identifier: GPL-2.0 > +subdir-y += allwinner > subdir-y += sifive > subdir-y += starfive > subdir-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += canaan > diff --git a/arch/riscv/boot/dts/allwinner/Makefile b/arch/riscv/boot/dts/allwinner/Makefile > new file mode 100644 > index 000000000000..2f2792594f7d > --- /dev/null > +++ b/arch/riscv/boot/dts/allwinner/Makefile > @@ -0,0 +1,2 @@ > +# SPDX-License-Identifier: GPL-2.0 > +dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1s-mangopi-mq.dtb > diff --git a/arch/riscv/boot/dts/allwinner/sun20i-common-regulators.dtsi b/arch/riscv/boot/dts/allwinner/sun20i-common-regulators.dtsi > new file mode 100644 > index 000000000000..de1adf2a2759 > --- /dev/null > +++ b/arch/riscv/boot/dts/allwinner/sun20i-common-regulators.dtsi > @@ -0,0 +1,35 @@ > +// SPDX-License-Identifier: (GPL-2.0+ or MIT) > +// Copyright (C) 2021-2022 Samuel Holland > + > +/ { > + reg_vcc: vcc { > + compatible = "regulator-fixed"; > + regulator-name = "vcc"; > + regulator-min-microvolt = <5000000>; > + regulator-max-microvolt = <5000000>; > + }; > + > + reg_vcc_3v3: vcc-3v3 { > + compatible = "regulator-fixed"; > + regulator-name = "vcc-3v3"; > + regulator-min-microvolt = <3300000>; > + regulator-max-microvolt = <3300000>; > + vin-supply = <®_vcc>; > + }; > +}; > + > +&pio { > + vcc-pb-supply = <®_vcc_3v3>; > + vcc-pc-supply = <®_vcc_3v3>; > + vcc-pd-supply = <®_vcc_3v3>; > + vcc-pe-supply = <®_vcc_3v3>; > + vcc-pf-supply = <®_vcc_3v3>; > + vcc-pg-supply = <®_vcc_3v3>; > +}; > + > +®_ldoa { > + regulator-always-on; > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1800000>; > + ldo-in-supply = <®_vcc_3v3>; > +}; > diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1s-mangopi-mq.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1s-mangopi-mq.dts > new file mode 100644 > index 000000000000..11b150182490 > --- /dev/null > +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1s-mangopi-mq.dts > @@ -0,0 +1,135 @@ > +// SPDX-License-Identifier: (GPL-2.0+ or MIT) > +// Copyright (C) 2022 Samuel Holland > + > +#include > +#include > + > +/dts-v1/; > + > +#include "sun20i-d1s.dtsi" > +#include "sun20i-common-regulators.dtsi" > + > +/ { > + model = "MangoPi MQ"; > + compatible = "widora,mangopi-mq", "allwinner,sun20i-d1s"; > + > + aliases { > + ethernet0 = &rtl8189ftv; > + mmc0 = &mmc0; > + serial3 = &uart3; > + }; > + > + chosen { > + stdout-path = "serial3:115200n8"; > + }; > + > + leds { > + compatible = "gpio-leds"; > + > + led-0 { > + color = ; > + function = LED_FUNCTION_BACKLIGHT; > + gpios = <&pio 3 22 GPIO_ACTIVE_LOW>; /* PD22 */ > + }; > + }; > + > + reg_avdd2v8: avdd2v8 { > + compatible = "regulator-fixed"; > + regulator-name = "avdd2v8"; > + regulator-min-microvolt = <2800000>; > + regulator-max-microvolt = <2800000>; > + vin-supply = <®_vcc_3v3>; > + }; > + > + reg_dvdd: dvdd { > + compatible = "regulator-fixed"; > + regulator-name = "dvdd"; > + regulator-min-microvolt = <1200000>; > + regulator-max-microvolt = <1200000>; > + vin-supply = <®_vcc_3v3>; > + }; > + > + reg_vcc_core: vcc-core { > + compatible = "regulator-fixed"; > + regulator-name = "vcc-core"; > + regulator-min-microvolt = <900000>; > + regulator-max-microvolt = <900000>; > + vin-supply = <®_vcc>; > + }; > + > + wifi_pwrseq: wifi-pwrseq { > + compatible = "mmc-pwrseq-simple"; > + reset-gpios = <&pio 6 12 GPIO_ACTIVE_LOW>; /* PG12 */ > + }; > +}; > + > +&cpu0 { > + cpu-supply = <®_vcc_core>; > +}; > + > +&dcxo { > + clock-frequency = <24000000>; > +}; > + > +&ehci1 { > + status = "okay"; > +}; > + > +&mmc0 { > + bus-width = <4>; > + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ > + disable-wp; > + vmmc-supply = <®_vcc_3v3>; > + vqmmc-supply = <®_vcc_3v3>; > + pinctrl-0 = <&mmc0_pins>; > + pinctrl-names = "default"; > + status = "okay"; > +}; > + > +&mmc1 { > + bus-width = <4>; > + mmc-pwrseq = <&wifi_pwrseq>; > + non-removable; > + vmmc-supply = <®_vcc_3v3>; > + vqmmc-supply = <®_vcc_3v3>; > + pinctrl-0 = <&mmc1_pins>; > + pinctrl-names = "default"; > + status = "okay"; > + > + rtl8189ftv: wifi@1 { > + reg = <1>; > + interrupt-parent = <&pio>; > + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 */ > + interrupt-names = "host-wake"; > + }; > +}; > + > +&ohci1 { > + status = "okay"; > +}; > + > +&pio { > + vcc-pe-supply = <®_avdd2v8>; > +}; > + > +®_ldob { > + regulator-name = "vcc-dram"; > + regulator-always-on; > + ldo-in-supply = <®_vcc_3v3>; > +}; > + > +&uart3 { > + pinctrl-0 = <&uart3_pb_pins>; > + pinctrl-names = "default"; > + status = "okay"; > +}; > + > +&usb_otg { > + dr_mode = "peripheral"; > + status = "okay"; > +}; > + > +&usbphy { > + usb1_vbus-supply = <®_vcc>; > + status = "okay"; > +}; > -- > 2.37.4 > -- Best Regards Guo Ren