Skip to content

Commit

Permalink
ARM: pxa: add U2D controller and ULPI driver for pxa3xx
Browse files Browse the repository at this point in the history
USB2.0 Device Controller (U2DC) which is found in Marvell PXA3xx.
U2DC supports both High and Full speed modes.
PXA320 and PXA300 U2DC supports only UTMI interface.
PXA310 U2DC supports only ULPI interface and has the OTG capability.

U2D Controller ULPI driver introduced in this patch supports only the
PXA310 USB Host via the ULPI.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
  • Loading branch information
Igor Grinberg authored and Eric Miao committed Oct 8, 2010
1 parent cb655d0 commit 69f22be
Show file tree
Hide file tree
Showing 7 changed files with 462 additions and 2 deletions.
4 changes: 4 additions & 0 deletions arch/arm/mach-pxa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ config CPU_PXA300
config CPU_PXA310
bool
select CPU_PXA300
select PXA310_ULPI if USB_ULPI
help
PXA310 (codename Monahans-LV)

Expand Down Expand Up @@ -698,4 +699,7 @@ config PXA_HAVE_BOARD_IRQS
config PXA_HAVE_ISA_IRQS
bool

config PXA310_ULPI
bool

endif
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif
# SoC-specific code
obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o
obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o pxa2xx.o pxa27x.o
obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o pxa3xx.o smemc.o
obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o
obj-$(CONFIG_CPU_PXA300) += pxa300.o
obj-$(CONFIG_CPU_PXA320) += pxa320.o
obj-$(CONFIG_CPU_PXA930) += pxa930.o
Expand Down
28 changes: 28 additions & 0 deletions arch/arm/mach-pxa/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <asm/pmu.h>
#include <mach/udc.h>
#include <mach/pxa3xx-u2d.h>
#include <mach/pxafb.h>
#include <mach/mmc.h>
#include <mach/irda.h>
Expand Down Expand Up @@ -134,6 +135,33 @@ struct platform_device pxa27x_device_udc = {
}
};

#ifdef CONFIG_PXA3xx
static struct resource pxa3xx_u2d_resources[] = {
[0] = {
.start = 0x54100000,
.end = 0x54100fff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_USB2,
.end = IRQ_USB2,
.flags = IORESOURCE_IRQ,
},
};

struct platform_device pxa3xx_device_u2d = {
.name = "pxa3xx-u2d",
.id = -1,
.resource = pxa3xx_u2d_resources,
.num_resources = ARRAY_SIZE(pxa3xx_u2d_resources),
};

void __init pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info)
{
pxa_register_device(&pxa3xx_device_u2d, info);
}
#endif /* CONFIG_PXA3xx */

static struct resource pxafb_resources[] = {
[0] = {
.start = 0x44000000,
Expand Down
1 change: 1 addition & 0 deletions arch/arm/mach-pxa/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern struct platform_device pxa3xx_device_mci2;
extern struct platform_device pxa3xx_device_mci3;
extern struct platform_device pxa25x_device_udc;
extern struct platform_device pxa27x_device_udc;
extern struct platform_device pxa3xx_device_u2d;
extern struct platform_device pxa_device_fb;
extern struct platform_device pxa_device_ffuart;
extern struct platform_device pxa_device_btuart;
Expand Down
35 changes: 35 additions & 0 deletions arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* PXA3xx U2D header
*
* Copyright (C) 2010 CompuLab Ltd.
*
* Igor Grinberg <grinberg@compulab.co.il>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __PXA310_U2D__
#define __PXA310_U2D__

#include <linux/usb/ulpi.h>

struct pxa3xx_u2d_platform_data {

#define ULPI_SER_6PIN (1 << 0)
#define ULPI_SER_3PIN (1 << 1)
unsigned int ulpi_mode;

int (*init)(struct device *);
void (*exit)(struct device *);
};


/* Start PXA3xx U2D host */
int pxa3xx_u2d_start_hc(struct usb_bus *host);
/* Stop PXA3xx U2D host */
void pxa3xx_u2d_stop_hc(struct usb_bus *host);

extern void pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info);

#endif /* __PXA310_U2D__ */
Loading

0 comments on commit 69f22be

Please sign in to comment.