aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2016-05-18 08:28:06 -0400
committerKishon Vijay Abraham I <kishon@ti.com>2016-06-03 02:36:41 -0400
commit31b2a32f708bb33b3f35b03ce3d2cb31f7d1e684 (patch)
treecec2d756eb4345065d6af165e5fbcab2e6b98258
parent06061dc63bff8d609bc8d64f5d3ef59d0a673b25 (diff)
phy: ti-pipe3: Program the DPLL even if it was already locked
If bootloader has set a wrong DPLL then we must trash those values and re-program it anyways. This fixes USB3 devices not being enumerated on beagle-x15 if usb was started in u-boot. We don't re-program SATA DPLL if it is locked as it was causing SATA failures if device was hotpluged after boot. Reported-by: Robert Nelson <robertcnelson@gmail.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
-rw-r--r--drivers/phy/phy-ti-pipe3.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/phy/phy-ti-pipe3.c b/drivers/phy/phy-ti-pipe3.c
index 0a477d24cf76..bf46844dc387 100644
--- a/drivers/phy/phy-ti-pipe3.c
+++ b/drivers/phy/phy-ti-pipe3.c
@@ -293,11 +293,18 @@ static int ti_pipe3_init(struct phy *x)
293 ret = ti_pipe3_dpll_wait_lock(phy); 293 ret = ti_pipe3_dpll_wait_lock(phy);
294 } 294 }
295 295
296 /* Program the DPLL only if not locked */ 296 /* SATA has issues if re-programmed when locked */
297 val = ti_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS); 297 val = ti_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS);
298 if (!(val & PLL_LOCK)) 298 if ((val & PLL_LOCK) && of_device_is_compatible(phy->dev->of_node,
299 if (ti_pipe3_dpll_program(phy)) 299 "ti,phy-pipe3-sata"))
300 return -EINVAL; 300 return ret;
301
302 /* Program the DPLL */
303 ret = ti_pipe3_dpll_program(phy);
304 if (ret) {
305 ti_pipe3_disable_clocks(phy);
306 return -EINVAL;
307 }
301 308
302 return ret; 309 return ret;
303} 310}