Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31b2a32f authored by Roger Quadros's avatar Roger Quadros Committed by Kishon Vijay Abraham I
Browse files

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: default avatarRobert Nelson <robertcnelson@gmail.com>
Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 06061dc6
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -293,11 +293,18 @@ static int ti_pipe3_init(struct phy *x)
		ret = ti_pipe3_dpll_wait_lock(phy);
	}

	/* Program the DPLL only if not locked */
	/* SATA has issues if re-programmed when locked */
	val = ti_pipe3_readl(phy->pll_ctrl_base, PLL_STATUS);
	if (!(val & PLL_LOCK))
		if (ti_pipe3_dpll_program(phy))
	if ((val & PLL_LOCK) && of_device_is_compatible(phy->dev->of_node,
							"ti,phy-pipe3-sata"))
		return ret;

	/* Program the DPLL */
	ret = ti_pipe3_dpll_program(phy);
	if (ret) {
		ti_pipe3_disable_clocks(phy);
		return -EINVAL;
	}

	return ret;
}