2 +++ b/arch/arm/mach-cns21xx/dev-usb.c
5 + * Copyright (c) 2008 Cavium Networks
6 + * Copyright (c) 2010 Gabor Juhos <juhosg@openwrt.org>
8 + * This file is free software; you can redistribute it and/or modify
9 + * it under the terms of the GNU General Public License, Version 2, as
10 + * published by the Free Software Foundation.
13 +#include <linux/init.h>
14 +#include <linux/irq.h>
15 +#include <linux/dma-mapping.h>
16 +#include <linux/platform_device.h>
18 +#include <mach/cns21xx.h>
20 +static u64 cns21xx_usb_dmamask = DMA_BIT_MASK(32);
22 +static struct resource cns21xx_ohci_resources[] = {
24 + .start = CNS21XX_OHCI_CTRL_BASE,
25 + .end = CNS21XX_OHCI_CTRL_BASE + SZ_1M - 1,
26 + .flags = IORESOURCE_MEM,
29 + .start = CNS21XX_IRQ_OHCI,
30 + .end = CNS21XX_IRQ_OHCI,
31 + .flags = IORESOURCE_IRQ,
35 +static struct platform_device cns21xx_ohci_device = {
36 + .name = "cns21xx-ohci",
39 + .dma_mask = &cns21xx_usb_dmamask,
40 + .coherent_dma_mask = DMA_BIT_MASK(32),
42 + .resource = cns21xx_ohci_resources,
43 + .num_resources = ARRAY_SIZE(cns21xx_ohci_resources),
46 +static struct resource cns21xx_ehci_resources[] = {
48 + .start = CNS21XX_EHCI_CTRL_BASE,
49 + .end = CNS21XX_EHCI_CTRL_BASE + SZ_1M - 1,
50 + .flags = IORESOURCE_MEM,
53 + .start = CNS21XX_IRQ_EHCI,
54 + .end = CNS21XX_IRQ_EHCI,
55 + .flags = IORESOURCE_IRQ,
59 +static struct platform_device cns21xx_ehci_device = {
60 + .name = "cns21xx-ehci",
63 + .dma_mask = &cns21xx_usb_dmamask,
64 + .coherent_dma_mask = DMA_BIT_MASK(32),
66 + .resource = cns21xx_ehci_resources,
67 + .num_resources = ARRAY_SIZE(cns21xx_ehci_resources),
70 +void __init cns21xx_register_usb(void)
72 + platform_device_register(&cns21xx_ehci_device);
73 + platform_device_register(&cns21xx_ohci_device);
75 --- a/arch/arm/mach-cns21xx/Kconfig
76 +++ b/arch/arm/mach-cns21xx/Kconfig
77 @@ -3,4 +3,7 @@ if ARCH_CNS21XX
78 menu "Cavium Networks CNS21xx based machines"
81 +config CNS21XX_DEV_USB
85 --- a/arch/arm/mach-cns21xx/Makefile
86 +++ b/arch/arm/mach-cns21xx/Makefile
89 obj-y := core.o devices.o gpio.o irq.o mm.o time.o
92 +obj-$(CONFIG_CNS21XX_DEV_USB) += dev-usb.o
94 # machine specific files
96 --- a/arch/arm/mach-cns21xx/common.h
97 +++ b/arch/arm/mach-cns21xx/common.h
98 @@ -18,5 +18,6 @@ extern struct sys_timer cns21xx_timer;
100 int __init cns21xx_register_uart0(void);
101 int __init cns21xx_register_uart1(void);
102 +int __init cns21xx_register_usb(void);
104 #endif /* _MACH_CNS21XX_COMMON_H */