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 12:09:35 +0100 [thread overview]
Message-ID: <201401071209.35378.marex@denx.de> (raw)
In-Reply-To: <CAFp+6iE5ZESfUXMchLwhVniXFFjp6hyGiNtyB0METqgi_8EDBQ@mail.gmail.com>
On Tuesday, January 07, 2014 at 10:37:24 AM, Vivek Gautam wrote:
[...]
> > How I'd do this:
> > 1) Rename all these submit_*() functions to usb_submit_*()
> > 2) Rename all five usb_*() functions to ehci_*() resp. xhci_*()
>
> This will happen in each controller drivers (ehci/xhci) which would
> eventually be
> called fro upper translation layer you mentioned below, right ?
Yes. Actually, thinking of this some more, to make the transition more fine-
grained, we might go about it like this even:
1) Rename all these submit_*() functions to usb_submit_*()
-> This one stay the same, just rename them all so they're consistent.
2) Rename all five usb_*() functions to ehci_*() resp. xhci_*()
-> In here, we should already have a fetus of the translation layer.
My idea here would be to implement drivers/usb/host/usb_trans.c, which
would implement all five usb_*() functions only as a wrappers. Each of
the five function would contain #ifdef and call the respective xhci_*()
or ehci_*() or [ou]hci_*() implementation depending on the configuration.
This would preserve the current behavior, which would be nice.
3) Implement real translation layer
-> Here, the usb_trans.c would need to be extended to track all the
controllers in a linked list. The usb core code would not change much,
all of the logic would live in this usb_trans.c .
-> Here, the usb_trans.c will no longer contain any of the ifdefs from
step 2), but it will likely turn out you would need to have ifdefs to
prevent triggering GCC complaint about missing definition of a functions.
I don't want to impose my ideas on you too hard, so please push back if you see
some obvious flaws or have a much better idea!
> > 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.
>
> Ok, i can understand this. Will try to put up code for this.
Thank you, this is much appreciated !
> > 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.
>
> Yeah, right. We won't need the controller count in this case.
Yes, nonexistent preprocessor symbol is a good preprocessor symbol :)
> >> 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.
>
> Ok, so first i will take up EHCI and XHCI then, and later 'll see the OHCI
> part.
Don't forget UHCI too. I think you will need to tackle all four at once, but it
should be mostly manual work, nothing too frightening. I think your predecessors
rectified the API nicely already :)
Best regards,
Marek Vasut
prev parent reply other threads:[~2014-01-07 11:09 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
2014-01-07 9:37 ` Vivek Gautam
2014-01-07 11:09 ` Marek Vasut [this message]
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=201401071209.35378.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