public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jana Rapava <fermata7@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot]  [PATCH v9 1/4] usb: Move ehci.h and ehci-core.h to include/usb directory
Date: Wed, 28 Sep 2011 21:49:45 +0200	[thread overview]
Message-ID: <1317239385-32219-1-git-send-email-fermata7@gmail.com> (raw)
In-Reply-To: <1317221946-18252-1-git-send-email-fermata7@gmail.com>

From: Fabio Estevam <festevam@gmail.com>

Move ehci.h and ehci-core.h to include/usb directory.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Remy Bohmer <linux@bohmer.net>
Cc: Marek Vasut <marek.vasut@gmail.com>
---
Changes for v1:
	- reorder patches in patchset
	- use patch from Fabio Estevam
Changes for v2:
	- fix From field
	- rebase on top of u-boot-imx/next(no actual changes)
Changes for v3:
	- change versioning in changelog from per patchset to per patch
	- no actual changes
Changes for v4:
	- no changes
Changes for v5:
	- no changes

 drivers/usb/host/ehci-core.h     |   29 ------
 drivers/usb/host/ehci-fsl.c      |    4 +-
 drivers/usb/host/ehci-hcd.c      |    2 +-
 drivers/usb/host/ehci-ixp4xx.c   |    4 +-
 drivers/usb/host/ehci-kirkwood.c |    4 +-
 drivers/usb/host/ehci-mpc512x.c  |    4 +-
 drivers/usb/host/ehci-mxc.c      |    4 +-
 drivers/usb/host/ehci-pci.c      |    4 +-
 drivers/usb/host/ehci-ppc4xx.c   |    4 +-
 drivers/usb/host/ehci-vct.c      |    4 +-
 drivers/usb/host/ehci.h          |  203 --------------------------------------
 include/usb/ehci-core.h          |   29 ++++++
 include/usb/ehci.h               |  203 ++++++++++++++++++++++++++++++++++++++
 13 files changed, 249 insertions(+), 249 deletions(-)
 delete mode 100644 drivers/usb/host/ehci-core.h
 delete mode 100644 drivers/usb/host/ehci.h
 create mode 100644 include/usb/ehci-core.h
 create mode 100644 include/usb/ehci.h

diff --git a/drivers/usb/host/ehci-core.h b/drivers/usb/host/ehci-core.h
deleted file mode 100644
index 39e5c5e..0000000
--- a/drivers/usb/host/ehci-core.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*-
- * 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
diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c
index 6e0043a..19b97ee 100644
--- a/drivers/usb/host/ehci-fsl.c
+++ b/drivers/usb/host/ehci-fsl.c
@@ -27,8 +27,8 @@
 #include <asm/io.h>
 #include <usb/ehci-fsl.h>
 
-#include "ehci.h"
-#include "ehci-core.h"
+#include <usb/ehci.h>
+#include <usb/ehci-core.h>
 
 /*
  * Create the appropriate control structures to manage
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 2197119..bdadd46 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -27,7 +27,7 @@
 #include <malloc.h>
 #include <watchdog.h>
 
-#include "ehci.h"
+#include <usb/ehci.h>
 
 int rootdev;
 struct ehci_hccr *hccr;	/* R/O registers, not need for volatile */
diff --git a/drivers/usb/host/ehci-ixp4xx.c b/drivers/usb/host/ehci-ixp4xx.c
index b8f15ae..d15237b 100644
--- a/drivers/usb/host/ehci-ixp4xx.c
+++ b/drivers/usb/host/ehci-ixp4xx.c
@@ -22,8 +22,8 @@
 #include <common.h>
 #include <usb.h>
 
