Skip to contentSkip to conversation

Add ehci core

RFC PATCH New Michael Trimarchi 3 participants 4 messages Nov 25, 2008 USB

lore
Share & tools
lore
#0 lore raw

cover Add ehci core

Add ehci core support

---
 common/cmd_usb.c            |    3 +-
 common/usb.c                |    2 +-
 drivers/usb/Makefile        |    2 +
 drivers/usb/usb_ehci.h      |  120 ++++++++
 drivers/usb/usb_ehci_core.c |  635 +++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/usb_ehci_core.h |   29 ++
 include/usb.h               |   15 +-
 include/usb_defs.h          |   10 +
 8 files changed, 808 insertions(+), 8 deletions(-)
 create mode 100644 drivers/usb/usb_ehci.h
 create mode 100644 drivers/usb/usb_ehci_core.c
 create mode 100644 drivers/usb/usb_ehci_core.h
common/cmd_usb.c +2 -1
index 99e551f..532df37 100644
@@ -276,7 +276,8 @@ void usb_show_tree_graph(struct usb_device *dev,char *pre)
 	pre[index++]= has_child ? '|' : ' ';
 	pre[index]=0;
 	printf(" %s (%s, %dmA)\n",usb_get_class_desc(dev->config.if_desc[0].bInterfaceClass),
-		dev->slow ? "1.5MBit/s" : "12MBit/s",dev->config.MaxPower * 2);
+		(dev->speed == USB_SPEED_LOW) ? "1.5MBit/s" : (dev->speed == USB_SPEED_FULL)
+		? "12MBit/s" : "480MBit/s", dev->config.MaxPower * 2);
 	if (strlen(dev->mf) ||
 	   strlen(dev->prod) ||
 	   strlen(dev->serial))
common/usb.c +1 -1
index 7ab5df6..1518d9a 100644
@@ -1126,7 +1126,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
 
 	/* Allocate a new device struct for it */
 	usb = usb_alloc_new_device();
-	usb->slow = (portstatus & USB_PORT_STAT_LOW_SPEED) ? 1 : 0;
+	usb->speed = (portstatus & USB_PORT_STAT_LOW_SPEED) ? 1 : 0;
 
 	dev->children[port] = usb;
 	usb->parent = dev;
drivers/usb/Makefile +2 -0
index c67a490..6a4df02 100644
@@ -34,6 +34,8 @@ COBJS-y += usbdcore.o
 COBJS-y += usbdcore_ep0.o
 COBJS-y += usbdcore_mpc8xx.o
 COBJS-y += usbdcore_omap1510.o
+COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
+COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/usb/usb_ehci.h new file +120 -0

120 lines not on this page · raw message

drivers/usb/usb_ehci_core.c new file +635 -0

635 lines not on this page · raw message

drivers/usb/usb_ehci_core.h new file +29 -0
new file mode 100644
index 0000000..39e5c5e
@@ -0,0 +1,29 @@
+/*-
+ * Copyright (c) 2007-2008, Juniper Networks, Inc.
+ * Copyright (c) 2008, Excito Elektronik i Sk?ne AB
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef USB_EHCI_CORE_H
+#define USB_EHCI_CORE_H
+
+extern int rootdev;
+extern struct ehci_hccr *hccr;
+extern volatile struct ehci_hcor *hcor;
+
+#endif
include/usb.h +9 -6
index 9a2e72c..840e657 100644
@@ -139,7 +139,7 @@ enum {
 
 struct usb_device {
 	int devnum;			/* Device number on USB bus */
-	int slow;			/* Slow device? */
+	int speed;			/* full/low/high */
 	char mf[32];			/* manufacturer */
 	char prod[32];			/* product */
 	char serial[32];		/* serial number */
@@ -171,6 +171,7 @@ struct usb_device {
 	unsigned long status;
 	int act_len;			/* transfered bytes */
 	int maxchild;			/* Number of ports if hub */
+	int portnr;
 	struct usb_device *parent;
 	struct usb_device *children[USB_MAXCHILDREN];
 };
