the following patch was just integrated into master:
commit 4e520725dd227ade37be9274ac499671e50e7b93
Author: Nico Huber <nico.huber(a)secunet.com>
Date: Mon May 21 14:05:41 2012 +0200
libpayload: Better error detection in USB mass storage
This implements status transport (CSW) more closely to the standard
(usbmassbulk_10).
Change-Id: Ife516316e054d4e87ebe698dc487eeb9ebcfd38d
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
Build-Tested: build bot (Jenkins) at Wed Jun 20 19:31:59 2012, giving +1
Reviewed-By: Peter Stuge <peter(a)stuge.se> at Wed Jun 20 17:27:03 2012, giving +2
See http://review.coreboot.org/1072 for details.
-gerrit
the following patch was just integrated into master:
commit b9f4b09e465b23cbaab10be2b637a6c82ae1e4cd
Author: Anton Kochkov <anton.kochkov(a)gmail.com>
Date: Wed Jun 20 03:57:18 2012 +0400
libpayload: Fix detach_contoller in the USB driver
Fixed usb controllers linked list walking in
detach_controller() function
Change-Id: Ia97c7ec814f75d2b1bfe185f160fb4cd32aa6fdb
Signed-off-by: Anton Kochkov <anton.kochkov(a)gmail.com>
Build-Tested: build bot (Jenkins) at Wed Jun 20 02:32:45 2012, giving +1
Reviewed-By: Nico Huber <nico.huber(a)secunet.com> at Wed Jun 20 17:44:58 2012, giving +2
See http://review.coreboot.org/1105 for details.
-gerrit
Nico Huber (nico.huber(a)secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1127
-gerrit
commit 8f0e148abe2490e677ed5f3ac588aea860c29c44
Author: Nico Huber <nico.huber(a)secunet.com>
Date: Tue Jun 19 10:27:00 2012 +0200
libpayload: Adjust timeouts and delays in OHCI driver
This sets the timeout for control and bulk transfers to 2s per
transfer descriptor (like we set it in the EHCI driver). It also adds
delays around the disabling of control and bulk list access to
overcome some race conditions.
Change-Id: Ia2d1db890fca51c7d9477de163d55030e0c5a04a
Signed-off-by: Nico Huber <nico.huber(a)secunet.com>
---
payloads/libpayload/drivers/usb/ohci.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c
index 6d98cc1..105f601 100644
--- a/payloads/libpayload/drivers/usb/ohci.c
+++ b/payloads/libpayload/drivers/usb/ohci.c
@@ -203,11 +203,10 @@ static int
wait_for_ed(usbdev_t *dev, ed_t *head, int pages)
{
/* wait for results */
- /* TODO: how long to wait?
- * give 50ms per page plus another 100ms for now
- * this should even work with low-speed
+ /* TOTEST: how long to wait?
+ * give 2s per TD (2 pages) plus another 2s for now
*/
- int timeout = pages*50 + 100;
+ int timeout = pages*1000 + 2000;
while (((head->head_pointer & ~3) != head->tail_pointer) &&
!(head->head_pointer & 1) &&
((((td_t*)phys_to_virt(head->head_pointer & ~3))->config
@@ -361,7 +360,10 @@ ohci_control (usbdev_t *dev, direction_t dir, int drlen, void *devreq, int dalen
int failure = wait_for_ed(dev, head,
(dalen==0)?0:(last_page - first_page + 1));
+ /* Wait some frames before and one after disabling list access. */
+ mdelay(4);
OHCI_INST(dev->controller)->opreg->HcControl &= ~ControlListEnable;
+ mdelay(1);
/* free memory */
ohci_free_ed(head);
@@ -462,7 +464,10 @@ ohci_bulk (endpoint_t *ep, int dalen, u8 *data, int finalize)
int failure = wait_for_ed(ep->dev, head,
(dalen==0)?0:(last_page - first_page + 1));
+ /* Wait some frames before and one after disabling list access. */
+ mdelay(4);
OHCI_INST(ep->dev->controller)->opreg->HcControl &= ~BulkListEnable;
+ mdelay(1);
ep->toggle = head->head_pointer & ED_TOGGLE;