Skip to contentSkip to conversation

Support 440EP On-Chip OHCI USB Host Controller

PATCH New John Otken 1 participant 1 message Jul 26, 2005 USB

lore
Share & tools
lore

John Otken

author
#0 lore raw

PATCH 1/1 Support 440EP On-Chip OHCI USB Host Controller

This patch adds support for the AMCC 440EP on-chip OHCI USB host controller. I tested it on the Bamboo and Yosemite boards using the 2.6.12 kernel.

This patch depends on Wade Farnsworth's "PPC440EP SoC and Bamboo board support" patch from 2005-04-07 and my "fix invalid function name usb_hcd_put in ohci-ppc-soc.c" patch from 2005-07-20:

http://patchwork.ozlabs.org/linuxppc/patch?id=1311
http://patchwork.ozlabs.org/linuxppc/patch?id=1803

Comments are welcome.

(This is a repost. My email host has had problems.)

arch/ppc/platforms/4xx/bamboo.c +0 -0
diff -uprN b/arch/ppc/platforms/4xx/bamboo.c c/arch/ppc/platforms/4xx/bamboo.c
@@ -431,5 +431,7 @@ void __init platform_init(unsigned long #ifdef CONFIG_KGDB
	ppc_md.early_serial_map = bamboo_early_serial_map;

#endif
+
+ SDR_WRITE( 0x320, 1 ); /* little endian usb (SDR0_USB0) */
}

arch/ppc/platforms/4xx/ibm440ep.c +0 -0
diff -uprN b/arch/ppc/platforms/4xx/ibm440ep.c c/arch/ppc/platforms/4xx/ibm440ep.c
@@ -187,3 +187,44 @@ struct ppc4xx_uic_settings ppc4xx_core_u
	},
};

+static struct resource ohci_usb_resources[] = {
+ [0] = {

+	    .start	= 0x0EF601000,
+	    .end	= 0x0EF601000 + 0x80 - 1,
+	    .flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+	    .start	= 40,
+	    .end	= 40,
+	    .flags	= IORESOURCE_IRQ,

+ },
+};
+
+static u64 dma_mask = 0xffffffffULL;
+
+#include <asm/usb.h>
+
+static struct usb_hcd_platform_data platform_data; +
+static struct platform_device ohci_usb_device = {
+ .name = "ppc-soc-ohci",
+ .id = 0,
+ .num_resources = ARRAY_SIZE(ohci_usb_resources),
+ .resource = ohci_usb_resources,
+ .dev = {

+	    .dma_mask = &dma_mask,
+	    .coherent_dma_mask = 0xffffffffULL,
+	    .platform_data = &platform_data,

+ }
+};
+
+static struct platform_device *ibm440ep_devs[] __initdata = {
+ &ohci_usb_device,
+};
+
+static int __init
+ ibm440ep_platform_add_devices(void)
+{
+ return platform_add_devices(ibm440ep_devs, ARRAY_SIZE(ibm440ep_devs));
+}
+arch_initcall(ibm440ep_platform_add_devices);

drivers/usb/host/Kconfig +0 -0
diff -uprN b/drivers/usb/host/Kconfig c/drivers/usb/host/Kconfig
@@ -68,7 +68,7 @@ config USB_OHCI_HCD
 

config USB_OHCI_HCD_PPC_SOC
bool "OHCI support for on-chip PPC USB controller"

-	depends on USB_OHCI_HCD && (STB03xxx || PPC_MPC52xx)
+	depends on USB_OHCI_HCD && (STB03xxx || PPC_MPC52xx || 440EP)
	default y
	select USB_OHCI_BIG_ENDIAN
	---help---

@@ -92,7 +92,7 @@ config USB_OHCI_BIG_ENDIAN
config USB_OHCI_LITTLE_ENDIAN
bool
depends on USB_OHCI_HCD

-	default n if STB03xxx || PPC_MPC52xx
+	default n if STB03xxx || PPC_MPC52xx || 440EP

default y

config USB_UHCI_HCD

include/asm-ppc/usb.h +13 -0
diff -uprN b/include/asm-ppc/usb.h c/include/asm-ppc/usb.h
@@ -0,0 +1,13 @@
+/*
+ * ppc/usb.h:
+ *
+ */
+#ifndef _PPC_USB_H
+#define _PPC_USB_H
+
+struct usb_hcd_platform_data {
+	int (*start) (struct platform_device *pdev);
+	void (*stop) (struct platform_device *pdev);
+};
+
+#endif /* !(_PPC_USB_H) */