@@ -180,6 +181,7 @@ struct usb_device {
  */
 
 #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
+	defined(CONFIG_USB_EHCI) || \
 	defined(CONFIG_USB_OHCI_NEW) || defined (CONFIG_USB_SL811HS) || \
 	defined(CONFIG_USB_ISP116X_HCD) || defined(CONFIG_USB_R8A66597_HCD)
 
@@ -274,7 +276,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
  *  - endpoint number (4 bits)
  *  - current Data0/1 state (1 bit)
  *  - direction (1 bit)
- *  - speed (1 bit)
+ *  - speed (2 bits)
  *  - max packet size (2 bits: 8, 16, 32 or 64)
  *  - pipe type (2 bits: control, interrupt, bulk, isochronous)
  *
@@ -290,7 +292,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
  *  - device:		bits 8-14
  *  - endpoint:		bits 15-18
  *  - Data0/1:		bit 19
- *  - speed:		bit 26		(0 = Full, 1 = Low Speed)
+ *  - speed:		bits 26-27	(0 = Full, 1 = Low, 2 = High)
  *  - pipe type:	bits 30-31	(00 = isochronous, 01 = interrupt, 10 = control, 11 = bulk)
  *
  * Why? Because it's arbitrary, and whatever encoding we select is really
@@ -300,8 +302,8 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
  */
 /* Create various pipes... */
 #define create_pipe(dev,endpoint) \
-		(((dev)->devnum << 8) | (endpoint << 15) | ((dev)->slow << 26) | (dev)->maxpacketsize)
-#define default_pipe(dev) ((dev)->slow <<26)
+		(((dev)->devnum << 8) | (endpoint << 15) | ((dev)->speed << 26) | (dev)->maxpacketsize)
+#define default_pipe(dev) ((dev)->speed << 26)
 
 #define usb_sndctrlpipe(dev,endpoint)	((PIPE_CONTROL << 30) | create_pipe(dev,endpoint))
 #define usb_rcvctrlpipe(dev,endpoint)	((PIPE_CONTROL << 30) | create_pipe(dev,endpoint) | USB_DIR_IN)
@@ -333,7 +335,8 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
 #define usb_pipe_endpdev(pipe)	(((pipe) >> 8) & 0x7ff)
 #define usb_pipeendpoint(pipe)	(((pipe) >> 15) & 0xf)
 #define usb_pipedata(pipe)	(((pipe) >> 19) & 1)
-#define usb_pipeslow(pipe)	(((pipe) >> 26) & 1)
+#define usb_pipespeed(pipe)	(((pipe) >> 26) & 3)
+#define usb_pipeslow(pipe)	(usb_pipespeed(pipe) == USB_SPEED_LOW)
 #define usb_pipetype(pipe)	(((pipe) >> 30) & 3)
 #define usb_pipeisoc(pipe)	(usb_pipetype((pipe)) == PIPE_ISOCHRONOUS)
 #define usb_pipeint(pipe)	(usb_pipetype((pipe)) == PIPE_INTERRUPT)
include/usb_defs.h +10 -0
index 353019f..8032e57 100644
@@ -80,6 +80,12 @@
 #define USB_DIR_OUT           0
 #define USB_DIR_IN            0x80
 
+/* USB device speeds */
+#define USB_SPEED_FULL		0x0	/* 12Mbps */
+#define USB_SPEED_LOW		0x1	/* 1.5Mbps */
+#define USB_SPEED_HIGH		0x2	/* 480Mbps */
+#define USB_SPEED_RESERVED	0x3
+
 /* Descriptor types */
 #define USB_DT_DEVICE        0x01
 #define USB_DT_CONFIG        0x02
@@ -202,6 +208,7 @@
 #define USB_PORT_FEAT_RESET          4
 #define USB_PORT_FEAT_POWER          8
 #define USB_PORT_FEAT_LOWSPEED       9
+#define USB_PORT_FEAT_HIGHSPEED      10
 #define USB_PORT_FEAT_C_CONNECTION   16
 #define USB_PORT_FEAT_C_ENABLE       17
 #define USB_PORT_FEAT_C_SUSPEND      18
@@ -216,6 +223,9 @@
 #define USB_PORT_STAT_RESET         0x0010
 #define USB_PORT_STAT_POWER         0x0100
 #define USB_PORT_STAT_LOW_SPEED     0x0200
+#define USB_PORT_STAT_HIGH_SPEED    0x0400	/* support for EHCI */
+#define USB_PORT_STAT_SPEED	\
+	(USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED)
 
 /* wPortChange bits */
 #define USB_PORT_STAT_C_CONNECTION  0x0001
Signature · 1 line
1.5.6.5
#1 lore raw

cover Add ehci core

Quoted 23 lines · Michael Trimarchi

Add ehci core support

---
 common/cmd_usb.c            |    3 +-
 common/usb.c                |    2 +-
 drivers/usb/Makefile        |    2 +
 drivers/usb/usb_ehci.h      |  120 ++++++++
 drivers/usb/usb_ehci_core.c |  635 +++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/usb_ehci_core.h |   29 ++
 include/usb.h               |   15 +-
 include/usb_defs.h          |   10 +
 8 files changed, 808 insertions(+), 8 deletions(-)
 create mode 100644 drivers/usb/usb_ehci.h
 create mode 100644 drivers/usb/usb_ehci_core.c
 create mode 100644 drivers/usb/usb_ehci_core.h
common/cmd_usb.c +0 -0
index 99e551f..532df37 100644

common/cmd_usb.c void usb_show_tree_graph(struct usb_device *dev,char *pre) · line 278

Quoted 3 lines
common/cmd_usb.c +0 -0
@@ -276,7 +276,8 @@ void usb_show_tree_graph(struct usb_device *dev,char *pre)
 	pre[index++]= has_child ? '|' : ' ';
 	pre[index]=0;
 	printf(" %s (%s, %dmA)\n",usb_get_class_desc(dev->config.if_desc[0].bInterfaceClass),

too long please split

common/cmd_usb.c void usb_show_tree_graph(struct usb_device *dev,char *pre) · line 279

Quoted 2 lines
common/cmd_usb.c +1 -1
-		dev->slow ? "1.5MBit/s" : "12MBit/s",dev->config.MaxPower * 2);
+		(dev->speed == USB_SPEED_LOW) ? "1.5MBit/s" : (dev->speed == USB_SPEED_FULL)

too long please split

Quoted 22 lines
common/cmd_usb.c +1 -0
+		? "12MBit/s" : "480MBit/s", dev->config.MaxPower * 2);
 	if (strlen(dev->mf) ||
 	   strlen(dev->prod) ||
 	   strlen(dev->serial))
