From: Jagan Teki <jagan@amarulasolutions.com>
To: Kever Yang <kever.yang@rock-chips.com>,
Philipp Tomsich <philipp.tomsich@vrull.eu>,
Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, linux-amarula@amarulasolutions.com,
Manoj Sai <abbaraju.manojsai@amarulasolutions.com>,
Ren Jianing <jianing.ren@rock-chips.com>,
Jagan Teki <jagan@amarulasolutions.com>
Subject: [PATCH v4 07/12] phy: rockchip-inno-usb2: Add USB2 PHY for rk3568
Date: Fri, 17 Feb 2023 17:28:40 +0530 [thread overview]
Message-ID: <20230217115845.75303-8-jagan@amarulasolutions.com> (raw)
In-Reply-To: <20230217115845.75303-1-jagan@amarulasolutions.com>
From: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
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 <jianing.ren@rock-chips.com>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Co-developed-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Manoj Sai <abbaraju.manojsai@amarulasolutions.com>
---
drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index a01148db22..55e1dbcfef 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -298,11 +298,65 @@ static const struct rockchip_usb2phy_cfg rk3399_usb2phy_cfgs[] = {
{ /* sentinel */ }
};
+static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = {
+ {
+ .reg = 0xfe8a0000,
+ .port_cfgs = {
+ [USB2PHY_PORT_OTG] = {
+ .phy_sus = { 0x0000, 8, 0, 0x052, 0x1d1 },
+ .bvalid_det_en = { 0x0080, 2, 2, 0, 1 },
+ .bvalid_det_st = { 0x0084, 2, 2, 0, 1 },
+ .bvalid_det_clr = { 0x0088, 2, 2, 0, 1 },
+ .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_avalid = { 0x00c0, 10, 10, 0, 1 },
+ .utmi_bvalid = { 0x00c0, 9, 9, 0, 1 },
+ .utmi_ls = { 0x00c0, 5, 4, 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 }
+ }
+ },
+ },
+ {
+ .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
next prev parent reply other threads:[~2023-02-17 12:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-17 11:58 [PATCH v4 00/12] rockchip: Add Radxa CM3 support Jagan Teki
2023-02-17 11:58 ` [PATCH v4 01/12] rockchip: rk3568: Move DM_RESET in arch kconfig Jagan Teki
2023-02-21 9:28 ` Kever Yang
2023-02-17 11:58 ` [PATCH v4 02/12] dt-bindings: rockchip: Sync rockchip, vop2.h from Linux Jagan Teki
2023-02-17 11:58 ` [PATCH v4 03/12] arm64: dts: rockchip: rk3566: Add Radxa Compute Module 3 Jagan Teki
2023-02-17 11:58 ` [PATCH v4 04/12] arm64: dts: rockchip: rk3566: Add Radxa Compute Module 3 IO Jagan Teki
2023-02-21 9:29 ` Kever Yang
2023-02-17 11:58 ` [PATCH v4 05/12] board: rockchip: Add Radxa Compute Module 3 IO Board Jagan Teki
2023-02-17 11:58 ` [PATCH v4 06/12] phy: rockchip: inno-usb2: Add support #address_cells = 2 Jagan Teki
2023-02-21 9:29 ` Kever Yang
2023-02-17 11:58 ` Jagan Teki [this message]
2023-02-21 9:30 ` [PATCH v4 07/12] phy: rockchip-inno-usb2: Add USB2 PHY for rk3568 Kever Yang
2023-02-17 11:58 ` [PATCH v4 08/12] drivers: phy: add naneng combphy " Jagan Teki
2023-02-21 9:31 ` Kever Yang
2023-02-17 11:58 ` [PATCH v4 09/12] arm64: dts: rk356x-u-boot: Drop combphy1 assigned-clocks/rates Jagan Teki
2023-02-21 9:32 ` Kever Yang
2023-02-17 11:58 ` [PATCH v4 10/12] rockchip: rk3568: add rk3568 pinctrl driver Jagan Teki
2023-02-21 9:32 ` Kever Yang
2023-02-17 11:58 ` [PATCH v4 11/12] rockchip: rk3568: Select DM_REGULATOR_FIXED Jagan Teki
2023-02-21 9:33 ` Kever Yang
2023-02-17 11:58 ` [PATCH v4 12/12] rk3566: radxa-cm3: Enable USB2.0, USB3.0 support Jagan Teki
2023-02-21 9:33 ` Kever Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230217115845.75303-8-jagan@amarulasolutions.com \
--to=jagan@amarulasolutions.com \
--cc=abbaraju.manojsai@amarulasolutions.com \
--cc=jianing.ren@rock-chips.com \
--cc=kever.yang@rock-chips.com \
--cc=linux-amarula@amarulasolutions.com \
--cc=philipp.tomsich@vrull.eu \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox