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 <h-salunke@ti.com>
This commit is contained in:
committed by
Tom Rini
parent
104a0de784
commit
8506cf58ff
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user