aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/cns21xx/patches-3.10/201-cns21xx-add-usb-devices.patch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-09-13 16:39:33 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-09-13 16:39:33 +0000
commit24215346125214b18e1c85e56075884d813c39d9 (patch)
treeb7f86ed54fc97d7e8eadec45a9297063e020a050 /target/linux/cns21xx/patches-3.10/201-cns21xx-add-usb-devices.patch
parent6c14f5f3a60e017f101d792d94941f061b9c43f2 (diff)
downloadupstream-24215346125214b18e1c85e56075884d813c39d9.tar.gz
upstream-24215346125214b18e1c85e56075884d813c39d9.tar.bz2
upstream-24215346125214b18e1c85e56075884d813c39d9.zip
cns21xx: add support for 3.10
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 37971
Diffstat (limited to 'target/linux/cns21xx/patches-3.10/201-cns21xx-add-usb-devices.patch')
-rw-r--r--target/linux/cns21xx/patches-3.10/201-cns21xx-add-usb-devices.patch104
1 files changed, 104 insertions, 0 deletions
diff --git a/target/linux/cns21xx/patches-3.10/201-cns21xx-add-usb-devices.patch b/target/linux/cns21xx/patches-3.10/201-cns21xx-add-usb-devices.patch
new file mode 100644
index 0000000000..f0ffa1e520
--- /dev/null
+++ b/target/linux/cns21xx/patches-3.10/201-cns21xx-add-usb-devices.patch
@@ -0,0 +1,104 @@
+--- /dev/null
++++ b/arch/arm/mach-cns21xx/dev-usb.c
+@@ -0,0 +1,71 @@
++/*
++ * Copyright (c) 2008 Cavium Networks
++ * Copyright (c) 2010-2012 Gabor Juhos <juhosg@openwrt.org>
++ *
++ * This file 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.
++ */
++
++#include <linux/init.h>
++#include <linux/irq.h>
++#include <linux/dma-mapping.h>
++#include <linux/platform_device.h>
++
++#include <mach/cns21xx.h>
++
++static u64 cns21xx_usb_dmamask = DMA_BIT_MASK(32);
++
++static struct resource cns21xx_ohci_resources[] = {
++ [0] = {
++ .start = CNS21XX_OHCI_CTRL_BASE,
++ .end = CNS21XX_OHCI_CTRL_BASE + SZ_1M - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = CNS21XX_IRQ_OHCI,
++ .end = CNS21XX_IRQ_OHCI,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device cns21xx_ohci_device = {
++ .name = "cns21xx-ohci",
++ .id = -1,
++ .dev = {
++ .dma_mask = &cns21xx_usb_dmamask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ },
++ .resource = cns21xx_ohci_resources,
++ .num_resources = ARRAY_SIZE(cns21xx_ohci_resources),
++};
++
++static struct resource cns21xx_ehci_resources[] = {
++ [0] = {
++ .start = CNS21XX_EHCI_CTRL_BASE,
++ .end = CNS21XX_EHCI_CTRL_BASE + SZ_1M - 1,
++ .flags = IORESOURCE_MEM,
++ },
++ [1] = {
++ .start = CNS21XX_IRQ_EHCI,
++ .end = CNS21XX_IRQ_EHCI,
++ .flags = IORESOURCE_IRQ,
++ },
++};
++
++static struct platform_device cns21xx_ehci_device = {
++ .name = "cns21xx-ehci",
++ .id = -1,
++ .dev = {
++ .dma_mask = &cns21xx_usb_dmamask,
++ .coherent_dma_mask = DMA_BIT_MASK(32),
++ },
++ .resource = cns21xx_ehci_resources,
++ .num_resources = ARRAY_SIZE(cns21xx_ehci_resources),
++};
++
++void __init cns21xx_register_usb(void)
++{
++ platform_device_register(&cns21xx_ehci_device);
++ platform_device_register(&cns21xx_ohci_device);
++}
+--- a/arch/arm/mach-cns21xx/Kconfig
++++ b/arch/arm/mach-cns21xx/Kconfig
+@@ -3,4 +3,7 @@ if ARCH_CNS21XX
+ menu "Cavium Networks CNS21xx based machines"
+ endmenu
+
++config CNS21XX_DEV_USB
++ def_bool n
++
+ endif
+--- a/arch/arm/mach-cns21xx/Makefile
++++ b/arch/arm/mach-cns21xx/Makefile
+@@ -6,5 +6,8 @@
+
+ obj-y := core.o irq.o gpio.o mm.o time.o idle.o devices.o
+
++# devices
++obj-$(CONFIG_CNS21XX_DEV_USB) += dev-usb.o
++
+ # machine specific files
+
+--- a/arch/arm/mach-cns21xx/common.h
++++ b/arch/arm/mach-cns21xx/common.h
+@@ -20,5 +20,6 @@ extern struct sys_timer cns21xx_timer;
+
+ int cns21xx_register_uart0(void);
+ int cns21xx_register_uart1(void);
++int cns21xx_register_usb(void);
+
+ #endif /* _MACH_CNS21XX_COMMON_H */