From nobody Sun Dec 22 18:44:47 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65274C05027 for ; Thu, 26 Jan 2023 04:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236086AbjAZE6P (ORCPT ); Wed, 25 Jan 2023 23:58:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235602AbjAZE5y (ORCPT ); Wed, 25 Jan 2023 23:57:54 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99F8E61B9; Wed, 25 Jan 2023 20:57:47 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1F71C5C0192; Wed, 25 Jan 2023 23:57:47 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 25 Jan 2023 23:57:47 -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=fm1; t=1674709067; x=1674795467; bh=1Z jJecFFZxIyPoT1olpe+Bav553LacFF2fCvtv/7+vE=; b=OSIwIpFXEnGr/E+9vl l6HjHuaQLBacINUcooovCmzRXhJzWVYBO3n4ALd+yE18iH1b6SIgTsbf/z1sKtO8 x1OGSeDLeNeLTJ0/ehr30d0Q2pPb2Dx69gpiKF5qsFQmUW6ULJ8kcHdLIrNwwTAK vSUOyoRQEkxS1oq9jsomyuo9dXHz1uK1SntIyWaYyLsGd04E9N6EvC8xEmlptIIB CtwcDlhzpfbnWErpoKPaDx+lQeRYD0U7RrY+TkFs81m/OCjNtf/eoHCjUjEkVbdB GUaVD0BzJww7sK9Ob7G67PqTIvWfcUjUOHqiNyg2BemOS1o7vRGEy58U1SKnXNH3 89iw== 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=fm3; t=1674709067; x=1674795467; bh=1ZjJecFFZxIyP oT1olpe+Bav553LacFF2fCvtv/7+vE=; b=XVafzO2P/ivcrYVhgQdgyAZK4qX3W IOPEo+OM4bwkUptcHPhVj+nLpc4+4ZxiDEjrz/Z2wEBh4vfNqyl2nzQvChPF9o4R lVetpRdJ9Kg98OvkUZzmktH64UI/ckXpuL5uOStBMf9zcQ0MSc9+z8ZydRdnA12Z +z8BmNQHs9q/+596UzFDyE4lix5Fd88uH/pWrgl8pLVslDWTn23VxYweq1O+GByE rK1nKtY+an8qlZ8fC4sYNXkKA+ZO/mgDr2cbcm/REpm3Dw3S+u41LGgVtXEpB6Hi PngR78UbJ2Nqs9aqSltScFYJW7C8GBiy6MnGOkBQIhutSbumgDBW85AIg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddvfedgjeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepufgrmhhu vghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecugg ftrfgrthhtvghrnhepudekteeuudehtdelteevgfduvddvjefhfedulefgudevgeeghefg udefiedtveetnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrh homhepshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 Jan 2023 23:57:46 -0500 (EST) From: Samuel Holland To: Chen-Yu Tsai , Jernej Skrabec , linux-sunxi@lists.linux.dev Cc: linux-riscv@lists.infradead.org, Heiko Stuebner , Palmer Dabbelt , Conor Dooley , Jisheng Zhang , Krzysztof Kozlowski , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andre Przywara , Rob Herring , linux-arm-kernel@lists.infradead.org, Samuel Holland , Palmer Dabbelt Subject: [PATCH v5 07/11] riscv: dts: allwinner: Add Sipeed Lichee RV devicetrees Date: Wed, 25 Jan 2023 22:57:34 -0600 Message-Id: <20230126045738.47903-8-samuel@sholland.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20230126045738.47903-1-samuel@sholland.org> References: <20230126045738.47903-1-samuel@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Sipeed manufactures a "Lichee RV" system-on-module, which provides a minimal working system on its own, as well as a few carrier boards. The "Dock" board provides audio, USB, and WiFi. The "86 Panel" additionally provides 100M Ethernet and a built-in display panel. The 86 Panel repurposes the USB ID and VBUS detection GPIOs for its RGB panel interface, since the USB OTG port is inaccessible inside the case. Co-developed-by: Jisheng Zhang Signed-off-by: Jisheng Zhang Acked-by: Jernej Skrabec Acked-by: Palmer Dabbelt Signed-off-by: Samuel Holland --- (no changes since v3) Changes in v3: - Fix `make W=3D1 dtbs` warnings (missing reg properties) - Drop mmc alias Changes in v2: - Added DMIC sound card to Lichee RV dock and Lichee RV 86 Panel - Removed LRADC (depends on analog LDOs) arch/riscv/boot/dts/allwinner/Makefile | 4 + .../sun20i-d1-lichee-rv-86-panel-480p.dts | 29 +++++ .../sun20i-d1-lichee-rv-86-panel-720p.dts | 10 ++ .../sun20i-d1-lichee-rv-86-panel.dtsi | 119 ++++++++++++++++++ .../allwinner/sun20i-d1-lichee-rv-dock.dts | 97 ++++++++++++++ .../dts/allwinner/sun20i-d1-lichee-rv.dts | 87 +++++++++++++ 6 files changed, 346 insertions(+) create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-pa= nel-480p.dts create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-pa= nel-720p.dts create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-pa= nel.dtsi create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.= dts create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv.dts diff --git a/arch/riscv/boot/dts/allwinner/Makefile b/arch/riscv/boot/dts/a= llwinner/Makefile index 277e59d1c907..f1c70b9dc9bf 100644 --- a/arch/riscv/boot/dts/allwinner/Makefile +++ b/arch/riscv/boot/dts/allwinner/Makefile @@ -1,3 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 +dtb-$(CONFIG_ARCH_SUNXI) +=3D sun20i-d1-lichee-rv-86-panel-480p.dtb +dtb-$(CONFIG_ARCH_SUNXI) +=3D sun20i-d1-lichee-rv-86-panel-720p.dtb +dtb-$(CONFIG_ARCH_SUNXI) +=3D sun20i-d1-lichee-rv-dock.dtb +dtb-$(CONFIG_ARCH_SUNXI) +=3D sun20i-d1-lichee-rv.dtb dtb-$(CONFIG_ARCH_SUNXI) +=3D sun20i-d1-nezha.dtb dtb-$(CONFIG_ARCH_SUNXI) +=3D sun20i-d1s-mangopi-mq.dtb diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel-480= p.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel-480p.dts new file mode 100644 index 000000000000..4df8ffb71561 --- /dev/null +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel-480p.dts @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +// Copyright (C) 2022 Samuel Holland + +#include "sun20i-d1-lichee-rv-86-panel.dtsi" + +/ { + model =3D "Sipeed Lichee RV 86 Panel (480p)"; + compatible =3D "sipeed,lichee-rv-86-panel-480p", "sipeed,lichee-rv", + "allwinner,sun20i-d1"; +}; + +&i2c2 { + pinctrl-0 =3D <&i2c2_pb0_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; + + touchscreen@48 { + compatible =3D "focaltech,ft6236"; + reg =3D <0x48>; + interrupt-parent =3D <&pio>; + interrupts =3D <6 14 IRQ_TYPE_LEVEL_LOW>; /* PG14 */ + iovcc-supply =3D <®_vcc_3v3>; + reset-gpios =3D <&pio 6 15 GPIO_ACTIVE_LOW>; /* PG15 */ + touchscreen-size-x =3D <480>; + touchscreen-size-y =3D <480>; + vcc-supply =3D <®_vcc_3v3>; + wakeup-source; + }; +}; diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel-720= p.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel-720p.dts new file mode 100644 index 000000000000..1874fc05359f --- /dev/null +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel-720p.dts @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +// Copyright (C) 2022 Samuel Holland + +#include "sun20i-d1-lichee-rv-86-panel.dtsi" + +/ { + model =3D "Sipeed Lichee RV 86 Panel (720p)"; + compatible =3D "sipeed,lichee-rv-86-panel-720p", "sipeed,lichee-rv", + "allwinner,sun20i-d1"; +}; diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel.dts= i b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel.dtsi new file mode 100644 index 000000000000..6cc7dd0c1ae2 --- /dev/null +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-86-panel.dtsi @@ -0,0 +1,119 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +// Copyright (C) 2022 Samuel Holland + +#include "sun20i-d1-lichee-rv.dts" + +/ { + aliases { + ethernet0 =3D &emac; + ethernet1 =3D &xr829; + }; + + dmic_codec: dmic-codec { + compatible =3D "dmic-codec"; + num-channels =3D <2>; + #sound-dai-cells =3D <0>; + }; + + dmic-sound { + compatible =3D "simple-audio-card"; + simple-audio-card,name =3D "DMIC"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + simple-audio-card,dai-link@0 { + reg =3D <0>; + format =3D "pdm"; + frame-master =3D <&link0_cpu>; + bitclock-master =3D <&link0_cpu>; + + link0_cpu: cpu { + sound-dai =3D <&dmic>; + }; + + link0_codec: codec { + sound-dai =3D <&dmic_codec>; + }; + }; + }; + + /* PC1 is repurposed as BT_WAKE_AP */ + /delete-node/ leds; + + wifi_pwrseq: wifi-pwrseq { + compatible =3D "mmc-pwrseq-simple"; + clocks =3D <&ccu CLK_FANOUT1>; + clock-names =3D "ext_clock"; + reset-gpios =3D <&pio 6 12 GPIO_ACTIVE_LOW>; /* PG12 */ + assigned-clocks =3D <&ccu CLK_FANOUT1>; + assigned-clock-rates =3D <32768>; + pinctrl-0 =3D <&clk_pg11_pin>; + pinctrl-names =3D "default"; + }; +}; + +&dmic { + pinctrl-0 =3D <&dmic_pb11_d0_pin>, <&dmic_pe17_clk_pin>; + pinctrl-names =3D "default"; + status =3D "okay"; +}; + +&ehci1 { + status =3D "okay"; +}; + +&emac { + pinctrl-0 =3D <&rmii_pe_pins>; + pinctrl-names =3D "default"; + phy-handle =3D <&ext_rmii_phy>; + phy-mode =3D "rmii"; + phy-supply =3D <®_vcc_3v3>; + status =3D "okay"; +}; + +&mdio { + ext_rmii_phy: ethernet-phy@1 { + compatible =3D "ethernet-phy-ieee802.3-c22"; + reg =3D <1>; + reset-gpios =3D <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */ + }; +}; + +&mmc1 { + bus-width =3D <4>; + mmc-pwrseq =3D <&wifi_pwrseq>; + non-removable; + vmmc-supply =3D <®_vcc_3v3>; + vqmmc-supply =3D <®_vcc_3v3>; + pinctrl-0 =3D <&mmc1_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; + + xr829: wifi@1 { + reg =3D <1>; + }; +}; + +&ohci1 { + status =3D "okay"; +}; + +&uart1 { + uart-has-rtscts; + pinctrl-0 =3D <&uart1_pg6_pins>, <&uart1_pg8_rts_cts_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; + + /* XR829 bluetooth is connected here */ +}; + +&usb_otg { + status =3D "disabled"; +}; + +&usbphy { + /* PD20 and PD21 are repurposed for the LCD panel */ + /delete-property/ usb0_id_det-gpios; + /delete-property/ usb0_vbus_det-gpios; + usb1_vbus-supply =3D <®_vcc>; +}; diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts b/a= rch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts new file mode 100644 index 000000000000..52b91e1affed --- /dev/null +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv-dock.dts @@ -0,0 +1,97 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +// Copyright (C) 2022 Jisheng Zhang +// Copyright (C) 2022 Samuel Holland + +#include + +#include "sun20i-d1-lichee-rv.dts" + +/ { + model =3D "Sipeed Lichee RV Dock"; + compatible =3D "sipeed,lichee-rv-dock", "sipeed,lichee-rv", + "allwinner,sun20i-d1"; + + aliases { + ethernet1 =3D &rtl8723ds; + }; + + dmic_codec: dmic-codec { + compatible =3D "dmic-codec"; + num-channels =3D <2>; + #sound-dai-cells =3D <0>; + }; + + dmic-sound { + compatible =3D "simple-audio-card"; + simple-audio-card,name =3D "DMIC"; + #address-cells =3D <1>; + #size-cells =3D <0>; + + simple-audio-card,dai-link@0 { + reg =3D <0>; + format =3D "pdm"; + frame-master =3D <&link0_cpu>; + bitclock-master =3D <&link0_cpu>; + + link0_cpu: cpu { + sound-dai =3D <&dmic>; + }; + + link0_codec: codec { + sound-dai =3D <&dmic_codec>; + }; + }; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible =3D "mmc-pwrseq-simple"; + reset-gpios =3D <&pio 6 12 GPIO_ACTIVE_LOW>; /* PG12 */ + }; +}; + +&dmic { + pinctrl-0 =3D <&dmic_pb11_d0_pin>, <&dmic_pe17_clk_pin>; + pinctrl-names =3D "default"; + status =3D "okay"; +}; + +&ehci1 { + status =3D "okay"; +}; + +&mmc1 { + bus-width =3D <4>; + mmc-pwrseq =3D <&wifi_pwrseq>; + non-removable; + vmmc-supply =3D <®_vcc_3v3>; + vqmmc-supply =3D <®_vcc_3v3>; + pinctrl-0 =3D <&mmc1_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; + + rtl8723ds: wifi@1 { + reg =3D <1>; + }; +}; + +&ohci1 { + status =3D "okay"; +}; + +&uart1 { + uart-has-rtscts; + pinctrl-0 =3D <&uart1_pg6_pins>, <&uart1_pg8_rts_cts_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; + + bluetooth { + compatible =3D "realtek,rtl8723ds-bt"; + device-wake-gpios =3D <&pio 6 15 GPIO_ACTIVE_HIGH>; /* PG16 */ + enable-gpios =3D <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18 */ + host-wake-gpios =3D <&pio 6 17 GPIO_ACTIVE_HIGH>; /* PG17 */ + }; +}; + +&usbphy { + usb1_vbus-supply =3D <®_vcc>; +}; diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv.dts b/arch/r= iscv/boot/dts/allwinner/sun20i-d1-lichee-rv.dts new file mode 100644 index 000000000000..d60a0562a8b1 --- /dev/null +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-lichee-rv.dts @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: (GPL-2.0+ or MIT) +// Copyright (C) 2022 Jisheng Zhang +// Copyright (C) 2022 Samuel Holland + +#include +#include + +/dts-v1/; + +#include "sun20i-d1.dtsi" +#include "sun20i-common-regulators.dtsi" + +/ { + model =3D "Sipeed Lichee RV"; + compatible =3D "sipeed,lichee-rv", "allwinner,sun20i-d1"; + + aliases { + serial0 =3D &uart0; + }; + + chosen { + stdout-path =3D "serial0:115200n8"; + }; + + leds { + compatible =3D "gpio-leds"; + + led-0 { + color =3D ; + function =3D LED_FUNCTION_STATUS; + gpios =3D <&pio 2 1 GPIO_ACTIVE_HIGH>; /* PC1 */ + }; + }; + + reg_vdd_cpu: vdd-cpu { + compatible =3D "regulator-fixed"; + regulator-name =3D "vdd-cpu"; + regulator-min-microvolt =3D <900000>; + regulator-max-microvolt =3D <900000>; + vin-supply =3D <®_vcc>; + }; +}; + +&cpu0 { + cpu-supply =3D <®_vdd_cpu>; +}; + +&dcxo { + clock-frequency =3D <24000000>; +}; + +&ehci0 { + status =3D "okay"; +}; + +&mmc0 { + broken-cd; + bus-width =3D <4>; + disable-wp; + vmmc-supply =3D <®_vcc_3v3>; + vqmmc-supply =3D <®_vcc_3v3>; + pinctrl-0 =3D <&mmc0_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; +}; + +&ohci0 { + status =3D "okay"; +}; + +&uart0 { + pinctrl-0 =3D <&uart0_pb8_pins>; + pinctrl-names =3D "default"; + status =3D "okay"; +}; + +&usb_otg { + dr_mode =3D "otg"; + status =3D "okay"; +}; + +&usbphy { + usb0_id_det-gpios =3D <&pio 3 21 GPIO_ACTIVE_HIGH>; /* PD21 */ + usb0_vbus_det-gpios =3D <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */ + usb0_vbus-supply =3D <®_vcc>; + status =3D "okay"; +}; --=20 2.37.4