USB: Add EHCI support for MX27 and MX31 based boards
Subsystems (5)
PATCH 1/1 USB: Add EHCI support for MX27 and MX31 based boards
The Freescale MX27 and MX31 SoCs have a EHCI controller onboard. The controller is capable of USB on the go. This patch adds a driver to support all three of them.
Users have to pass details about serial interface configuration in the platform data.
The USB OTG core used here is the ARC core, so the driver should be renamed and probably be merged with ehci-fsl.c eventually.
Signed-off-by Sascha Hauer <[email protected]>
Signed-off-by Daniel Mack <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc David Brownell <[email protected]>
Cc linux-usb at vger.kernel.org
--- arch/arm/plat-mxc/Makefile | 2 + arch/arm/plat-mxc/ehci.c | 92 +++++++++ arch/arm/plat-mxc/include/mach/mxc_ehci.h | 37 ++++ drivers/usb/Kconfig | 1 + drivers/usb/host/Kconfig | 7 + drivers/usb/host/ehci-hcd.c | 5 + drivers/usb/host/ehci-mxc.c | 296 +++++++++++++++++++++++++++++ 7 files changed, 440 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-mxc/ehci.c create mode 100644 arch/arm/plat-mxc/include/mach/mxc_ehci.h create mode 100644 drivers/usb/host/ehci-mxc.c
arch/arm/plat-mxc/Makefile +2 -0
@@ -10,3 +10,5 @@ obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o obj-$(CONFIG_MXC_PWM) += pwm.o obj-$(CONFIG_MXC_ULPI) += ulpi.o +obj-$(CONFIG_USB_EHCI_MXC) += ehci.o +
arch/arm/plat-mxc/ehci.c new file +92 -0
92 lines not on this page · raw message
arch/arm/plat-mxc/include/mach/mxc_ehci.h new file +37 -0
@@ -0,0 +1,37 @@ +#ifndef __INCLUDE_ASM_ARCH_MXC_EHCI_H +#define __INCLUDE_ASM_ARCH_MXC_EHCI_H + +/* values for portsc field */ +#define MXC_EHCI_PHY_LOW_POWER_SUSPEND (1 << 23) +#define MXC_EHCI_FORCE_FS (1 << 24) +#define MXC_EHCI_UTMI_8BIT (0 << 28) +#define MXC_EHCI_UTMI_16BIT (1 << 28) +#define MXC_EHCI_SERIAL (1 << 29) +#define MXC_EHCI_MODE_UTMI (0 << 30) +#define MXC_EHCI_MODE_PHILIPS (1 << 30) +#define MXC_EHCI_MODE_ULPI (2 << 30) +#define MXC_EHCI_MODE_SERIAL (3 << 30) + +/* values for flags field */ +#define MXC_EHCI_INTERFACE_DIFF_UNI (0 << 0) +#define MXC_EHCI_INTERFACE_DIFF_BI (1 << 0) +#define MXC_EHCI_INTERFACE_SINGLE_UNI (2 << 0) +#define MXC_EHCI_INTERFACE_SINGLE_BI (3 << 0) +#define MXC_EHCI_INTERFACE_MASK (0xf) + +#define MXC_EHCI_POWER_PINS_ENABLED (1 << 5) +#define MXC_EHCI_TTL_ENABLED (1 << 6) + +struct mxc_usbh_platform_data { +int (*init)(struct platform_device *pdev); +int (*exit)(struct platform_device *pdev); + +unsigned int portsc; +unsigned int flags; +struct otg_transceiver *otg; +}; + +int mxc_set_usbcontrol (int port,unsigned int flags); + +#endif /* __INCLUDE_ASM_ARCH_MXC_EHCI_H */ +
drivers/usb/Kconfig +1 -0
@@ -60,6 +60,7 @@ config USB_ARCH_HAS_EHCI default y if ARCH_IXP4XX default y if ARCH_W90X900 default y if ARCH_AT91SAM9G45 + default y if ARCH_MXC default PCI # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface.
drivers/usb/host/Kconfig +7 -0
@@ -105,6 +105,13 @@ config USB_EHCI_FSL ---help--- Variation of ARC USB block used in some Freescale chips. +config USB_EHCI_MXC + bool "Support for Freescale on-chip EHCI USB controller" + depends on USB_EHCI_HCD && ARCH_MXC + select USB_EHCI_ROOT_HUB_TT + ---help--- + Variation of ARC USB block used in some Freescale chips. + config USB_EHCI_HCD_PPC_OF bool "EHCI support for PPC USB controller on OF platform bus" depends on USB_EHCI_HCD && PPC_OF
drivers/usb/host/ehci-hcd.c +5 -0
@@ -1103,6 +1103,11 @@ MODULE_LICENSE ("GPL");#define PLATFORM_DRIVER ehci_fsl_driver#endif +#ifdef CONFIG_USB_EHCI_MXC +#include "ehci-mxc.c" +#define PLATFORM_DRIVER ehci_mxc_driver +#endif +#ifdef CONFIG_SOC_AU1200 #include "ehci-au1xxx.c" #define PLATFORM_DRIVER ehci_hcd_au1xxx_driver
drivers/usb/host/ehci-mxc.c new file +296 -0
296 lines not on this page · raw message
Signature · 1 line
1.6.5