common/usb.c +1 -1
index 7ab5df6..1518d9a 100644
@@ -1126,7 +1126,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, int port)
 
 	/* Allocate a new device struct for it */
 	usb = usb_alloc_new_device();
-	usb->slow = (portstatus & USB_PORT_STAT_LOW_SPEED) ? 1 : 0;
+	usb->speed = (portstatus & USB_PORT_STAT_LOW_SPEED) ? 1 : 0;
 
 	dev->children[port] = usb;
 	usb->parent = dev;
drivers/usb/Makefile +0 -0
index c67a490..6a4df02 100644

drivers/usb/Makefile COBJS-y += usbdcore.o · line 38

Quoted 5 lines
drivers/usb/Makefile +2 -0
@@ -34,6 +34,8 @@ COBJS-y += usbdcore.o
 COBJS-y += usbdcore_ep0.o
 COBJS-y += usbdcore_mpc8xx.o
 COBJS-y += usbdcore_omap1510.o
+COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
+COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o

I've send a patch to move condition compile to Makefile please base your after this one

Quoted 25 lines
drivers/usb/Makefile +0 -0
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/usb/usb_ehci.h new file +16 -0
new file mode 100644
index 0000000..9911068
@@ -0,0 +1,120 @@
+/*-
+ * Copyright (c) 2007-2008, Juniper Networks, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation version 2 of
+ * the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software

drivers/usb/usb_ehci.h line 26

Quoted 10 lines
drivers/usb/usb_ehci.h new file +10 -0
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef USB_EHCI_H
+#define USB_EHCI_H
+
+/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
+#define DeviceRequest \
+	((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)

please a space before and after '|' and '<<'

drivers/usb/usb_ehci.h line 28

Quoted 2 lines
drivers/usb/usb_ehci.h new file +2 -0
+#define DeviceOutRequest \
+	((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)

please a space before and after '|' and '<<'

drivers/usb/usb_ehci.h line 31

Quoted 3 lines
drivers/usb/usb_ehci.h new file +3 -0
+
+#define InterfaceRequest \
+	((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)

please a space before and after '|' and '<<'

drivers/usb/usb_ehci.h line 34

Quoted 3 lines
drivers/usb/usb_ehci.h new file +3 -0
+
+#define EndpointRequest \
+	((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)

please a space before and after '|' and '<<'

drivers/usb/usb_ehci.h line 36

Quoted 2 lines
drivers/usb/usb_ehci.h new file +2 -0
+#define EndpointOutRequest \
+	((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)

please a space before and after '|' and '<<'

Quoted 35 lines
drivers/usb/usb_ehci.h new file +35 -0
+
+/*
+ * Register Space.
+ */
+struct ehci_hccr {
+	uint8_t cr_caplength;
+	uint16_t cr_hciversion;
+	uint32_t cr_hcsparams;
+	uint32_t cr_hccparams;
+	uint8_t cr_hcsp_portrt[8];
+};
+
+struct ehci_hcor {
+	uint32_t or_usbcmd;
+	uint32_t or_usbsts;
+	uint32_t or_usbintr;
+	uint32_t or_frindex;
+	uint32_t or_ctrldssegment;
+	uint32_t or_periodiclistbase;
+	uint32_t or_asynclistaddr;
+	uint32_t _reserved_[9];
+	uint32_t or_configflag;
+	uint32_t or_portsc[2];
+	uint32_t or_systune;
+};
+
+#define EHCI_PS_WKOC_E		0x00400000	/* RW wake on over current */
+#define EHCI_PS_WKDSCNNT_E	0x00200000	/* RW wake on disconnect */
+#define EHCI_PS_WKCNNT_E	0x00100000	/* RW wake on connect */
+#define EHCI_PS_PTC		0x000f0000	/* RW port test control */
+#define EHCI_PS_PIC		0x0000c000	/* RW port indicator control */
+#define EHCI_PS_PO		0x00002000	/* RW port owner */
+#define EHCI_PS_PP		0x00001000	/* RW,RO port power */
+#define EHCI_PS_LS		0x00000c00	/* RO line status */
+#define EHCI_PS_IS_LOWSPEED(x) (((x) & EHCI_PS_LS) == 0x00000400)

drivers/usb/usb_ehci.h line 81

Quoted 10 lines
drivers/usb/usb_ehci.h new file +10 -0
+#define EHCI_PS_PR		0x00000100	/* RW port reset */
+#define EHCI_PS_SUSP		0x00000080	/* RW suspend */
+#define EHCI_PS_FPR		0x00000040	/* RW force port resume */
+#define EHCI_PS_OCC		0x00000020	/* RWC over current change */
+#define EHCI_PS_OCA		0x00000010	/* RO over current active */
+#define EHCI_PS_PEC		0x00000008	/* RWC port enable change */
+#define EHCI_PS_PE		0x00000004	/* RW port enable */
+#define EHCI_PS_CSC		0x00000002	/* RWC connect status change */
+#define EHCI_PS_CS		0x00000001	/* RO connect status */
+#define EHCI_PS_CLEAR		(EHCI_PS_OCC|EHCI_PS_PEC|EHCI_PS_CSC)

please a space before and after '|' and '<<'

Quoted 41 lines
drivers/usb/usb_ehci.h new file +41 -0
+
+/*
+ * Schedule Interface Space.
+ *
+ * IMPORTANT: Software must ensure that no interface data structure
+ * reachable by the EHCI host controller spans a 4K page boundary!
+ *
+ * Periodic transfers (i.e. isochronous and interrupt transfers) are
+ * not supported.
+ */
+
+/* Queue Element Transfer Descriptor (qTD). */
+struct qTD {
+	uint32_t qt_next;
+#define	QT_NEXT_TERMINATE	1
+	uint32_t qt_altnext;
+	uint32_t qt_token;
+	uint32_t qt_buffer[5];
+};
+
+/* Queue Head (QH). */
+struct QH {
+	uint32_t qh_link;
+#define	QH_LINK_TERMINATE	1
+#define	QH_LINK_TYPE_ITD	0
+#define	QH_LINK_TYPE_QH		2
+#define	QH_LINK_TYPE_SITD	4
+#define	QH_LINK_TYPE_FSTN	6
+	uint32_t qh_endpt1;
+	uint32_t qh_endpt2;
+	uint32_t qh_curtd;
+	struct qTD qh_overlay;
+};
+
+/* Low level intit functions */
+
+int ehci_hcd_init(void);
+int ehci_hcd_stop(void);
+#endif /* USB_EHCI_H */
+#include <asm/io.h>
+#include "usb_ehci.h"

