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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD47EC76196 for ; Mon, 3 Apr 2023 11:28:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E3C9585BB7; Mon, 3 Apr 2023 13:28:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="SGQfzBfV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D0D185C65; Mon, 3 Apr 2023 13:28:41 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9196385A1D for ; Mon, 3 Apr 2023 13:28:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from [192.168.0.125] (unknown [82.76.24.202]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id A593166016BD; Mon, 3 Apr 2023 12:28:36 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1680521317; bh=Rs2D4R4aAVjD9tbmrGGDYTie/4UmfX6bmPYdm0VnDdk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SGQfzBfVOw657r0/LH1m7tQIFxV6VyQ1Uqv66Re82fRGccev7yrFZApe9jBLnhMQY f1n1kmh+ly4BTdpRkqwnzo1gIp6Ueq2Pi9+jH42CJ2ZQo9C+aX/YAnVyuELubggtRa 7cj1F3B414Jbd7Km6uV8VTo34R5/ZSEyp1pukPtqVbLX6/enizer+V3lmJJ+DRf9R2 JDQ8Sz8fHZZ4QLxGWlC7MU3TXfSvvE+7S82/tb4p6s98f5dJkPzGt3GArxZJf0Fz+q jqfrJe+Fcf8Vl3wnVrmBI8fw0ADYbpDK0qqBYbYzBucpFeUZhOUHSy2ixk8qSrUP/z Y3VzXwl/G3o6g== Message-ID: <61703851-c9bb-19a5-94a1-ca82d4ccae63@collabora.com> Date: Mon, 3 Apr 2023 14:28:33 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 1/3] ARM: dts: rockchip: rk3588-rock-5b-u-boot: add USB 2.0 host Content-Language: en-US To: Jonas Karlman , kever.yang@rock-chips.com Cc: jagan@edgeble.ai, William Wu , u-boot@lists.denx.de References: <20230331094050.149867-1-eugen.hristev@collabora.com> From: Eugen Hristev In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 4/2/23 14:00, Jonas Karlman wrote: > Hi Eugen, > > On 2023-03-31 11:40, Eugen Hristev wrote: >> Add USB 2.0 host nodes and PHYs. >> >> Co-developed-by: William Wu >> Signed-off-by: William Wu >> Signed-off-by: Eugen Hristev >> --- >> Changes in v2,v3: >> - none >> >> arch/arm/dts/rk3588-rock-5b-u-boot.dtsi | 169 ++++++++++++++++++++++++ >> 1 file changed, 169 insertions(+) >> >> diff --git a/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi b/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi >> index 2386edf90deb..e1d240baf35d 100644 >> --- a/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi >> +++ b/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi >> @@ -4,6 +4,9 @@ >> */ >> >> #include "rk3588-u-boot.dtsi" >> +#include >> +#include >> +#include >> >> / { >> aliases { >> @@ -13,6 +16,105 @@ >> chosen { >> u-boot,spl-boot-order = &sdmmc; >> }; >> + >> + vcc5v0_host: vcc5v0-host-regulator { >> + u-boot,dm-pre-reloc; >> + compatible = "regulator-fixed"; >> + regulator-name = "vcc5v0_host"; >> + regulator-min-microvolt = <5000000>; >> + regulator-max-microvolt = <5000000>; >> + enable-active-high; >> + gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; >> + pinctrl-names = "default"; >> + pinctrl-0 = <&vcc5v0_host_en>; >> + vin-supply = <&vcc5v0_sys>; >> + }; >> + >> + usb_host0_ehci: usb@fc800000 { >> + compatible = "generic-ehci"; >> + reg = <0x0 0xfc800000 0x0 0x40000>; >> + interrupts = ; >> + clocks = <&cru HCLK_HOST0>, <&cru HCLK_HOST_ARB0>; >> + clock-names = "usbhost", "arbiter"; >> + power-domains = <&power RK3588_PD_USB>; >> + status = "disabled"; >> + }; >> + >> + usb_host0_ohci: usb@fc840000 { >> + compatible = "generic-ohci"; >> + reg = <0x0 0xfc840000 0x0 0x40000>; >> + interrupts = ; >> + clocks = <&cru HCLK_HOST0>, <&cru HCLK_HOST_ARB0>; >> + clock-names = "usbhost", "arbiter"; >> + power-domains = <&power RK3588_PD_USB>; >> + status = "disabled"; >> + }; >> + >> + usb_host1_ehci: usb@fc880000 { >> + compatible = "generic-ehci"; >> + reg = <0x0 0xfc880000 0x0 0x40000>; >> + interrupts = ; >> + clocks = <&cru HCLK_HOST1>, <&cru HCLK_HOST_ARB1>; >> + clock-names = "usbhost", "arbiter"; >> + power-domains = <&power RK3588_PD_USB>; >> + status = "disabled"; >> + }; >> + >> + usb_host1_ohci: usb@fc8c0000 { >> + compatible = "generic-ohci"; >> + reg = <0x0 0xfc8c0000 0x0 0x40000>; >> + interrupts = ; >> + clocks = <&cru HCLK_HOST1>, <&cru HCLK_HOST_ARB1>; >> + clock-names = "usbhost", "arbiter"; >> + power-domains = <&power RK3588_PD_USB>; >> + status = "disabled"; >> + }; >> + >> + usb2phy2_grf: syscon@fd5d8000 { >> + compatible = "rockchip,rk3588-usb2phy-grf", "syscon", >> + "simple-mfd"; >> + reg = <0x0 0xfd5d8000 0x0 0x4000>; >> + #address-cells = <1>; >> + #size-cells = <1>; >> + >> + u2phy2: usb2-phy@8000 { >> + compatible = "rockchip,rk3588-usb2phy"; >> + reg = <0x8000 0x10>; >> + interrupts = ; >> + clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>; >> + clock-names = "phyclk"; >> + #clock-cells = <0>; >> + status = "disabled"; >> + >> + u2phy2_host: host-port { >> + #phy-cells = <0>; >> + status = "disabled"; >> + }; >> + }; >> + }; >> + >> + usb2phy3_grf: syscon@fd5dc000 { >> + compatible = "rockchip,rk3588-usb2phy-grf", "syscon", >> + "simple-mfd"; >> + reg = <0x0 0xfd5dc000 0x0 0x4000>; >> + #address-cells = <1>; >> + #size-cells = <1>; >> + >> + u2phy3: usb2-phy@c000 { >> + compatible = "rockchip,rk3588-usb2phy"; >> + reg = <0xc000 0x10>; >> + interrupts = ; >> + clocks = <&cru CLK_USB2PHY_HDPTXRXPHY_REF>; >> + clock-names = "phyclk"; >> + #clock-cells = <0>; >> + status = "disabled"; >> + >> + u2phy3_host: host-port { >> + #phy-cells = <0>; >> + status = "disabled"; >> + }; >> + }; >> + }; > > Most of these nodes could be added to the soc u-boot dtsi and not the > board specific file. Also wondering if some of the reset and clock > related properties below are board specific or soc specific and can go > into the above soc nodes directly. That is right, but , it would spread all the -u-boot.dtsi nodes into a lot of files. So I kept them here to have them all in one place. I can move them if you think it's better. > > Are there any patches in the works to add these nodes to linux dt? From what I know, yes, the patches are in the works, but I cannot say for sure when they will be sent/accepted > > Regards, > Jonas > >> }; >> >> &sdmmc { >> @@ -20,3 +122,70 @@ >> u-boot,dm-spl; >> status = "okay"; >> }; >> + >> +&pinctrl { >> + usb { >> + vcc5v0_host_en: vcc5v0-host-en { >> + rockchip,pins = <4 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>; >> + }; >> + }; >> +}; >> + >> +&usb_host0_ehci { >> + companion = <&usb_host0_ohci>; >> + phys = <&u2phy2_host>; >> + phy-names = "usb2-phy"; >> + status = "okay"; >> +}; >> + >> +&usb_host0_ohci { >> + phys = <&u2phy2_host>; >> + phy-names = "usb2-phy"; >> + status = "okay"; >> +}; >> + >> +&usb2phy2_grf { >> + status = "okay"; >> +}; >> + >> +&u2phy2 { >> + resets = <&cru SRST_OTGPHY_U2_0>, <&cru SRST_P_USB2PHY_U2_0_GRF0>; >> + reset-names = "phy", "apb"; >> + clock-output-names = "usb480m_phy2"; >> + status = "okay"; >> +}; >> + >> +&u2phy2_host { >> + phy-supply = <&vcc5v0_host>; >> + status = "okay"; >> +}; >> + >> +&usb_host1_ehci { >> + companion = <&usb_host1_ohci>; >> + phys = <&u2phy3_host>; >> + phy-names = "usb2-phy"; >> + status = "okay"; >> +}; >> + >> +&usb_host1_ohci { >> + phys = <&u2phy3_host>; >> + phy-names = "usb2-phy"; >> + status = "okay"; >> +}; >> + >> +&usb2phy3_grf { >> + status = "okay"; >> +}; >> + >> +&u2phy3 { >> + resets = <&cru SRST_OTGPHY_U2_1>, <&cru SRST_P_USB2PHY_U2_1_GRF0>; >> + reset-names = "phy", "apb"; >> + clock-output-names = "usb480m_phy3"; >> + status = "okay"; >> +}; >> + >> +&u2phy3_host { >> + phy-supply = <&vcc5v0_host>; >> + status = "okay"; >> +}; >> + >