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ń <tomasz.mon@nordicsemi.no>
This commit is contained in:
Tomasz Moń 2024-11-28 11:57:00 +01:00 committed by Benjamin Cabé
commit df36b162bd

View file

@ -201,6 +201,9 @@ static inline int usbhs_enable_core(const struct device *dev)
wrapper->ENABLE = USBHS_ENABLE_PHY_Msk | USBHS_ENABLE_CORE_Msk;
wrapper->TASKS_START = 1UL;
/* Wait for clock to start to avoid hang on too early register read */
k_busy_wait(1);
/* Enable interrupts */
wrapper->INTENSET = 1UL;