From patchwork Fri Nov 25 23:46:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 26164 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4356210wrr; Fri, 25 Nov 2022 15:48:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf7QUfA8eQt4yD9Jdfok7sE/XyKfYWeo2wuPu8eBV2bKTzgGMa+7eksdLmYuEu34uJBdjS1N X-Received: by 2002:a17:902:c60b:b0:189:651d:5c9e with SMTP id r11-20020a170902c60b00b00189651d5c9emr6508982plr.24.1669420118861; Fri, 25 Nov 2022 15:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669420118; cv=none; d=google.com; s=arc-20160816; b=hd9XL+HCBc6hu3xpAIQCqCoIRwVCHpjFLIew1cWpPoVjmJ+GWocxZMpRrYnPDcNT7t qUjLEnpK7DmIXKObBesZhjKeqcAJ73wauFOWTkfI2fYJ+mzDY/FobpQ8t5LmX0biLRqy NrnQ5PuOvZls8iMIhy5ydpeZ3WFeiEa5sg8c+i4grX1XdPLuBJBAByM5RCD5plg1MjXb 7yPKVZNP9rfNWSmhCYXPl8N38+Y/H8Qgf6rWApkZqr4104sVzVS2pQQPbU06xUIe51jj 2AISgsKARrZifaFcEE9b5li4gyx4IUcGmGAC/EHyKfTFw889hJm4kJSzUs94YO/0XURi eSGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=cfhxV/MvooQBTZE8TtZ0PGDV/q29MFce7Db7Suuco1A=; b=SC/le9ds7keJ+lahHdVUIqY+7ADrfOrlC9Fgjrt2pPd2bmFkpkIPG4/m1gC6T8J7kW 5c0gP/GCJTnb6y6B+/AeRgHdBUWqUMgvEidd/nW2143a/E73TJFbtfm2UD5Hog7W25Qf C7SZlCQRfUFUMNaO1TvMmmEA5+6XYO4Cdqh9VRGOx2JcJWOSY3Mz0h1Zn+UnCBUg152o HiyHmTibZ9Oxer8t7WmnJVq0hwON+hBz2iMGpIhQkXcuc/CWUlEIHhFB/IvCOmOMFNNN XXFY1RLcKVH+VIYzSEFh9eKfgmUsNqgIO9eBwjsLmhrRk4mr6//R3zDF9GFbo82ns9kL bq6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=NxTk+8Cl; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="Us5Fq0j/"; 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=sholland.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 144-20020a630496000000b0046af247a19asi5548698pge.438.2022.11.25.15.48.25; Fri, 25 Nov 2022 15:48:38 -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=@sholland.org header.s=fm2 header.b=NxTk+8Cl; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="Us5Fq0j/"; 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=sholland.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230195AbiKYXro (ORCPT + 99 others); Fri, 25 Nov 2022 18:47:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230132AbiKYXrR (ORCPT ); Fri, 25 Nov 2022 18:47:17 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9033C59FFB; Fri, 25 Nov 2022 15:47:10 -0800 (PST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 083AD5C00C8; Fri, 25 Nov 2022 18:47:10 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Fri, 25 Nov 2022 18:47:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1669420030; x=1669506430; bh=cf hxV/MvooQBTZE8TtZ0PGDV/q29MFce7Db7Suuco1A=; b=NxTk+8ClJi97TXQUzn RLgkPktu2+rbQKguCOIkaarJ4KqE/OcvhdovpR4o7PhCFfqWULdG+PL+iZ39zeZv V8QFvNa0LfaWJujeQvJOqVWM/2xM4i+E0caZXytjhtJlFhTf0V6OXwR1Q9YJnNje zoCb6SVoHDQmkLLuvvI6BnrXFRou9iy1jCzOBvxC64BaJGdQsLYHNLHlZoTEkEjb 8cIjWSX+CE5BvJxhT0Tl/s9utAcYiIq7L/+Z6MfVsmgvs7vtJ0rP7/DK4KHmemht A/Os185os//IszQ5gcg8AoJpXdIOh/yqb+PHlOwlUCASJkJ/dzvo8qi/v4jvghHM ZzAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1669420030; x=1669506430; bh=cfhxV/MvooQBT ZE8TtZ0PGDV/q29MFce7Db7Suuco1A=; b=Us5Fq0j/uBXOKorzYqLatAUN4ti1h MDM1tfzALX0rAOM1uapxL+B6APB5aBdHgqKd4CmQk9UOCPEsQjeTyt8UkyC/NRdx TpXB5F9fKMExihsfIlg1my+4Dj8UiNFvbKH+qPy7SHmB1oE88Cg1g1CWy6DkMJR/ CaNR9Rk9Yb8t/nbCRyXq4853sapCJHatbcK9c+GoDSTq/zbe+Wp+AaSqbuxpD+tg Xi0n8ij/9edbZaVNmq/6UC/4oXc+yL3H6TBAsC1XIzlGEeINwUNtGmxjRs49+mQt BBd3DYyJT44tTT8+rvBFAr8w+1XvEDIYaUPsfUIdht9SoEKYkzgCNaazQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieeigddutdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 25 Nov 2022 18:47:08 -0500 (EST) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec , linux-sunxi@lists.linux.dev, Palmer Dabbelt , Conor Dooley , linux-riscv@lists.infradead.org Cc: 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 , Samuel Holland , Albert Ou , Anup Patel , Atish Patra , Christian Hewitt , Conor Dooley , Guo Ren , Heinrich Schuchardt , Linus Walleij , Paul Walmsley , Stanislav Jakubek Subject: [PATCH v2 06/12] riscv: dts: allwinner: Add Allwinner D1 Nezha devicetree Date: Fri, 25 Nov 2022 17:46:50 -0600 Message-Id: <20221125234656.47306-7-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221125234656.47306-1-samuel@sholland.org> References: <20221125234656.47306-1-samuel@sholland.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750513870357266484?= X-GMAIL-MSGID: =?utf-8?q?1750513870357266484?= "D1 Nezha" is Allwinner's first-party development board for the D1 SoC. It was shipped with 512M, 1G, or 2G of DDR3. It supports onboard audio, HDMI, gigabit Ethernet, WiFi and Bluetooth, USB 2.0 host and OTG ports, plus low-speed I/O from the SoC and a GPIO expander chip. Reviewed-by: Heiko Stuebner Tested-by: Conor Dooley Tested-by: Heiko Stuebner Signed-off-by: Samuel Holland Reviewed-by: Guo Ren Reviewed-by: Conor Dooley Acked-by: Jernej Skrabec --- Changes in v2: - Common regulators moved to MangoPi MQ patch, removed analog LDOs - Removed LRADC (depends on analog LDOs) - Added XR829 host-wake interrupt arch/riscv/boot/dts/allwinner/Makefile | 1 + .../boot/dts/allwinner/sun20i-d1-nezha.dts | 167 ++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts diff --git a/arch/riscv/boot/dts/allwinner/Makefile b/arch/riscv/boot/dts/allwinner/Makefile index 2f2792594f7d..277e59d1c907 100644 --- a/arch/riscv/boot/dts/allwinner/Makefile +++ b/arch/riscv/boot/dts/allwinner/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 +dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-nezha.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1s-mangopi-mq.dtb diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts new file mode 100644 index 000000000000..9ea3648e64ea --- /dev/null +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +// Copyright (C) 2021-2022 Samuel Holland + +#include +#include + +/dts-v1/; + +#include "sun20i-d1.dtsi" +#include "sun20i-common-regulators.dtsi" + +/ { + model = "Allwinner D1 Nezha"; + compatible = "allwinner,d1-nezha", "allwinner,sun20i-d1"; + + aliases { + ethernet0 = &emac; + ethernet1 = &xr829; + mmc0 = &mmc0; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + reg_usbvbus: usbvbus { + compatible = "regulator-fixed"; + regulator-name = "usbvbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */ + enable-active-high; + vin-supply = <®_vcc>; + }; + + /* + * This regulator is PWM-controlled, but the PWM controller is not + * yet supported, so fix the regulator to its default voltage. + */ + reg_vdd_cpu: vdd-cpu { + compatible = "regulator-fixed"; + regulator-name = "vdd-cpu"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + vin-supply = <®_vcc>; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&pio 6 12 GPIO_ACTIVE_LOW>; /* PG12 */ + }; +}; + +&cpu0 { + cpu-supply = <®_vdd_cpu>; +}; + +&dcxo { + clock-frequency = <24000000>; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&emac { + pinctrl-0 = <&rgmii_pe_pins>; + pinctrl-names = "default"; + phy-handle = <&ext_rgmii_phy>; + phy-mode = "rgmii-id"; + phy-supply = <®_vcc_3v3>; + status = "okay"; +}; + +&i2c2 { + pinctrl-0 = <&i2c2_pb0_pins>; + pinctrl-names = "default"; + status = "okay"; + + pcf8574a: gpio@38 { + compatible = "nxp,pcf8574a"; + reg = <0x38>; + interrupt-parent = <&pio>; + interrupts = <1 2 IRQ_TYPE_LEVEL_LOW>; /* PB2 */ + interrupt-controller; + gpio-controller; + #gpio-cells = <2>; + #interrupt-cells = <2>; + }; +}; + +&mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&mmc0 { + bus-width = <4>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* 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"; + + xr829: wifi@1 { + reg = <1>; + interrupt-parent = <&pio>; + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 */ + interrupt-names = "host-wake"; + }; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&uart0 { + pinctrl-0 = <&uart0_pb8_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&uart1 { + uart-has-rtscts; + pinctrl-0 = <&uart1_pg6_pins>, <&uart1_pg8_rts_cts_pins>; + pinctrl-names = "default"; + status = "okay"; + + /* XR829 bluetooth is connected here */ +}; + +&usb_otg { + dr_mode = "otg"; + status = "okay"; +}; + +&usbphy { + usb0_id_det-gpios = <&pio 3 21 GPIO_ACTIVE_HIGH>; /* PD21 */ + usb0_vbus_det-gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */ + usb0_vbus-supply = <®_usbvbus>; + usb1_vbus-supply = <®_vcc>; + status = "okay"; +};