[U-Boot] [PATCH v5 10/14] usb: extend generic EHCI with PHY

Patrice CHOTARD patrice.chotard at st.com
Fri May 12 08:49:45 UTC 2017


Hi Marek

On 05/11/2017 01:55 PM, Marek Vasut wrote:
> On 05/11/2017 09:19 AM, Patrice CHOTARD wrote:
>> Hi Marek
>>
>> On 05/10/2017 11:18 PM, Marek Vasut wrote:
>>> On 05/10/2017 06:09 PM, patrice.chotard at st.com wrote:
>>>> From: Patrice Chotard <patrice.chotard at st.com>
>>>
>>> Commit message missing.
>>
>> ok i will fix it
>>
>>>
>>> You should also break this patchset up into smaller pieces.
>>
>> You mean, extract the update of generic OHCI and >EHCI driver from this
>> series ?
>
> Yes, split the patchset into independent pieces so it's not such a
> massive drop of code.
>

Ok

>>>> Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
>>>> ---
>>>>
>>>> v5:   _ add support of new generic PHY UCLASS
>>>>
>>>>  drivers/usb/host/ehci-generic.c | 13 +++++++++++++
>>>>  1 file changed, 13 insertions(+)
>>>>
>>>> diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
>>>> index 2190adb..3c2f5a7 100644
>>>> --- a/drivers/usb/host/ehci-generic.c
>>>> +++ b/drivers/usb/host/ehci-generic.c
>>>> @@ -6,6 +6,8 @@
>>>>
>>>>  #include <common.h>
>>>>  #include <clk.h>
>>>> +#include <fdtdec.h>
>>>> +#include <generic-phy.h>
>>>>  #include <reset.h>
>>>>  #include <asm/io.h>
>>>>  #include <dm.h>
>>>> @@ -50,6 +52,17 @@ static int ehci_usb_probe(struct udevice *dev)
>>>>  		reset_free(&reset);
>>>>  	}
>>>>
>>>> +	for (i = 0; ; i++) {
>>>> +		struct phy usb_phy;
>>>> +		int ret;
>>>> +
>>>> +		ret = generic_phy_get_by_index(dev, i, &usb_phy);
>>>> +		if (ret < 0)
>>>> +			break;
>>>> +		if (generic_phy_init(&usb_phy))
>>>> +			printf("failed to init usb phy %d\n", i);
>>>
>>> How does this whole block work ? What is this about ?
>>
>> It allows to retrieve any present USB phys node and call the associated
>> init callback. see patch 4 of this series ([PATCH v5 04/14] usb: phy:
>> Add STi USB2 PHY)
>>
>> FYI, in dm next branch, there is a new generic PHY framework implementation.
>> See  0ace7fe60d5c258324ef4b2caaa556616b96d1d9 drivers: phy: add generic
>> PHY framework
>
> And why do you need to iterate over indexes ? Why don't you just parse a
> phandle ?
>

As for clocks or resets, in case there is more than 1 phy connected.

Patrice


More information about the U-Boot mailing list