Google
  Web www.spinics.net

[PATCH] IXP43X USB EHCI board config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Patch defines registers and configures platform device for  USB EHCI  on
ixp43x.

Tested on KIXRP435  board.  Applies against 2.6.27-rc5  

Note: This patch will not work properly on the board without the patch 
to cpu.h and  ixp4xx-regs.h  That is not yet in linus's tree as of rc5

http://marc.info/?l=linux-arm-kernel&m=121444002819528&w=2


Thanks,

Karl
Signed-off-by: Karl Hiramoto <karl@xxxxxxxxxxxx>

diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 58bd284..21808d5 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -305,6 +305,59 @@ struct sys_timer ixp4xx_timer = {
 	.init		= ixp4xx_timer_init,
 };
 
+static struct resource ixp43x_usb_hcd0_resources[] = {
+	[0] = {
+		.start = IXP43X_USB0_PERIPHERAL_BASE_PHYS,
+		.end = IXP43X_USB0_PERIPHERAL_BASE_PHYS
+			+ IXP43X_USB0_PERIPHERAL_REGION_SIZE,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= 32,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+
+static struct resource ixp43x_usb_hcd1_resources[] = {
+	[0] = {
+		.start = IXP43X_USB1_PERIPHERAL_BASE_PHYS,
+		.end = IXP43X_USB1_PERIPHERAL_BASE_PHYS
+			+ IXP43X_USB1_PERIPHERAL_REGION_SIZE,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= 33,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static u64 ehci_dma_mask = ~(u32)0;
+
+static struct platform_device ixp43x_usb_hcd0_device =  {
+	.name		= "ixp4xx-ehci",
+	.id		= 0,
+	.resource	= ixp43x_usb_hcd0_resources,
+	.num_resources	= ARRAY_SIZE(ixp43x_usb_hcd0_resources),
+	 .dev = {
+		 .dma_mask		= &ehci_dma_mask,
+		 .coherent_dma_mask	= 0xffffffff,
+		 },
+};
+
+
+static struct platform_device ixp43x_usb_hcd1_device = {
+	.name		= "ixp4xx-ehci",
+	.id		= 1,
+	.resource	= ixp43x_usb_hcd1_resources,
+	.num_resources	= ARRAY_SIZE(ixp43x_usb_hcd1_resources),
+	.dev = {
+		 .dma_mask		= &ehci_dma_mask,
+		 .coherent_dma_mask	= 0xffffffff,
+		 },
+};
+
+
 static struct pxa2xx_udc_mach_info ixp4xx_udc_info;
 
 void __init ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info)
@@ -371,6 +424,13 @@ static struct platform_device *ixp46x_devices[] __initdata = {
 	&ixp46x_i2c_controller
 };
 
+static struct platform_device *ixp43x_devices[] __initdata = {
+	&ixp43x_usb_hcd0_device,
+	&ixp43x_usb_hcd1_device,
+};
+
+
+
 unsigned long ixp4xx_exp_bus_size;
 EXPORT_SYMBOL(ixp4xx_exp_bus_size);
 
@@ -380,6 +440,11 @@ void __init ixp4xx_sys_init(void)
 
 	platform_add_devices(ixp4xx_devices, ARRAY_SIZE(ixp4xx_devices));
 
+	if (cpu_is_ixp43x()) {
+		platform_add_devices(ixp43x_devices,
+				ARRAY_SIZE(ixp43x_devices));
+	}
+
 	if (cpu_is_ixp46x()) {
 		int region;
 
diff --git a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
index ad9c888..393f54a 100644
--- a/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
+++ b/arch/arm/mach-ixp4xx/include/mach/ixp4xx-regs.h
@@ -37,6 +37,10 @@
  * 0xC4000000	0x00001000	0xffbfe000	EXP CFG
  *
  * 0xC8000000	0x00013000	0xffbeb000	On-Chip Peripherals
+ *
+ * 0xCD000000	0x00000300	0xffbead00	USB Host controller Port 0
+ *
+ * 0xCE000000	0x00000300	0xffbeaa00	USB Host controller Port 1
  */
 
 /*
@@ -66,6 +70,21 @@
 #define IXP4XX_PERIPHERAL_BASE_VIRT	(0xFFBEB000)
 #define IXP4XX_PERIPHERAL_REGION_SIZE	(0x00013000)
 
+
+/*
+ * USB Host controller Port 0
+ */
+#define IXP43X_USB0_PERIPHERAL_BASE_PHYS	(0xCD000000)
+#define IXP43X_USB0_PERIPHERAL_BASE_VIRT	(0xFFBEAD00)
+#define IXP43X_USB0_PERIPHERAL_REGION_SIZE	(0x00000300)
+
+/*
+ * USB Host controller Port 1
+ */
+#define IXP43X_USB1_PERIPHERAL_BASE_PHYS	(0xCE000000)
+#define IXP43X_USB1_PERIPHERAL_BASE_VIRT	(0xFFBEAA00)
+#define IXP43X_USB1_PERIPHERAL_REGION_SIZE	(0x00000300)
+
 /*
  * Debug UART
  *

[Home]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Video Projectors]     [PDAs]     [Free Online Dating]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [16.7MP]

Add to Google Powered by Linux