diff mbox series

[v2,02/25] phy: cadence: Sierra: Fix PHY power_on sequence

Message ID 20220128081152.14901-3-a-govindraju@ti.com
State Accepted
Commit 67703eed11fecc425857078e35779b9db6c62066
Delegated to: Tom Rini
Headers show
Series SIERRA: Add support for Mulitlink Configuration | expand

Commit Message

Aswath Govindraju Jan. 28, 2022, 8:11 a.m. UTC
From: Kishon Vijay Abraham I <kishon@ti.com>

Commit 39b823381d9d ("phy: cadence: Add driver for Sierra PHY")
de-asserts PHY_RESET even before the configurations are loaded in
phy_init(). However PHY_RESET should be de-asserted only after
all the configurations has been initialized, instead of de-asserting
in probe. Fix it here.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---
 drivers/phy/cadence/phy-cadence-sierra.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Tom Rini Feb. 8, 2022, 5:33 p.m. UTC | #1
On Fri, Jan 28, 2022 at 01:41:29PM +0530, Aswath Govindraju wrote:

> From: Kishon Vijay Abraham I <kishon@ti.com>
> 
> Commit 39b823381d9d ("phy: cadence: Add driver for Sierra PHY")
> de-asserts PHY_RESET even before the configurations are loaded in
> phy_init(). However PHY_RESET should be de-asserted only after
> all the configurations has been initialized, instead of de-asserting
> in probe. Fix it here.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/phy/cadence/phy-cadence-sierra.c b/drivers/phy/cadence/phy-cadence-sierra.c
index 6b26b30dcf9d..bd42145fcacc 100644
--- a/drivers/phy/cadence/phy-cadence-sierra.c
+++ b/drivers/phy/cadence/phy-cadence-sierra.c
@@ -296,6 +296,12 @@  static int cdns_sierra_phy_on(struct phy *gphy)
 	u32 val;
 	int ret;
 
+	ret = reset_control_deassert(sp->phy_rst);
+	if (ret) {
+		dev_err(dev, "Failed to take the PHY out of reset\n");
+		return ret;
+	}
+
 	/* Take the PHY lane group out of reset */
 	ret = reset_deassert_bulk(ins->lnk_rst);
 	if (ret) {
@@ -544,7 +550,6 @@  static int cdns_sierra_phy_probe(struct udevice *dev)
 	if (!sp->autoconf && sp->nsubnodes > 1)
 		regmap_field_write(sp->phy_pll_cfg_1, 0x1);
 
-	reset_control_deassert(sp->phy_rst);
 	dev_info(dev, "sierra probed\n");
 	return 0;