Skip to content

Commit a4741f2

Browse files
committed
[nrf fromtree] drivers: udc_dwc2: Ensure overlapping USBHS reset
Wait for PHY clock before triggering START task to ensure overlapped reset for PHY and DWC2 core. Signed-off-by: Tomasz Moń <[email protected]> (cherry picked from commit 437983e)
1 parent 7383e86 commit a4741f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/usb/udc/udc_dwc2_vendor_quirks.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ static inline int usbhs_enable_core(const struct device *dev)
199199
}
200200

201201
wrapper->ENABLE = USBHS_ENABLE_PHY_Msk | USBHS_ENABLE_CORE_Msk;
202+
203+
/* Wait for PHY clock to start */
204+
k_busy_wait(45);
205+
206+
/* Release DWC2 reset */
202207
wrapper->TASKS_START = 1UL;
203208

204209
/* Wait for clock to start to avoid hang on too early register read */
@@ -218,7 +223,6 @@ static inline int usbhs_disable_core(const struct device *dev)
218223
wrapper->INTENCLR = 1UL;
219224

220225
wrapper->ENABLE = 0UL;
221-
wrapper->TASKS_START = 1UL;
222226

223227
return 0;
224228
}

0 commit comments

Comments
 (0)