Skip to content

Commit

Permalink
LFU-627 imx95_evk: Fix USB host restart crash
Browse files Browse the repository at this point in the history
Found a issue that restart USB host enumeration will cause u-boot
crash. It is introduced by enabling SCMI power domain driver.
Because u-boot SCMI power domain driver does not support multiple
devices to share one power domain. But both usb2.0 and usb3.0
controllers share the HSIO TOP PD, so stop any of controller will power
off the HSIO TOP PD and cause issue to the other.

Temporally fix the issue by removing the power-domain property for
both usb nodes. Power on the HSIO TOP at u-boot early and power off
it at board quiesce devices.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
  • Loading branch information
Ye Li committed Dec 12, 2023
1 parent bcb95e6 commit de5fbcc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
5 changes: 5 additions & 0 deletions arch/arm/dts/imx95-19x19-evk-u-boot.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@

&usb2 {
compatible = "fsl,imx8mm-usb", "fsl,imx7d-usb";
/delete-property/power-domains;
};

&usb3 {
/delete-property/power-domains;
};

&usb3_dwc3 {
Expand Down
19 changes: 13 additions & 6 deletions board/freescale/imx95_evk/imx95_evk.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,6 @@ int board_usb_init(int index, enum usb_init_type init)
int ret = 0;

if (index == 0 && init == USB_INIT_DEVICE) {
ret = imx9_scmi_power_domain_enable(IMX95_PD_HSIO_TOP, true);
if (ret) {
printf("SCMI_POWWER_STATE_SET Failed for USB\n");
return ret;
}

#ifdef CONFIG_USB_DWC3
dwc3_nxp_usb_phy_init(&dwc3_device_data);
#endif
Expand Down Expand Up @@ -302,6 +296,13 @@ int board_phy_config(struct phy_device *phydev)

int board_init(void)
{
int ret;
ret = imx9_scmi_power_domain_enable(IMX95_PD_HSIO_TOP, true);
if (ret) {
printf("SCMI_POWWER_STATE_SET Failed for USB\n");
return ret;
}

#if defined(CONFIG_USB_TCPC)
setup_typec();
#endif
Expand Down Expand Up @@ -337,6 +338,12 @@ void board_quiesce_devices(void)
{
int ret;

ret = imx9_scmi_power_domain_enable(IMX95_PD_HSIO_TOP, false);
if (ret) {
printf("%s: Failed for HSIO MIX: %d\n", __func__, ret);
return;
}

ret = imx9_scmi_power_domain_enable(IMX95_PD_NETC, false);
if (ret) {
printf("%s: Failed for NETC MIX: %d\n", __func__, ret);
Expand Down

0 comments on commit de5fbcc

Please sign in to comment.