libpayload: Add support for interrupt transfers in OHCI

This adds support for usb interrupt transfers to the OHCI driver.
Basically this enables support for HID keyboard devices.

For each interrupt transfer endpoint, two queues of transfer
descriptors (TDs) are maintained: the first with initialized TDs
is linked to the periodic schedule of the host controller (HC), the
second holds processed TDs which will be polled by the usb class
driver. The HC moves processed TDs from its schedule to a done queue.
We periodically fetch all TDs from the done queue, to put them on the
queue associated with the endpoint, where they can be polled from.
Fully processed TDs (i.e. which have gone throuch all of this) will be
reinitialized and put on the first queue again.

Change-Id: Iaab72c04087b36c9f0f6e539e31b47060c190015
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/1128
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Nico Huber
2012-06-20 14:58:21 +02:00
parent 542fe85da9
commit 274c63e367
2 changed files with 224 additions and 9 deletions

View File

@@ -231,6 +231,7 @@
#define TD_QUEUETYPE_SHIFT 0
#define TD_QUEUETYPE_MASK MASK(TD_QUEUETYPE_SHIFT, 2)
#define TD_QUEUETYPE_ASYNC (0 << TD_QUEUETYPE_SHIFT)
#define TD_QUEUETYPE_INTR (1 << TD_QUEUETYPE_SHIFT)
#define TD_DIRECTION_SHIFT 19
#define TD_DIRECTION_MASK MASK(TD_DIRECTION_SHIFT, 2)