* [PATCH] Support 440EP On-Chip OHCI USB Host Controller (v2)
@ 2005-08-09 12:03 John Otken
2005-08-09 16:30 ` Eugene Surovegin
0 siblings, 1 reply; 2+ messages in thread
From: John Otken @ 2005-08-09 12:03 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: roffermanns
This updated patch adds support for the AMCC 440EP on-chip
OHCI USB host controller. I tested it on the Bamboo board
using the 2.6.13-rc6 kernel.
This patch depends on 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=1803
Thanks to Wade Farnsworth for a bug fix.
This patch supersedes my previous patch released on
2005-07-25 and duped on 2005-07-27.
Comments are welcome.
Signed-off-by: John Otken <jotken@softadvances.com>
diff -uprN a/arch/ppc/platforms/4xx/ibm440ep.c b/arch/ppc/platforms/4xx/ibm440ep.c
--- a/arch/ppc/platforms/4xx/ibm440ep.c 2005-08-04 14:56:30.000000000 -0500
+++ b/arch/ppc/platforms/4xx/ibm440ep.c 2005-08-05 07:21:55.000000000 -0500
@@ -194,8 +194,37 @@ static struct resource usb_gadget_resour
},
};
+static struct resource ohci_usb_resources[] = {
+ [0] = {
+ .start = 0x0EF601000,
+ .end = 0x0EF60107F,
+ .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 usb_gadget_device = {
.name = "musbhsfc",
.id = 0,
@@ -208,6 +237,7 @@ static struct platform_device usb_gadget
};
static struct platform_device *ibm440ep_devs[] __initdata = {
+ &ohci_usb_device,
&usb_gadget_device,
};
diff -uprN a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
--- a/drivers/usb/host/Kconfig 2005-08-04 14:56:33.000000000 -0500
+++ b/drivers/usb/host/Kconfig 2005-08-08 18:30:58.000000000 -0500
@@ -81,12 +81,12 @@ 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---
- Enables support for the USB controller on the MPC52xx or
- STB03xxx processor chip. If unsure, say Y.
+ Enables support for the USB controller on the MPC52xx,
+ STB03xxx, or 440EP processor chip. If unsure, say Y.
config USB_OHCI_HCD_PCI
bool "OHCI support for PCI-bus USB controllers"
@@ -105,7 +105,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
diff -uprN a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
--- a/drivers/usb/host/ohci.h 2005-08-04 14:56:33.000000000 -0500
+++ b/drivers/usb/host/ohci.h 2005-08-08 18:31:04.000000000 -0500
@@ -560,7 +560,7 @@ static inline u32 hc32_to_cpup (const st
* some big-endian SOC implementations. Same thing happens with PSW access.
*/
-#ifdef CONFIG_STB03xxx
+#if defined(CONFIG_STB03xxx) || defined(CONFIG_440EP)
#define OHCI_BE_FRAME_NO_SHIFT 16
#else
#define OHCI_BE_FRAME_NO_SHIFT 0
diff -uprN a/drivers/usb/Kconfig b/drivers/usb/Kconfig
--- a/drivers/usb/Kconfig 2005-08-04 14:56:33.000000000 -0500
+++ b/drivers/usb/Kconfig 2005-08-05 06:55:33.000000000 -0500
@@ -25,6 +25,7 @@ config USB_ARCH_HAS_OHCI
# PPC:
default y if STB03xxx
default y if PPC_MPC52xx
+ default y if 440EP
# MIPS:
default y if SOC_AU1X00
# more:
diff -uprN a/include/asm-ppc/usb.h b/include/asm-ppc/usb.h
--- a/include/asm-ppc/usb.h 1969-12-31 17:00:00.000000000 -0700
+++ b/include/asm-ppc/usb.h 2005-08-05 06:13:58.000000000 -0500
@@ -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) */
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] Support 440EP On-Chip OHCI USB Host Controller (v2)
2005-08-09 12:03 [PATCH] Support 440EP On-Chip OHCI USB Host Controller (v2) John Otken
@ 2005-08-09 16:30 ` Eugene Surovegin
0 siblings, 0 replies; 2+ messages in thread
From: Eugene Surovegin @ 2005-08-09 16:30 UTC (permalink / raw)
To: John Otken; +Cc: roffermanns, linuxppc-embedded
On Tue, Aug 09, 2005 at 07:03:21AM -0500, John Otken wrote:
> This updated patch adds support for the AMCC 440EP on-chip
> OHCI USB host controller. I tested it on the Bamboo board
> using the 2.6.13-rc6 kernel.
>
> @@ -194,8 +194,37 @@ static struct resource usb_gadget_resour
> },
> };
>
> +static struct resource ohci_usb_resources[] = {
> + [0] = {
> + .start = 0x0EF601000,
> + .end = 0x0EF60107F,
> + .flags = IORESOURCE_MEM,
> + },
> + [1] = {
> + .start = 40,
> + .end = 40,
> + .flags = IORESOURCE_IRQ,
> + },
> +};
> +
> static u64 dma_mask = 0xffffffffULL;
>
> +#include <asm/usb.h>
Let's place #include directives at the top of the source file.
--
Eugene
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-09 16:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-09 12:03 [PATCH] Support 440EP On-Chip OHCI USB Host Controller (v2) John Otken
2005-08-09 16:30 ` Eugene Surovegin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).