Skip to content

Commit a051156

Browse files
tmon-nordicjukkar
authored andcommitted
[nrf fromtree] drivers: udc_dwc2: Wait for USBHS clock start
Accessing DWC2 otg core registers before the clock starts results in complete system hang. Add a 1 us busy wait to make sure that software won't access registers before the clock is started. Signed-off-by: Tomasz Moń <[email protected]> (cherry picked from commit df36b16) (cherry picked from commit 581e638)
1 parent b56a27f commit a051156

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/usb/udc/udc_dwc2_vendor_quirks.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ static inline int usbhs_enable_core(const struct device *dev)
201201
wrapper->ENABLE = USBHS_ENABLE_PHY_Msk | USBHS_ENABLE_CORE_Msk;
202202
wrapper->TASKS_START = 1UL;
203203

204+
/* Wait for clock to start to avoid hang on too early register read */
205+
k_busy_wait(1);
206+
204207
/* Enable interrupts */
205208
wrapper->INTENSET = 1UL;
206209

0 commit comments

Comments
 (0)