Nico Huber (nico.huber(a)secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1078
-gerrit
commit 8141a15f6aa96be6c388421fa190950cfbaf9f55
Author: Nico Huber <nico.huber(a)secunet.com>
Date: Mon May 21 14:56:21 2012 +0200
libpayload: Correct port power settings for EHCI root hub
Enable power on EHCI root hub ports only if the controller supports it.
Wait 20ms for the power to become stable.
Change-Id: I8897756ed2bfcb88408fe5e9f9e3f8af5dd900ac
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
payloads/libpayload/drivers/usb/ehci_private.h | 1 +
payloads/libpayload/drivers/usb/ehci_rh.c | 13 ++++++++++++-
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/ehci_private.h b/payloads/libpayload/drivers/usb/ehci_private.h
index 6fa5f03..8ac15b3 100644
--- a/payloads/libpayload/drivers/usb/ehci_private.h
+++ b/payloads/libpayload/drivers/usb/ehci_private.h
@@ -49,6 +49,7 @@ typedef volatile u32 portsc_t;
typedef volatile struct {
#define HCS_NPORTS_MASK 0xf
+#define HCS_PORT_POWER_CONTROL 0x10
u8 caplength;
u8 res1;
u16 hciversion;
diff --git a/payloads/libpayload/drivers/usb/ehci_rh.c b/payloads/libpayload/drivers/usb/ehci_rh.c
index aeead3b..5f92bd7 100644
--- a/payloads/libpayload/drivers/usb/ehci_rh.c
+++ b/payloads/libpayload/drivers/usb/ehci_rh.c
@@ -159,10 +159,21 @@ ehci_rh_init (usbdev_t *dev)
debug("root hub has %x ports\n", RH_INST(dev)->n_ports);
+ /* If the host controller has port power control, enable power on
+ * all ports and wait 20ms.
+ */
+ if (EHCI_INST(dev->controller)->capabilities->hcsparams
+ & HCS_PORT_POWER_CONTROL) {
+ debug("host controller has port power control, "
+ "giving power to all ports.\n");
+ for (i=0; i < RH_INST(dev)->n_ports; i++)
+ RH_INST(dev)->ports[i] |= P_PP;
+ }
+ mdelay(20); // ehci spec 2.3.9
+
RH_INST(dev)->devices = malloc(RH_INST(dev)->n_ports * sizeof(int));
for (i=0; i < RH_INST(dev)->n_ports; i++) {
RH_INST(dev)->devices[i] = -1;
- RH_INST(dev)->ports[i] |= P_PP;
ehci_rh_scanport(dev, i);
}
Nico Huber (nico.huber(a)secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1075
-gerrit
commit 77727940b54e5fe4daafa21e638951f2fb2162f2
Author: Nico Huber <nico.huber(a)secunet.com>
Date: Mon May 21 14:41:49 2012 +0200
libpayload: Remove orphaned delay from OHCI USB driver
This removes a synthetic delay of 5ms from every OHCI USB command. A delay
here seems to be of no use and first tests have shown no glitches.
Change-Id: Ie72b2d49e6734345708f04f3f7b86bacc7926108
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
payloads/libpayload/drivers/usb/ohci.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c
index fa7db3a..830542e 100644
--- a/payloads/libpayload/drivers/usb/ohci.c
+++ b/payloads/libpayload/drivers/usb/ohci.c
@@ -213,7 +213,6 @@ wait_for_ed(usbdev_t *dev, ed_t *head)
(((td_t*)phys_to_virt(head->head_pointer & ~3))->config & TD_CC_MASK) >> TD_CC_SHIFT);
mdelay(1);
}
- mdelay(5);
#if 0
/* XXX: The following debugging code may follow invalid lists and
* cause a reboot.
Nico Huber (nico.huber(a)secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1071
-gerrit
commit 3e0c6641a94dbcb652f9283b4b769c56c0d9829a
Author: Nico Huber <nico.huber(a)secunet.com>
Date: Mon May 21 14:01:52 2012 +0200
libpayload: Remove orphaned delay from USB mass storage
This removes a synthetic delay of 10ms from every mass storage command.
A delay here seems to be of no use and first tests have only shown a
huge speed increase.
Change-Id: Ida7423229373ec521d4326c5467a3f518b76149c
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
payloads/libpayload/drivers/usb/usbmsc.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/usbmsc.c b/payloads/libpayload/drivers/usb/usbmsc.c
index e19b2a6..8d57736 100644
--- a/payloads/libpayload/drivers/usb/usbmsc.c
+++ b/payloads/libpayload/drivers/usb/usbmsc.c
@@ -194,7 +194,6 @@ execute_command (usbdev_t *dev, cbw_direction dir, const u8 *cb, int cblen,
reset_transport (dev);
return 1;
}
- mdelay (10);
if (buflen > 0) {
if (dir == cbw_direction_data_in) {
if (dev->controller->