History log of /haiku/src/add-ons/kernel/busses/usb/ehci_hardware.h
Revision Date Author Comments
# c91002a1 12-Mar-2018 Jérôme Duval <jerome.duval@gmail.com>

Revert "EHCI USB: process the extended capabilities chain"

This reverts commit 137135a10dc6322773be9da67861c05f53b709a5.

Change-Id: I6e6ef1933b3b3f5eda7278d37b673eefe2867c2a


# 137135a1 13-Dec-2014 Jérôme Duval <jerome.duval@gmail.com>

EHCI USB: process the extended capabilities chain

...instead of the first one only.


# 63cf3cfa 31-Aug-2014 Michael Lotz <mmlr@mlotz.ch>

EHCI: Simplify short packet logic to use alternate pointer.

The alternate pointer is the software equivalent of the alternate
physical address in the hardware queue head part. The controller
follows that path, so we can follow the alternate pointer as well.
Simplifies and generalizes the logic.


# 97f865f7 03-Dec-2013 Jérôme Duval <jerome.duval@gmail.com>

Avoid undefined behavior by using unsigned int instead of int.

* 1 << 31, 2 << 30, 3 << 30 replaced by 1U << 31, 2U << 30 or 3U << 30.


# d8b4cfc9 04-Aug-2012 Rene Gollent <anevilyak@gmail.com>

Get USB functional on x86-64.

- Various changes to printf format specifiers to make them 32/64 safe.
- Adjustments to various descriptor structures since addr_t is not 32-bit
on x86-64, and consequently this breaks the physical structure that's
expected. Also adjusted padding to accomodate 32-byte boundaries when
64-bit pointers are in use.
- Adjustments to make use of phys_addr_t where needed.


# ef2eaedc 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Account for full-/lowspeed errors and ensure an error is set.

For full- and lowspeed devices the unused ping status bit works as an
additional error bit (albeit it's so generic that it isn't really
useful). Include that bit when the error counter counts down to zero.

Also ensure that an error is returned if the error counter reaches
zero, but print a warning if none of the describing bits are set.


# 77660b03 23-Aug-2011 Jérôme Duval <korli@users.berlios.de>

* threshold higher bit means a full frame. Also use the threshold for micro frames instead of frames.
* introduces fNextStartingFrame to keep track of the next frame to use on next submit.
* set the IOC bit for the last ITD
* computes multiply field of the ITD based on the packed size (1, 2 or 3).
* use locking around linking of ITD
* free descriptors on errors
* on finishing, whenever a non success status is found, set actual length to zero
* on finishing, when copying data to the Transfer object, copy starting on packet boundaries (skipping unused bytes).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42679 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c0b58c07 22-May-2011 Jérôme Duval <korli@users.berlios.de>

* added some EHCI definitions (specification 1.1)
* enable per-port change events when available


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41661 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3bb57042 15-May-2011 Michael Lotz <mmlr@mlotz.ch>

Introduce workaround for the (documented) bug with ATI/AMD SB600 and early SB700
periodic list cache. This workaround is based on similar patches in NetBSD and
Linux and disables the (Advanced) Periodic List Cache on the affected devices
using ATI/AMD specifc registers (as documented in the corresponding AMD
register reference guide).
Also remove a ton of stray whitespace introduced by the isochronous patches.
Please take more care the next time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41512 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7df33d91 10-May-2011 Jérôme Duval <korli@users.berlios.de>

* Implement inbound isochronous transfer for EHCI, based on UHCI implementation.
* changes next_log to their actual type instead of void*
* the field this_phy now includes the item type, it simplifies things.
* isochronous transfer descriptors are linked in the periodic frame list first,
and points to existing interrupt transfer descriptors.

This is still work in progress. Yet it's worth committing as it doesn't seem to
have impacts, and is required for the UVC SoC project. Tested basically with
usb_webcam to receive UVC stream headers.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41424 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4085ff6f 28-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Check for and discard not enabled interrupts in EHCI.
* Simplify acknowledging interrupts a bit.

