[PATCH] phy: ti: phy-j721e-wiz: Allow reinitialization when SERDES is pre-configured
    Hrushikesh Salunke 
    h-salunke at ti.com
       
    Fri Oct 17 07:25:19 CEST 2025
    
    
  
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 <h-salunke at ti.com>
---
This patch is based on commit
4e4a9de31de Merge branch 'next' of git://source.denx.de/u-boot-usb into next
 drivers/phy/ti/phy-j721e-wiz.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
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;
-- 
2.34.1
    
    
More information about the U-Boot
mailing list