drivers/usb/usb_ehci.h

Quoted 10 lines
drivers/usb/usb_ehci.h new file +10 -0
+
+int rootdev;
+struct ehci_hccr *hccr;		/* R/O registers, not need for volatile */
+volatile struct ehci_hcor *hcor;
+
+static uint16_t portreset;
+static struct QH qh_list __attribute__((aligned(32)));
+
+struct usb_device_descriptor device = {
+	sizeof(struct usb_device_descriptor),   /* bLength */
					     ^^^

whitespace please fix

drivers/usb/usb_ehci.h

Quoted 9 lines
drivers/usb/usb_ehci.h new file +9 -0
+	1,		/* bDescriptorType: UDESC_DEVICE */
+	0x0002,		/* bcdUSB: v2.0 */
+	9,		/* bDeviceClass: UDCLASS_HUB */
+	0,		/* bDeviceSubClass: UDSUBCLASS_HUB */
+	1,		/* bDeviceProtocol: UDPROTO_HSHUBSTT */
+	64,		/* bMaxPacketSize: 64 bytes */
+	0x0000,		/* idVendor */
+	0x0000,		/* idProduct */
+	0x0001,         /* bcdDevice */
	       ^^^^^^^^^

whitespace please fix

Quoted 13 lines
drivers/usb/usb_ehci.h new file +13 -0
+	1,		/* bDescriptorType: UDESC_DEVICE */
+	1,		/* iManufacturer */
+	2,		/* iProduct */
+	0,		/* iSerialNumber */
+	1		/* bNumConfigurations: 1 */
+};
+
+struct usb_config_descriptor config = {
+	sizeof(struct usb_config_descriptor),
+	2,		/* bDescriptorType: UDESC_CONFIG */
+	sizeof(struct usb_config_descriptor) +
+	sizeof(struct usb_interface_descriptor) +
+	sizeof(struct usb_endpoint_descriptor),

drivers/usb/usb_ehci.h

Quoted 10 lines
drivers/usb/usb_ehci.h new file +10 -0
+	0,
+	1,		/* bNumInterface */
+	1,		/* bConfigurationValue */
+	0,		/* iConfiguration */
+	0x40,		/* bmAttributes: UC_SELF_POWER */
+	0		/* bMaxPower */
+};
+
+struct usb_interface_descriptor interface = {
+	sizeof(struct usb_interface_descriptor),        /* bLength */
						^^^^^^^^

whitespace please fix

drivers/usb/usb_ehci.h

Quoted 12 lines
drivers/usb/usb_ehci.h new file +12 -0
+	4,		/* bDescriptorType: UDESC_INTERFACE */
+	0,		/* bInterfaceNumber */
+	0,		/* bAlternateSetting */
+	1,		/* bNumEndpoints */
+	9,		/* bInterfaceClass: UICLASS_HUB */
+	0,		/* bInterfaceSubClass: UISUBCLASS_HUB */
+	0,		/* bInterfaceProtocol: UIPROTO_HSHUBSTT */
+	0		/* iInterface */
+};
+
+struct usb_endpoint_descriptor endpoint = {
+sizeof(struct usb_endpoint_descriptor),         /* bLength */
					  ^^^^^^^^^

whitespace please fix

drivers/usb/usb_ehci.h

Quoted 11 lines
drivers/usb/usb_ehci.h new file +11 -0
+	5,		/* bDescriptorType: UDESC_ENDPOINT */
+	0x81,		/* bEndpointAddress: UE_DIR_IN | EHCI_INTR_ENDPT */
+	3,		/* bmAttributes: UE_INTERRUPT */
+	8, 0,		/* wMaxPacketSize */
+	255		/* bInterval */
+};
+
+struct usb_hub_descriptor hub = {
+	sizeof(struct usb_hub_descriptor),	/* bDescLength */
+	0x29,		/* bDescriptorType: hub
+			   descriptor */
			^^^

whitespace please fix
and please use this style of comment
/*
*
*/

Quoted 8 lines
drivers/usb/usb_ehci.h new file +7 -0
+	2,		/* bNrPorts -- runtime modified */
+	0, 0,		/* wHubCharacteristics */
+	0xff,		/* bPwrOn2PwrGood */
+	{},		/* bHubCntrCurrent */
+	{}		/* at most 7 ports! XXX */
+};
+

