Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11501731rwb; Fri, 25 Nov 2022 16:53:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf6EEts3RZ45VxDHesLs9ZNVgdNPR3SRpF4oFAT48mC2rJ3cwOGotLbvE3tHQ6iba/Isovqy X-Received: by 2002:a17:902:c7d1:b0:179:b756:5b60 with SMTP id r17-20020a170902c7d100b00179b7565b60mr24527432pla.22.1669424004335; Fri, 25 Nov 2022 16:53:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669424004; cv=none; d=google.com; s=arc-20160816; b=BmNYj+LSaM0aDqJ2kM1FNDqXiKwbujF/C+WEH4ABjEM/7Wx0RZiLoKOr5avtnLUckY Ww/Eqq4qyy5aFrRhJ4O4/cwDnv54P6Acr1J06VC3g3apZQhn3TkiFdUkHb3HwM4rzMqN nuN9jw4oW8iaABWFLI/Xdq2HcpVSGqyvbGflXNqt93z3t0FrS+Q+Hp/evhaZEIALBDwg 7sfSQSijhcR0xckQTQABjepzXKsUGiq6KlvlP5whdqXqFFS2OzxX+V7oxXOA0j56xzaI +EwFDie3khGiKgHbmWx0F7T148qQDmtRxujpmoanMFo4AyrO2ucgjOkpJBb+4zmei2Mq FwtA== 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=/Y2ZXqphS7dxprVK7zQNFV9uPzD0A6MNoUZiBZTuwCk=; b=SiwBCNHrSziYcEOb40+l81vsqCL+0Lbsrht3o98DFsBPX4GdNESu0V8TypXIH4pNTo wz8SJsxcvmG1gFuuB/SWyR2JEvwLI5MjPWvRIOvz/JwHCVLs7ce78+QzL/ieokX76uGU 02JV9xKbWBWUoo1qGEPydKHIGmA9ad+tWJw/yVXElHU3Hq99PRdF2MznExFC5s34dgnC VBlcf8Bvwlw3vLSiGiwgPGwkQWlXU/DyU42i9VvUykrWKqL4wG1jcttrFZx4fFRNzp26 EFOThmTsM75WfdxFfZqPCPQJpBHuCCAJjITi+jNZXcsljEhFzOhFgyJcyYDGy8r19+xt kepQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N233vt2R; 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 o24-20020a17090aac1800b0020982a8dbf2si4765661pjq.96.2022.11.25.16.53.12; Fri, 25 Nov 2022 16:53:24 -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=N233vt2R; 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 S230141AbiKZAWD (ORCPT + 85 others); Fri, 25 Nov 2022 19:22:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbiKZAWB (ORCPT ); Fri, 25 Nov 2022 19:22:01 -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 00A0B537D6; Fri, 25 Nov 2022 16:21:59 -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 9346D6118A; Sat, 26 Nov 2022 00:21:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F26C7C433D7; Sat, 26 Nov 2022 00:21:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669422119; bh=EvnPbzsbEw7zAyBO+z4cuktpDw5KqBq4/XvJ8AzDkIA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=N233vt2R0fGUYWTUsF5BcxdXFNpWCZFTJVfJrX6MJeFBM4YlwwIBZDoLj2QsJ1XYX +I/KaXRb9TW9NS5ICBefBP5TM9XFffcCyKD3gAHy/g2vc7NkNRIUcD8u8B49ypVJ+g tYEqfoG+HdNCIS+Sd3DOyYSfzdZhylg84yra+VhRN6bBxoo0s2Q01FsFJr0FeScGDv lCybSTB5hLgalXNHKV4KZt2sdGoVFFbAJvW4YTEdy3wSPJqcFaj3DVa82tUjc3M1f8 GN/7vUpo2Xq/Tyde1XA/9hQKPRhlgLwg8lq5uLNtX0RZfRW+WprkBh7G2/NBXPgGc3 NdpapzbYwHnwQ== Received: by mail-ed1-f49.google.com with SMTP id l11so8290625edb.4; Fri, 25 Nov 2022 16:21:58 -0800 (PST) X-Gm-Message-State: ANoB5plmRRunkaMguAd4Dk2ihifeWa+WP/3ynFnIiSu3a7lh6P7rtVEN Dx+FNuwXVcXX4OkeQZH83lmgn5z/9Ne5EhrSp2w= X-Received: by 2002:a05:6402:399a:b0:468:fdf2:477f with SMTP id fk26-20020a056402399a00b00468fdf2477fmr10389831edb.329.1669422117198; Fri, 25 Nov 2022 16:21:57 -0800 (PST) MIME-Version: 1.0 References: <20221125234656.47306-1-samuel@sholland.org> <20221125234656.47306-7-samuel@sholland.org> In-Reply-To: <20221125234656.47306-7-samuel@sholland.org> From: Guo Ren Date: Sat, 26 Nov 2022 08:21:45 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 06/12] riscv: dts: allwinner: Add Allwinner D1 Nezha 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: > > "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 > --- > > 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"; > +}; > -- > 2.37.4 > -- Best Regards Guo Ren