Commit 69f22be7 authored by Igor Grinberg's avatar Igor Grinberg Committed by Eric Miao
Browse files

ARM: pxa: add U2D controller and ULPI driver for pxa3xx



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: default avatarIgor Grinberg <grinberg@compulab.co.il>
Signed-off-by: default avatarMike Rapoport <mike@compulab.co.il>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent cb655d0f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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)

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

config PXA310_ULPI
	bool

endif
+1 −1
Original line number Diff line number Diff line
@@ -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
+28 −0
Original line number Diff line number Diff line
@@ -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>
@@ -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,
+1 −0
Original line number Diff line number Diff line
@@ -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;
+35 −0
Original line number Diff line number Diff line
/*
 * 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