From patchwork Sat Dec 31 23:38:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 37925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3548533wrt; Sat, 31 Dec 2022 15:44:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXu+uIFiUrGoNuGB50GAi6Mq6n/qypY6/OrxW1j+lD2JxevOXrudcgc08W37ELNwvFMMU8f9 X-Received: by 2002:a05:6402:13c4:b0:46a:be66:c0e2 with SMTP id a4-20020a05640213c400b0046abe66c0e2mr31282870edx.28.1672530261464; Sat, 31 Dec 2022 15:44:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672530261; cv=none; d=google.com; s=arc-20160816; b=ha3rMXASOyr6f6hrytJaDStn6q1Ql0pSYfmNA4kNts+0OnjbXDQB/byBuf+SrA/lI0 lb11jcwMRnX1y+USsEFxUnpI6sFmu8oooidST5ZlRZ3iKpHKgmQb7dy5eudqMNaHbJ/t epMzJUUk8VwjYC5vdPDD34/GZC1DcUCExNe+c0u3aqMmaE/tow+O/bA6bamKXEcSpvvT 6iRELFM2Bdlc5pBrO8cy1oHhnRolWXbdkV1ZQ/dvWGx1mJzrNdsnJ24+iKdIj+jd/a2v 2KccDPxhXsry3OKI+0N7WgHrBCiWOl1Vn1DIyd42j7tVcA3mr9ZchKGi/7F4AEgYOa1g u5fA== 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=J6rVARyJw3muIrcP2dT3zZNyK79SVGldDrAhgT6GSYM=; b=B6ZsCl9tnmvFHsuNvsDNV6uR4NXkl/7qkImlaDeLxOLilBzppJWaooir+4BeziVAzT ajpxfLgb2GgMQMsm078jpy2kMBH5+CPqiUbXPaIOGoJmwWSRKi6304Vjzn95O/0PX+kv pbv/lLnpgBxyFvFOdCU6+qltZYgNg0VhtQ1Io4TcxAaYCXhx5p4Hqoi2rC812XvNYqeB 1/mrcM7KuYT3XJWhX5YA4oQcvUsKm1WuvovYosuVgFx13dikMAypHbSPDuGwBOQ+JDfy Rk9neOBCaSDCZIGKzQnMkuHNQaQuI8b0X/ibeqShrP4seLECL29IN9Rh1o2kR7/zy1Zn JFkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=lPOqAUz8; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XxfBgMmF; 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 bd14-20020a056402206e00b0045a1dbedd92si19251244edb.35.2022.12.31.15.43.56; Sat, 31 Dec 2022 15:44:21 -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=fm3 header.b=lPOqAUz8; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=XxfBgMmF; 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 S236082AbiLaXjX (ORCPT + 99 others); Sat, 31 Dec 2022 18:39:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235804AbiLaXjD (ORCPT ); Sat, 31 Dec 2022 18:39:03 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7716B65A6; Sat, 31 Dec 2022 15:39:02 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D82D65C00AB; Sat, 31 Dec 2022 18:39:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 31 Dec 2022 18:39:01 -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=fm3; t=1672529941; x=1672616341; bh=J6 rVARyJw3muIrcP2dT3zZNyK79SVGldDrAhgT6GSYM=; b=lPOqAUz8H+7uJm+eKd ECf73YRfEL4S9dsCWvL0/k+7QWyhwJ+iPYLu3mDlqDVx4DFn+Hu1I9S67GcDMu0K 5VcR7ABPDgfwpkdADgE1/ujAZpsod21npMYOvNYDfFxBzkdftcXFOeUVqwStU4Xk ZE5JrvXdzYHAqZkFEyW3QfSm1YIx2gwBDmbJM+5PGWmDrZDCP8VODFRZNrlE0Smz fUwtrEe2A6DOgc3om9OshOMsqGJJc7kHQ4agk9MAzWVBNffrYHOENWA1zBF9Nihi +UZrHOT5SHf7XEDS3LSrG3lFee+VKv6bKJ/Pq46Sdlz95KKGhUNp47cXN4ZjMSj+ +GgA== 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=fm2; t=1672529941; x=1672616341; bh=J6rVARyJw3muI rcP2dT3zZNyK79SVGldDrAhgT6GSYM=; b=XxfBgMmF8pYlC19NjFs/qVpaISWiJ 6d1kfpASWIFphk08oShxXVGnzTJApJcGjI3nNOxpizqpeoFZpEjt4cxaKurT7pLF DlLICqP75zHDUtaFHGmszWHG5PgY6zCY7w5OWMnQxF1X+KRdBbYh1pMktS53pI02 Y+9aPW06ptUoLdHM+MFyh1HLF9vWNjQ1RBjmLLsENXKcTJC9mXz/6W+GOFNbUFsA gReMcxK89RmxZBr2VE0+y5V+vsMjNP5ExwFR6q8HxOkKBszkCtshPc9jPS8GenM2 tK3+43J22P/RbFLMCzrVxJoWJ9WHb8eLq4+DgJxJMO9zHnmYybx49fjRw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrieelgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 31 Dec 2022 18:39:00 -0500 (EST) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec , linux-sunxi@lists.linux.dev Cc: devicetree@vger.kernel.org, Rob Herring , Jisheng Zhang , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Andre Przywara , Palmer Dabbelt , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, Heiko Stuebner , Samuel Holland , Palmer Dabbelt , Guo Ren , Conor Dooley Subject: [PATCH v4 06/12] riscv: dts: allwinner: Add Allwinner D1 Nezha devicetree Date: Sat, 31 Dec 2022 17:38:45 -0600 Message-Id: <20221231233851.24923-7-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221231233851.24923-1-samuel@sholland.org> References: <20221231233851.24923-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_H2,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?1753775091294621273?= X-GMAIL-MSGID: =?utf-8?q?1753775091294621273?= "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. Acked-by: Jernej Skrabec Acked-by: Palmer Dabbelt Reviewed-by: Guo Ren Reviewed-by: Heiko Stuebner Tested-by: Conor Dooley Tested-by: Heiko Stuebner Signed-off-by: Samuel Holland --- (no changes since v3) Changes in v3: - Drop mmc alias 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 | 166 ++++++++++++++++++ 2 files changed, 167 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..a0769185be97 --- /dev/null +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-nezha.dts @@ -0,0 +1,166 @@ +// 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; + 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"; +};