Might help with bug #2083 in case the controller would interrupt on a port
change or frame list rollover even though those aren't enabled by us.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29354 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 856c49e6 06-Jun-2008 Michael Lotz <mmlr@mlotz.ch>

Only check the explicitly enabled interrupts in EHCI. Otherwise we might steal
a shared interrupt from someone else.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25822 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 33574eaf 14-Apr-2008 Michael Lotz <mmlr@mlotz.ch>

Exclude the frame list rollover interrupt from the interrupts we are interested
in. We do not enable this interrupt and if we still "handle" it in our
interrupt handler we might prevent the interrupt from reaching the real intended
handler in a shared interrupt setup. Not sure if this could have happend at
all, but this is more correct in any case.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24965 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 10b06464 21-Nov-2007 Michael Lotz <mmlr@mlotz.ch>

Implemented split transactions for control and bulk pipes in EHCI.
With this it is possible to use low/fullspeed (USB 1.1) devices below USB 2.0 Hubs.
Note though that you cannot yet use mice or keyboards attached to USB 2.0 Hubs as split transactions for interrupt pipes are still missing.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ed1eff2f 17-Nov-2007 Michael Lotz <mmlr@mlotz.ch>

* Implement interrupt transfers in EHCI
* Uses a "collapsed binary tree" (for lack of a better name) to support the different intervals
* Remove a leftover variable declaration that was hiding error conditions away...
* Some cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22942 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17f83b21 24-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Switched from the old v2 callback status codes to the new v3 codes
This means that the usb_callback_func now takes a status_t instead of a uint32 status.
Also the error codes are now different. I don't see this as a real problem in binary compatibility, as the status codes were never really documented and most drivers just assumed that a nonzero status meant an error.
Source compatibility breaks for callback functions and error defines. I fixed (hopefully) all places in the tree that are currenty included in the image and affected by the change.
* Corrected error reporting in UHCI and EHCI using the new status codes.
* Fixed a memory leak in EHCI where the async advance interrupt was not triggered in time.
* Fixed another race condition in usb_raw that could cause a crash when a device is removed while a transfer is pending.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18916 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8a278a1b 24-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Fixing my previous attempt at fixing cookie handling. Device addresses cannot be used, since there may be devices with the same address across different busses. A linked list of usb_driver_cookies is maintained now that relates devices and cookies.
* Fixed endpoint halt clearing. The data toggle has to be reset when we clear a stall.
* Now using up to B_PAGE_SIZE * 4 sized buffers in EHCI. They are split automatically by the host controller. This further pushes throughput.
* Optimize memory allocator settings for the above case. Enlarging it's managed space to 1MB
* Ignore the transaction error bit in EHCI. It is only of informational character as it also idicates errors that were recovered automatically. If an unrecoverable error occures, other bits will indicate this.
* Fixed some more print formats in debug output.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18915 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dff0c634 15-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented transfer finishing in EHCI
* Implemented actual length calculation in EHCI
* Implemented bulk transfers in EHCI
* Implemented queue freeing in EHCI
* Added extended buffer pointers to the EHCI structs, necessary when the controller supports 64bit
* Fixed debug output and removed warnings due to wrong print format

Control and bulk transfers are now working nicely for EHCI. This means that I can now get pictures from my camera with USB 2.0 speed. Note though that many things still are unimplemented (isochronous transfers, split transactions, interrupt transfers, queue chaches per pipe, ...). But it's certainly a nice step forward :-).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18855 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f452f9dc 14-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented most qTD and qH functions for EHCI async transfers.
* Implementing control and bulk (async) transfers. They don't work yet though.
* Corrected the legacy support handling in EHCI
* Fixed the bit mask for total bytes in qTDs and added the data toggle bit
* Changed the boolean low speed flags to usb_speed enum that allows for low, full and highspeed

