Linux clock framework development
 help / color / mirror / Atom feed
* [PATCH] clk: ti: omap4: Initialize DPLL_USB_M2 during the boot
@ 2026-07-01 15:06 Thomas Richard
  2026-07-01 16:45 ` Andreas Kemnade
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Richard @ 2026-07-01 15:06 UTC (permalink / raw)
  To: Tero Kristo, Michael Turquette, Stephen Boyd, Brian Masney
  Cc: Thomas Petazzoni, linux-omap, linux-clk, linux-kernel,
	Thomas Richard

Initialize and lock DPLL_USB_M2 at boot to make USB devices work.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
---
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/20260608-omap4-support-v3-0-8595ccd203f0@bootlin.com/
[2] https://lore.kernel.org/all/20260330-omap4-fix-usb-support-v2-0-1c1e11b190dc@bootlin.com/
---
 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

---
base-commit: d247142d038d06514de633de44db8faf17227752
change-id: 20260617-clk-ti-omap4-dpll-usb-m2-c7ed057eb8c8

Best regards,
-- 
Thomas Richard <thomas.richard@bootlin.com>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: ti: omap4: Initialize DPLL_USB_M2 during the boot
  2026-07-01 15:06 [PATCH] clk: ti: omap4: Initialize DPLL_USB_M2 during the boot Thomas Richard
@ 2026-07-01 16:45 ` Andreas Kemnade
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Kemnade @ 2026-07-01 16:45 UTC (permalink / raw)
  To: Thomas Richard
  Cc: Tero Kristo, Michael Turquette, Stephen Boyd, Brian Masney,
	Thomas Petazzoni, linux-omap, linux-clk, linux-kernel

On Wed, 01 Jul 2026 17:06:28 +0200
Thomas Richard <thomas.richard@bootlin.com> wrote:

> Initialize and lock DPLL_USB_M2 at boot to make USB devices work.
> 
> Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
> ---
> 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/20260608-omap4-support-v3-0-8595ccd203f0@bootlin.com/
> [2] https://lore.kernel.org/all/20260330-omap4-fix-usb-support-v2-0-1c1e11b190dc@bootlin.com/
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-01 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-01 15:06 [PATCH] clk: ti: omap4: Initialize DPLL_USB_M2 during the boot Thomas Richard
2026-07-01 16:45 ` Andreas Kemnade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox