From 0d46434b606a53fc835cbb70cad4bf03e99f613d Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Thu, 30 Dec 2010 17:19:16 +0000 Subject: cns21xx: add initial support for the Cavium CNS21xx SoC git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24859 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../201-cns21xx-add-usb-devices.patch | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 target/linux/cns21xx/patches-2.6.36/201-cns21xx-add-usb-devices.patch (limited to 'target/linux/cns21xx/patches-2.6.36/201-cns21xx-add-usb-devices.patch') diff --git a/target/linux/cns21xx/patches-2.6.36/201-cns21xx-add-usb-devices.patch b/target/linux/cns21xx/patches-2.6.36/201-cns21xx-add-usb-devices.patch new file mode 100644 index 0000000000..1bf40d4cb5 --- /dev/null +++ b/target/linux/cns21xx/patches-2.6.36/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 Gabor Juhos ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++ ++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 devices.o gpio.o irq.o mm.o time.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 +@@ -18,5 +18,6 @@ extern struct sys_timer cns21xx_timer; + + int __init cns21xx_register_uart0(void); + int __init cns21xx_register_uart1(void); ++int __init cns21xx_register_usb(void); + + #endif /* _MACH_CNS21XX_COMMON_H */ -- cgit v1.2.3