Re: [PATCH] clk: ti: omap4: Initialize DPLL_USB_M2 during the boot

Andreas Kemnade <[email protected]> Wed, 1 Jul 2026 18:45:25 +0200
Newsgroups org.kernel.vger.linux-omap,org.kernel.vger.linux-clk,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Wed, 01 Jul 2026 17:06:28 +0200
Thomas Richard <[email protected]> wrote:

> Initialize and lock DPLL_USB_M2 at boot to make USB devices work.
> 
> Signed-off-by: Thomas Richard <[email protected]>
> ---
> Recently a series [1] adding back OMAP4 support in U-Boot has been merged
> in next branch. While testing it, I noticed USB is not working on
> omap4_var_som.
> 
> usb 1-1: new full-speed USB device number 8 using ohci-platform
> usb 1-1: device descriptor read/64, error -62
> usb 1-1: device descriptor read/64, error -62
> usb 1-1: new full-speed USB device number 9 using ohci-platform
> usb 1-1: device descriptor read/64, error -62
> usb 1-1: device descriptor read/64, error -62
> usb usb1-port1: attempt power cycle
> 
> The USB_M2 DPLL was previously initialized by U-Boot, but [1] lacks USB
> support for OMAP4. This patch initializes the DPLL in the kernel to avoid
> relying on the bootloader.
> 
> If you want to test, as U-Boot does not handle pbias regulators, you also
> have to apply the patch series "[PATCH v2 00/11] Add SIM pbias regulator
> support for USB on OMAP4" [2].
> 
> [1] https://lore.kernel.org/all/[email protected]/
> [2] https://lore.kernel.org/all/[email protected]/
> ---
>  drivers/clk/ti/clk-44xx.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/clk/ti/clk-44xx.c b/drivers/clk/ti/clk-44xx.c
> index 9b2824ed785b..3944c50b7cd0 100644
> --- a/drivers/clk/ti/clk-44xx.c
> +++ b/drivers/clk/ti/clk-44xx.c
> @@ -811,6 +811,11 @@ int __init omap4xxx_dt_clk_init(void)
>  	if (rc)
>  		pr_err("%s: failed to configure USB DPLL!\n", __func__);
>  
> +	usb_dpll = clk_get_sys(NULL, "dpll_usb_m2_ck");
> +	rc = clk_set_rate(usb_dpll, OMAP4_DPLL_USB_DEFFREQ / 2);
> +	if (rc)
> +		pr_err("%s: failed to configure DPLL_USB_M2!\n", __func__);
> +
>  	/*
>  	 * On OMAP4460 the ABE DPLL fails to turn on if in idle low-power
>  	 * state when turning the ABE clock domain. Workaround this by
> 
we have assigned-rates in omap44xx-clocks.dtsi
for similar divider clocks. I have a patch needed because of recent u-boots
not having some abe stuff initalized to have mcbsp working in master mode
on omap4. I think should have some consistency here and agree on it.

So I would say if it is all about setting recommended defaults, probably
a better way is to have it in clk-44xx.c (as you have). Reparenting might
be a different story. There might be reasons to have it reconfigured.

Regards,
Andreas