-#include "ehci.h"
-#include "ehci-core.h"
+#include <usb/ehci.h>
+#include <usb/ehci-core.h>
 /*
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
diff --git a/drivers/usb/host/ehci-kirkwood.c b/drivers/usb/host/ehci-kirkwood.c
index 5570fc6..ab75acd 100644
--- a/drivers/usb/host/ehci-kirkwood.c
+++ b/drivers/usb/host/ehci-kirkwood.c
@@ -25,8 +25,8 @@
 #include <common.h>
 #include <asm/io.h>
 #include <usb.h>
-#include "ehci.h"
-#include "ehci-core.h"
+#include <usb/ehci.h>
+#include <usb/ehci-core.h>
 #include <asm/arch/kirkwood.h>
 
 #define rdl(off)	readl(KW_USB20_BASE + (off))
diff --git a/drivers/usb/host/ehci-mpc512x.c b/drivers/usb/host/ehci-mpc512x.c
index d360108..8d2c93b 100644
--- a/drivers/usb/host/ehci-mpc512x.c
+++ b/drivers/usb/host/ehci-mpc512x.c
@@ -32,8 +32,8 @@
 #include <asm/io.h>
 #include <usb/ehci-fsl.h>
 
-#include "ehci.h"
-#include "ehci-core.h"
+#include <usb/ehci.h>
+#include <usb/ehci-core.h>
 
 static void fsl_setup_phy(volatile struct ehci_hcor *);
 static void fsl_platform_set_host_mode(volatile struct usb_ehci *ehci);
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index a0cfbb7..fde1f0f 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -24,8 +24,8 @@
 #include <usb/ehci-fsl.h>
 #include <errno.h>
 
-#include "ehci.h"
-#include "ehci-core.h"
+#include <usb/ehci.h>
+#include <usb/ehci-core.h>
 
 #define USBCTRL_OTGBASE_OFFSET	0x600
 
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
index 020ab11..e1f84d9 100644
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -22,8 +22,8 @@
 #include <pci.h>
 #include <usb.h>
 
-#include "ehci.h"
-#include "ehci-core.h"
+#include <usb/ehci.h>
+#include <usb/ehci-core.h>
 
 #ifdef CONFIG_PCI_EHCI_DEVICE
 static struct pci_device_id ehci_pci_ids[] = {
diff --git a/drivers/usb/host/ehci-ppc4xx.c b/drivers/usb/host/ehci-ppc4xx.c
index 1179919..1a1fae1 100644
--- a/drivers/usb/host/ehci-ppc4xx.c
+++ b/drivers/usb/host/ehci-ppc4xx.c
@@ -22,8 +22,8 @@
 #include <common.h>
 #include <usb.h>
 
-#include "ehci.h"
-#include "ehci-core.h"
+#include <usb/ehci.h>
+#include <usb/ehci-core.h>
 
 /*
  * Create the appropriate control structures to manage
diff --git a/drivers/usb/host/ehci-vct.c b/drivers/usb/host/ehci-vct.c
index 3063dd1..e73cf38 100644
--- a/drivers/usb/host/ehci-vct.c
+++ b/drivers/usb/host/ehci-vct.c
@@ -20,8 +20,8 @@
 #include <common.h>
 #include <usb.h>
 
-#include "ehci.h"
-#include "ehci-core.h"
+#include <usb/ehci.h>
+#include <usb/ehci-core.h>
 
 int vct_ehci_hcd_init(u32 *hccr, u32 *hcor);
 
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
deleted file mode 100644
index 3d0ad0c..0000000
--- a/drivers/usb/host/ehci.h
+++ /dev/null
@@ -1,203 +0,0 @@
-/*-
- * Copyright (c) 2007-2008, Juniper Networks, Inc.
- * Copyright (c) 2008, Michael Trimarchi <trimarchimichael@yahoo.it>
- * 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_H
-#define USB_EHCI_H
-
-#if !defined(CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS)
-#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	2
-#endif
-
-/* (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)
-
-#define DeviceOutRequest \
-	((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8)
-
-#define InterfaceRequest \
-	((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
-
-#define EndpointRequest \
-	((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
-
-#define EndpointOutRequest \
-	((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
-
-/*
- * Register Space.
- */
-struct ehci_hccr {
-	uint32_t cr_capbase;
-#define HC_LENGTH(p)		(((p) >> 0) & 0x00ff)
-#define HC_VERSION(p)		(((p) >> 16) & 0xffff)
-	uint32_t cr_hcsparams;
-#define HCS_PPC(p)		((p) & (1 << 4))
-#define HCS_INDICATOR(p)	((p) & (1 << 16)) /* Port indicators */
-#define HCS_N_PORTS(p)		(((p) >> 0) & 0xf)
-	uint32_t cr_hccparams;
-	uint8_t cr_hcsp_portrt[8];
-} __attribute__ ((packed, aligned(4)));
-
-struct ehci_hcor {
-	uint32_t or_usbcmd;
-#define CMD_PARK	(1 << 11)		/* enable "park" */
-#define CMD_PARK_CNT(c)	(((c) >> 8) & 3)	/* how many transfers to park */
-#define CMD_ASE		(1 << 5)		/* async schedule enable */
-#define CMD_LRESET	(1 << 7)		/* partial reset */
-#define CMD_IAAD	(1 << 5)		/* "doorbell" interrupt */
-#define CMD_PSE		(1 << 4)		/* periodic schedule enable */
-#define CMD_RESET	(1 << 1)		/* reset HC not bus */
-#define CMD_RUN		(1 << 0)		/* start/stop HC */
-	uint32_t or_usbsts;
-#define	STD_ASS		(1 << 15)
-#define STS_HALT	(1 << 12)
-	uint32_t or_usbintr;
-#define INTR_UE         (1 << 0)                /* USB interrupt enable */
-#define INTR_UEE        (1 << 1)                /* USB error interrupt enable */
-#define INTR_PCE        (1 << 2)                /* Port change detect enable */
-#define INTR_SEE        (1 << 4)                /* system error enable */
-#define INTR_AAE        (1 << 5)                /* Interrupt on async adavance enable */
-	uint32_t or_frindex;
-	uint32_t or_ctrldssegment;
-	uint32_t or_periodiclistbase;
-	uint32_t or_asynclistaddr;
-	uint32_t _reserved_[9];
-	uint32_t or_configflag;
-#define FLAG_CF		(1 << 0)	/* true:  we'll support "high speed" */
-	uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS];
-	uint32_t or_systune;
-} __attribute__ ((packed, aligned(4)));
-
-#define USBMODE		0x68		/* USB Device mode */
-#define USBMODE_SDIS	(1 << 3)	/* Stream disable */
-#define USBMODE_BE	(1 << 2)	/* BE/LE endiannes select */
-#define USBMODE_CM_HC	(3 << 0)	/* host controller mode */
-#define USBMODE_CM_IDLE	(0 << 0)	/* idle state */
-
-/* Interface descriptor */
-struct usb_linux_interface_descriptor {
-	unsigned char	bLength;
-	unsigned char	bDescriptorType;
-	unsigned char	bInterfaceNumber;
-	unsigned char	bAlternateSetting;
-	unsigned char	bNumEndpoints;
-	unsigned char	bInterfaceClass;
-	unsigned char	bInterfaceSubClass;
-	unsigned char	bInterfaceProtocol;
-	unsigned char	iInterface;
-} __attribute__ ((packed));
-
-/* Configuration descriptor information.. */
-struct usb_linux_config_descriptor {
-	unsigned char	bLength;
-	unsigned char	bDescriptorType;
-	unsigned short	wTotalLength;
-	unsigned char	bNumInterfaces;
-	unsigned char	bConfigurationValue;
-	unsigned char	iConfiguration;
-	unsigned char	bmAttributes;
-	unsigned char	MaxPower;
-} __attribute__ ((packed));
-
-#if defined CONFIG_EHCI_DESC_BIG_ENDIAN
-#define	ehci_readl(x)		(*((volatile u32 *)(x)))
-#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = ((volatile u32)b))
-#else
-#define ehci_readl(x)		cpu_to_le32((*((volatile u32 *)(x))))
-#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = \
-					cpu_to_le32(((volatile u32)b)))
-#endif
-
-#if defined CONFIG_EHCI_MMIO_BIG_ENDIAN
-#define hc32_to_cpu(x)		be32_to_cpu((x))
-#define cpu_to_hc32(x)		cpu_to_be32((x))
-#else
-#define hc32_to_cpu(x)		le32_to_cpu((x))
-#define cpu_to_hc32(x)		cpu_to_le32((x))
-#endif
-
-#define EHCI_PS_WKOC_E		(1 << 22)	/* RW wake on over current */
-#define EHCI_PS_WKDSCNNT_E	(1 << 21)	/* RW wake on disconnect */
-#define EHCI_PS_WKCNNT_E	(1 << 20)	/* RW wake on connect */
-#define EHCI_PS_PO		(1 << 13)	/* RW port owner */
-#define EHCI_PS_PP		(1 << 12)	/* RW,RO port power */
-#define EHCI_PS_LS		(3 << 10)	/* RO line status */
-#define EHCI_PS_PR		(1 << 8)	/* RW port reset */
-#define EHCI_PS_SUSP		(1 << 7)	/* RW suspend */
-#define EHCI_PS_FPR		(1 << 6)	/* RW force port resume */
-#define EHCI_PS_OCC		(1 << 5)	/* RWC over current change */
-#define EHCI_PS_OCA		(1 << 4)	/* RO over current active */
-#define EHCI_PS_PEC		(1 << 3)	/* RWC port enable change */
-#define EHCI_PS_PE		(1 << 2)	/* RW port enable */
-#define EHCI_PS_CSC		(1 << 1)	/* RWC connect status change */
-#define EHCI_PS_CS		(1 << 0)	/* RO connect status */
-#define EHCI_PS_CLEAR		(EHCI_PS_OCC | EHCI_PS_PEC | EHCI_PS_CSC)
-
-#define EHCI_PS_IS_LOWSPEED(x)	(((x) & EHCI_PS_LS) == (1 << 10))
-
-/*
- * 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 {
-	/* this part defined by EHCI spec */
-	uint32_t qt_next;		/* see EHCI 3.5.1 */
-#define	QT_NEXT_TERMINATE	1
-	uint32_t qt_altnext;		/* see EHCI 3.5.2 */
-	uint32_t qt_token;		/* see EHCI 3.5.3 */
-	uint32_t qt_buffer[5];		/* see EHCI 3.5.4 */
-	uint32_t qt_buffer_hi[5];	/* Appendix B */
-	/* pad struct for 32 byte alignment */
-	uint32_t unused[3];
-};
-
-/* 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;
-	/*
-	 * Add dummy fill value to make the size of this struct
-	 * aligned to 32 bytes
-	 */
-	uint8_t fill[16];
-};
-
-/* Low level init functions */
-int ehci_hcd_init(void);
-int ehci_hcd_stop(void);
-
-#endif /* USB_EHCI_H */
diff --git a/include/usb/ehci-core.h b/include/usb/ehci-core.h
new file mode 100644
index 0000000..39e5c5e
--- /dev/null
+++ b/include/usb/ehci-core.h
@@ -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
diff --git a/include/usb/ehci.h b/include/usb/ehci.h
new file mode 100644
index 0000000..3d0ad0c
--- /dev/null
+++ b/include/usb/ehci.h
@@ -0,0 +1,203 @@
+/*-
+ * Copyright (c) 2007-2008, Juniper Networks, Inc.
+ * Copyright (c) 2008, Michael Trimarchi <trimarchimichael@yahoo.it>
+ * 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_H
+#define USB_EHCI_H
+
+#if !defined(CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS)
+#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	2
+#endif
+
+/* (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)
+
+#define DeviceOutRequest \
+	((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_DEVICE) << 8)
+
+#define InterfaceRequest \
+	((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
+
+#define EndpointRequest \
+	((USB_DIR_IN | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
+
+#define EndpointOutRequest \
+	((USB_DIR_OUT | USB_TYPE_STANDARD | USB_RECIP_INTERFACE) << 8)
+
+/*
+ * Register Space.
+ */
+struct ehci_hccr {
+	uint32_t cr_capbase;
+#define HC_LENGTH(p)		(((p) >> 0) & 0x00ff)
+#define HC_VERSION(p)		(((p) >> 16) & 0xffff)
+	uint32_t cr_hcsparams;
+#define HCS_PPC(p)		((p) & (1 << 4))
+#define HCS_INDICATOR(p)	((p) & (1 << 16)) /* Port indicators */
+#define HCS_N_PORTS(p)		(((p) >> 0) & 0xf)
+	uint32_t cr_hccparams;
+	uint8_t cr_hcsp_portrt[8];
+} __attribute__ ((packed, aligned(4)));
+
+struct ehci_hcor {
+	uint32_t or_usbcmd;
+#define CMD_PARK	(1 << 11)		/* enable "park" */
+#define CMD_PARK_CNT(c)	(((c) >> 8) & 3)	/* how many transfers to park */
+#define CMD_ASE		(1 << 5)		/* async schedule enable */
+#define CMD_LRESET	(1 << 7)		/* partial reset */
+#define CMD_IAAD	(1 << 5)		/* "doorbell" interrupt */
+#define CMD_PSE		(1 << 4)		/* periodic schedule enable */
+#define CMD_RESET	(1 << 1)		/* reset HC not bus */
+#define CMD_RUN		(1 << 0)		/* start/stop HC */
+	uint32_t or_usbsts;
+#define	STD_ASS		(1 << 15)
+#define STS_HALT	(1 << 12)
+	uint32_t or_usbintr;
+#define INTR_UE         (1 << 0)                /* USB interrupt enable */
+#define INTR_UEE        (1 << 1)                /* USB error interrupt enable */
+#define INTR_PCE        (1 << 2)                /* Port change detect enable */
+#define INTR_SEE        (1 << 4)                /* system error enable */
+#define INTR_AAE        (1 << 5)                /* Interrupt on async adavance enable */
+	uint32_t or_frindex;
+	uint32_t or_ctrldssegment;
+	uint32_t or_periodiclistbase;
+	uint32_t or_asynclistaddr;
+	uint32_t _reserved_[9];
+	uint32_t or_configflag;
+#define FLAG_CF		(1 << 0)	/* true:  we'll support "high speed" */
+	uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS];
+	uint32_t or_systune;
+} __attribute__ ((packed, aligned(4)));
+
+#define USBMODE		0x68		/* USB Device mode */
+#define USBMODE_SDIS	(1 << 3)	/* Stream disable */
+#define USBMODE_BE	(1 << 2)	/* BE/LE endiannes select */
+#define USBMODE_CM_HC	(3 << 0)	/* host controller mode */
+#define USBMODE_CM_IDLE	(0 << 0)	/* idle state */
+
+/* Interface descriptor */
+struct usb_linux_interface_descriptor {
+	unsigned char	bLength;
+	unsigned char	bDescriptorType;
+	unsigned char	bInterfaceNumber;
+	unsigned char	bAlternateSetting;
+	unsigned char	bNumEndpoints;
+	unsigned char	bInterfaceClass;
+	unsigned char	bInterfaceSubClass;
+	unsigned char	bInterfaceProtocol;
+	unsigned char	iInterface;
+} __attribute__ ((packed));
+
+/* Configuration descriptor information.. */
+struct usb_linux_config_descriptor {
+	unsigned char	bLength;
+	unsigned char	bDescriptorType;
+	unsigned short	wTotalLength;
+	unsigned char	bNumInterfaces;
+	unsigned char	bConfigurationValue;
+	unsigned char	iConfiguration;
+	unsigned char	bmAttributes;
+	unsigned char	MaxPower;
+} __attribute__ ((packed));
+
+#if defined CONFIG_EHCI_DESC_BIG_ENDIAN
+#define	ehci_readl(x)		(*((volatile u32 *)(x)))
+#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = ((volatile u32)b))
+#else
+#define ehci_readl(x)		cpu_to_le32((*((volatile u32 *)(x))))
+#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = \
+					cpu_to_le32(((volatile u32)b)))
+#endif
+
+#if defined CONFIG_EHCI_MMIO_BIG_ENDIAN
+#define hc32_to_cpu(x)		be32_to_cpu((x))
+#define cpu_to_hc32(x)		cpu_to_be32((x))
+#else
+#define hc32_to_cpu(x)		le32_to_cpu((x))
+#define cpu_to_hc32(x)		cpu_to_le32((x))
+#endif
+
+#define EHCI_PS_WKOC_E		(1 << 22)	/* RW wake on over current */
+#define EHCI_PS_WKDSCNNT_E	(1 << 21)	/* RW wake on disconnect */
+#define EHCI_PS_WKCNNT_E	(1 << 20)	/* RW wake on connect */
+#define EHCI_PS_PO		(1 << 13)	/* RW port owner */
+#define EHCI_PS_PP		(1 << 12)	/* RW,RO port power */
+#define EHCI_PS_LS		(3 << 10)	/* RO line status */
+#define EHCI_PS_PR		(1 << 8)	/* RW port reset */
+#define EHCI_PS_SUSP		(1 << 7)	/* RW suspend */
+#define EHCI_PS_FPR		(1 << 6)	/* RW force port resume */
+#define EHCI_PS_OCC		(1 << 5)	/* RWC over current change */
+#define EHCI_PS_OCA		(1 << 4)	/* RO over current active */
+#define EHCI_PS_PEC		(1 << 3)	/* RWC port enable change */
+#define EHCI_PS_PE		(1 << 2)	/* RW port enable */
+#define EHCI_PS_CSC		(1 << 1)	/* RWC connect status change */
+#define EHCI_PS_CS		(1 << 0)	/* RO connect status */
+#define EHCI_PS_CLEAR		(EHCI_PS_OCC | EHCI_PS_PEC | EHCI_PS_CSC)
+
+#define EHCI_PS_IS_LOWSPEED(x)	(((x) & EHCI_PS_LS) == (1 << 10))
+
+/*
+ * 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 {
+	/* this part defined by EHCI spec */
+	uint32_t qt_next;		/* see EHCI 3.5.1 */
+#define	QT_NEXT_TERMINATE	1
+	uint32_t qt_altnext;		/* see EHCI 3.5.2 */
+	uint32_t qt_token;		/* see EHCI 3.5.3 */
+	uint32_t qt_buffer[5];		/* see EHCI 3.5.4 */
+	uint32_t qt_buffer_hi[5];	/* Appendix B */
+	/* pad struct for 32 byte alignment */
+	uint32_t unused[3];
+};
+
+/* 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;
+	/*
+	 * Add dummy fill value to make the size of this struct
+	 * aligned to 32 bytes
+	 */
+	uint8_t fill[16];
+};
+
+/* Low level init functions */
+int ehci_hcd_init(void);
+int ehci_hcd_stop(void);
+
+#endif /* USB_EHCI_H */
-- 
1.7.1

  reply	other threads:[~2011-09-28 19:49 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 21:06 [U-Boot] some USB cleanup on EfikaMX Jana Rapava
2011-09-08 22:32 ` Wolfgang Denk
2011-09-09 10:18 ` Stefano Babic
2011-09-12 17:20 ` [U-Boot] [PATCH 1/2 v2] USB cleanup for EfikaMX Jana Rapava
2011-09-12 19:25   ` Marek Vasut
2011-09-18  2:19   ` [U-Boot] [PATCH v3] Add USB support for Efika Jana Rapava
2011-09-18  2:33     ` Marek Vasut
2011-09-19  8:43     ` Stefano Babic
2011-09-19 10:30       ` Marek Vasut
2011-09-24 15:57       ` Remy Bohmer
2011-09-24 19:07         ` Fabio Estevam
2011-09-24 19:19           ` Marek Vasut
2011-09-24 21:22             ` Fabio Estevam
2011-09-22  5:18     ` Marek Vasut
2011-09-25 11:55     ` [U-Boot] [PATCH v4 1/5] EHCI: add callback ehci_fixup Jana Rapava
2011-09-25 11:55       ` [U-Boot] [PATCH v4 2/5] Add USB support for Efika Jana Rapava
2011-09-25 11:55       ` [U-Boot] [PATCH v4 3/5] /drivers/usb/host/ehci-mxc.c: naming cleanup Jana Rapava
2011-09-25 11:55       ` [U-Boot] [PATCH v4 4/5] USB: Add usb_event_poll() to get keyboards working with EHCI Jana Rapava
2011-09-25 12:02         ` Marek Vasut
2011-09-25 11:55       ` [U-Boot] [PATCH v4 5/5] USB: move ehci.h and ehci-core.h into /include/usb/ Jana Rapava
2011-09-27 10:45         ` [U-Boot] [PATCH v5 1/4] usb: Move ehci.h and ehci-core.h to include/usb directory Jana Rapava
2011-09-27 10:57           ` Fabio Estevam
2011-09-27 11:01           ` [U-Boot] [PATCH v5 2/4] EHCI: add callback ehci_fixup Jana Rapava
2011-09-27 11:01             ` [U-Boot] [PATCH v5 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-27 11:01             ` [U-Boot] [PATCH v5 4/4] Add USB support for Efika Jana Rapava
2011-09-27 11:50               ` Marek Vasut
2011-09-27 14:12                 ` Jana Rapava
2011-09-27 14:55                   ` Marek Vasut
2011-09-27 18:17                 ` Jana Rapava
2011-09-27 18:20                   ` Marek Vasut
2011-09-28 10:26                   ` Stefano Babic
2011-09-28 12:12                     ` Jana Rapava
2011-09-27 11:23             ` [U-Boot] [PATCH v5 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-27 11:42               ` Jana Rapava
2011-09-27 19:24                 ` [U-Boot] [PATCH v6 " Jana Rapava
2011-09-27 19:24                   ` [U-Boot] [PATCH v6 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-27 19:41                     ` Marek Vasut
2011-09-27 20:19                       ` Jana Rapava
2011-09-27 20:47                         ` Marek Vasut
2011-09-27 19:24                   ` [U-Boot] [PATCH v6 4/4] Add USB support for Efika Jana Rapava
2011-09-27 19:47                     ` Marek Vasut
2011-09-27 20:40                       ` Jana Rapava
2011-09-27 20:50                         ` Marek Vasut
2011-09-27 19:40                   ` [U-Boot] [PATCH v6 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-27 22:21                   ` [U-Boot] [PATCH v7 " Jana Rapava
2011-09-27 22:21                     ` [U-Boot] [PATCH v7 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-27 22:21                     ` [U-Boot] [PATCH v7 4/4] Add USB support for Efika Jana Rapava
2011-09-28  0:43                       ` Marek Vasut
2011-09-28 12:25                         ` Jana Rapava
2011-09-28 12:28                           ` Marek Vasut
2011-09-28  0:46                     ` [U-Boot] [PATCH v7 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-28 10:54                     ` Marek Vasut
2011-09-28 11:52                       ` Jana Rapava
2011-09-28 12:13                         ` Marek Vasut
2011-09-28 15:02                     ` [U-Boot] [PATCH v8 " Jana Rapava
2011-09-28 15:05                       ` [U-Boot] [PATCH v8 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-28 15:07                         ` [U-Boot] [PATCH v8 4/4] Add USB support for Efika Jana Rapava
2011-09-28 15:20                           ` Marek Vasut
2011-09-28 18:12                             ` Jana Rapava
2011-09-28 18:26                               ` Marek Vasut
2011-10-06 21:18                           ` Wolfgang Denk
2011-10-07 17:16                             ` Jana Rapava
2011-09-28 15:21                       ` [U-Boot] [PATCH v8 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-27 11:07           ` [U-Boot] [PATCH v5 1/4] usb: Move ehci.h and ehci-core.h to include/usb directory Fabio Estevam
2011-09-27 11:09             ` Fabio Estevam
2011-09-27 11:27               ` Jana Rapava
2011-09-27 18:44           ` [U-Boot] [PATCH v6 " Jana Rapava
2011-09-27 22:06             ` [U-Boot] [PATCH v7 " Jana Rapava
2011-09-28 14:59               ` [U-Boot] [PATCH v8 " Jana Rapava
2011-09-28 19:49                 ` Jana Rapava [this message]
2011-09-28 20:36                   ` [U-Boot] [PATCH v9 " Marek Vasut
2011-09-28 21:10                     ` Jana Rapava
2011-09-28 21:43                       ` Marek Vasut
2011-09-28 23:04                         ` Jana Rapava
2011-09-28 23:05                           ` Marek Vasut
2011-09-28 23:22                             ` Jana Rapava
2011-09-28 19:51                 ` [U-Boot] [PATCH v9 2/4] EHCI: add callback ehci_fixup Jana Rapava
2011-09-28 19:52                   ` [U-Boot] [PATCH v9 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-28 19:54                     ` [U-Boot] [PATCH v9 4/4] Add USB support for Efika Jana Rapava
2011-09-28 20:44                       ` Marek Vasut
2011-09-28 20:36                   ` [U-Boot] [PATCH v9 2/4] EHCI: add callback ehci_fixup Marek Vasut
2011-09-28 21:14                     ` Jana Rapava
2011-09-28 21:26                       ` Marek Vasut
2011-09-25 12:02       ` [U-Boot] [PATCH v4 1/5] " Marek Vasut
2011-09-25 17:25     ` [U-Boot] [PATCH v4 1/4] USB: move ehci.h and ehci-core.h into /include/usb/ Jana Rapava
2011-09-25 17:25       ` [U-Boot] [PATCH v4 2/4] EHCI: add callback ehci_fixup Jana Rapava
2011-09-25 17:41         ` Marek Vasut
2011-09-25 17:25       ` [U-Boot] [PATCH v4 3/4] EHCI: adjust for mx5 Jana Rapava
2011-09-25 17:38         ` Marek Vasut
2011-09-25 17:25       ` [U-Boot] [PATCH v4 4/4] Add USB support for Efika Jana Rapava
2011-09-25 17:34         ` Marek Vasut
2011-09-26 20:28           ` Jana Rapava
2011-09-26 20:42             ` Marek Vasut
2011-09-26 20:51             ` Marek Vasut
2011-09-27 11:00               ` Jana Rapava
2011-09-25 19:01       ` [U-Boot] [PATCH v4 1/4] USB: move ehci.h and ehci-core.h into /include/usb/ Fabio Estevam
2011-09-26  8:32         ` Jana Rapava
2011-10-09 18:42       ` Marek Vasut
2011-10-09 20:22         ` Jana Rapava
2011-10-14 15:49           ` Fabio Estevam
2011-10-14 16:07             ` Marek Vasut
2011-10-14 15:50           ` Marek Vasut
2011-10-06 21:33   ` [U-Boot] [PATCH 1/2 v2] USB cleanup for EfikaMX Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317239385-32219-1-git-send-email-fermata7@gmail.com \
    --to=fermata7@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox