[U-Boot] [PATCH] usb: ehci-mx5: Fix bus enumeration for DM case
Marek Vasut
marex at denx.de
Tue Feb 25 19:01:13 CET 2020
On 2/24/20 4:28 PM, Lukasz Majewski wrote:
> Hi Marek,
Hi,
>> On Thu, 20 Jun 2019 22:53:58 +0200
>> Marek Vasut <marex at denx.de> wrote:
>>
>>> It is likely that the DM conversion of EHCI iMX5 driver was a
>>> derivative of EHCI VF, however the conversion is incomplete and is
>>> missing the bind workaround, which updates dev->seq number. Without
>>> this, all controllers have dev->seq number 0 . Add this bind
>>> workaround into EHCI iMX5 driver as well.
>>>
>>> Signed-off-by: Marek Vasut <marex at denx.de>
>>> Cc: Abel Vesa <abel.vesa at nxp.com>
>>> Cc: Adam Ford <aford173 at gmail.com>
>>> Cc: Fabio Estevam <festevam at gmail.com>
>>> Cc: Ludwig Zenz <lzenz at dh-electronics.com>
>>> Cc: Peng Fan <peng.fan at nxp.com>
>>> Cc: Stefano Babic <sbabic at denx.de>
>>> Cc: Vagrant Cascadian <vagrant at debian.org>
>>> ---
>>> drivers/usb/host/ehci-mx5.c | 17 +++++++++++++++++
>>> 1 file changed, 17 insertions(+)
>>>
>>> diff --git a/drivers/usb/host/ehci-mx5.c
>>> b/drivers/usb/host/ehci-mx5.c index 0b32728c57..4db513f4e5 100644
>>> --- a/drivers/usb/host/ehci-mx5.c
>>> +++ b/drivers/usb/host/ehci-mx5.c
>>> @@ -301,6 +301,22 @@ static int ehci_usb_ofdata_to_platdata(struct
>>> udevice *dev) return 0;
>>> }
>>>
>>> +static int ehci_usb_bind(struct udevice *dev)
>>> +{
>>> + static int num_controllers;
>>> +
>>> + /*
>>> + * Without this hack, if we return ENODEV for USB
>>> Controller 0, on
>>> + * probe for the next controller, USB Controller 1 will be
>>> given a
>>> + * sequence number of 0. This conflicts with our
>>> requirement of
>>> + * sequence numbers while initialising the peripherals.
>>> + */
>>> + dev->req_seq = num_controllers;
>>> + num_controllers++;
>>> +
>>> + return 0;
>>> +}
>>> +
>>> static int ehci_usb_probe(struct udevice *dev)
>>> {
>>> struct usb_platdata *plat = dev_get_platdata(dev);
>>> @@ -362,6 +378,7 @@ U_BOOT_DRIVER(usb_mx5) = {
>>> .id = UCLASS_USB,
>>> .of_match = mx5_usb_ids,
>>> .ofdata_to_platdata = ehci_usb_ofdata_to_platdata,
>>> + .bind = ehci_usb_bind,
>>> .probe = ehci_usb_probe,
>>> .remove = ehci_deregister,
>>> .ops = &ehci_usb_ops,
>>
>> Tested-by: Lukasz Majewski <lukma at denx.de>
>>
>> Tested on HSC|DDC i.MX53 board (usb start works as previously).
>>
>
> Gentle ping on this patch :-)
I think this approach doesn't work, there was a discussion about this
under a patch like this for ehci-mx6.c . Take a look at the patches for
the ehci-mx6.c in mainline and replicate the approach, or even better,
solve the TODO there altogether.
[...]
More information about the U-Boot
mailing list