All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Jacques Hiblot <jjhiblot@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 2/9] phy: ti-pip3-phy: Add support for USB3 PHY
Date: Fri, 4 May 2018 16:34:44 +0200	[thread overview]
Message-ID: <1525444491-24324-3-git-send-email-jjhiblot@ti.com> (raw)
In-Reply-To: <1525444491-24324-1-git-send-email-jjhiblot@ti.com>

From: Vignesh R <vigneshr@ti.com>

Add support to handle USB3 PHYs present on AM57xx/DRA7xx SoCs. This is
needed to move AM57xx to DM_USB.

Signed-off-by: Vignesh R <vigneshr@ti.com>

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2:
- Add USB3 support to ti-pipe3-phy driver

 drivers/phy/ti-pipe3-phy.c | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/drivers/phy/ti-pipe3-phy.c b/drivers/phy/ti-pipe3-phy.c
index babf2ff..9fddd01 100644
--- a/drivers/phy/ti-pipe3-phy.c
+++ b/drivers/phy/ti-pipe3-phy.c
@@ -266,10 +266,13 @@ static int pipe3_exit(struct phy *phy)
 		return -EBUSY;
 	}
 
-	val = readl(pipe3->pll_reset_reg);
-	writel(val | SATA_PLL_SOFT_RESET, pipe3->pll_reset_reg);
-	mdelay(1);
-	writel(val & ~SATA_PLL_SOFT_RESET, pipe3->pll_reset_reg);
+	if (pipe3->pll_reset_reg) {
+		val = readl(pipe3->pll_reset_reg);
+		writel(val | SATA_PLL_SOFT_RESET, pipe3->pll_reset_reg);
+		mdelay(1);
+		writel(val & ~SATA_PLL_SOFT_RESET, pipe3->pll_reset_reg);
+	}
+
 	return 0;
 }
 
@@ -332,9 +335,11 @@ static int pipe3_phy_probe(struct udevice *dev)
 	if (!pipe3->power_reg)
 		return -EINVAL;
 
-	pipe3->pll_reset_reg = get_reg(dev, "syscon-pllreset");
-	if (!pipe3->pll_reset_reg)
-		return -EINVAL;
+	if (device_is_compatible(dev, "ti,phy-pipe3-sata")) {
+		pipe3->pll_reset_reg = get_reg(dev, "syscon-pllreset");
+		if (!pipe3->pll_reset_reg)
+			return -EINVAL;
+	}
 
 	pipe3->dpll_map = (struct pipe3_dpll_map *)dev_get_driver_data(dev);
 
@@ -351,8 +356,19 @@ static struct pipe3_dpll_map dpll_map_sata[] = {
 	{ },                                    /* Terminator */
 };
 
+static struct pipe3_dpll_map dpll_map_usb[] = {
+	{12000000, {1250, 5, 4, 20, 0} },	/* 12 MHz */
+	{16800000, {3125, 20, 4, 20, 0} },	/* 16.8 MHz */
+	{19200000, {1172, 8, 4, 20, 65537} },	/* 19.2 MHz */
+	{20000000, {1000, 7, 4, 10, 0} },	/* 20 MHz */
+	{26000000, {1250, 12, 4, 20, 0} },	/* 26 MHz */
+	{38400000, {3125, 47, 4, 20, 92843} },	/* 38.4 MHz */
+	{ },					/* Terminator */
+};
+
 static const struct udevice_id pipe3_phy_ids[] = {
 	{ .compatible = "ti,phy-pipe3-sata", .data = (ulong)&dpll_map_sata },
+	{ .compatible = "ti,omap-usb3", .data = (ulong)&dpll_map_usb},
 	{ }
 };
 
-- 
2.7.4

  parent reply	other threads:[~2018-05-04 14:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 14:34 [U-Boot] [PATCH v5 0/9] Add support for DM_USB for TI's DRA7 EVMs and AM57 EVMs platforms Jean-Jacques Hiblot
2018-05-04 14:34 ` [U-Boot] [PATCH v5 1/9] syscon: dm: Add a new method to get a regmap from DTS Jean-Jacques Hiblot
2018-05-04 21:38   ` Simon Glass
2018-05-04 14:34 ` Jean-Jacques Hiblot [this message]
2018-05-04 14:34 ` [U-Boot] [PATCH v5 3/9] phy: Add a new driver for OMAP's USB2 PHYs Jean-Jacques Hiblot
2018-05-04 14:38   ` Marek Vasut
2018-05-04 14:34 ` [U-Boot] [PATCH v5 4/9] board: ti: dra7xx-evm: turn on USB clocks in late init stage Jean-Jacques Hiblot
2018-05-04 14:38   ` Marek Vasut
2018-05-04 14:42     ` Jean-Jacques Hiblot
2018-05-04 15:43       ` Marek Vasut
2018-05-04 17:58         ` Jean-Jacques Hiblot
2018-05-04 19:06           ` Marek Vasut
2018-05-15 16:10             ` Jean-Jacques Hiblot
2018-05-15 18:05               ` Jean-Jacques Hiblot
2018-05-15 22:13               ` Marek Vasut
2018-05-16  9:00                 ` Jean-Jacques Hiblot
2018-05-16  9:04                   ` Marek Vasut
2018-05-16 13:53                     ` Jean-Jacques Hiblot
2018-05-16 15:21                     ` Tom Rini
2018-05-17  9:27                       ` Jean-Jacques Hiblot
2018-05-16 12:46                   ` Tom Rini
2018-05-04 14:34 ` [U-Boot] [PATCH v5 5/9] board; ti: am57xx: turn on USB clocks Jean-Jacques Hiblot
2018-05-04 14:34 ` [U-Boot] [PATCH v5 6/9] dts: dra7x: make ocp2scp@4a080000 compatible with simple-bus Jean-Jacques Hiblot
2018-05-04 14:34 ` [U-Boot] [PATCH v5 7/9] dts: dra7x: Disable USB1 on all evms Jean-Jacques Hiblot
2018-05-04 14:34 ` [U-Boot] [PATCH v5 8/9] configs: enable OMAP_USB2_PHY for all DRA7 platforms Jean-Jacques Hiblot
2018-05-04 14:34 ` [U-Boot] [PATCH v5 9/9] configs: am57xx_evm: Enable DM_USB and dependencies Jean-Jacques Hiblot

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=1525444491-24324-3-git-send-email-jjhiblot@ti.com \
    --to=jjhiblot@ti.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.