libpayload: Add init() function to hci_t and rework uhci_reset()

uhci_reset() differs in semantics compared to the other HCI's reset()
implementations. uhci_reset() does some initialization work after a
controller reset. So move the initialization part to a new function,
uhci_reinit(), which get's exported through a new entry in hci_t:
hci_t.init().

Warning: This breaks code that relies on the current, special,
counterintuitive behaviour of uhci_reset(). If one wants a working host
controller after calling hci_t.reset(), he should call hci_t.init()
afterwards.

Change-Id: Ia7ce80865d12d11157645ce251f77f349f8e3c34
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/1851
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Nico Huber
2012-11-12 16:20:32 +01:00
committed by Ronald G. Minnich
parent aaa212d17d
commit 6e711c6a97
5 changed files with 26 additions and 0 deletions

View File

@@ -58,6 +58,11 @@ ohci_reset (hci_t *controller)
mdelay(10); /* wait 10ms */
}
static void
ohci_reinit (hci_t *controller)
{
}
#ifdef USB_DEBUG
/* Section 4.3.3 */
static const char *completion_codes[] = {
@@ -107,6 +112,7 @@ ohci_init (pcidev_t addr)
controller->start = ohci_start;
controller->stop = ohci_stop;
controller->reset = ohci_reset;
controller->init = ohci_reinit;
controller->shutdown = ohci_shutdown;
controller->bulk = ohci_bulk;
controller->control = ohci_control;