From 8f62ca646fbad26b17f832cc3c2579080247de6e Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 6 Mar 2013 14:08:31 +0000 Subject: usb: ehci: Support interrupt transfers via periodic list Interrupt transfers aren't meant to be used from the async list (the EHCI spec indicates trouble with low/full-speed intr on async). Build a periodic list instead, and provide an API to make use of it. Then, use that API from the existing interrupt transfer API. This provides support for USB keyboards using EHCI. Use timeouts to ensure we cannot get stuck in the keyboard scanning if something wrong happens (USB device unplugged or fatal I/O error) Signed-off-by: Vincent Palatin Signed-off-by: Julius Werner Signed-off-by: Simon Glass --- drivers/usb/host/ehci.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/usb/host/ehci.h') diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 1e3cd793b..46b535f36 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -69,6 +69,7 @@ struct ehci_hcor { #define CMD_RUN (1 << 0) /* start/stop HC */ uint32_t or_usbsts; #define STS_ASS (1 << 15) +#define STS_PSS (1 << 14) #define STS_HALT (1 << 12) uint32_t or_usbintr; #define INTR_UE (1 << 0) /* USB interrupt enable */ @@ -245,7 +246,10 @@ struct QH { * Add dummy fill value to make the size of this struct * aligned to 32 bytes */ - uint8_t fill[16]; + union { + uint8_t fill[16]; + void *buffer; + }; }; /* Low level init functions */ -- cgit v1.2.3-70-g09d2 From 61755c7908be54a8221280cc801e65bc9d91dfad Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Wed, 6 Mar 2013 14:08:32 +0000 Subject: usb: ehci: Fix aliasing issue in EHCI interrupt code The interrupt endpoint handling code stores the buffer pointer in the QH padding field. We need to make it the size of a pointer to avoid strict aliasing issue with the compiler. Signed-off-by: Vincent Palatin Signed-off-by: Simon Glass --- drivers/usb/host/ehci.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/host/ehci.h') diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 46b535f36..d090f0a53 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -247,7 +247,7 @@ struct QH { * aligned to 32 bytes */ union { - uint8_t fill[16]; + uint32_t fill[4]; void *buffer; }; }; -- cgit v1.2.3-70-g09d2