....

Quoted 17 lines

#define usb_sndctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | create_pipe(dev,endpoint))
#define usb_rcvctrlpipe(dev,endpoint) ((PIPE_CONTROL << 30) | create_pipe(dev,endpoint) | USB_DIR_IN)

drivers/usb/usb_ehci.h new file +2 -1
@@ -333,7 +335,8 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate);
 #define usb_pipe_endpdev(pipe)	(((pipe) >> 8) & 0x7ff)
 #define usb_pipeendpoint(pipe)	(((pipe) >> 15) & 0xf)
 #define usb_pipedata(pipe)	(((pipe) >> 19) & 1)
-#define usb_pipeslow(pipe)	(((pipe) >> 26) & 1)
+#define usb_pipespeed(pipe)	(((pipe) >> 26) & 3)
+#define usb_pipeslow(pipe)	(usb_pipespeed(pipe) == USB_SPEED_LOW)
 #define usb_pipetype(pipe)	(((pipe) >> 30) & 3)
 #define usb_pipeisoc(pipe)	(usb_pipetype((pipe)) == PIPE_ISOCHRONOUS)
 #define usb_pipeint(pipe)	(usb_pipetype((pipe)) == PIPE_INTERRUPT)
include/usb_defs.h +0 -0
index 353019f..8032e57 100644

include/usb_defs.h line 80

Quoted 1 line
include/usb_defs.h +0 -0
@@ -80,6 +80,12 @@
 #define USB_DIR_OUT           0

whitespace please fix

include/usb_defs.h line 81

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_DIR_IN            0x80

whitespace please fix

include/usb_defs.h line 90

Quoted 9 lines
include/usb_defs.h +6 -0
+/* USB device speeds */
+#define USB_SPEED_FULL		0x0	/* 12Mbps */
+#define USB_SPEED_LOW		0x1	/* 1.5Mbps */
+#define USB_SPEED_HIGH		0x2	/* 480Mbps */
+#define USB_SPEED_RESERVED	0x3
+
 /* Descriptor types */
 #define USB_DT_DEVICE        0x01
			^^^^^^^^

