Linux clock framework development
 help / color / mirror / Atom feed
From: Andreas Kemnade <andreas@kemnade.info>
To: Thomas Richard <thomas.richard@bootlin.com>
Cc: Tero Kristo <kristo@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney@redhat.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-omap@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: ti: omap4: Initialize DPLL_USB_M2 during the boot
Date: Wed, 1 Jul 2026 18:45:25 +0200	[thread overview]
Message-ID: <20260701184525.6d80ad79@kemnade.info> (raw)
In-Reply-To: <20260701-clk-ti-omap4-dpll-usb-m2-v1-1-02d8a3845a55@bootlin.com>

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

      reply	other threads:[~2026-07-01 16:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260701184525.6d80ad79@kemnade.info \
    --to=andreas@kemnade.info \
    --cc=bmasney@redhat.com \
    --cc=kristo@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=thomas.richard@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox