[U-Boot-Users] Contribution: EHCI USB HC driver

All,
Juniper Networks wrote a driver for the EHCI UCB HC and I'd like to contribute that back if there's interest. Besides a new piece of code, this also changes some of the common USB code so that high-speed devices and split-transactions are supported.
At this time the EHCI driver is exclusive in that there's no support for having the companion controller active. I presume this is one of the major themes for adding EHCI support, so that's definitely open for discussion.
Attached a patch with the common code changes as well as the EHCI driver itself. The patch does not contain any changes to get it built (i.e. included in libusb, etc). A seasoned U-Boot developer should have no problem playing with it, while the details are being worked out for getting this alongside a USB 1.1 HC driver.
Comments and suggestions are welcome. Please let me know how best to move forward with adding this to U-Boot, provided there's interest. FYI,

Hi Marcel,
Juniper Networks wrote a driver for the EHCI UCB HC and I'd like to contribute that back if there's interest. Besides a new piece of code, this also changes some of the common USB code so that high-speed devices and split-transactions are supported.
Cool!
At this time the EHCI driver is exclusive in that there's no support for having the companion controller active. I presume this is one of the major themes for adding EHCI support, so that's definitely open for discussion.
Attached a patch with the common code changes as well as the EHCI driver itself. The patch does not contain any changes to get it built (i.e. included in libusb, etc). A seasoned U-Boot developer should have no problem playing with it, while the details are being worked out for getting this alongside a USB 1.1 HC driver.
Glancing over the patch I fail to see what hardware and configuration you are using for your development. Can you enlighten us on this?
Comments and suggestions are welcome. Please let me know how best to move forward with adding this to U-Boot, provided there's interest. FYI,
I think this will have to go through Markus' USB tree, so I put him on CC. Markus, could you perhaps add a branch in your repository to give this (and the upcoming) patches a better visibility even during development?
I am actually pretty happy, that finally someone is actively starting to put effort into moving the usb support in U-Boot forward - and before this gets interpreted wrongly - in my opinion Markus does a great job as a USB maintainer and I definitely do not want lessen his work here, but as we talked about a few times, most of his effort got sucked up in maintaining the current code base.
So thanks again Marcel and I am looking forward to a shiny USB support in U-Boot ;)
Cheers Detlev

On Feb 29, 2008, at 9:24 AM, Detlev Zundel wrote:
Hi Marcel,
Juniper Networks wrote a driver for the EHCI UCB HC and I'd like to contribute that back if there's interest. Besides a new piece of code, this also changes some of the common USB code so that high-speed devices and split-transactions are supported.
Cool!
At this time the EHCI driver is exclusive in that there's no support for having the companion controller active. I presume this is one of the major themes for adding EHCI support, so that's definitely open for discussion.
Attached a patch with the common code changes as well as the EHCI driver itself. The patch does not contain any changes to get it built (i.e. included in libusb, etc). A seasoned U-Boot developer should have no problem playing with it, while the details are being worked out for getting this alongside a USB 1.1 HC driver.
Glancing over the patch I fail to see what hardware and configuration you are using for your development. Can you enlighten us on this?
Ah, good point. This driver was developed for the Philips ISP156x. The configuration is derived from the MPC8555 configuration. It's a customer board, so there's no way for me to point to some URL...
So thanks again Marcel and I am looking forward to a shiny USB support in U-Boot ;)
You're welcome :-)

Hi Marcel,
Marcel Moolenaar marcelm@juniper.net writes:
On Feb 29, 2008, at 9:24 AM, Detlev Zundel wrote:
Glancing over the patch I fail to see what hardware and configuration you are using for your development. Can you enlighten us on this?
Ah, good point. This driver was developed for the Philips ISP156x. The configuration is derived from the MPC8555 configuration. It's a customer board, so there's no way for me to point to some URL...
Are there any plans at this point for merging the support for this board? I'd really like to merge this driver, but on the other hand it make little sense until there code that actually uses it!
Best regards
Markus Klotzbücher
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de

Hi Markus,
On Saturday 01 March 2008, Markus Klotzbücher wrote:
Glancing over the patch I fail to see what hardware and configuration you are using for your development. Can you enlighten us on this?
Ah, good point. This driver was developed for the Philips ISP156x. The configuration is derived from the MPC8555 configuration. It's a customer board, so there's no way for me to point to some URL...
Are there any plans at this point for merging the support for this board? I'd really like to merge this driver, but on the other hand it make little sense until there code that actually uses it!
We have other boards with EHCI support that could be used for testing (e.g. Sequoia). But the original board where it is know to work would be best of course.
Best regards, Stefan
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================

