From: Hrushikesh Salunke Date: Fri, 17 Oct 2025 05:25:19 +0000 (+0530) Subject: phy: ti: phy-j721e-wiz: Allow reinitialization when SERDES is pre-configured X-Git-Tag: v2026.01-rc1~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8506cf58ffa2029f168cc64089763084b408051d;p=thirdparty%2Fu-boot.git phy: ti: phy-j721e-wiz: Allow reinitialization when SERDES is pre-configured Move the SERDES configuration check after clock and reset initialization and change it from a hard failure to a skip of WIZ initialization. This allows the driver to probe successfully when the SERDES has been pre-configured by a previous boot stage (e.g., ROM or SPL). This approach aligns with how the Linux kernel handles pre-configured SERDES, where the driver gracefully skips reinitialization rather than failing to probe. Signed-off-by: Hrushikesh Salunke --- diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c index 6e2d4bc2b05..eaf68d18f3a 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -1180,6 +1180,7 @@ static int j721e_wiz_probe(struct udevice *dev) ofnode node; struct regmap *regmap; u32 num_lanes; + bool already_configured = false; node = get_child_by_name(dev, "serdes"); @@ -1243,15 +1244,6 @@ static int j721e_wiz_probe(struct udevice *dev) goto err_addr_to_resource; } - for (i = 0; i < wiz->num_lanes; i++) { - regmap_field_read(wiz->p_enable[i], &val); - if (val & (P_ENABLE | P_ENABLE_FORCE)) { - dev_err(dev, "SERDES already configured\n"); - rc = -EBUSY; - goto err_addr_to_resource; - } - } - rc = j721e_wiz_bind_of_clocks(wiz); if (rc) { dev_err(dev, "Failed to bind clocks\n"); @@ -1270,10 +1262,21 @@ static int j721e_wiz_probe(struct udevice *dev) goto err_addr_to_resource; } - rc = wiz_init(wiz); - if (rc) { - dev_err(dev, "WIZ initialization failed\n"); - goto err_addr_to_resource; + for (i = 0; i < wiz->num_lanes; i++) { + regmap_field_read(wiz->p_enable[i], &val); + if (val & (P_ENABLE | P_ENABLE_FORCE)) { + dev_info(dev, "SERDES already configured, skipping wiz initialization\n"); + already_configured = true; + break; + } + } + + if (!already_configured) { + rc = wiz_init(wiz); + if (rc) { + dev_err(dev, "WIZ initialization failed\n"); + goto err_addr_to_resource; + } } return 0;