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 20063C77B7A for ; Fri, 2 Jun 2023 15:28:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0B195865CC; Fri, 2 Jun 2023 17:27:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="UejAV7JV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AD6D0865C1; Fri, 2 Jun 2023 17:27:20 +0200 (CEST) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2C29B863C7 for ; Fri, 2 Jun 2023 17:27:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-64d24136685so1716674b3a.1 for ; Fri, 02 Jun 2023 08:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1685719637; x=1688311637; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TVddlRPNKzeLN6Ey4m9q5qhWx/T79IM3mz6a11IPSM0=; b=UejAV7JVr4LjbFKDsugHUczLtaoEm+wvd16PLN/ZAw+Sh0HJCEaNYXWfil6TS5kCIo IGLbdSNV3Az01EOrvP1MN6wfacoOwcmGf7MelU2LUsFdwZb/TXaY/I3YZp9D80+YDdZ3 jwgizhitAcFtEBqbSH5wpJTbr6KwitiJujt60= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685719637; x=1688311637; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TVddlRPNKzeLN6Ey4m9q5qhWx/T79IM3mz6a11IPSM0=; b=QgMLSxti8/rLkX1eM9Ko+6j5SyAbigpCQlmXwX3N3YffmBVORjuD910OD3cTH6VVx9 2a/m9Txb0KJvpkI7lkh3lt4ROqiNZTxcgRw1O/WIqnl1O7ZBAMsNyVG6WynYWkAtx5OW 9ue3Fec4d6a8EvMDPe4DHHjVflcMPVdDRtgt3sp6vMdyvCR1MdQZwc4/32p8yIMpyLtK +J90kTq5Vz93x8ZhAdeFZj+JT+PHTm6l6vIIsr8wWOyidkFGkX0t+KpUYv1Z+IrcNdpd /4d+84Q9OlL/IU1WTu6jTuvq1IgUaifE+hSONUqjqDI08fgKX4p3vFxd8Z1xwYjFkwO2 JtBg== X-Gm-Message-State: AC+VfDwxMCufElspUGZ/LGvrf+BQ30UOkBO3NWRU33tExG8E7BK3yBeZ pRbD2HRLMOviD3iU165KGU0YpcFuvf+T65irPIfyoKn5 X-Google-Smtp-Source: ACHHUZ5TsrOKk9xklpdDWJOyRJgA6Y/T1dElGxGMURm4mmf9gKUJiJ2QbdW6OqCZuTnDA1qAXqBTJg== X-Received: by 2002:a05:6a00:a96:b0:63b:54e4:871b with SMTP id b22-20020a056a000a9600b0063b54e4871bmr6403667pfl.8.1685719637620; Fri, 02 Jun 2023 08:27:17 -0700 (PDT) Received: from localhost.localdomain ([2401:4900:2003:4e14:c7e6:b770:ced9:e760]) by smtp.gmail.com with ESMTPSA id l3-20020a62be03000000b0063afb08afeesm1154124pff.67.2023.06.02.08.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Jun 2023 08:27:17 -0700 (PDT) From: Jagan Teki To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Jonas Karlman , u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 5/7] phy: rockchip-inno-usb2: Add USB2 PHY for RK3328 Date: Fri, 2 Jun 2023 20:56:29 +0530 Message-Id: <20230602152631.106887-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230602152631.106887-1-jagan@amarulasolutions.com> References: <20230602152631.106887-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 USB2.0 Host and OTG controllers in RK3328 are using USB2PHY. Add support for it. Signed-off-by: Jagan Teki --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 8986a5543c..75aea2298f 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -267,6 +267,35 @@ static int rockchip_usb2phy_bind(struct udevice *dev) return ret; } +static const struct rockchip_usb2phy_cfg rk3328_usb2phy_cfgs[] = { + { + .reg = 0x100, + .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, @@ -416,6 +445,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, -- 2.25.1