From mboxrd@z Thu Jan 1 00:00:00 1970 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 404B6C001DC for ; Wed, 26 Jul 2023 16:58:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7A3E786823; Wed, 26 Jul 2023 18:58:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id AF8078683A; Wed, 26 Jul 2023 18:57:57 +0200 (CEST) Received: from mail-m11886.qiye.163.com (mail-m11886.qiye.163.com [115.236.118.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4156186773 for ; Wed, 26 Jul 2023 18:57:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@rock-chips.com Received: from [172.16.12.93] (unknown [58.22.7.114]) by mail-m11886.qiye.163.com (Hmail) with ESMTPA id 75364802EE; Wed, 26 Jul 2023 19:01:31 +0800 (CST) Message-ID: <99b0463b-ce0c-e987-95f2-f377220344be@rock-chips.com> Date: Wed, 26 Jul 2023 19:01:31 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2 5/7] phy: rockchip-inno-usb2: Add USB2 PHY for RK3328 Content-Language: en-US To: Jagan Teki , Simon Glass , Philipp Tomsich Cc: Jonas Karlman , u-boot@lists.denx.de, linux-amarula@amarulasolutions.com References: <20230606170918.45581-1-jagan@amarulasolutions.com> <20230606170918.45581-6-jagan@amarulasolutions.com> From: Kever Yang In-Reply-To: <20230606170918.45581-6-jagan@amarulasolutions.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZGh5NGlZKQ0gfGUMdSkNJQx5VEwETFh oSFyQUDg9ZV1kYEgtZQVlOQ1VJSVVMVUpKT1lXWRYaDxIVHRRZQVlPS0hVSk5MSUpJVUpLS1VKQl kG X-HM-Tid: 0a8991dc75672ebakusn75364802ee X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MDI6HCo5PT1LE0M3KB4UEysU CC0wCh1VSlVKTUJLSE1CSUJJSk9IVTMWGhIXVRAeDR4JVQIaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlOQ1VJSVVMVUpKT1lXWQgBWUFIQ0tINwY+ 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 2023/6/7 01:09, Jagan Teki wrote: > USB2.0 Host and OTG controllers in RK3328 are using USB2PHY. > > Add support for it. > > Signed-off-by: Jagan Teki Reviewed-by: Kever Yang Thanks, - Kever > --- > Changes for v2: > - add clkout_ctl > > drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 34 +++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > index e43a5ba9b5..d8738f891d 100644 > --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > @@ -345,6 +345,36 @@ bind_fail: > return ret; > } > > +static const struct rockchip_usb2phy_cfg rk3328_usb2phy_cfgs[] = { > + { > + .reg = 0x100, > + .clkout_ctl = { 0x108, 4, 4, 1, 0 }, > + .port_cfgs = { > + [USB2PHY_PORT_OTG] = { > + .phy_sus = { 0x0100, 15, 0, 0, 0x1d1 }, > + .bvalid_det_en = { 0x0110, 3, 2, 0, 3 }, > + .bvalid_det_st = { 0x0114, 3, 2, 0, 3 }, > + .bvalid_det_clr = { 0x0118, 3, 2, 0, 3 }, > + .ls_det_en = { 0x0110, 0, 0, 0, 1 }, > + .ls_det_st = { 0x0114, 0, 0, 0, 1 }, > + .ls_det_clr = { 0x0118, 0, 0, 0, 1 }, > + .utmi_avalid = { 0x0120, 10, 10, 0, 1 }, > + .utmi_bvalid = { 0x0120, 9, 9, 0, 1 }, > + .utmi_ls = { 0x0120, 5, 4, 0, 1 }, > + }, > + [USB2PHY_PORT_HOST] = { > + .phy_sus = { 0x104, 15, 0, 0, 0x1d1 }, > + .ls_det_en = { 0x110, 1, 1, 0, 1 }, > + .ls_det_st = { 0x114, 1, 1, 0, 1 }, > + .ls_det_clr = { 0x118, 1, 1, 0, 1 }, > + .utmi_ls = { 0x120, 17, 16, 0, 1 }, > + .utmi_hstdet = { 0x120, 19, 19, 0, 1 } > + } > + }, > + }, > + { /* sentinel */ } > +}; > + > static const struct rockchip_usb2phy_cfg rk3399_usb2phy_cfgs[] = { > { > .reg = 0xe450, > @@ -498,6 +528,10 @@ static const struct rockchip_usb2phy_cfg rk3588_phy_cfgs[] = { > }; > > static const struct udevice_id rockchip_usb2phy_ids[] = { > + { > + .compatible = "rockchip,rk3328-usb2phy", > + .data = (ulong)&rk3328_usb2phy_cfgs, > + }, > { > .compatible = "rockchip,rk3399-usb2phy", > .data = (ulong)&rk3399_usb2phy_cfgs,