From patchwork Fri Nov 25 23:46:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 26170 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp4356489wrr; Fri, 25 Nov 2022 15:49:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf549At+ylgSMA++AAx+5c6+sZ7BjuwbRw8Kf9/oNG9xAbXhipUD6dONmN4zDitTiGLcf3Q2 X-Received: by 2002:a17:90a:a790:b0:218:e3e8:c024 with SMTP id f16-20020a17090aa79000b00218e3e8c024mr15307520pjq.125.1669420167119; Fri, 25 Nov 2022 15:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669420167; cv=none; d=google.com; s=arc-20160816; b=BJw3Mt7gcHFlcWmhgXnBt8PbNZiiDa1CTomXCmAIA+YFEp2wkFKhyM07St6sx14S+W NiUu22qhDOAH6HmT5/acN68Ldi0f1RC8QPvjn1vIChu5X6K5wh7XDT8sB7DSFwtxL/IX XfeP0t/YqnJFcdO7BE5m0asmJM67CZXpqowJy2BQgHfJ/cI0H/m9CpkHYc1cOc4Q7W8/ 3mxy+zgXj92QjLqHRmNqkkgfUuK1iYAa3/tsE4L+LIpxGYr9D4jj+2qNK0XbchuiNVr+ AFpBnSKazu43b4LaA2WHJw2T+tgvdZlsX0ybOonRSIFoTNcJBAX8uTaKVOlsmXNssEYV Er+A== 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=lpBC9qotmaGEHEPnCf47hznVhBx/bTmBO6U31NxnFo4=; b=RbyvhenQKiAF72M8/EMJx0rhR+rj0eJZy/pETvtpQVRHH3P8iNF6hvElnJS9F7CU3n O0F6WP/6KPfWSFXyvLae7eec4w7tAAuFx20liCz6PilBUnP3FYL4HF1Jxh3HoclXYfZC riI1RS7KFe+l1NOMG3Ct4mkOso6m2yHuxisVAVxq7tOK9vQnqpKgq0rt+/BWiHPnhmon OWfpRz2jvlCraN3m3qF7ZLUFQvhT3VqQq8RkG2Pb+CaWBCExgrrOAXIhpfO+N+Vbz9IE ESPFVayETwua1xsZ6VnoCdTbpJf/byPHn+EBuVsKcQ3w8Cs8VGmpkyL89oOQZdIFl68E FJVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm2 header.b=UER4zFjK; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=CdUuZ7bl; 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 o23-20020a63fb17000000b00476ea7b91dfsi6700174pgh.586.2022.11.25.15.49.14; Fri, 25 Nov 2022 15:49:27 -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=UER4zFjK; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=CdUuZ7bl; 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 S230264AbiKYXsL (ORCPT + 99 others); Fri, 25 Nov 2022 18:48:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230178AbiKYXrg (ORCPT ); Fri, 25 Nov 2022 18:47:36 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D65D5B5A3; Fri, 25 Nov 2022 15:47:15 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AA7515C00EA; Fri, 25 Nov 2022 18:47:14 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 25 Nov 2022 18:47:14 -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=1669420034; x=1669506434; bh=lp BC9qotmaGEHEPnCf47hznVhBx/bTmBO6U31NxnFo4=; b=UER4zFjKAWRy8gzLWy hn22WQxWfVoqNoT3RVS1fHDS/55nP7vhRFVCZhYjJFp5cFe+pwlVfsbCoCeWxAaP sfEnpoqf+4FfUsbzveslcG1kmb/f49qt8QYJ2N3DuAec5oEsQTo/DpVsWNc+csFg 8HiQL9ewt5uO5lzwrZUODZvfk0VD2Z4Qydr3MWoB+ZXm4zBoXA0Np16ckqxrePdJ 3NFPlGYSHLMCcxsfTN3+jeKo78r2cUqmrmIzlFXeL67dmFT5oaW8eOkN+rIaPvDV sTimiWI6zt0F7iUWu42IwFW+/WMjaIO7Zwyi6/n4nAbG2t2953ISCAcfUFbD8Y3q Tp8g== 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=1669420034; x=1669506434; bh=lpBC9qotmaGEH EPnCf47hznVhBx/bTmBO6U31NxnFo4=; b=CdUuZ7blDObgcslUike83hVpIKNtW +bEOYgTOA4BCwPPDU27NrCjOo0zfJ53vI0Wl0tIsG/P7a8mmdtvIseOMn/tNzgrU ynN4Ov7gO4kXepZOdiOp7wkfnyzLrdDxapEHdG+skqZPoh0UMC6wZFbeJJZHwdfP rf6DouP7n45Ap91hdbdcBz/MHKwUSPrL+a3ftRdFfozQPawaOmCkMyXQoNphwfEl 5PnSWT6QZzhOFDvHdetS2/eFaasb52V51GUKZmdZ/vbyFm72hy4+wusyQ9bPzuOe ltWOz+ob+EMK4J6F4Pb7FN/Q3U+zbVjG8+m3Isen4TKxwI3LXEaxVOoNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrieeigdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpedukeetueduhedtleetvefguddvvdejhfefudelgfduveeggeehgfdu feeitdevteenucevlhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 25 Nov 2022 18:47:13 -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 09/12] riscv: dts: allwinner: Add Dongshan Nezha STU devicetree Date: Fri, 25 Nov 2022 17:46:53 -0600 Message-Id: <20221125234656.47306-10-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?1750513920922324855?= X-GMAIL-MSGID: =?utf-8?q?1750513920922324855?= The 100ask Dongshan Nezha STU is a system-on-module that can be used standalone or with a carrier board. The SoM provides gigabit Ethernet, HDMI, a USB peripheral port, and WiFi/Bluetooth via an RTL8723DS chip. The "DIY" carrier board exposes almost every pin from the D1 SoC to 0.1" headers, but contains no digital circuitry, so it does not have its own devicetree. Signed-off-by: Samuel Holland Reviewed-by: Guo Ren Acked-by: Jernej Skrabec --- (no changes since v1) arch/riscv/boot/dts/allwinner/Makefile | 1 + .../sun20i-d1-dongshan-nezha-stu.dts | 118 ++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-dongshan-nezha-stu.dts diff --git a/arch/riscv/boot/dts/allwinner/Makefile b/arch/riscv/boot/dts/allwinner/Makefile index 2ed586fafaea..87f70b1af6b4 100644 --- a/arch/riscv/boot/dts/allwinner/Makefile +++ b/arch/riscv/boot/dts/allwinner/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-dongshan-nezha-stu.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-480p.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-720p.dtb dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-dock.dtb diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-dongshan-nezha-stu.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-dongshan-nezha-stu.dts new file mode 100644 index 000000000000..c549a1c5fbf0 --- /dev/null +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-dongshan-nezha-stu.dts @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +// Copyright (C) 2022 Samuel Holland + +#include +#include + +/dts-v1/; + +#include "sun20i-d1.dtsi" +#include "sun20i-common-regulators.dtsi" + +/ { + model = "Dongshan Nezha STU"; + compatible = "100ask,dongshan-nezha-stu", "allwinner,sun20i-d1"; + + aliases { + ethernet0 = &emac; + mmc0 = &mmc0; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 2 1 GPIO_ACTIVE_HIGH>; /* PC1 */ + }; + }; + + 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>; + }; +}; + +&cpu0 { + cpu-supply = <®_vdd_cpu>; +}; + +&dcxo { + clock-frequency = <24000000>; +}; + +&ehci0 { + 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"; +}; + +&mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&mmc0 { + broken-cd; + bus-width = <4>; + disable-wp; + vmmc-supply = <®_vcc_3v3>; + vqmmc-supply = <®_vcc_3v3>; + pinctrl-0 = <&mmc0_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&uart0 { + pinctrl-0 = <&uart0_pb8_pins>; + pinctrl-names = "default"; + status = "okay"; +}; + +&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>; + status = "okay"; +};