From patchwork Thu Nov 14 20:13:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: E Shattow X-Patchwork-Id: 13875606 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 975B1D6A22D for ; Thu, 14 Nov 2024 20:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=F99s1OmKW7qbq+1J92QvW1aE+am9Yes0RrvRqyZx04k=; b=Tn2/lPI5unFsJ5 TsZYhB+gwbUZW2oCFBDNDza3q/pyZ5g7vwP88AK27pOQmEofg7NhcMRnLruAHkV6N0XbvuEVkRlhJ 80NMni4OysWa+QSJdKtooR63LvAbaofMSGncjdtum+jHrgIoB9M0J0IMZaVFrHuR1eoyeejOiKnfI Ug1Hx3FelXy57Aazg1TJ1kNLfbnIL12X8iu7MuMmXLlJ2PUmN3Hv/Vr6L6zQdytKVLsC8Bjqw/IxP Q31GkB6Z9ogbhPEC5epntX995LZ+r67kprf4H6z9SW1QXVtgSIF+EL0lEbcAIzMiLw4BWOfmlU4BW xgsMl2P5dGGyLlLEw+zg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tBgkL-00000000nAh-2Uu9; Thu, 14 Nov 2024 20:47:21 +0000 Received: from freeshell.de ([116.202.128.144]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tBgkH-00000000n9s-3YWz for linux-riscv@lists.infradead.org; Thu, 14 Nov 2024 20:47:20 +0000 Received: from hay.lan. (unknown [IPv6:2605:59c8:31de:bf00:6ecf:39ff:fe00:8375]) (Authenticated sender: e) by freeshell.de (Postfix) with ESMTPSA id CC025B2283B7; Thu, 14 Nov 2024 21:47:10 +0100 (CET) From: E Shattow To: Jisheng Zhang Cc: E Shattow , Emil Renner Berthing , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: dts: starfive: jh7110-milkv-mars: set host mode and vbus pin for on-chip USB 2.0 Date: Thu, 14 Nov 2024 12:13:40 -0800 Message-ID: <20241114201805.24143-2-e@freeshell.de> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241114_124718_030588_1D7AFE50 X-CRM114-Status: UNSURE ( 9.79 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Enable host mode USB for Milk-V Mars by setting host mode and connect vbus pinctrl. Note that testing this functionality depends on two features: 1. commit e10c52e7e064038d9bd67b20bf4ce92077d7d84e "phy: starfive: jh7110-usb: Fix link configuration to controller" 2. Setting the USB over-current register to disable. This is done at bootloader phase, for example U-Boot: https://patchwork.ozlabs.org/project/uboot/patch/20241012031328.4268-6-minda.chen@starfivetech.com/ If the over-current register is not prepared for us then the result is no change in functional outcome with this patch applied; there is an error visible to the user and usb configuration fails (same as it is now). Signed-off-by: E Shattow --- .../boot/dts/starfive/jh7110-milkv-mars.dts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts index 0d248b671d4b..bddfc7c6b00f 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts +++ b/arch/riscv/boot/dts/starfive/jh7110-milkv-mars.dts @@ -53,7 +53,23 @@ &spi0 { status = "okay"; }; +&sysgpio { + usb_pins: usb0-0 { + driver-vbus-pin { + pinmux = ; + bias-disable; + input-disable; + input-schmitt-disable; + slew-rate = <0>; + }; + }; +}; + &usb0 { - dr_mode = "peripheral"; + dr_mode = "host"; + pinctrl-names = "default"; + pinctrl-0 = <&usb_pins>; status = "okay"; };