public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 8/8] config: smdk5420: Enable support for multiple XHCI controllers
Date: Tue, 7 Jan 2014 10:14:31 +0100	[thread overview]
Message-ID: <201401071014.32117.marex@denx.de> (raw)
In-Reply-To: <CAFp+6iF+RQjNWOx5s5zacY9T9RHz+eonP87tPWf4bvKq+WWP+Q@mail.gmail.com>

On Tuesday, January 07, 2014 at 09:55:37 AM, Vivek Gautam wrote:
> HI Marek,
> 
> 
> On Mon, Jan 6, 2014 at 9:24 PM, Marek Vasut <marex@denx.de> wrote:
> 
> Thanks for reviewing this. :-)
> 
> > On Monday, January 06, 2014 at 10:29:43 AM, Vivek Gautam wrote:
> >> Update USB_MAX_CONTROLLER_COUNT to be '2' to enable support
> >> for both usb 3.0 controllers on exynos5420.
> >> 
> >> NOTE: To use EHCI on exynos5420, this change will need to be
> >> reverted, since there's only one EHCI controller available on
> >> exynos5420.
> > 
> > OK, this I seriously dislike. Hence a question ... my feeling is the XHCI
> > and EHCI code for handling multiple controllers and multiple ports is
> > almost the same. Can this code be adjusted to handle both EHCI and XHCI
> > controllers indiscriminately ?
> 
> The controller count is actually used by the usb core (common/usb*)
> framework, right ?
> There's a need to add support for multiple controller types actually
> (so that EHCI
> and XHCI can be enabled simultaneously). Is that what you mean here ?

Yes. That should not be too much of a problem though.

> > This would result in having CONFIG_USB_MAX_CONTROLLER_COUNT 3 on this
> > board and being able to use both EHCI and XHCI . Would this be possible
> > for you to implement please ? Thanks !
> 
> Ok, so you mean get all the controllers present on the board (EHCI and
> XHCI) setup.

Yes

> I think right now, the way USB core handles the controller count is
> quite different, so
> that 'CONFIG_USB_MAX_CONTROLLER_COUNT' helps in probing multiple
> controllers of the same type.

The only problem is, that both EHCI and XHCI core implement:

submit_control_msg()
submit_bulk_msg()
submit_int_msg()
usb_lowlevel_init()
usb_lowlevel_stop()

How I'd do this:
1) Rename all these submit_*() functions to usb_submit_*()
2) Rename all five usb_*() functions to ehci_*() resp. xhci_*()
3) Implement translation layer, where the common code would still call usb_*()
   and the layer would determine whether to call ehci_*() or xhci_*() call.

Surely, you'd need to change the probe() logic a bit, the controller drivers 
would have to call some "usb_register_driver()" function for each controller. 
This function would generate a new entry in a linked list of all controllers 
registered and would add a flag whether this controller is EHCI or XHCI.

Effectively, this would even remove the need for CONFIG_USB_MAX_CONTROLLER_COUNT 
at all, since you'd be tracking all the USB controllers in the USB core code and 
in a linked list.

> I had plans to add support to use controllers of different types (EHCI
> and XHCI etc) simultaneously.
> But haven't really put a code for that yet.
> Can you suggest some pointers about how would you like to see EHCI and
> XHCI or even OHCI work
> together :-)
> I can take up this.

Thank you, see above please. OHCI might be nastier, but should happen along 
these lines above as well.

Best regards,
Marek Vasut

  reply	other threads:[~2014-01-07  9:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06  9:29 [U-Boot] [PATCH 0/8] Exynos5420: Add support for XHCI controller Vivek Gautam
2014-01-06  9:29 ` [U-Boot] [PATCH 1/8] arm: exynos5420: Fix base address for USBPHY Vivek Gautam
2014-01-06 15:47   ` Marek Vasut
2014-01-06  9:29 ` [U-Boot] [PATCH 2/8] arm: exynos5420: Add base addresses for USB 3.0 Vivek Gautam
2014-01-06 15:47   ` Marek Vasut
2014-01-06  9:29 ` [U-Boot] [PATCH 3/8] dts: exynos5250: Remove explicit device node of 'xhci' Vivek Gautam
2014-01-06 15:47   ` Marek Vasut
2014-01-06  9:29 ` [U-Boot] [PATCH 4/8] config: exynos5: Enable XHCI on all Exynos5 systems Vivek Gautam
2014-01-06 15:47   ` Marek Vasut
2014-01-06  9:29 ` [U-Boot] [PATCH 5/8] usb: xhci-exynos5: Add support for multiple USB 3.0 controllers Vivek Gautam
2014-01-06 15:51   ` Marek Vasut
2014-01-07  9:48     ` Vivek Gautam
2014-01-07  5:30   ` Minkyu Kang
2014-01-07  9:15     ` Vivek Gautam
2014-01-07 10:59       ` Marek Vasut
2014-01-07 11:41         ` Vivek Gautam
2014-01-06  9:29 ` [U-Boot] [PATCH 6/8] dts: exynos5420: Move device node for xhci 2nd controller Vivek Gautam
2014-01-06 15:51   ` Marek Vasut
2014-01-06  9:29 ` [U-Boot] [PATCH 7/8] smdk5420: Correct the vbus gpio configuration for USB controller Vivek Gautam
2014-01-06 15:52   ` Marek Vasut
2014-01-07  6:37     ` Vivek Gautam
2014-01-07  7:49       ` Marek Vasut
2014-01-07  9:03         ` Vivek Gautam
2014-01-07  9:15           ` Marek Vasut
2014-01-06  9:29 ` [U-Boot] [PATCH 8/8] config: smdk5420: Enable support for multiple XHCI controllers Vivek Gautam
2014-01-06 15:54   ` Marek Vasut
2014-01-07  8:55     ` Vivek Gautam
2014-01-07  9:14       ` Marek Vasut [this message]
2014-01-07  9:37         ` Vivek Gautam
2014-01-07 11:09           ` 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=201401071014.32117.marex@denx.de \
    --to=marex@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox