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

Marek Vasut marex at denx.de
Wed Nov 6 21:59:05 UTC 2019


On 11/6/19 7:03 PM, Patrick DELAUNAY wrote:
> Hi Marek,

Hi,

[...]

>> 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
> CONFIG_IS_ENABLED(CLK)
> 
> But I don't 100% sure as I don't tested it on one platform without DM_CLK...

SoCFPGA is one of those, so +CC Simon.

>> [...]
>>
>>> @@ -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)

But if you don't disable the clock in .remove callback, the clock are
left running and that might cause other problems.

Are there such systems which share single clock enable bit between
multiple DWC2 IPs ?

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

I suspect that driver might need fixing.

[...]

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list