All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb: ehci-mx5: Fix bus enumeration for DM case
Date: Wed, 26 Feb 2020 10:16:28 +0100	[thread overview]
Message-ID: <20200226101628.7e00d64a@jawa> (raw)
In-Reply-To: <aa383f02-c826-e958-1a23-3c0e2a5ad9dd@denx.de>

Dear Marek,

> 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@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@denx.de>
> >>> Cc: Abel Vesa <abel.vesa@nxp.com>
> >>> Cc: Adam Ford <aford173@gmail.com>
> >>> Cc: Fabio Estevam <festevam@gmail.com>
> >>> Cc: Ludwig Zenz <lzenz@dh-electronics.com>
> >>> Cc: Peng Fan <peng.fan@nxp.com>
> >>> Cc: Stefano Babic <sbabic@denx.de>
> >>> Cc: Vagrant Cascadian <vagrant@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@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

The code for ehci-mx5 DM/DTS conversion was based on ehci-mx6. There is
a patch developed by you - SHA1:
501547cec1f7f0438cae388a104ff60f18576c01 which provides a partial DT
conversion. 

On top of that is another patch - SHA1:
1198a104d37b10064cd90f36d472787d549eda02 developed by Igor, which adds
even more hacks for i.MX7.

That is what we do have now in-tree for iMX6/iMX7.



Since the last ping for this patch (6+ months) we do have a regression
(just not usable USB) for some iMX53 boards. This patch fixes them.

Why are you reluctant to accept the fix? It is similar to what was
added for iMX7.

> , or even
> better, solve the TODO there altogether.

Please correct me if I did not understood you correctly:

To fix regression on i.MX53 boards (with applying this patch) you do
recommend to look for out of tree patches for i.MX6/i.MX7 and solve the
TODO for i.MX6/i.MX7?


> 
> [...]




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200226/2550f1cb/attachment.sig>

  reply	other threads:[~2020-02-26  9:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-20 20:53 [U-Boot] [PATCH] usb: ehci-mx5: Fix bus enumeration for DM case Marek Vasut
2019-06-24 12:09 ` Lukasz Majewski
2020-02-24 15:28   ` Lukasz Majewski
2020-02-25 18:01     ` Marek Vasut
2020-02-26  9:16       ` Lukasz Majewski [this message]
2020-02-28 23:43         ` Marek Vasut

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=20200226101628.7e00d64a@jawa \
    --to=lukma@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.