summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorHrushikesh Salunke <[email protected]>2025-10-17 10:55:19 +0530
committerTom Rini <[email protected]>2025-10-24 13:47:50 -0600
commit8506cf58ffa2029f168cc64089763084b408051d (patch)
treebe513b6254e10352e41ab54eb00686c86e1be2ab /drivers/phy
parent104a0de7844eee51d183d92f5bd22fa6202bb699 (diff)
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 <[email protected]>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/ti/phy-j721e-wiz.c29
1 files 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;