Also wrote a memory allocator that takes over memory management from the stack. It is similar to a buddy allocator. This does on the one hand remove some ugly code from the stack and is on the other hand far more scalable than the previous free list approach. This scalability is needed for proper EHCI support where buffers can go up to a size of 5 pages. The allocator is not perfect and it's memory overhead is quite high compared to the managed memory (depends on the managed block sizes), but it's quik and works well so far.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18849 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ffe3f107 27-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Redisigned some of the USB Stack. Unified constructors, removed redundant functions and moved some other functions around
* Implemented the EHCIRootHub
* Reworked UHCIRootHub to be more of a utility class and moved the actual work into the UHCI BusManager
* Implemented port reset in EHCI. Ports with low and fullspeed devices are now correctly handed over to the companion host controller.

Attachs and detachs as well as port resetting / enabling works now in EHCI. Only the actual data transfers are missing thereafter ;-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18656 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 01595708 26-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Changed EHCI register access from port to memory mapped io (which is required)
* Added individual register operations for operational and capability registers
* Added resetting the host controller which appearantly actually works

Note that you shouldn't install the ehci module if you want uhci to work.
It disables the companion host controller drivers (uhci and ohci) because it takes port ownership and does not yet give it back for low and fullspeed devices.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18648 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e857d24 25-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Adding skeleton EHCI driver. Some parts filled from the specs and the UHCI driver.
* Corrected some errors I found while reading UHCI.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18626 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 63cf3cfa115b97cebcef542609aaa4e13dfc151b 31-Aug-2014 Michael Lotz <mmlr@mlotz.ch>

EHCI: Simplify short packet logic to use alternate pointer.

The alternate pointer is the software equivalent of the alternate
physical address in the hardware queue head part. The controller
follows that path, so we can follow the alternate pointer as well.
Simplifies and generalizes the logic.


# 97f865f72a5e3084e47caa02d8749b10f0c201b9 03-Dec-2013 Jérôme Duval <jerome.duval@gmail.com>

Avoid undefined behavior by using unsigned int instead of int.

* 1 << 31, 2 << 30, 3 << 30 replaced by 1U << 31, 2U << 30 or 3U << 30.


# d8b4cfc9829119291e68cfe0152c239fd8850b3d 04-Aug-2012 Rene Gollent <anevilyak@gmail.com>

Get USB functional on x86-64.

- Various changes to printf format specifiers to make them 32/64 safe.
- Adjustments to various descriptor structures since addr_t is not 32-bit
on x86-64, and consequently this breaks the physical structure that's
expected. Also adjusted padding to accomodate 32-byte boundaries when
64-bit pointers are in use.
- Adjustments to make use of phys_addr_t where needed.


# ef2eaedc2ec5332905a4784a38283a2d83234f3a 04-Dec-2011 Michael Lotz <mmlr@mlotz.ch>

Account for full-/lowspeed errors and ensure an error is set.

For full- and lowspeed devices the unused ping status bit works as an
additional error bit (albeit it's so generic that it isn't really
useful). Include that bit when the error counter counts down to zero.

Also ensure that an error is returned if the error counter reaches
zero, but print a warning if none of the describing bits are set.


# 77660b03e844ff20dc766a3033f4ee0d776983fb 23-Aug-2011 Jérôme Duval <korli@users.berlios.de>

* threshold higher bit means a full frame. Also use the threshold for micro frames instead of frames.
* introduces fNextStartingFrame to keep track of the next frame to use on next submit.
* set the IOC bit for the last ITD
* computes multiply field of the ITD based on the packed size (1, 2 or 3).
* use locking around linking of ITD
* free descriptors on errors
* on finishing, whenever a non success status is found, set actual length to zero
* on finishing, when copying data to the Transfer object, copy starting on packet boundaries (skipping unused bytes).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42679 a95241bf-73f2-0310-859d-f6bbb57e9c96


# c0b58c071f690fd5f5bbcb20a4b54853a624b575 22-May-2011 Jérôme Duval <korli@users.berlios.de>

* added some EHCI definitions (specification 1.1)
* enable per-port change events when available


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41661 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3bb5704280cf288802cde939808949eb5ed6479e 15-May-2011 Michael Lotz <mmlr@mlotz.ch>

Introduce workaround for the (documented) bug with ATI/AMD SB600 and early SB700
periodic list cache. This workaround is based on similar patches in NetBSD and
Linux and disables the (Advanced) Periodic List Cache on the affected devices
using ATI/AMD specifc registers (as documented in the corresponding AMD
register reference guide).
Also remove a ton of stray whitespace introduced by the isochronous patches.
Please take more care the next time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41512 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7df33d912b05c8d986287bec208df68c595c24a8 10-May-2011 Jérôme Duval <korli@users.berlios.de>

* Implement inbound isochronous transfer for EHCI, based on UHCI implementation.
* changes next_log to their actual type instead of void*
* the field this_phy now includes the item type, it simplifies things.
* isochronous transfer descriptors are linked in the periodic frame list first,
and points to existing interrupt transfer descriptors.

This is still work in progress. Yet it's worth committing as it doesn't seem to
have impacts, and is required for the UVC SoC project. Tested basically with
usb_webcam to receive UVC stream headers.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41424 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4085ff6fcfa78eae897d339e97a2956de475a3f7 28-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

* Check for and discard not enabled interrupts in EHCI.
* Simplify acknowledging interrupts a bit.

Might help with bug #2083 in case the controller would interrupt on a port
change or frame list rollover even though those aren't enabled by us.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29354 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 856c49e614420148f8fe9471e33baf1e97cf6a9e 06-Jun-2008 Michael Lotz <mmlr@mlotz.ch>

Only check the explicitly enabled interrupts in EHCI. Otherwise we might steal
a shared interrupt from someone else.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25822 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 33574eaf6e1efe1f43a89fdbfc94ff5293869187 14-Apr-2008 Michael Lotz <mmlr@mlotz.ch>

Exclude the frame list rollover interrupt from the interrupts we are interested
in. We do not enable this interrupt and if we still "handle" it in our
interrupt handler we might prevent the interrupt from reaching the real intended
handler in a shared interrupt setup. Not sure if this could have happend at
all, but this is more correct in any case.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24965 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 10b06464222e1b41e95bcd0c8476b8677aa91a23 21-Nov-2007 Michael Lotz <mmlr@mlotz.ch>

Implemented split transactions for control and bulk pipes in EHCI.
With this it is possible to use low/fullspeed (USB 1.1) devices below USB 2.0 Hubs.
Note though that you cannot yet use mice or keyboards attached to USB 2.0 Hubs as split transactions for interrupt pipes are still missing.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ed1eff2fec7b126e8032ef19357cb7aceda2c388 17-Nov-2007 Michael Lotz <mmlr@mlotz.ch>

