[U-Boot] [RESEND PATCH 2/5] usb: host: dwc2: add support for clk

Patrick DELAUNAY patrick.delaunay at st.com
Wed Nov 6 18:03:23 UTC 2019

Hi Marek,

> From: Marek Vasut <marex at denx.de>
> Sent: mardi 15 octobre 2019 01:28
> On 10/14/19 10:00 AM, Patrick Delaunay wrote:
> > Add support for clock with driver model.
> >
> Same question as with the PHY -- is there now a mandatory dependency on the
> DM CLK ?

No I don't think.

Because the clk function are also stubbed in ./include/clk.h

But I don't 100% sure as I don't tested it on one platform without DM_CLK...
> [...]
> > @@ -1403,6 +1429,7 @@ static int dwc2_usb_remove(struct udevice *dev)
> >  	dwc2_uninit_common(priv->regs);
> >
> >  	reset_release_bulk(&priv->resets);
> > +	clk_release_bulk(&priv->clks);
> Shouldn't there be some clk_...disable() here ?

I don't like make clk_....disable() in U-Boot remove function because the clock
u-class don't managed a counter for each clock user (as it is done in kernel).

We have always a risk to deactivate a clock needed by a several device:
each driver (A&B) enable a common clock with U-Boot clock function, 
but the first clock disable (A) really deactivate the clock even it is still needed
by the other driver (B)

I use the same logical than dwc3 driver: clk_disable_bulk is not called.

static int dwc3_glue_remove(struct udevice *dev)
	struct dwc3_glue_data *glue = dev_get_platdata(dev);



	return 0;


More information about the U-Boot mailing list