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 54E94C61DA4 for ; Thu, 9 Feb 2023 14:33:19 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C98285C73; Thu, 9 Feb 2023 15:32:47 +0100 (CET) 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="EZQLyhSo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2DEB785F66; Thu, 9 Feb 2023 15:32:33 +0100 (CET) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) (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 2D66685F51 for ; Thu, 9 Feb 2023 15:32:11 +0100 (CET) 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-x435.google.com with SMTP id n2so1437523pfo.3 for ; Thu, 09 Feb 2023 06:32:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; 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=5wL2gZfIb82QlSMdIE/Fs9xPxYBOaRS0aaCrUFBAWFw=; b=EZQLyhSoqRsq9mm89gxM18wNVo5+dv46KPG4VdNphb95WU6qcHPqnOnuUXGWrvAdRA 7H3RQ7dYOY4vtZLysRlvnecYh+D0eaMZfanMm2bvL7Tf1/FH6OY1BoaRnlsOj7kCHNzL YiJRcT35wg1ubrJAh7AhBZKoUOsIYzhdr3DFE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=5wL2gZfIb82QlSMdIE/Fs9xPxYBOaRS0aaCrUFBAWFw=; b=G8bjDobd+itUUc4RIhfrPDbLg12wxEQuOTc7b75/izKR00oFB41A/YltkHBkn9B3hN kbT2AGStu1+kXlzn9i7qiuj3bkGBjQtCr1r+p3x8131czcWk9UsEaO02EHjUVYA1i+Cr c0ZXzN8h5H0E9hky9fSKwEFWDObPBRy/kLhjj+AtnJBze1UhAx7uxPMV88r6bhyopngo Zm+m0pUrng/SZ8O6kPWq9qvIygym1DiA/m8DWV2kRkAF/QvO8+33kyIPS2ZRMV9W8wBG +42SK97H+9NSQiR9Nvh/0qJSc0HMDfZSb9gxvHe7Ct/aoRThNmW7XgDnDql5WXILeu3r gTTQ== X-Gm-Message-State: AO0yUKWvQln1uHDPQRhIVeky6fvIDB5l9iCrgkB7qI3JSIxM3wN5m1LD Pobmw+dR25Ac7q1kSa/9zYdMeZ4d9w1ppphjVTs= X-Google-Smtp-Source: AK7set+jXLV59VrUCQYlUiof0VHfODNnYqGaKWptpRABYa8qh0FvIXuD3U9HO7tcmic9s/j+5+BXaA== X-Received: by 2002:a62:2587:0:b0:5a8:5fa0:3d6 with SMTP id l129-20020a622587000000b005a85fa003d6mr1611635pfl.19.1675953125485; Thu, 09 Feb 2023 06:32:05 -0800 (PST) Received: from localhost.localdomain ([183.83.141.79]) by smtp.gmail.com with ESMTPSA id j7-20020aa783c7000000b005938bd2bfd3sm1501226pfn.120.2023.02.09.06.32.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 06:32:04 -0800 (PST) From: Jagan Teki To: Kever Yang , Philipp Tomsich , Simon Glass Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com, Manoj Sai , Ren Jianing , Jagan Teki Subject: [PATCH v3 6/7] phy: rockchip-inno-usb2: Add USB2 PHY for rk3568 Date: Thu, 9 Feb 2023 20:00:59 +0530 Message-Id: <20230209143100.113376-6-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230209143100.113376-1-jagan@amarulasolutions.com> References: <20230209143100.113376-1-jagan@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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.6 at phobos.denx.de X-Virus-Status: Clean From: Manoj Sai RK3568 has two USB 2.0 PHYs, and each PHY has two ports, the OTG port of PHY0 support OTG mode with charging detection function, they are similar to previous Rockchip SoCs. However, there are three different designs for RK3568 USB 2.0 PHY. 1. RK3568 uses independent USB GRF module for each USB 2.0 PHY. 2. RK3568 accesses the registers of USB 2.0 PHY IP directly by APB. 3. The two ports of USB 2.0 PHY share one interrupt. This patch only PHY1 with necessary attributes required to function USBPHY1 on U-Boot. Co-developed-by: Ren Jianing Signed-off-by: Ren Jianing Co-developed-by: Jagan Teki Signed-off-by: Jagan Teki Signed-off-by: Manoj Sai --- Changes for v3: - new patch drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index a01148db22..38cd0f0f33 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -298,11 +298,40 @@ static const struct rockchip_usb2phy_cfg rk3399_usb2phy_cfgs[] = { { /* sentinel */ } }; +static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = { + { + .reg = 0xfe8b0000, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0000, 8, 0, 0x1d2, 0x1d1 }, + .ls_det_en = { 0x0080, 0, 0, 0, 1 }, + .ls_det_st = { 0x0084, 0, 0, 0, 1 }, + .ls_det_clr = { 0x0088, 0, 0, 0, 1 }, + .utmi_ls = { 0x00c0, 5, 4, 0, 1 }, + .utmi_hstdet = { 0x00c0, 7, 7, 0, 1 } + }, + [USB2PHY_PORT_HOST] = { + .phy_sus = { 0x0004, 8, 0, 0x1d2, 0x1d1 }, + .ls_det_en = { 0x0080, 1, 1, 0, 1 }, + .ls_det_st = { 0x0084, 1, 1, 0, 1 }, + .ls_det_clr = { 0x0088, 1, 1, 0, 1 }, + .utmi_ls = { 0x00c0, 17, 16, 0, 1 }, + .utmi_hstdet = { 0x00c0, 19, 19, 0, 1 } + } + }, + }, + { /* sentinel */ } +}; + static const struct udevice_id rockchip_usb2phy_ids[] = { { .compatible = "rockchip,rk3399-usb2phy", .data = (ulong)&rk3399_usb2phy_cfgs, }, + { + .compatible = "rockchip,rk3568-usb2phy", + .data = (ulong)&rk3568_phy_cfgs, + }, { /* sentinel */ } }; -- 2.25.1