On Mar 1, 2008, at 12:38 AM, Markus Klotzbücher wrote:
Hi Marcel,
Marcel Moolenaar marcelm@juniper.net writes:
On Feb 29, 2008, at 9:24 AM, Detlev Zundel wrote:
Glancing over the patch I fail to see what hardware and configuration you are using for your development. Can you enlighten us on this?
Ah, good point. This driver was developed for the Philips ISP156x. The configuration is derived from the MPC8555 configuration. It's a customer board, so there's no way for me to point to some URL...
Are there any plans at this point for merging the support for this board? I'd really like to merge this driver, but on the other hand it make little sense until there code that actually uses it!
Contributing the EHCI driver is one such plan :-)
The board is proprietary. Not everything will be contributed, because it will be of no use to anyone (not to mention that we probably did things to the code that would not be acceptable if it were to be part of U-Boot. :-)
The plan is to simply offer code for contribution when we think it could be useful for all parties concerned and let the U-Boot community decide whether they want it or not. How much will be contributed in the end, I don't know.

Hi Marcel, Detlev,
I somehow missed this mail, thanks for following up!
Detlev Zundel dzu@denx.de writes:
Juniper Networks wrote a driver for the EHCI UCB HC and I'd like to contribute that back if there's interest. Besides a new piece of code, this also changes some of the common USB code so that high-speed devices and split-transactions are supported.
Cool!
Very nice indeed, thanks for sharing Marcel!
At this time the EHCI driver is exclusive in that there's no support for having the companion controller active. I presume this is one of the major themes for adding EHCI support, so that's definitely open for discussion.
This is definitely an issue, but not one that can or should be solved for the USB subsystem solely. What we really need to implement such features in a clean manner is a well thought out U-Boot Driver Model...
Attached a patch with the common code changes as well as the EHCI driver itself. The patch does not contain any changes to get it built (i.e. included in libusb, etc). A seasoned U-Boot developer should have no problem playing with it, while the details are being worked out for getting this alongside a USB 1.1 HC driver.
Nice work! One thing we definitely will want to do is separate the low-level board/cpu specific and generic ehci code such as done for the generic ohci driver. From a first look it doesn't seem this would be too hard.
I think this will have to go through Markus' USB tree, so I put him on CC. Markus, could you perhaps add a branch in your repository to give this (and the upcoming) patches a better visibility even during development?
Yes, I'll do that.
I am actually pretty happy, that finally someone is actively starting to put effort into moving the usb support in U-Boot forward - and before this gets interpreted wrongly - in my opinion Markus does a great job as a USB maintainer and I definitely do not want lessen his work here, but as we talked about a few times, most of his effort got sucked up in maintaining the current code base.
;-) No offence taken! I'm also glad to see some effort in this direction!
Best regards
Markus Klotzbücher
-- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de

On Mar 1, 2008, at 12:35 AM, Markus Klotzbücher wrote:
At this time the EHCI driver is exclusive in that there's no support for having the companion controller active. I presume this is one of the major themes for adding EHCI support, so that's definitely open for discussion.
This is definitely an issue, but not one that can or should be solved for the USB subsystem solely. What we really need to implement such features in a clean manner is a well thought out U-Boot Driver Model...
Agreed. But for USB it also goes beyond just a driver model. In particular we have: usb_lowlevel_init() usb_lowlevel_stop() submit_bulk_msg() submit_control_msg() submit_int_msg()
The functionality of the usb_lowlevel_*() functions will need to be addressed by a driver abstraction. This leaves the submit_*() functions. Those should be abstracted in the USB stack itself and be directed to the HC driver to which the USB device is attached. Something like function pointers in struct usb_device should do the trick...
Attached a patch with the common code changes as well as the EHCI driver itself. The patch does not contain any changes to get it built (i.e. included in libusb, etc). A seasoned U-Boot developer should have no problem playing with it, while the details are being worked out for getting this alongside a USB 1.1 HC driver.
Nice work! One thing we definitely will want to do is separate the low-level board/cpu specific and generic ehci code such as done for the generic ohci driver. From a first look it doesn't seem this would be too hard.
Agreed on both counts.
participants (4)
-
Detlev Zundel
-
Marcel Moolenaar
-
Markus Klotzbücher
-
Stefan Roese