zephyr/drivers/usb/device
Marcin Niestroj f72ef5c237 drivers: usb: stm32: fix support of STM32U5 OTG_HS with embedded PHY
Introduce new binding "st,stm32u5-otghs-phy" for OTG_HS PHY. This allows to
configure clock source and handle STM32U5 specific OTG_HS PHY behavior in
driver implementation in a more readable way.

Move OTG_HS PHY clock selection (previously <&rcc STM32_SRC_HSI48
ICKLK_SEL(0)>) from OTG_HS node to OTG_HS PHY node.

Rename USBPHYC_SEL -> OTGHS_SEL which matches the definition in the stm32u5
CCIPR2 register (RM0456 Rev 5, Section 11.8.47).

Support enabling OTG_HS PHY clock, which is bit 15 (OTGHSPHYEN) in
RCC_AHB2ENR1. Change OTG_HS clock to be bit 14 (OTGEN).

Calculate in runtime OTG_HS PHY clock source frequency. Try to match that
to supported (16, 19.2, 20, 24, 26, 32 MHz) frequencies and select proper
option with HAL_SYSCFG_SetOTGPHYReferenceClockSelection() API (instead of
hardcoded 16 MHz selection).

Co-authored-by: Adrian Chadd <adrian.chadd@meta.com>
Signed-off-by: Adrian Chadd <adrian.chadd@meta.com>
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2024-12-11 08:00:03 +01:00
..
CMakeLists.txt
Kconfig drivers: usb: stm32: fix support of STM32U5 OTG_HS with embedded PHY 2024-12-11 08:00:03 +01:00
usb_dc_dw_stm32.h
usb_dc_dw.c
usb_dc_it82xx2.c drivers: Fix uninitialized variable warning. 2024-11-12 15:58:47 -06:00
usb_dc_kinetis.c drivers: usb: Use VREG only if present for NXP Kinetis usb 2024-10-25 05:11:44 +01:00
usb_dc_mcux.c zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY 2024-10-03 17:06:52 +01:00
usb_dc_native_posix_adapt.c
usb_dc_native_posix_adapt.h
usb_dc_native_posix.c
usb_dc_nrfx.c zephyr: bulk update to DT_NODE_HAS_STATUS_OKAY 2024-10-03 17:06:52 +01:00
usb_dc_numaker.c
usb_dc_rpi_pico.c drivers: usb_dc_rpi_pico: Implemented vbus detection handling 2024-10-17 10:47:15 -04:00
usb_dc_sam0.c
usb_dc_sam_usbc.c
usb_dc_sam_usbhs.c
usb_dc_smartbond.c
usb_dc_stm32.c drivers: usb: stm32: fix support of STM32U5 OTG_HS with embedded PHY 2024-12-11 08:00:03 +01:00