* Implement interrupt transfers in EHCI
* Uses a "collapsed binary tree" (for lack of a better name) to support the different intervals
* Remove a leftover variable declaration that was hiding error conditions away...
* Some cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22942 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 17f83b219d63eae4de462d6868e7d26ad6c3949e 24-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Switched from the old v2 callback status codes to the new v3 codes
This means that the usb_callback_func now takes a status_t instead of a uint32 status.
Also the error codes are now different. I don't see this as a real problem in binary compatibility, as the status codes were never really documented and most drivers just assumed that a nonzero status meant an error.
Source compatibility breaks for callback functions and error defines. I fixed (hopefully) all places in the tree that are currenty included in the image and affected by the change.
* Corrected error reporting in UHCI and EHCI using the new status codes.
* Fixed a memory leak in EHCI where the async advance interrupt was not triggered in time.
* Fixed another race condition in usb_raw that could cause a crash when a device is removed while a transfer is pending.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18916 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8a278a1bb7c57c701210c7ded6b5b8dca82e293f 24-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Fixing my previous attempt at fixing cookie handling. Device addresses cannot be used, since there may be devices with the same address across different busses. A linked list of usb_driver_cookies is maintained now that relates devices and cookies.
* Fixed endpoint halt clearing. The data toggle has to be reset when we clear a stall.
* Now using up to B_PAGE_SIZE * 4 sized buffers in EHCI. They are split automatically by the host controller. This further pushes throughput.
* Optimize memory allocator settings for the above case. Enlarging it's managed space to 1MB
* Ignore the transaction error bit in EHCI. It is only of informational character as it also idicates errors that were recovered automatically. If an unrecoverable error occures, other bits will indicate this.
* Fixed some more print formats in debug output.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18915 a95241bf-73f2-0310-859d-f6bbb57e9c96


# dff0c634db8e3d8210c08419fa2795a355352714 15-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented transfer finishing in EHCI
* Implemented actual length calculation in EHCI
* Implemented bulk transfers in EHCI
* Implemented queue freeing in EHCI
* Added extended buffer pointers to the EHCI structs, necessary when the controller supports 64bit
* Fixed debug output and removed warnings due to wrong print format

Control and bulk transfers are now working nicely for EHCI. This means that I can now get pictures from my camera with USB 2.0 speed. Note though that many things still are unimplemented (isochronous transfers, split transactions, interrupt transfers, queue chaches per pipe, ...). But it's certainly a nice step forward :-).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18855 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f452f9dc783e647ece105a379564d9ce6a05de2b 14-Sep-2006 Michael Lotz <mmlr@mlotz.ch>

* Implemented most qTD and qH functions for EHCI async transfers.
* Implementing control and bulk (async) transfers. They don't work yet though.
* Corrected the legacy support handling in EHCI
* Fixed the bit mask for total bytes in qTDs and added the data toggle bit
* Changed the boolean low speed flags to usb_speed enum that allows for low, full and highspeed

Also wrote a memory allocator that takes over memory management from the stack. It is similar to a buddy allocator. This does on the one hand remove some ugly code from the stack and is on the other hand far more scalable than the previous free list approach. This scalability is needed for proper EHCI support where buffers can go up to a size of 5 pages. The allocator is not perfect and it's memory overhead is quite high compared to the managed memory (depends on the managed block sizes), but it's quik and works well so far.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18849 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ffe3f107c4ae65ec52128bb36115779fe07a01c0 27-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Redisigned some of the USB Stack. Unified constructors, removed redundant functions and moved some other functions around
* Implemented the EHCIRootHub
* Reworked UHCIRootHub to be more of a utility class and moved the actual work into the UHCI BusManager
* Implemented port reset in EHCI. Ports with low and fullspeed devices are now correctly handed over to the companion host controller.

Attachs and detachs as well as port resetting / enabling works now in EHCI. Only the actual data transfers are missing thereafter ;-)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18656 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 01595708f3ff37e1c86f32548fc48a7a6a5d4be7 26-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Changed EHCI register access from port to memory mapped io (which is required)
* Added individual register operations for operational and capability registers
* Added resetting the host controller which appearantly actually works

Note that you shouldn't install the ehci module if you want uhci to work.
It disables the companion host controller drivers (uhci and ohci) because it takes port ownership and does not yet give it back for low and fullspeed devices.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18648 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9e857d24ca41743874f6b3c08bb0c35f53df5763 25-Aug-2006 Michael Lotz <mmlr@mlotz.ch>

* Adding skeleton EHCI driver. Some parts filled from the specs and the UHCI driver.
* Corrected some errors I found while reading UHCI.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18626 a95241bf-73f2-0310-859d-f6bbb57e9c96