whitespace please fix

include/usb_defs.h line 91

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_DT_CONFIG        0x02
			^^^^^^^^

whitespace please fix

include/usb_defs.h line 208

Quoted 2 lines
include/usb_defs.h +0 -0
@@ -202,6 +208,7 @@
 #define USB_PORT_FEAT_RESET          4
			      ^^^^^^^^^^

whitespace please fix

include/usb_defs.h line 209

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_PORT_FEAT_POWER          8
			      ^^^^^^^^^^

whitespace please fix

include/usb_defs.h line 210

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_PORT_FEAT_LOWSPEED       9
				 ^^^^^^^

whitespace please fix

include/usb_defs.h line 211

Quoted 1 line
include/usb_defs.h +1 -0
+#define USB_PORT_FEAT_HIGHSPEED      10
				  ^^^^^^

whitespace please fix

include/usb_defs.h line 212

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_PORT_FEAT_C_CONNECTION   16
				     ^^^

whitespace please fix

include/usb_defs.h line 213

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_PORT_FEAT_C_ENABLE       17
				 ^^^^^^^

whitespace please fix

include/usb_defs.h line 214

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_PORT_FEAT_C_SUSPEND      18
				  ^^^^^^

whitespace please fix

include/usb_defs.h

Quoted 1 line
include/usb_defs.h +0 -0
@@ -216,6 +223,9 @@

whitespace please fix

include/usb_defs.h line 223

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_PORT_STAT_RESET         0x0010
			      ^^^^^^^^^

whitespace please fix

include/usb_defs.h line 224

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_PORT_STAT_POWER         0x0100
			      ^^^^^^^^^

whitespace please fix

include/usb_defs.h line 225

Quoted 1 line
include/usb_defs.h +0 -0
 #define USB_PORT_STAT_LOW_SPEED     0x0200
				  ^^^^^

whitespace please fix

include/usb_defs.h line 226

Quoted 1 line
include/usb_defs.h +1 -0
+#define USB_PORT_STAT_HIGH_SPEED    0x0400	/* support for EHCI */
				   ^^^^

whitespace please fix

include/usb_defs.h line 231

Quoted 5 lines
include/usb_defs.h +2 -0
+#define USB_PORT_STAT_SPEED	\
+	(USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED)
 
 /* wPortChange bits */
 #define USB_PORT_STAT_C_CONNECTION  0x0001
			^^^^^^^^

whitespace please fix

for the non modified line with a whiteplease it will be nice to send an other patch

Best Regards,
J.

#2 lore raw

cover Add ehci core

Hello All,

2008/11/25 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:

Quoted 4 lines

drivers/usb/Makefile COBJS-y += usbdcore.o · line 38

Quoted 2 lines
drivers/usb/Makefile +2 -0
+COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
+COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o

I've send a patch to move condition compile to Makefile please base your after this one

That is correct. I have put that patch in the u-boot-usb tree, the 'next' branch.
http://git.denx.de/?p=u-boot/u-boot-usb.git;a=shortlog;h=refs/heads/next
This is were this series is going also, when it is stable.

Kind Regards,

Remy

author
#3 lore raw

cover Add ehci core

Hi,

Quoted 11 lines · Remy Bohmer

Hello All,

2008/11/25 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:

Quoted 6 lines

drivers/usb/Makefile COBJS-y += usbdcore.o · line 38

Quoted 3 lines
drivers/usb/Makefile +2 -0
+COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
+COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o

I've send a patch to move condition compile to Makefile please base your after this one

Quoted 10 lines

That is correct. I have put that patch in the u-boot-usb tree, the 'next' branch.
http://git.denx.de/?p=u-boot/u-boot-usb.git;a=shortlog;h=refs/heads/next
This is were this series is going also, when it is stable.

Kind Regards,

Remy

Ok, tomorrow I rebase all to the u-boot-usb.git. Send 3 patch with the suggested cleanup

Michael