From 90930998ee300ee832799e2b021bf33dad8e27a3 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Sun, 11 Nov 2012 18:51:00 +0100 Subject: [PATCH] linux: update RPi patch Signed-off-by: Stephan Raue --- ...linux-3.6.6-601-RPi_support-9641b52.patch} | 10104 +++++++++------- .../linux-3.6.6-604-RPi_rebootfix.patch | 65 - projects/ATV/linux/linux.i386.conf | 1 + projects/Fusion/linux/linux.i386.conf | 1 + projects/Fusion/linux/linux.x86_64.conf | 1 + projects/Generic/linux/linux.i386.conf | 1 + projects/Generic_OSS/linux/linux.i386.conf | 1 + projects/ION/linux/linux.i386.conf | 1 + projects/ION/linux/linux.x86_64.conf | 1 + projects/Intel/linux/linux.i386.conf | 1 + projects/Intel/linux/linux.x86_64.conf | 1 + projects/RPi/linux/linux.arm.conf | 3 +- projects/Ultra/linux/linux.x86_64.conf | 1 + projects/Virtual/linux/linux.i386.conf | 1 + projects/Virtual/linux/linux.x86_64.conf | 1 + 15 files changed, 5730 insertions(+), 4454 deletions(-) rename packages/linux/patches/{linux-3.6.6-601-RPi_support-a23.6.6.patch => linux-3.6.6-601-RPi_support-9641b52.patch} (94%) delete mode 100644 packages/linux/patches/linux-3.6.6-604-RPi_rebootfix.patch diff --git a/packages/linux/patches/linux-3.6.6-601-RPi_support-a23.6.6.patch b/packages/linux/patches/linux-3.6.6-601-RPi_support-9641b52.patch similarity index 94% rename from packages/linux/patches/linux-3.6.6-601-RPi_support-a23.6.6.patch rename to packages/linux/patches/linux-3.6.6-601-RPi_support-9641b52.patch index 98617f3ced..c375ab8bdf 100644 --- a/packages/linux/patches/linux-3.6.6-601-RPi_support-a23.6.6.patch +++ b/packages/linux/patches/linux-3.6.6-601-RPi_support-9641b52.patch @@ -1,75 +1,6 @@ -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 2f88d8d..c4193ad 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -998,6 +998,23 @@ config PLAT_SPEAR - help - Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). - -+config ARCH_BCM2708 -+ bool "Broadcom BCM2708 family" -+ select CPU_V6 -+ select ARM_AMBA -+ select HAVE_CLK -+ select HAVE_SCHED_CLOCK -+ select NEED_MACH_MEMORY_H -+ select CLKDEV_LOOKUP -+ select ARCH_HAS_CPUFREQ -+ select GENERIC_CLOCKEVENTS -+ select ARM_ERRATA_411920 -+ select MACH_BCM2708 -+ select VC4 -+ select FIQ -+ help -+ This enables support for Broadcom BCM2708 boards. -+ - config ARCH_VT8500 - bool "VIA/WonderMedia 85xx" - select CPU_ARM926T -@@ -1132,6 +1149,7 @@ source "arch/arm/plat-versatile/Kconfig" - source "arch/arm/mach-vt8500/Kconfig" - - source "arch/arm/mach-w90x900/Kconfig" -+source "arch/arm/mach-bcm2708/Kconfig" - - # Definitions to make life easier - config ARCH_ACORN -diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug -index e968a52..c33604c 100644 ---- a/arch/arm/Kconfig.debug -+++ b/arch/arm/Kconfig.debug -@@ -371,6 +371,14 @@ choice - For more details about semihosting, please see - chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd. - -+ config DEBUG_BCM2708_UART0 -+ bool "Broadcom BCM2708 UART0 (PL011)" -+ depends on MACH_BCM2708 -+ help -+ Say Y here if you want the debug print routines to direct -+ their output to UART 0. The port must have been initialised -+ by the boot-loader before use. -+ - endchoice - - config EARLY_PRINTK -diff --git a/arch/arm/Makefile b/arch/arm/Makefile -index a051dfb..179a2e5 100644 ---- a/arch/arm/Makefile -+++ b/arch/arm/Makefile -@@ -198,6 +198,7 @@ machine-$(CONFIG_MACH_SPEAR310) := spear3xx - machine-$(CONFIG_MACH_SPEAR320) := spear3xx - machine-$(CONFIG_MACH_SPEAR600) := spear6xx - machine-$(CONFIG_ARCH_ZYNQ) := zynq -+machine-$(CONFIG_ARCH_BCM2708) := bcm2708 - - # Platform directory name. This list is sorted alphanumerically - # by CONFIG_* macro name. -diff --git a/arch/arm/configs/bcmrpi_cutdown_defconfig b/arch/arm/configs/bcmrpi_cutdown_defconfig -new file mode 100644 -index 0000000..3b8bd74 ---- /dev/null -+++ b/arch/arm/configs/bcmrpi_cutdown_defconfig +diff -Naur linux-3.6.1/arch/arm/configs/bcmrpi_cutdown_defconfig linux-rpi-3.6.y/arch/arm/configs/bcmrpi_cutdown_defconfig +--- linux-3.6.1/arch/arm/configs/bcmrpi_cutdown_defconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/configs/bcmrpi_cutdown_defconfig 2012-11-11 18:17:01.093891144 +0100 @@ -0,0 +1,546 @@ +CONFIG_EXPERIMENTAL=y +CONFIG_LOCALVERSION="-cutdown" @@ -617,11 +548,9 @@ index 0000000..3b8bd74 +# CONFIG_CRYPTO_HW is not set +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -new file mode 100644 -index 0000000..b4a3da1 ---- /dev/null -+++ b/arch/arm/configs/bcmrpi_defconfig +diff -Naur linux-3.6.1/arch/arm/configs/bcmrpi_defconfig linux-rpi-3.6.y/arch/arm/configs/bcmrpi_defconfig +--- linux-3.6.1/arch/arm/configs/bcmrpi_defconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/configs/bcmrpi_defconfig 2012-11-11 18:17:01.075890790 +0100 @@ -0,0 +1,945 @@ +# CONFIG_ARM_PATCH_PHYS_VIRT is not set +CONFIG_EXPERIMENTAL=y @@ -1568,11 +1497,9 @@ index 0000000..b4a3da1 +# CONFIG_CRYPTO_HW is not set +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -diff --git a/arch/arm/configs/bcmrpi_emergency_defconfig b/arch/arm/configs/bcmrpi_emergency_defconfig -new file mode 100644 -index 0000000..3b40c49 ---- /dev/null -+++ b/arch/arm/configs/bcmrpi_emergency_defconfig +diff -Naur linux-3.6.1/arch/arm/configs/bcmrpi_emergency_defconfig linux-rpi-3.6.y/arch/arm/configs/bcmrpi_emergency_defconfig +--- linux-3.6.1/arch/arm/configs/bcmrpi_emergency_defconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/configs/bcmrpi_emergency_defconfig 2012-11-11 18:17:01.074890771 +0100 @@ -0,0 +1,532 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set @@ -2106,11 +2033,10 @@ index 0000000..3b40c49 +# CONFIG_CRYPTO_HW is not set +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -diff --git a/arch/arm/include/asm/fiq.h b/arch/arm/include/asm/fiq.h -index d493d0b..f1a131b 100644 ---- a/arch/arm/include/asm/fiq.h -+++ b/arch/arm/include/asm/fiq.h -@@ -42,6 +42,7 @@ extern void disable_fiq(int fiq); +diff -Naur linux-3.6.1/arch/arm/include/asm/fiq.h linux-rpi-3.6.y/arch/arm/include/asm/fiq.h +--- linux-3.6.1/arch/arm/include/asm/fiq.h 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/include/asm/fiq.h 2012-11-11 18:17:00.010869975 +0100 +@@ -42,6 +42,7 @@ /* helpers defined in fiqasm.S: */ extern void __set_fiq_regs(unsigned long const *regs); extern void __get_fiq_regs(unsigned long *regs); @@ -2118,23 +2044,63 @@ index d493d0b..f1a131b 100644 static inline void set_fiq_regs(struct pt_regs const *regs) { -diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c -index 2adda11..3e71f30 100644 ---- a/arch/arm/kernel/fiq.c -+++ b/arch/arm/kernel/fiq.c -@@ -137,6 +137,7 @@ void disable_fiq(int fiq) - EXPORT_SYMBOL(set_fiq_handler); - EXPORT_SYMBOL(__set_fiq_regs); /* defined in fiqasm.S */ - EXPORT_SYMBOL(__get_fiq_regs); /* defined in fiqasm.S */ -+EXPORT_SYMBOL(__FIQ_Branch); /* defined in fiqasm.S */ - EXPORT_SYMBOL(claim_fiq); - EXPORT_SYMBOL(release_fiq); - EXPORT_SYMBOL(enable_fiq); -diff --git a/arch/arm/kernel/fiqasm.S b/arch/arm/kernel/fiqasm.S -index 207f9d6..5233d54 100644 ---- a/arch/arm/kernel/fiqasm.S -+++ b/arch/arm/kernel/fiqasm.S -@@ -47,3 +47,7 @@ ENTRY(__get_fiq_regs) +diff -Naur linux-3.6.1/arch/arm/Kconfig linux-rpi-3.6.y/arch/arm/Kconfig +--- linux-3.6.1/arch/arm/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/Kconfig 2012-11-11 18:17:01.656902145 +0100 +@@ -998,6 +998,23 @@ + help + Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx). + ++config ARCH_BCM2708 ++ bool "Broadcom BCM2708 family" ++ select CPU_V6 ++ select ARM_AMBA ++ select HAVE_CLK ++ select HAVE_SCHED_CLOCK ++ select NEED_MACH_MEMORY_H ++ select CLKDEV_LOOKUP ++ select ARCH_HAS_CPUFREQ ++ select GENERIC_CLOCKEVENTS ++ select ARM_ERRATA_411920 ++ select MACH_BCM2708 ++ select VC4 ++ select FIQ ++ help ++ This enables support for Broadcom BCM2708 boards. ++ + config ARCH_VT8500 + bool "VIA/WonderMedia 85xx" + select CPU_ARM926T +@@ -1132,6 +1149,7 @@ + source "arch/arm/mach-vt8500/Kconfig" + + source "arch/arm/mach-w90x900/Kconfig" ++source "arch/arm/mach-bcm2708/Kconfig" + + # Definitions to make life easier + config ARCH_ACORN +diff -Naur linux-3.6.1/arch/arm/Kconfig.debug linux-rpi-3.6.y/arch/arm/Kconfig.debug +--- linux-3.6.1/arch/arm/Kconfig.debug 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/Kconfig.debug 2012-11-11 18:17:00.647882426 +0100 +@@ -371,6 +371,14 @@ + For more details about semihosting, please see + chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd. + ++ config DEBUG_BCM2708_UART0 ++ bool "Broadcom BCM2708 UART0 (PL011)" ++ depends on MACH_BCM2708 ++ help ++ Say Y here if you want the debug print routines to direct ++ their output to UART 0. The port must have been initialised ++ by the boot-loader before use. ++ + endchoice + + config EARLY_PRINTK +diff -Naur linux-3.6.1/arch/arm/kernel/fiqasm.S linux-rpi-3.6.y/arch/arm/kernel/fiqasm.S +--- linux-3.6.1/arch/arm/kernel/fiqasm.S 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/kernel/fiqasm.S 2012-11-11 18:17:00.238874431 +0100 +@@ -47,3 +47,7 @@ mov r0, r0 @ avoid hazard prior to ARMv4 mov pc, lr ENDPROC(__get_fiq_regs) @@ -2142,74 +2108,20 @@ index 207f9d6..5233d54 100644 +ENTRY(__FIQ_Branch) + mov pc, r8 +ENDPROC(__FIQ_Branch) -diff --git a/arch/arm/mach-bcm2708/Kconfig b/arch/arm/mach-bcm2708/Kconfig -new file mode 100644 -index 0000000..63bb76c ---- /dev/null -+++ b/arch/arm/mach-bcm2708/Kconfig -@@ -0,0 +1,34 @@ -+menu "Broadcom BCM2708 Implementations" -+ depends on ARCH_BCM2708 -+ -+config MACH_BCM2708 -+ bool "Broadcom BCM2708 Development Platform" -+ select NEED_MACH_MEMORY_H -+ select NEED_MACH_IO_H -+ select CPU_V6 -+ help -+ Include support for the Broadcom(R) BCM2708 platform. -+ -+config BCM2708_GPIO -+ bool "BCM2708 gpio support" -+ depends on MACH_BCM2708 -+ select ARCH_REQUIRE_GPIOLIB -+ default y -+ help -+ Include support for the Broadcom(R) BCM2708 gpio. -+ -+config BCM2708_VCMEM -+ bool "Videocore Memory" -+ depends on MACH_BCM2708 -+ default y -+ help -+ Helper for videocore memory access and total size allocation. -+ -+config BCM2708_NOL2CACHE -+ bool "Videocore L2 cache disable" -+ depends on MACH_BCM2708 -+ default n -+ help -+ Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt. -+ -+endmenu -diff --git a/arch/arm/mach-bcm2708/Makefile b/arch/arm/mach-bcm2708/Makefile -new file mode 100644 -index 0000000..3ee8a4b ---- /dev/null -+++ b/arch/arm/mach-bcm2708/Makefile -@@ -0,0 +1,8 @@ -+# -+# Makefile for the linux kernel. -+# -+ -+obj-$(CONFIG_MACH_BCM2708) += clock.o bcm2708.o armctrl.o vcio.o power.o dma.o delay.o -+obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o -+obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o -+ -diff --git a/arch/arm/mach-bcm2708/Makefile.boot b/arch/arm/mach-bcm2708/Makefile.boot -new file mode 100644 -index 0000000..67039c3 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/Makefile.boot -@@ -0,0 +1,3 @@ -+ zreladdr-y := 0x00008000 -+params_phys-y := 0x00000100 -+initrd_phys-y := 0x00800000 -diff --git a/arch/arm/mach-bcm2708/armctrl.c b/arch/arm/mach-bcm2708/armctrl.c -new file mode 100644 -index 0000000..f22fbba ---- /dev/null -+++ b/arch/arm/mach-bcm2708/armctrl.c +diff -Naur linux-3.6.1/arch/arm/kernel/fiq.c linux-rpi-3.6.y/arch/arm/kernel/fiq.c +--- linux-3.6.1/arch/arm/kernel/fiq.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/kernel/fiq.c 2012-11-11 18:17:00.521879960 +0100 +@@ -137,6 +137,7 @@ + EXPORT_SYMBOL(set_fiq_handler); + EXPORT_SYMBOL(__set_fiq_regs); /* defined in fiqasm.S */ + EXPORT_SYMBOL(__get_fiq_regs); /* defined in fiqasm.S */ ++EXPORT_SYMBOL(__FIQ_Branch); /* defined in fiqasm.S */ + EXPORT_SYMBOL(claim_fiq); + EXPORT_SYMBOL(release_fiq); + EXPORT_SYMBOL(enable_fiq); +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/armctrl.c linux-rpi-3.6.y/arch/arm/mach-bcm2708/armctrl.c +--- linux-3.6.1/arch/arm/mach-bcm2708/armctrl.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/armctrl.c 2012-11-11 18:16:52.771728474 +0100 @@ -0,0 +1,227 @@ +/* + * linux/arch/arm/mach-bcm2708/armctrl.c @@ -2438,11 +2350,9 @@ index 0000000..f22fbba + init_FIQ(FIQ_START); + return 0; +} -diff --git a/arch/arm/mach-bcm2708/armctrl.h b/arch/arm/mach-bcm2708/armctrl.h -new file mode 100644 -index 0000000..0aa916e ---- /dev/null -+++ b/arch/arm/mach-bcm2708/armctrl.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/armctrl.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/armctrl.h +--- linux-3.6.1/arch/arm/mach-bcm2708/armctrl.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/armctrl.h 2012-11-11 18:16:52.741727886 +0100 @@ -0,0 +1,27 @@ +/* + * linux/arch/arm/mach-bcm2708/armctrl.h @@ -2471,12 +2381,10 @@ index 0000000..0aa916e + u32 armctrl_sources, u32 resume_sources); + +#endif -diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c -new file mode 100644 -index 0000000..02cb556 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/bcm2708.c -@@ -0,0 +1,917 @@ +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/bcm2708.c linux-rpi-3.6.y/arch/arm/mach-bcm2708/bcm2708.c +--- linux-3.6.1/arch/arm/mach-bcm2708/bcm2708.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/bcm2708.c 2012-11-11 18:16:52.752728101 +0100 +@@ -0,0 +1,951 @@ +/* + * linux/arch/arm/mach-bcm2708/bcm2708.c + * @@ -2539,6 +2447,11 @@ index 0000000..02cb556 +#include "armctrl.h" +#include "clock.h" + ++#ifdef CONFIG_BCM_VC_CMA ++#include ++#endif ++ ++ +/* Effectively we have an IOMMU (ARM<->VideoCore map) that is set up to + * give us IO access only to 64Mbytes of physical memory (26 bits). We could + * represent this window by setting our dmamasks to 26 bits but, in fact @@ -3137,6 +3050,21 @@ index 0000000..02cb556 + return ret; +} + ++static void bcm2708_restart(char mode, const char *cmd) ++{ ++ uint32_t pm_rstc, pm_wdog; ++ uint32_t timeout = 10; ++ ++ /* Setup watchdog for reset */ ++ pm_rstc = readl(IO_ADDRESS(PM_RSTC)); ++ ++ pm_wdog = PM_PASSWORD | (timeout & PM_WDOG_TIME_SET); // watchdog timer = timer clock / 16; need password (31:16) + value (11:0) ++ pm_rstc = PM_PASSWORD | (pm_rstc & PM_RSTC_WRCFG_CLR) | PM_RSTC_WRCFG_FULL_RESET; ++ ++ writel(pm_wdog, IO_ADDRESS(PM_WDOG)); ++ writel(pm_rstc, IO_ADDRESS(PM_RSTC)); ++} ++ +/* We can't really power off, but if we do the normal reset scheme, and indicate to bootcode.bin not to reboot, then most of the chip will be powered off */ +static void bcm2708_power_off(void) +{ @@ -3145,13 +3073,16 @@ index 0000000..02cb556 + pm_rsts = PM_PASSWORD | (pm_rsts & PM_RSTC_WRCFG_CLR) | PM_RSTS_HADWRH_SET; + writel(pm_rsts, IO_ADDRESS(PM_RSTS)); + /* continue with normal reset mechanism */ -+ arch_reset(0, ""); ++ bcm2708_restart(0, ""); +} + +void __init bcm2708_init(void) +{ + int i; + ++#if defined(CONFIG_BCM_VC_CMA) ++ vc_cma_early_init(); ++#endif + printk("bcm2708.uart_clock = %d\n", uart_clock); + pm_power_off = bcm2708_power_off; + @@ -3379,7 +3310,16 @@ index 0000000..02cb556 + * context. Increase size of atomic coherent pool to make sure such + * the allocations won't fail. + */ ++#if !defined(CONFIG_BCM_VC_CMA) + init_dma_coherent_pool_size(SZ_2M); ++#endif ++} ++ ++static void __init board_reserve(void) ++{ ++#if defined(CONFIG_BCM_VC_CMA) ++ vc_cma_reserve(); ++#endif +} + +MACHINE_START(BCM2708, "BCM2708") @@ -3389,73 +3329,16 @@ index 0000000..02cb556 + .timer =&bcm2708_timer, + .init_machine = bcm2708_init, + .init_early = bcm2708_init_early, ++ .reserve = board_reserve, ++ .restart = bcm2708_restart, +MACHINE_END + +module_param(boardrev, uint, 0644); +module_param(serial, uint, 0644); +module_param(uart_clock, uint, 0644); -diff --git a/arch/arm/mach-bcm2708/bcm2708.h b/arch/arm/mach-bcm2708/bcm2708.h -new file mode 100644 -index 0000000..dfe8700 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/bcm2708.h -@@ -0,0 +1,51 @@ -+/* -+ * linux/arch/arm/mach-bcm2708/bcm2708.h -+ * -+ * BCM2708 machine support header -+ * -+ * Copyright (C) 2010 Broadcom -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef __BCM2708_BCM2708_H -+#define __BCM2708_BCM2708_H -+ -+#include -+ -+extern void __init bcm2708_init(void); -+extern void __init bcm2708_init_irq(void); -+extern void __init bcm2708_map_io(void); -+extern struct sys_timer bcm2708_timer; -+extern unsigned int mmc_status(struct device *dev); -+ -+#define AMBA_DEVICE(name, busid, base, plat) \ -+static struct amba_device name##_device = { \ -+ .dev = { \ -+ .coherent_dma_mask = ~0, \ -+ .init_name = busid, \ -+ .platform_data = plat, \ -+ }, \ -+ .res = { \ -+ .start = base##_BASE, \ -+ .end = (base##_BASE) + SZ_4K - 1,\ -+ .flags = IORESOURCE_MEM, \ -+ }, \ -+ .dma_mask = ~0, \ -+ .irq = base##_IRQ, \ -+ /* .dma = base##_DMA,*/ \ -+} -+ -+#endif -diff --git a/arch/arm/mach-bcm2708/bcm2708_gpio.c b/arch/arm/mach-bcm2708/bcm2708_gpio.c -new file mode 100644 -index 0000000..6c81d9d ---- /dev/null -+++ b/arch/arm/mach-bcm2708/bcm2708_gpio.c +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/bcm2708_gpio.c linux-rpi-3.6.y/arch/arm/mach-bcm2708/bcm2708_gpio.c +--- linux-3.6.1/arch/arm/mach-bcm2708/bcm2708_gpio.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/bcm2708_gpio.c 2012-11-11 18:16:52.721727498 +0100 @@ -0,0 +1,339 @@ +/* + * linux/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -3796,11 +3679,64 @@ index 0000000..6c81d9d + +MODULE_DESCRIPTION("Broadcom BCM2708 GPIO driver"); +MODULE_LICENSE("GPL"); -diff --git a/arch/arm/mach-bcm2708/clock.c b/arch/arm/mach-bcm2708/clock.c -new file mode 100644 -index 0000000..4fc556e ---- /dev/null -+++ b/arch/arm/mach-bcm2708/clock.c +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/bcm2708.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/bcm2708.h +--- linux-3.6.1/arch/arm/mach-bcm2708/bcm2708.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/bcm2708.h 2012-11-11 18:16:52.753728121 +0100 +@@ -0,0 +1,51 @@ ++/* ++ * linux/arch/arm/mach-bcm2708/bcm2708.h ++ * ++ * BCM2708 machine support header ++ * ++ * Copyright (C) 2010 Broadcom ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef __BCM2708_BCM2708_H ++#define __BCM2708_BCM2708_H ++ ++#include ++ ++extern void __init bcm2708_init(void); ++extern void __init bcm2708_init_irq(void); ++extern void __init bcm2708_map_io(void); ++extern struct sys_timer bcm2708_timer; ++extern unsigned int mmc_status(struct device *dev); ++ ++#define AMBA_DEVICE(name, busid, base, plat) \ ++static struct amba_device name##_device = { \ ++ .dev = { \ ++ .coherent_dma_mask = ~0, \ ++ .init_name = busid, \ ++ .platform_data = plat, \ ++ }, \ ++ .res = { \ ++ .start = base##_BASE, \ ++ .end = (base##_BASE) + SZ_4K - 1,\ ++ .flags = IORESOURCE_MEM, \ ++ }, \ ++ .dma_mask = ~0, \ ++ .irq = base##_IRQ, \ ++ /* .dma = base##_DMA,*/ \ ++} ++ ++#endif +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/clock.c linux-rpi-3.6.y/arch/arm/mach-bcm2708/clock.c +--- linux-3.6.1/arch/arm/mach-bcm2708/clock.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/clock.c 2012-11-11 18:16:52.722727517 +0100 @@ -0,0 +1,61 @@ +/* + * linux/arch/arm/mach-bcm2708/clock.c @@ -3863,11 +3799,9 @@ index 0000000..4fc556e + return -EIO; +} +EXPORT_SYMBOL(clk_set_rate); -diff --git a/arch/arm/mach-bcm2708/clock.h b/arch/arm/mach-bcm2708/clock.h -new file mode 100644 -index 0000000..5f9d725 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/clock.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/clock.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/clock.h +--- linux-3.6.1/arch/arm/mach-bcm2708/clock.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/clock.h 2012-11-11 18:16:52.721727498 +0100 @@ -0,0 +1,24 @@ +/* + * linux/arch/arm/mach-bcm2708/clock.h @@ -3893,11 +3827,9 @@ index 0000000..5f9d725 +struct clk { + unsigned long rate; +}; -diff --git a/arch/arm/mach-bcm2708/delay.S b/arch/arm/mach-bcm2708/delay.S -new file mode 100644 -index 0000000..91754d6 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/delay.S +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/delay.S linux-rpi-3.6.y/arch/arm/mach-bcm2708/delay.S +--- linux-3.6.1/arch/arm/mach-bcm2708/delay.S 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/delay.S 2012-11-11 18:16:52.741727886 +0100 @@ -0,0 +1,20 @@ +/* + * linux/arch/arm/lib/delay.S @@ -3919,11 +3851,9 @@ index 0000000..91754d6 + bhi bcm2708_delay + mov pc, lr +ENDPROC(bcm2708_delay) -diff --git a/arch/arm/mach-bcm2708/dma.c b/arch/arm/mach-bcm2708/dma.c -new file mode 100644 -index 0000000..0b7a4f6 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/dma.c +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/dma.c linux-rpi-3.6.y/arch/arm/mach-bcm2708/dma.c +--- linux-3.6.1/arch/arm/mach-bcm2708/dma.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/dma.c 2012-11-11 18:16:52.720727478 +0100 @@ -0,0 +1,397 @@ +/* + * linux/arch/arm/mach-bcm2708/dma.c @@ -4322,11 +4252,9 @@ index 0000000..0b7a4f6 +MODULE_LICENSE("GPL"); + +MODULE_PARM_DESC(dmachans, "Bitmap of DMA channels available to the ARM"); -diff --git a/arch/arm/mach-bcm2708/include/mach/arm_control.h b/arch/arm/mach-bcm2708/include/mach/arm_control.h -new file mode 100644 -index 0000000..a82bb92 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/arm_control.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/arm_control.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/arm_control.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/arm_control.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/arm_control.h 2012-11-11 18:16:52.768728417 +0100 @@ -0,0 +1,419 @@ +/* + * linux/arch/arm/mach-bcm2708/arm_control.h @@ -4747,11 +4675,9 @@ index 0000000..a82bb92 +#define AJBTDO HW_REGISTER_RW(AJB_BASE+0x0c) + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/arm_power.h b/arch/arm/mach-bcm2708/include/mach/arm_power.h -new file mode 100644 -index 0000000..aae9136 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/arm_power.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/arm_power.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/arm_power.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/arm_power.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/arm_power.h 2012-11-11 18:16:52.770728455 +0100 @@ -0,0 +1,60 @@ +/* + * linux/arch/arm/mach-bcm2708/include/mach/arm_power.h @@ -4813,11 +4739,9 @@ index 0000000..aae9136 +}; + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/clkdev.h b/arch/arm/mach-bcm2708/include/mach/clkdev.h -new file mode 100644 -index 0000000..04b37a8 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/clkdev.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/clkdev.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/clkdev.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/clkdev.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/clkdev.h 2012-11-11 18:16:52.756728183 +0100 @@ -0,0 +1,7 @@ +#ifndef __ASM_MACH_CLKDEV_H +#define __ASM_MACH_CLKDEV_H @@ -4826,11 +4750,9 @@ index 0000000..04b37a8 +#define __clk_put(clk) do { } while (0) + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/debug-macro.S b/arch/arm/mach-bcm2708/include/mach/debug-macro.S -new file mode 100644 -index 0000000..2d0dc1c ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/debug-macro.S +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/debug-macro.S linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/debug-macro.S +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/debug-macro.S 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/debug-macro.S 2012-11-11 18:16:52.769728436 +0100 @@ -0,0 +1,22 @@ +/* arch/arm/mach-bcm2708/include/mach/debug-macro.S + * @@ -4854,11 +4776,9 @@ index 0000000..2d0dc1c + .endm + +#include -diff --git a/arch/arm/mach-bcm2708/include/mach/dma.h b/arch/arm/mach-bcm2708/include/mach/dma.h -new file mode 100644 -index 0000000..25e06d7 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/dma.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/dma.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/dma.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/dma.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/dma.h 2012-11-11 18:16:52.770728455 +0100 @@ -0,0 +1,84 @@ +/* + * linux/arch/arm/mach-bcm2708/include/mach/dma.h @@ -4944,11 +4864,9 @@ index 0000000..25e06d7 + + +#endif /* _MACH_BCM2708_DMA_H */ -diff --git a/arch/arm/mach-bcm2708/include/mach/entry-macro.S b/arch/arm/mach-bcm2708/include/mach/entry-macro.S -new file mode 100644 -index 0000000..79b62d9 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/entry-macro.S +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/entry-macro.S linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/entry-macro.S +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/entry-macro.S 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/entry-macro.S 2012-11-11 18:16:52.755728163 +0100 @@ -0,0 +1,69 @@ +/* + * arch/arm/mach-bcm2708/include/mach/entry-macro.S @@ -5019,11 +4937,9 @@ index 0000000..79b62d9 +1020: @ EQ will be set if no irqs pending + + .endm -diff --git a/arch/arm/mach-bcm2708/include/mach/frc.h b/arch/arm/mach-bcm2708/include/mach/frc.h -new file mode 100644 -index 0000000..dd51e07 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/frc.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/frc.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/frc.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/frc.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/frc.h 2012-11-11 18:16:52.769728436 +0100 @@ -0,0 +1,38 @@ +/* + * arch/arm/mach-bcm2708/include/mach/timex.h @@ -5063,11 +4979,9 @@ index 0000000..dd51e07 +extern unsigned long long frc_clock_ticks63(void); + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/gpio.h b/arch/arm/mach-bcm2708/include/mach/gpio.h -new file mode 100644 -index 0000000..0b82f26 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/gpio.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/gpio.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/gpio.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/gpio.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/gpio.h 2012-11-11 18:16:52.768728417 +0100 @@ -0,0 +1,48 @@ +/* + * arch/arm/mach-bcm2708/include/mach/gpio.h @@ -5117,11 +5031,9 @@ index 0000000..0b82f26 + +#endif + -diff --git a/arch/arm/mach-bcm2708/include/mach/hardware.h b/arch/arm/mach-bcm2708/include/mach/hardware.h -new file mode 100644 -index 0000000..c2954e8 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/hardware.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/hardware.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/hardware.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/hardware.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/hardware.h 2012-11-11 18:16:52.769728436 +0100 @@ -0,0 +1,28 @@ +/* + * arch/arm/mach-bcm2708/include/mach/hardware.h @@ -5151,11 +5063,9 @@ index 0000000..c2954e8 +#include + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/io.h b/arch/arm/mach-bcm2708/include/mach/io.h -new file mode 100644 -index 0000000..e8c7fca ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/io.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/io.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/io.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/io.h 2012-11-11 18:16:52.768728417 +0100 @@ -0,0 +1,28 @@ +/* + * arch/arm/mach-bcm2708/include/mach/io.h @@ -5185,11 +5095,9 @@ index 0000000..e8c7fca +#define __mem_pci(a) (a) + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/irqs.h b/arch/arm/mach-bcm2708/include/mach/irqs.h -new file mode 100644 -index 0000000..9aaedf1 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/irqs.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/irqs.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/irqs.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/irqs.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/irqs.h 2012-11-11 18:16:52.768728417 +0100 @@ -0,0 +1,199 @@ +/* + * arch/arm/mach-bcm2708/include/mach/irqs.h @@ -5390,11 +5298,9 @@ index 0000000..9aaedf1 + + +#endif /* _BCM2708_IRQS_H_ */ -diff --git a/arch/arm/mach-bcm2708/include/mach/memory.h b/arch/arm/mach-bcm2708/include/mach/memory.h -new file mode 100644 -index 0000000..521540d ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/memory.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/memory.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/memory.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/memory.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/memory.h 2012-11-11 18:16:52.767728398 +0100 @@ -0,0 +1,57 @@ +/* + * arch/arm/mach-bcm2708/include/mach/memory.h @@ -5453,11 +5359,9 @@ index 0000000..521540d +#define __bus_to_pfn(x) __phys_to_pfn((x) - (BUS_OFFSET - PLAT_PHYS_OFFSET)) + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/platform.h b/arch/arm/mach-bcm2708/include/mach/platform.h -new file mode 100644 -index 0000000..9c5d334 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/platform.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/platform.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/platform.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/platform.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/platform.h 2012-11-11 18:16:52.754728142 +0100 @@ -0,0 +1,225 @@ +/* + * arch/arm/mach-bcm2708/include/mach/platform.h @@ -5684,11 +5588,9 @@ index 0000000..9c5d334 +#endif + +/* END */ -diff --git a/arch/arm/mach-bcm2708/include/mach/power.h b/arch/arm/mach-bcm2708/include/mach/power.h -new file mode 100644 -index 0000000..52b3b02 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/power.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/power.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/power.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/power.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/power.h 2012-11-11 18:16:52.770728455 +0100 @@ -0,0 +1,26 @@ +/* + * linux/arch/arm/mach-bcm2708/power.h @@ -5716,12 +5618,10 @@ index 0000000..52b3b02 +extern int bcm_power_close(BCM_POWER_HANDLE_T handle); + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/system.h b/arch/arm/mach-bcm2708/include/mach/system.h -new file mode 100644 -index 0000000..bc9d458 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/system.h -@@ -0,0 +1,53 @@ +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/system.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/system.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/system.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/system.h 2012-11-11 18:16:52.754728142 +0100 +@@ -0,0 +1,38 @@ +/* + * arch/arm/mach-bcm2708/include/mach/system.h + * @@ -5759,27 +5659,10 @@ index 0000000..bc9d458 + cpu_do_idle(); +} + -+static inline void arch_reset(char mode, const char *cmd) -+{ -+ uint32_t pm_rstc, pm_wdog; -+ uint32_t timeout = 10; -+ -+ /* Setup watchdog for reset */ -+ pm_rstc = readl(IO_ADDRESS(PM_RSTC)); -+ -+ pm_wdog = PM_PASSWORD | (timeout & PM_WDOG_TIME_SET); // watchdog timer = timer clock / 16; need password (31:16) + value (11:0) -+ pm_rstc = PM_PASSWORD | (pm_rstc & PM_RSTC_WRCFG_CLR) | PM_RSTC_WRCFG_FULL_RESET; -+ -+ writel(pm_wdog, IO_ADDRESS(PM_WDOG)); -+ writel(pm_rstc, IO_ADDRESS(PM_RSTC)); -+} -+ +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/timex.h b/arch/arm/mach-bcm2708/include/mach/timex.h -new file mode 100644 -index 0000000..64a660c ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/timex.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/timex.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/timex.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/timex.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/timex.h 2012-11-11 18:16:52.755728163 +0100 @@ -0,0 +1,23 @@ +/* + * arch/arm/mach-bcm2708/include/mach/timex.h @@ -5804,11 +5687,9 @@ index 0000000..64a660c + */ + +#define CLOCK_TICK_RATE (1000000) -diff --git a/arch/arm/mach-bcm2708/include/mach/uncompress.h b/arch/arm/mach-bcm2708/include/mach/uncompress.h -new file mode 100644 -index 0000000..5c43412 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/uncompress.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/uncompress.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/uncompress.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/uncompress.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/uncompress.h 2012-11-11 18:16:52.770728455 +0100 @@ -0,0 +1,85 @@ +/* + * arch/arm/mach-bcn2708/include/mach/uncompress.h @@ -5895,53 +5776,9 @@ index 0000000..5c43412 + */ +#define arch_decomp_wdog() + -diff --git a/arch/arm/mach-bcm2708/include/mach/vc_mem.h b/arch/arm/mach-bcm2708/include/mach/vc_mem.h -new file mode 100644 -index 0000000..d29125b ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/vc_mem.h -@@ -0,0 +1,36 @@ -+/***************************************************************************** -+* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved. -+* -+* Unless you and Broadcom execute a separate written software license -+* agreement governing use of this software, this software is licensed to you -+* under the terms of the GNU General Public License version 2, available at -+* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). -+* -+* Notwithstanding the above, under no circumstances may you combine this -+* software in any way with any other Broadcom software provided under a -+* license other than the GPL, without Broadcom's express prior written -+* consent. -+*****************************************************************************/ -+ -+#if !defined( VC_MEM_H ) -+#define VC_MEM_H -+ -+#include -+ -+#define VC_MEM_IOC_MAGIC 'v' -+ -+#define VC_MEM_IOC_MEM_PHYS_ADDR _IOR( VC_MEM_IOC_MAGIC, 0, unsigned long ) -+#define VC_MEM_IOC_MEM_SIZE _IOR( VC_MEM_IOC_MAGIC, 1, unsigned int ) -+#define VC_MEM_IOC_MEM_BASE _IOR( VC_MEM_IOC_MAGIC, 2, unsigned int ) -+#define VC_MEM_IOC_MEM_LOAD _IOR( VC_MEM_IOC_MAGIC, 3, unsigned int ) -+ -+#if defined( __KERNEL__ ) -+#define VC_MEM_TO_ARM_ADDR_MASK 0x3FFFFFFF -+ -+extern unsigned long mm_vc_mem_phys_addr; -+extern unsigned int mm_vc_mem_size; -+extern int vc_mem_get_current_size( void ); -+#endif -+ -+#endif /* VC_MEM_H */ -+ -diff --git a/arch/arm/mach-bcm2708/include/mach/vcio.h b/arch/arm/mach-bcm2708/include/mach/vcio.h -new file mode 100644 -index 0000000..7dfd14e ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/vcio.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/vcio.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/vcio.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/vcio.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/vcio.h 2012-11-11 18:16:52.755728163 +0100 @@ -0,0 +1,108 @@ +/* + * arch/arm/mach-bcm2708/include/mach/vcio.h @@ -6051,11 +5888,49 @@ index 0000000..7dfd14e +extern int /*rc*/ bcm_mailbox_property(void *data, int size); + +#endif -diff --git a/arch/arm/mach-bcm2708/include/mach/vmalloc.h b/arch/arm/mach-bcm2708/include/mach/vmalloc.h -new file mode 100644 -index 0000000..502c617 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/include/mach/vmalloc.h +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/vc_mem.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/vc_mem.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/vc_mem.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/vc_mem.h 2012-11-11 18:16:52.769728436 +0100 +@@ -0,0 +1,36 @@ ++/***************************************************************************** ++* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ ++ ++#if !defined( VC_MEM_H ) ++#define VC_MEM_H ++ ++#include ++ ++#define VC_MEM_IOC_MAGIC 'v' ++ ++#define VC_MEM_IOC_MEM_PHYS_ADDR _IOR( VC_MEM_IOC_MAGIC, 0, unsigned long ) ++#define VC_MEM_IOC_MEM_SIZE _IOR( VC_MEM_IOC_MAGIC, 1, unsigned int ) ++#define VC_MEM_IOC_MEM_BASE _IOR( VC_MEM_IOC_MAGIC, 2, unsigned int ) ++#define VC_MEM_IOC_MEM_LOAD _IOR( VC_MEM_IOC_MAGIC, 3, unsigned int ) ++ ++#if defined( __KERNEL__ ) ++#define VC_MEM_TO_ARM_ADDR_MASK 0x3FFFFFFF ++ ++extern unsigned long mm_vc_mem_phys_addr; ++extern unsigned int mm_vc_mem_size; ++extern int vc_mem_get_current_size( void ); ++#endif ++ ++#endif /* VC_MEM_H */ ++ +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/include/mach/vmalloc.h linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/vmalloc.h +--- linux-3.6.1/arch/arm/mach-bcm2708/include/mach/vmalloc.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/include/mach/vmalloc.h 2012-11-11 18:16:52.755728163 +0100 @@ -0,0 +1,20 @@ +/* + * arch/arm/mach-bcm2708/include/mach/vmalloc.h @@ -6077,11 +5952,66 @@ index 0000000..502c617 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#define VMALLOC_END (0xe8000000) -diff --git a/arch/arm/mach-bcm2708/power.c b/arch/arm/mach-bcm2708/power.c -new file mode 100644 -index 0000000..256bf1a ---- /dev/null -+++ b/arch/arm/mach-bcm2708/power.c +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/Kconfig linux-rpi-3.6.y/arch/arm/mach-bcm2708/Kconfig +--- linux-3.6.1/arch/arm/mach-bcm2708/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/Kconfig 2012-11-11 18:16:52.772728493 +0100 +@@ -0,0 +1,34 @@ ++menu "Broadcom BCM2708 Implementations" ++ depends on ARCH_BCM2708 ++ ++config MACH_BCM2708 ++ bool "Broadcom BCM2708 Development Platform" ++ select NEED_MACH_MEMORY_H ++ select NEED_MACH_IO_H ++ select CPU_V6 ++ help ++ Include support for the Broadcom(R) BCM2708 platform. ++ ++config BCM2708_GPIO ++ bool "BCM2708 gpio support" ++ depends on MACH_BCM2708 ++ select ARCH_REQUIRE_GPIOLIB ++ default y ++ help ++ Include support for the Broadcom(R) BCM2708 gpio. ++ ++config BCM2708_VCMEM ++ bool "Videocore Memory" ++ depends on MACH_BCM2708 ++ default y ++ help ++ Helper for videocore memory access and total size allocation. ++ ++config BCM2708_NOL2CACHE ++ bool "Videocore L2 cache disable" ++ depends on MACH_BCM2708 ++ default n ++ help ++ Do not allow ARM to use GPU's L2 cache. Requires disable_l2cache in config.txt. ++ ++endmenu +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/Makefile linux-rpi-3.6.y/arch/arm/mach-bcm2708/Makefile +--- linux-3.6.1/arch/arm/mach-bcm2708/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/Makefile 2012-11-11 18:16:52.771728474 +0100 +@@ -0,0 +1,8 @@ ++# ++# Makefile for the linux kernel. ++# ++ ++obj-$(CONFIG_MACH_BCM2708) += clock.o bcm2708.o armctrl.o vcio.o power.o dma.o delay.o ++obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o ++obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o ++ +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/Makefile.boot linux-rpi-3.6.y/arch/arm/mach-bcm2708/Makefile.boot +--- linux-3.6.1/arch/arm/mach-bcm2708/Makefile.boot 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/Makefile.boot 2012-11-11 18:16:52.741727886 +0100 +@@ -0,0 +1,3 @@ ++ zreladdr-y := 0x00008000 ++params_phys-y := 0x00000100 ++initrd_phys-y := 0x00800000 +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/power.c linux-rpi-3.6.y/arch/arm/mach-bcm2708/power.c +--- linux-3.6.1/arch/arm/mach-bcm2708/power.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/power.c 2012-11-11 18:16:52.771728474 +0100 @@ -0,0 +1,194 @@ +/* + * linux/arch/arm/mach-bcm2708/power.c @@ -6277,11 +6207,351 @@ index 0000000..256bf1a +MODULE_AUTHOR("Phil Elwell"); +MODULE_DESCRIPTION("Interface to BCM2708 power management"); +MODULE_LICENSE("GPL"); -diff --git a/arch/arm/mach-bcm2708/vc_mem.c b/arch/arm/mach-bcm2708/vc_mem.c -new file mode 100644 -index 0000000..f12cb49 ---- /dev/null -+++ b/arch/arm/mach-bcm2708/vc_mem.c +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/vcio.c linux-rpi-3.6.y/arch/arm/mach-bcm2708/vcio.c +--- linux-3.6.1/arch/arm/mach-bcm2708/vcio.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/vcio.c 2012-11-11 18:16:52.771728474 +0100 +@@ -0,0 +1,338 @@ ++/* ++ * linux/arch/arm/mach-bcm2708/vcio.c ++ * ++ * Copyright (C) 2010 Broadcom ++ * ++ * This program 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. ++ * ++ * This device provides a shared mechanism for writing to the mailboxes, ++ * semaphores, doorbells etc. that are shared between the ARM and the ++ * VideoCore processor ++ */ ++ ++#if defined(CONFIG_SERIAL_BCM_MBOX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) ++#define SUPPORT_SYSRQ ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include ++#include ++ ++#define DRIVER_NAME BCM_VCIO_DRIVER_NAME ++ ++/* ---------------------------------------------------------------------- ++ * Mailbox ++ * -------------------------------------------------------------------- */ ++ ++/* offsets from a mail box base address */ ++#define MAIL_WRT 0x00 /* write - and next 4 words */ ++#define MAIL_RD 0x00 /* read - and next 4 words */ ++#define MAIL_POL 0x10 /* read without popping the fifo */ ++#define MAIL_SND 0x14 /* sender ID (bottom two bits) */ ++#define MAIL_STA 0x18 /* status */ ++#define MAIL_CNF 0x1C /* configuration */ ++ ++#define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) ++#define MBOX_MSG_LSB(chan, data28) (((data28) << 4) | ((chan) & 0xf)) ++#define MBOX_CHAN(msg) ((msg) & 0xf) ++#define MBOX_DATA28(msg) ((msg) & ~0xf) ++#define MBOX_DATA28_LSB(msg) (((uint32_t)msg) >> 4) ++ ++#define MBOX_MAGIC 0xd0d0c0de ++ ++struct vc_mailbox { ++ struct device *dev; /* parent device */ ++ void __iomem *status; ++ void __iomem *config; ++ void __iomem *read; ++ void __iomem *write; ++ uint32_t msg[MBOX_CHAN_COUNT]; ++ struct semaphore sema[MBOX_CHAN_COUNT]; ++ uint32_t magic; ++}; ++ ++static void mbox_init(struct vc_mailbox *mbox_out, struct device *dev, ++ uint32_t addr_mbox) ++{ ++ int i; ++ ++ mbox_out->dev = dev; ++ mbox_out->status = __io_address(addr_mbox + MAIL_STA); ++ mbox_out->config = __io_address(addr_mbox + MAIL_CNF); ++ mbox_out->read = __io_address(addr_mbox + MAIL_RD); ++ /* Write to the other mailbox */ ++ mbox_out->write = ++ __io_address((addr_mbox ^ ARM_0_MAIL0_WRT ^ ARM_0_MAIL1_WRT) + ++ MAIL_WRT); ++ ++ for (i = 0; i < MBOX_CHAN_COUNT; i++) { ++ mbox_out->msg[i] = 0; ++ sema_init(&mbox_out->sema[i], 0); ++ } ++ ++ /* Enable the interrupt on data reception */ ++ writel(ARM_MC_IHAVEDATAIRQEN, mbox_out->config); ++ ++ mbox_out->magic = MBOX_MAGIC; ++} ++ ++static int mbox_write(struct vc_mailbox *mbox, unsigned chan, uint32_t data28) ++{ ++ int rc; ++ ++ if (mbox->magic != MBOX_MAGIC) ++ rc = -EINVAL; ++ else { ++ /* wait for the mailbox FIFO to have some space in it */ ++ while (0 != (readl(mbox->status) & ARM_MS_FULL)) ++ cpu_relax(); ++ ++ writel(MBOX_MSG(chan, data28), mbox->write); ++ rc = 0; ++ } ++ return rc; ++} ++ ++static int mbox_read(struct vc_mailbox *mbox, unsigned chan, uint32_t *data28) ++{ ++ int rc; ++ ++ if (mbox->magic != MBOX_MAGIC) ++ rc = -EINVAL; ++ else { ++ down(&mbox->sema[chan]); ++ *data28 = MBOX_DATA28(mbox->msg[chan]); ++ mbox->msg[chan] = 0; ++ rc = 0; ++ } ++ return rc; ++} ++ ++static irqreturn_t mbox_irq(int irq, void *dev_id) ++{ ++ /* wait for the mailbox FIFO to have some data in it */ ++ struct vc_mailbox *mbox = (struct vc_mailbox *) dev_id; ++ int status = readl(mbox->status); ++ int ret = IRQ_NONE; ++ ++ while (!(status & ARM_MS_EMPTY)) { ++ uint32_t msg = readl(mbox->read); ++ int chan = MBOX_CHAN(msg); ++ if (chan < MBOX_CHAN_COUNT) { ++ if (mbox->msg[chan]) { ++ /* Overflow */ ++ printk(KERN_ERR DRIVER_NAME ++ ": mbox chan %d overflow - drop %08x\n", ++ chan, msg); ++ } else { ++ mbox->msg[chan] = (msg | 0xf); ++ up(&mbox->sema[chan]); ++ } ++ } else { ++ printk(KERN_ERR DRIVER_NAME ++ ": invalid channel selector (msg %08x)\n", msg); ++ } ++ ret = IRQ_HANDLED; ++ status = readl(mbox->status); ++ } ++ return ret; ++} ++ ++static struct irqaction mbox_irqaction = { ++ .name = "ARM Mailbox IRQ", ++ .flags = IRQF_DISABLED | IRQF_IRQPOLL, ++ .handler = mbox_irq, ++}; ++ ++/* ---------------------------------------------------------------------- ++ * Mailbox Methods ++ * -------------------------------------------------------------------- */ ++ ++static struct device *mbox_dev; /* we assume there's only one! */ ++ ++static int dev_mbox_write(struct device *dev, unsigned chan, uint32_t data28) ++{ ++ int rc; ++ ++ struct vc_mailbox *mailbox = dev_get_drvdata(dev); ++ device_lock(dev); ++ rc = mbox_write(mailbox, chan, data28); ++ device_unlock(dev); ++ ++ return rc; ++} ++ ++static int dev_mbox_read(struct device *dev, unsigned chan, uint32_t *data28) ++{ ++ int rc; ++ ++ struct vc_mailbox *mailbox = dev_get_drvdata(dev); ++ device_lock(dev); ++ rc = mbox_read(mailbox, chan, data28); ++ device_unlock(dev); ++ ++ return rc; ++} ++ ++extern int bcm_mailbox_write(unsigned chan, uint32_t data28) ++{ ++ if (mbox_dev) ++ return dev_mbox_write(mbox_dev, chan, data28); ++ else ++ return -ENODEV; ++} ++EXPORT_SYMBOL_GPL(bcm_mailbox_write); ++ ++extern int bcm_mailbox_read(unsigned chan, uint32_t *data28) ++{ ++ if (mbox_dev) ++ return dev_mbox_read(mbox_dev, chan, data28); ++ else ++ return -ENODEV; ++} ++EXPORT_SYMBOL_GPL(bcm_mailbox_read); ++ ++static void dev_mbox_register(const char *dev_name, struct device *dev) ++{ ++ mbox_dev = dev; ++} ++ ++extern int bcm_mailbox_property(void *data, int size) ++{ ++ uint32_t success; ++ dma_addr_t mem_bus; /* the memory address accessed from videocore */ ++ void *mem_kern; /* the memory address accessed from driver */ ++ int s = 0; ++ ++ /* allocate some memory for the messages communicating with GPU */ ++ mem_kern = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &mem_bus, GFP_ATOMIC); ++ if (mem_kern) { ++ /* create the message */ ++ memcpy(mem_kern, data, size); ++ ++ /* send the message */ ++ wmb(); ++ s = bcm_mailbox_write(MBOX_CHAN_PROPERTY, (uint32_t)mem_bus); ++ if (s == 0) { ++ s = bcm_mailbox_read(MBOX_CHAN_PROPERTY, &success); ++ } ++ if (s == 0) { ++ /* copy the response */ ++ rmb(); ++ memcpy(data, mem_kern, size); ++ } ++ dma_free_coherent(NULL, PAGE_ALIGN(size), mem_kern, mem_bus); ++ } else { ++ s = -ENOMEM; ++ } ++ if (s != 0) ++ printk(KERN_ERR DRIVER_NAME ": %s failed (%d)\n", __func__, s); ++ return s; ++} ++EXPORT_SYMBOL_GPL(bcm_mailbox_property); ++ ++/* ---------------------------------------------------------------------- ++ * Platform Device for Mailbox ++ * -------------------------------------------------------------------- */ ++ ++static int bcm_vcio_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ struct vc_mailbox *mailbox; ++ ++ mailbox = kzalloc(sizeof(*mailbox), GFP_KERNEL); ++ if (NULL == mailbox) { ++ printk(KERN_ERR DRIVER_NAME ": failed to allocate " ++ "mailbox memory\n"); ++ ret = -ENOMEM; ++ } else { ++ struct resource *res; ++ ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (res == NULL) { ++ printk(KERN_ERR DRIVER_NAME ": failed to obtain memory " ++ "resource\n"); ++ ret = -ENODEV; ++ kfree(mailbox); ++ } else { ++ /* should be based on the registers from res really */ ++ mbox_init(mailbox, &pdev->dev, ARM_0_MAIL0_RD); ++ ++ platform_set_drvdata(pdev, mailbox); ++ dev_mbox_register(DRIVER_NAME, &pdev->dev); ++ ++ mbox_irqaction.dev_id = mailbox; ++ setup_irq(IRQ_ARM_MAILBOX, &mbox_irqaction); ++ printk(KERN_INFO DRIVER_NAME ": mailbox at %p\n", ++ __io_address(ARM_0_MAIL0_RD)); ++ } ++ } ++ return ret; ++} ++ ++static int bcm_vcio_remove(struct platform_device *pdev) ++{ ++ struct vc_mailbox *mailbox = platform_get_drvdata(pdev); ++ ++ platform_set_drvdata(pdev, NULL); ++ kfree(mailbox); ++ ++ return 0; ++} ++ ++static struct platform_driver bcm_mbox_driver = { ++ .probe = bcm_vcio_probe, ++ .remove = bcm_vcio_remove, ++ ++ .driver = { ++ .name = DRIVER_NAME, ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init bcm_mbox_init(void) ++{ ++ int ret; ++ ++ printk(KERN_INFO "mailbox: Broadcom VideoCore Mailbox driver\n"); ++ ++ ret = platform_driver_register(&bcm_mbox_driver); ++ if (ret != 0) { ++ printk(KERN_ERR DRIVER_NAME ": failed to register " ++ "on platform\n"); ++ } ++ ++ return ret; ++} ++ ++static void __exit bcm_mbox_exit(void) ++{ ++ platform_driver_unregister(&bcm_mbox_driver); ++} ++ ++arch_initcall(bcm_mbox_init); /* Initialize early */ ++module_exit(bcm_mbox_exit); ++ ++MODULE_AUTHOR("Gray Girling"); ++MODULE_DESCRIPTION("ARM I/O to VideoCore processor"); ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:bcm-mbox"); +diff -Naur linux-3.6.1/arch/arm/mach-bcm2708/vc_mem.c linux-rpi-3.6.y/arch/arm/mach-bcm2708/vc_mem.c +--- linux-3.6.1/arch/arm/mach-bcm2708/vc_mem.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/arch/arm/mach-bcm2708/vc_mem.c 2012-11-11 18:16:52.753728121 +0100 @@ -0,0 +1,458 @@ +/***************************************************************************** +* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved. @@ -6741,368 +7011,21 @@ index 0000000..f12cb49 +module_param(mem_size, uint, 0644); +module_param(mem_base, uint, 0644); + -diff --git a/arch/arm/mach-bcm2708/vcio.c b/arch/arm/mach-bcm2708/vcio.c -new file mode 100644 -index 0000000..468fdef ---- /dev/null -+++ b/arch/arm/mach-bcm2708/vcio.c -@@ -0,0 +1,338 @@ -+/* -+ * linux/arch/arm/mach-bcm2708/vcio.c -+ * -+ * Copyright (C) 2010 Broadcom -+ * -+ * This program 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. -+ * -+ * This device provides a shared mechanism for writing to the mailboxes, -+ * semaphores, doorbells etc. that are shared between the ARM and the -+ * VideoCore processor -+ */ -+ -+#if defined(CONFIG_SERIAL_BCM_MBOX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) -+#define SUPPORT_SYSRQ -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+#include -+#include -+ -+#define DRIVER_NAME BCM_VCIO_DRIVER_NAME -+ -+/* ---------------------------------------------------------------------- -+ * Mailbox -+ * -------------------------------------------------------------------- */ -+ -+/* offsets from a mail box base address */ -+#define MAIL_WRT 0x00 /* write - and next 4 words */ -+#define MAIL_RD 0x00 /* read - and next 4 words */ -+#define MAIL_POL 0x10 /* read without popping the fifo */ -+#define MAIL_SND 0x14 /* sender ID (bottom two bits) */ -+#define MAIL_STA 0x18 /* status */ -+#define MAIL_CNF 0x1C /* configuration */ -+ -+#define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) -+#define MBOX_MSG_LSB(chan, data28) (((data28) << 4) | ((chan) & 0xf)) -+#define MBOX_CHAN(msg) ((msg) & 0xf) -+#define MBOX_DATA28(msg) ((msg) & ~0xf) -+#define MBOX_DATA28_LSB(msg) (((uint32_t)msg) >> 4) -+ -+#define MBOX_MAGIC 0xd0d0c0de -+ -+struct vc_mailbox { -+ struct device *dev; /* parent device */ -+ void __iomem *status; -+ void __iomem *config; -+ void __iomem *read; -+ void __iomem *write; -+ uint32_t msg[MBOX_CHAN_COUNT]; -+ struct semaphore sema[MBOX_CHAN_COUNT]; -+ uint32_t magic; -+}; -+ -+static void mbox_init(struct vc_mailbox *mbox_out, struct device *dev, -+ uint32_t addr_mbox) -+{ -+ int i; -+ -+ mbox_out->dev = dev; -+ mbox_out->status = __io_address(addr_mbox + MAIL_STA); -+ mbox_out->config = __io_address(addr_mbox + MAIL_CNF); -+ mbox_out->read = __io_address(addr_mbox + MAIL_RD); -+ /* Write to the other mailbox */ -+ mbox_out->write = -+ __io_address((addr_mbox ^ ARM_0_MAIL0_WRT ^ ARM_0_MAIL1_WRT) + -+ MAIL_WRT); -+ -+ for (i = 0; i < MBOX_CHAN_COUNT; i++) { -+ mbox_out->msg[i] = 0; -+ sema_init(&mbox_out->sema[i], 0); -+ } -+ -+ /* Enable the interrupt on data reception */ -+ writel(ARM_MC_IHAVEDATAIRQEN, mbox_out->config); -+ -+ mbox_out->magic = MBOX_MAGIC; -+} -+ -+static int mbox_write(struct vc_mailbox *mbox, unsigned chan, uint32_t data28) -+{ -+ int rc; -+ -+ if (mbox->magic != MBOX_MAGIC) -+ rc = -EINVAL; -+ else { -+ /* wait for the mailbox FIFO to have some space in it */ -+ while (0 != (readl(mbox->status) & ARM_MS_FULL)) -+ cpu_relax(); -+ -+ writel(MBOX_MSG(chan, data28), mbox->write); -+ rc = 0; -+ } -+ return rc; -+} -+ -+static int mbox_read(struct vc_mailbox *mbox, unsigned chan, uint32_t *data28) -+{ -+ int rc; -+ -+ if (mbox->magic != MBOX_MAGIC) -+ rc = -EINVAL; -+ else { -+ down(&mbox->sema[chan]); -+ *data28 = MBOX_DATA28(mbox->msg[chan]); -+ mbox->msg[chan] = 0; -+ rc = 0; -+ } -+ return rc; -+} -+ -+static irqreturn_t mbox_irq(int irq, void *dev_id) -+{ -+ /* wait for the mailbox FIFO to have some data in it */ -+ struct vc_mailbox *mbox = (struct vc_mailbox *) dev_id; -+ int status = readl(mbox->status); -+ int ret = IRQ_NONE; -+ -+ while (!(status & ARM_MS_EMPTY)) { -+ uint32_t msg = readl(mbox->read); -+ int chan = MBOX_CHAN(msg); -+ if (chan < MBOX_CHAN_COUNT) { -+ if (mbox->msg[chan]) { -+ /* Overflow */ -+ printk(KERN_ERR DRIVER_NAME -+ ": mbox chan %d overflow - drop %08x\n", -+ chan, msg); -+ } else { -+ mbox->msg[chan] = (msg | 0xf); -+ up(&mbox->sema[chan]); -+ } -+ } else { -+ printk(KERN_ERR DRIVER_NAME -+ ": invalid channel selector (msg %08x)\n", msg); -+ } -+ ret = IRQ_HANDLED; -+ status = readl(mbox->status); -+ } -+ return ret; -+} -+ -+static struct irqaction mbox_irqaction = { -+ .name = "ARM Mailbox IRQ", -+ .flags = IRQF_DISABLED | IRQF_IRQPOLL, -+ .handler = mbox_irq, -+}; -+ -+/* ---------------------------------------------------------------------- -+ * Mailbox Methods -+ * -------------------------------------------------------------------- */ -+ -+static struct device *mbox_dev; /* we assume there's only one! */ -+ -+static int dev_mbox_write(struct device *dev, unsigned chan, uint32_t data28) -+{ -+ int rc; -+ -+ struct vc_mailbox *mailbox = dev_get_drvdata(dev); -+ device_lock(dev); -+ rc = mbox_write(mailbox, chan, data28); -+ device_unlock(dev); -+ -+ return rc; -+} -+ -+static int dev_mbox_read(struct device *dev, unsigned chan, uint32_t *data28) -+{ -+ int rc; -+ -+ struct vc_mailbox *mailbox = dev_get_drvdata(dev); -+ device_lock(dev); -+ rc = mbox_read(mailbox, chan, data28); -+ device_unlock(dev); -+ -+ return rc; -+} -+ -+extern int bcm_mailbox_write(unsigned chan, uint32_t data28) -+{ -+ if (mbox_dev) -+ return dev_mbox_write(mbox_dev, chan, data28); -+ else -+ return -ENODEV; -+} -+EXPORT_SYMBOL_GPL(bcm_mailbox_write); -+ -+extern int bcm_mailbox_read(unsigned chan, uint32_t *data28) -+{ -+ if (mbox_dev) -+ return dev_mbox_read(mbox_dev, chan, data28); -+ else -+ return -ENODEV; -+} -+EXPORT_SYMBOL_GPL(bcm_mailbox_read); -+ -+static void dev_mbox_register(const char *dev_name, struct device *dev) -+{ -+ mbox_dev = dev; -+} -+ -+extern int bcm_mailbox_property(void *data, int size) -+{ -+ uint32_t success; -+ dma_addr_t mem_bus; /* the memory address accessed from videocore */ -+ void *mem_kern; /* the memory address accessed from driver */ -+ int s = 0; -+ -+ /* allocate some memory for the messages communicating with GPU */ -+ mem_kern = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &mem_bus, GFP_ATOMIC); -+ if (mem_kern) { -+ /* create the message */ -+ memcpy(mem_kern, data, size); -+ -+ /* send the message */ -+ wmb(); -+ s = bcm_mailbox_write(MBOX_CHAN_PROPERTY, (uint32_t)mem_bus); -+ if (s == 0) { -+ s = bcm_mailbox_read(MBOX_CHAN_PROPERTY, &success); -+ } -+ if (s == 0) { -+ /* copy the response */ -+ rmb(); -+ memcpy(data, mem_kern, size); -+ } -+ dma_free_coherent(NULL, PAGE_ALIGN(size), mem_kern, mem_bus); -+ } else { -+ s = -ENOMEM; -+ } -+ if (s != 0) -+ printk(KERN_ERR DRIVER_NAME ": %s failed (%d)\n", __func__, s); -+ return s; -+} -+EXPORT_SYMBOL_GPL(bcm_mailbox_property); -+ -+/* ---------------------------------------------------------------------- -+ * Platform Device for Mailbox -+ * -------------------------------------------------------------------- */ -+ -+static int bcm_vcio_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ struct vc_mailbox *mailbox; -+ -+ mailbox = kzalloc(sizeof(*mailbox), GFP_KERNEL); -+ if (NULL == mailbox) { -+ printk(KERN_ERR DRIVER_NAME ": failed to allocate " -+ "mailbox memory\n"); -+ ret = -ENOMEM; -+ } else { -+ struct resource *res; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res == NULL) { -+ printk(KERN_ERR DRIVER_NAME ": failed to obtain memory " -+ "resource\n"); -+ ret = -ENODEV; -+ kfree(mailbox); -+ } else { -+ /* should be based on the registers from res really */ -+ mbox_init(mailbox, &pdev->dev, ARM_0_MAIL0_RD); -+ -+ platform_set_drvdata(pdev, mailbox); -+ dev_mbox_register(DRIVER_NAME, &pdev->dev); -+ -+ mbox_irqaction.dev_id = mailbox; -+ setup_irq(IRQ_ARM_MAILBOX, &mbox_irqaction); -+ printk(KERN_INFO DRIVER_NAME ": mailbox at %p\n", -+ __io_address(ARM_0_MAIL0_RD)); -+ } -+ } -+ return ret; -+} -+ -+static int bcm_vcio_remove(struct platform_device *pdev) -+{ -+ struct vc_mailbox *mailbox = platform_get_drvdata(pdev); -+ -+ platform_set_drvdata(pdev, NULL); -+ kfree(mailbox); -+ -+ return 0; -+} -+ -+static struct platform_driver bcm_mbox_driver = { -+ .probe = bcm_vcio_probe, -+ .remove = bcm_vcio_remove, -+ -+ .driver = { -+ .name = DRIVER_NAME, -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static int __init bcm_mbox_init(void) -+{ -+ int ret; -+ -+ printk(KERN_INFO "mailbox: Broadcom VideoCore Mailbox driver\n"); -+ -+ ret = platform_driver_register(&bcm_mbox_driver); -+ if (ret != 0) { -+ printk(KERN_ERR DRIVER_NAME ": failed to register " -+ "on platform\n"); -+ } -+ -+ return ret; -+} -+ -+static void __exit bcm_mbox_exit(void) -+{ -+ platform_driver_unregister(&bcm_mbox_driver); -+} -+ -+arch_initcall(bcm_mbox_init); /* Initialize early */ -+module_exit(bcm_mbox_exit); -+ -+MODULE_AUTHOR("Gray Girling"); -+MODULE_DESCRIPTION("ARM I/O to VideoCore processor"); -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS("platform:bcm-mbox"); -diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig -index 101b968..a93a41e 100644 ---- a/arch/arm/mm/Kconfig -+++ b/arch/arm/mm/Kconfig -@@ -354,7 +354,7 @@ config CPU_PJ4 +diff -Naur linux-3.6.1/arch/arm/Makefile linux-rpi-3.6.y/arch/arm/Makefile +--- linux-3.6.1/arch/arm/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/Makefile 2012-11-11 18:17:00.535880235 +0100 +@@ -198,6 +198,7 @@ + machine-$(CONFIG_MACH_SPEAR320) := spear3xx + machine-$(CONFIG_MACH_SPEAR600) := spear6xx + machine-$(CONFIG_ARCH_ZYNQ) := zynq ++machine-$(CONFIG_ARCH_BCM2708) := bcm2708 - # ARMv6 - config CPU_V6 -- bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX -+ bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || MACH_BCM2708 - select CPU_32v6 - select CPU_ABRT_EV6 - select CPU_PABRT_V6 -diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c -index 9107231..87d2468 100644 ---- a/arch/arm/mm/alignment.c -+++ b/arch/arm/mm/alignment.c -@@ -856,9 +856,11 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) + # Platform directory name. This list is sorted alphanumerically + # by CONFIG_* macro name. +diff -Naur linux-3.6.1/arch/arm/mm/alignment.c linux-rpi-3.6.y/arch/arm/mm/alignment.c +--- linux-3.6.1/arch/arm/mm/alignment.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/mm/alignment.c 2012-11-11 18:16:55.348778848 +0100 +@@ -856,9 +856,11 @@ case 0x08000000: /* ldm or stm, or thumb-2 32bit instruction */ if (thumb2_32b) handler = do_alignment_t32_to_handler(&instr, regs, &offset); @@ -7116,11 +7039,22 @@ index 9107231..87d2468 100644 default: goto bad; -diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S -index 86b8b48..dc86b85 100644 ---- a/arch/arm/mm/proc-v6.S -+++ b/arch/arm/mm/proc-v6.S -@@ -73,10 +73,19 @@ ENDPROC(cpu_v6_reset) +diff -Naur linux-3.6.1/arch/arm/mm/Kconfig linux-rpi-3.6.y/arch/arm/mm/Kconfig +--- linux-3.6.1/arch/arm/mm/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/mm/Kconfig 2012-11-11 18:16:55.364779159 +0100 +@@ -354,7 +354,7 @@ + + # ARMv6 + config CPU_V6 +- bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX ++ bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || MACH_BCM2708 + select CPU_32v6 + select CPU_ABRT_EV6 + select CPU_PABRT_V6 +diff -Naur linux-3.6.1/arch/arm/mm/proc-v6.S linux-rpi-3.6.y/arch/arm/mm/proc-v6.S +--- linux-3.6.1/arch/arm/mm/proc-v6.S 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/mm/proc-v6.S 2012-11-11 18:16:55.350778887 +0100 +@@ -73,10 +73,19 @@ * * IRQs are already disabled. */ @@ -7143,11 +7077,10 @@ index 86b8b48..dc86b85 100644 mov pc, lr ENTRY(cpu_v6_dcache_clean_area) -diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types -index 2997e56..c166a40 100644 ---- a/arch/arm/tools/mach-types -+++ b/arch/arm/tools/mach-types -@@ -519,6 +519,7 @@ torbreck MACH_TORBRECK TORBRECK 3090 +diff -Naur linux-3.6.1/arch/arm/tools/mach-types linux-rpi-3.6.y/arch/arm/tools/mach-types +--- linux-3.6.1/arch/arm/tools/mach-types 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/arch/arm/tools/mach-types 2012-11-11 18:16:53.970751911 +0100 +@@ -519,6 +519,7 @@ prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103 paz00 MACH_PAZ00 PAZ00 3128 acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129 @@ -7155,40 +7088,968 @@ index 2997e56..c166a40 100644 ag5evm MACH_AG5EVM AG5EVM 3189 tsunagi MACH_TSUNAGI TSUNAGI 3197 ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206 -diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm -index 5961e64..6999dfd 100644 ---- a/drivers/cpufreq/Kconfig.arm -+++ b/drivers/cpufreq/Kconfig.arm -@@ -76,3 +76,12 @@ config ARM_EXYNOS5250_CPUFREQ - help - This adds the CPUFreq driver for Samsung EXYNOS5250 - SoC. +diff -Naur linux-3.6.1/drivers/char/broadcom/Kconfig linux-rpi-3.6.y/drivers/char/broadcom/Kconfig +--- linux-3.6.1/drivers/char/broadcom/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/char/broadcom/Kconfig 2012-11-11 18:15:54.257582920 +0100 +@@ -0,0 +1,18 @@ ++# ++# Broadcom char driver config ++# + -+config ARM_BCM2835_CPUFREQ -+ bool "BCM2835 Driver" -+ default y ++menuconfig BRCM_CHAR_DRIVERS ++ tristate "Broadcom Char Drivers" ++ depends on PROC_FS + help -+ This adds the CPUFreq driver for BCM2835 ++ Broadcom's char drivers + -+ If in doubt, say N. ++config BCM_VC_CMA ++ tristate "Videocore CMA" ++ #depends on BCM_VC_SERVICES ++ depends on CMA ++ default n ++ help ++ Helper for videocore CMA access. + -diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile -index 9531fc2..860ab83 100644 ---- a/drivers/cpufreq/Makefile -+++ b/drivers/cpufreq/Makefile -@@ -48,6 +48,7 @@ obj-$(CONFIG_ARM_EXYNOS4210_CPUFREQ) += exynos4210-cpufreq.o - obj-$(CONFIG_ARM_EXYNOS4X12_CPUFREQ) += exynos4x12-cpufreq.o - obj-$(CONFIG_ARM_EXYNOS5250_CPUFREQ) += exynos5250-cpufreq.o - obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ) += omap-cpufreq.o -+obj-$(CONFIG_ARM_BCM2835_CPUFREQ) += bcm2835-cpufreq.o +diff -Naur linux-3.6.1/drivers/char/broadcom/Makefile linux-rpi-3.6.y/drivers/char/broadcom/Makefile +--- linux-3.6.1/drivers/char/broadcom/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/char/broadcom/Makefile 2012-11-11 18:15:54.257582920 +0100 +@@ -0,0 +1,2 @@ ++obj-$(CONFIG_BCM_VC_CMA) += vc_cma/ ++ +diff -Naur linux-3.6.1/drivers/char/broadcom/vc_cma/Makefile linux-rpi-3.6.y/drivers/char/broadcom/vc_cma/Makefile +--- linux-3.6.1/drivers/char/broadcom/vc_cma/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/char/broadcom/vc_cma/Makefile 2012-11-11 18:15:54.257582920 +0100 +@@ -0,0 +1,15 @@ ++EXTRA_CFLAGS += -Wall -Wstrict-prototypes -Wno-trigraphs ++EXTRA_CFLAGS += -Werror ++EXTRA_CFLAGS += -I"include/linux/broadcom" ++EXTRA_CFLAGS += -I"drivers/misc/vc04_services" ++EXTRA_CFLAGS += -I"drivers/misc/vc04_services/interface/vchi" ++EXTRA_CFLAGS += -I"drivers/misc/vc04_services/interface/vchiq_arm" ++ ++EXTRA_CFLAGS += -D__KERNEL__ ++EXTRA_CFLAGS += -D__linux__ ++EXTRA_CFLAGS += -Werror ++ ++obj-$(CONFIG_BCM_VC_CMA) += vc-cma.o ++ ++vc-cma-objs := vc_cma.o ++ +diff -Naur linux-3.6.1/drivers/char/broadcom/vc_cma/vc_cma.c linux-rpi-3.6.y/drivers/char/broadcom/vc_cma/vc_cma.c +--- linux-3.6.1/drivers/char/broadcom/vc_cma/vc_cma.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/char/broadcom/vc_cma/vc_cma.c 2012-11-11 18:15:54.257582920 +0100 +@@ -0,0 +1,886 @@ ++/***************************************************************************** ++* Copyright 2012 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++#include "vc_cma.h" ++ ++#include "vchiq_util.h" ++#include "vchiq_connected.h" ++ ++#define DRIVER_NAME "vc-cma" ++ ++#define LOG_DBG(fmt, ...) \ ++ if (vc_cma_debug) \ ++ printk(KERN_INFO fmt "\n", ##__VA_ARGS__) ++#define LOG_ERR(fmt, ...) \ ++ printk(KERN_ERR fmt "\n", ##__VA_ARGS__) ++ ++#define VC_CMA_FOURCC VCHIQ_MAKE_FOURCC('C', 'M', 'A', ' ') ++#define VC_CMA_VERSION 2 ++ ++#define VC_CMA_CHUNK_ORDER 6 /* 256K */ ++#define VC_CMA_CHUNK_SIZE (4096 << VC_CMA_CHUNK_ORDER) ++#define VC_CMA_MAX_PARAMS_PER_MSG \ ++ ((VCHIQ_MAX_MSG_SIZE - sizeof(unsigned short))/sizeof(unsigned short)) ++#define VC_CMA_RESERVE_COUNT_MAX 16 ++ ++#define PAGES_PER_CHUNK (VC_CMA_CHUNK_SIZE / PAGE_SIZE) ++ ++enum { ++ VC_CMA_MSG_QUIT, ++ VC_CMA_MSG_OPEN, ++ VC_CMA_MSG_TICK, ++ VC_CMA_MSG_ALLOC, /* chunk count */ ++ VC_CMA_MSG_FREE, /* chunk, chunk, ... */ ++ VC_CMA_MSG_ALLOCATED, /* chunk, chunk, ... */ ++ VC_CMA_MSG_REQUEST_ALLOC, /* chunk count */ ++ VC_CMA_MSG_REQUEST_FREE, /* chunk count */ ++ VC_CMA_MSG_RESERVE, /* bytes lo, bytes hi */ ++ VC_CMA_MSG_UPDATE_RESERVE, ++ VC_CMA_MSG_MAX ++}; ++ ++struct cma_msg { ++ unsigned short type; ++ unsigned short params[VC_CMA_MAX_PARAMS_PER_MSG]; ++}; ++ ++struct vc_cma_reserve_user { ++ unsigned int pid; ++ unsigned int reserve; ++}; ++ ++/* Device (/dev) related variables */ ++static dev_t vc_cma_devnum; ++static struct class *vc_cma_class; ++static struct cdev vc_cma_cdev; ++static int vc_cma_inited; ++static int vc_cma_debug; ++ ++/* Proc entry */ ++static struct proc_dir_entry *vc_cma_proc_entry; ++ ++phys_addr_t vc_cma_base; ++struct page *vc_cma_base_page; ++unsigned int vc_cma_size; ++EXPORT_SYMBOL(vc_cma_size); ++unsigned int vc_cma_initial; ++unsigned int vc_cma_chunks; ++unsigned int vc_cma_chunks_used; ++unsigned int vc_cma_chunks_reserved; ++ ++unsigned int vc_cma_reserve_total; ++unsigned int vc_cma_reserve_count; ++struct vc_cma_reserve_user vc_cma_reserve_users[VC_CMA_RESERVE_COUNT_MAX]; ++static DEFINE_SEMAPHORE(vc_cma_reserve_mutex); ++static DEFINE_SEMAPHORE(vc_cma_worker_queue_push_mutex); ++ ++static u64 vc_cma_dma_mask = DMA_BIT_MASK(32); ++static struct platform_device vc_cma_device = { ++ .name = "vc-cma", ++ .id = 0, ++ .dev = { ++ .dma_mask = &vc_cma_dma_mask, ++ .coherent_dma_mask = DMA_BIT_MASK(32), ++ }, ++}; ++ ++static VCHIQ_INSTANCE_T cma_instance; ++static VCHIQ_SERVICE_HANDLE_T cma_service; ++static VCHIU_QUEUE_T cma_msg_queue; ++static struct task_struct *cma_worker; ++ ++static int vc_cma_set_reserve(unsigned int reserve, unsigned int pid); ++static int vc_cma_alloc_chunks(int num_chunks, struct cma_msg *reply); ++static VCHIQ_STATUS_T cma_service_callback( ++ VCHIQ_REASON_T reason, ++ VCHIQ_HEADER_T *header, ++ VCHIQ_SERVICE_HANDLE_T service, ++ void *bulk_userdata); ++static void send_vc_msg( ++ unsigned short type, ++ unsigned short param1, ++ unsigned short param2); ++static bool send_worker_msg(VCHIQ_HEADER_T *msg); ++ ++static int __init early_vc_cma_mem(char *p) ++{ ++ unsigned int new_size; ++ printk(KERN_ERR "early_vc_cma_mem(%s)", p); ++ vc_cma_size = memparse(p, &p); ++ vc_cma_initial = vc_cma_size; ++ if (*p == '/') ++ vc_cma_size = memparse(p + 1, &p); ++ if (*p == '@') ++ vc_cma_base = memparse(p + 1, &p); ++ ++ new_size = (vc_cma_size - ((-vc_cma_base) & (VC_CMA_CHUNK_SIZE - 1))) ++ & ~(VC_CMA_CHUNK_SIZE - 1); ++ if (new_size > vc_cma_size) ++ vc_cma_size = 0; ++ vc_cma_initial = (vc_cma_initial + VC_CMA_CHUNK_SIZE - 1) ++ & ~(VC_CMA_CHUNK_SIZE - 1); ++ if (vc_cma_initial > vc_cma_size) ++ vc_cma_initial = vc_cma_size; ++ vc_cma_base = (vc_cma_base + VC_CMA_CHUNK_SIZE - 1) ++ & ~(VC_CMA_CHUNK_SIZE - 1); ++ ++ printk(KERN_ERR " -> initial %x, size %x, base %x", vc_cma_initial, ++ vc_cma_size, (unsigned int)vc_cma_base); ++ ++ return 0; ++} ++ ++early_param("vc-cma-mem", early_vc_cma_mem); ++ ++void __init vc_cma_early_init(void) ++{ ++ LOG_DBG("vc_cma_early_init - vc_cma_chunks = %d", vc_cma_chunks); ++ if (vc_cma_size) { ++ int rc = platform_device_register(&vc_cma_device); ++ LOG_DBG("platform_device_register -> %d", rc); ++ } ++} ++ ++void __init vc_cma_reserve(void) ++{ ++ /* if vc_cma_size is set, then declare vc CMA area of the same ++ * size from the end of memory ++ */ ++ if (vc_cma_size) { ++ if (dma_declare_contiguous(&vc_cma_device.dev, vc_cma_size, ++ vc_cma_base, 0) == 0) { ++ } else { ++ LOG_ERR("vc_cma: dma_declare_contiguous(%x,%x) failed", ++ vc_cma_size, (unsigned int)vc_cma_base); ++ vc_cma_size = 0; ++ } ++ } ++ vc_cma_chunks = vc_cma_size / VC_CMA_CHUNK_SIZE; ++} ++ ++/**************************************************************************** ++* ++* vc_cma_open ++* ++***************************************************************************/ ++ ++static int vc_cma_open(struct inode *inode, struct file *file) ++{ ++ (void)inode; ++ (void)file; ++ ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* vc_cma_release ++* ++***************************************************************************/ ++ ++static int vc_cma_release(struct inode *inode, struct file *file) ++{ ++ (void)inode; ++ (void)file; ++ ++ vc_cma_set_reserve(0, current->tgid); ++ ++ return 0; ++} ++ ++/**************************************************************************** ++* ++* vc_cma_ioctl ++* ++***************************************************************************/ ++ ++static long vc_cma_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ++{ ++ int rc = 0; ++ ++ (void)cmd; ++ (void)arg; ++ ++ switch (cmd) { ++ case VC_CMA_IOC_RESERVE: ++ rc = vc_cma_set_reserve((unsigned int)arg, current->tgid); ++ if (rc >= 0) ++ rc = 0; ++ break; ++ default: ++ LOG_ERR("vc-cma: Unknown ioctl %x", cmd); ++ return -ENOTTY; ++ } ++ ++ return rc; ++} ++ ++ ++/**************************************************************************** ++* ++* File Operations for the driver. ++* ++***************************************************************************/ ++ ++static const struct file_operations vc_cma_fops = { ++ .owner = THIS_MODULE, ++ .open = vc_cma_open, ++ .release = vc_cma_release, ++ .unlocked_ioctl = vc_cma_ioctl, ++}; ++ ++/**************************************************************************** ++* ++* vc_cma_proc_open ++* ++***************************************************************************/ ++ ++static int vc_cma_show_info(struct seq_file *m, void *v) ++{ ++ int i; ++ ++ seq_printf(m, "Videocore CMA:\n"); ++ seq_printf(m, " Base : %08x\n", (unsigned int)vc_cma_base); ++ seq_printf(m, " Length : %08x\n", vc_cma_size); ++ seq_printf(m, " Initial : %08x\n", vc_cma_initial); ++ seq_printf(m, " Chunk size : %08x\n", VC_CMA_CHUNK_SIZE); ++ seq_printf(m, " Chunks : %4d (%d bytes)\n", ++ (int)vc_cma_chunks, ++ (int)(vc_cma_chunks * VC_CMA_CHUNK_SIZE)); ++ seq_printf(m, " Used : %4d (%d bytes)\n", ++ (int)vc_cma_chunks_used, ++ (int)(vc_cma_chunks_used * VC_CMA_CHUNK_SIZE)); ++ seq_printf(m, " Reserved : %4d (%d bytes)\n", ++ (unsigned int)vc_cma_chunks_reserved, ++ (int)(vc_cma_chunks_reserved * VC_CMA_CHUNK_SIZE)); ++ ++ for (i = 0; i < vc_cma_reserve_count; i++) { ++ struct vc_cma_reserve_user *user = &vc_cma_reserve_users[i]; ++ seq_printf(m, " PID %5d: %d bytes\n", user->pid, ++ user->reserve); ++ } ++ ++ seq_printf(m, "\n"); ++ ++ return 0; ++} ++ ++static int vc_cma_proc_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, vc_cma_show_info, NULL); ++} ++ ++/**************************************************************************** ++* ++* vc_cma_proc_write ++* ++***************************************************************************/ ++ ++static int vc_cma_proc_write( ++ struct file *file, ++ const char __user *buffer, ++ size_t size, ++ loff_t *ppos) ++{ ++ int rc = -EFAULT; ++ char input_str[20]; ++ ++ memset(input_str, 0, sizeof(input_str)); ++ ++ if (size > sizeof(input_str)) { ++ LOG_ERR("%s: input string length too long", __func__); ++ goto out; ++ } ++ ++ if (copy_from_user(input_str, buffer, size - 1)) { ++ LOG_ERR("%s: failed to get input string", __func__); ++ goto out; ++ } ++ ++#define ALLOC_STR "alloc" ++#define FREE_STR "free" ++#define DEBUG_STR "debug" ++#define RESERVE_STR "reserve" ++ if (strncmp(input_str, ALLOC_STR, strlen(ALLOC_STR)) == 0) { ++ int size; ++ char *p = input_str + strlen(ALLOC_STR); ++ ++ while (*p == ' ') ++ p++; ++ size = memparse(p, NULL); ++ LOG_ERR("/proc/vc-cma: alloc %d", size); ++ if (size) ++ send_vc_msg(VC_CMA_MSG_REQUEST_FREE, ++ size / VC_CMA_CHUNK_SIZE, 0); ++ else ++ LOG_ERR("invalid size '%s'", p); ++ rc = size; ++ } else if (strncmp(input_str, FREE_STR, ++ strlen(FREE_STR)) == 0) { ++ int size; ++ char *p = input_str + strlen(FREE_STR); ++ ++ while (*p == ' ') ++ p++; ++ size = memparse(p, NULL); ++ LOG_ERR("/proc/vc-cma: free %d", size); ++ if (size) ++ send_vc_msg(VC_CMA_MSG_REQUEST_ALLOC, ++ size / VC_CMA_CHUNK_SIZE, 0); ++ else ++ LOG_ERR("invalid size '%s'", p); ++ rc = size; ++ } else if (strncmp(input_str, DEBUG_STR, strlen(DEBUG_STR)) == 0) { ++ char *p = input_str + strlen(DEBUG_STR); ++ while (*p == ' ') ++ p++; ++ if ((strcmp(p, "on") == 0) || (strcmp(p, "1") == 0)) ++ vc_cma_debug = 1; ++ else if ((strcmp(p, "off") == 0) || (strcmp(p, "0") == 0)) ++ vc_cma_debug = 0; ++ LOG_ERR("/proc/vc-cma: debug %s", vc_cma_debug ? "on" : "off"); ++ rc = size; ++ } else if (strncmp(input_str, RESERVE_STR, strlen(RESERVE_STR)) == 0) { ++ int size; ++ int reserved; ++ char *p = input_str + strlen(RESERVE_STR); ++ while (*p == ' ') ++ p++; ++ size = memparse(p, NULL); ++ ++ reserved = vc_cma_set_reserve(size, current->tgid); ++ rc = (reserved >= 0) ? size : reserved; ++ } ++ ++out: ++ return rc; ++} ++ ++ ++/**************************************************************************** ++* ++* File Operations for /proc interface. ++* ++***************************************************************************/ ++ ++static const struct file_operations vc_cma_proc_fops = { ++ .open = vc_cma_proc_open, ++ .read = seq_read, ++ .write = vc_cma_proc_write, ++ .llseek = seq_lseek, ++ .release = single_release ++}; ++ ++ ++static int vc_cma_set_reserve(unsigned int reserve, unsigned int pid) ++{ ++ struct vc_cma_reserve_user *user = NULL; ++ int delta = 0; ++ int i; ++ ++ if (down_interruptible(&vc_cma_reserve_mutex)) ++ return -ERESTARTSYS; ++ ++ for (i = 0; i < vc_cma_reserve_count; i++) { ++ if (pid == vc_cma_reserve_users[i].pid) { ++ user = &vc_cma_reserve_users[i]; ++ delta = reserve - user->reserve; ++ if (reserve) ++ user->reserve = reserve; ++ else { ++ /* Remove this entry by copying downwards */ ++ while ((i + 1) < vc_cma_reserve_count) { ++ user[0].pid = user[1].pid; ++ user[0].reserve = user[1].reserve; ++ user++; ++ i++; ++ } ++ vc_cma_reserve_count--; ++ user = NULL; ++ } ++ break; ++ } ++ } ++ ++ if (reserve && !user) { ++ if (vc_cma_reserve_count == VC_CMA_RESERVE_COUNT_MAX) { ++ LOG_ERR("vc-cma: Too many reservations - " ++ "increase CMA_RESERVE_COUNT_MAX"); ++ up(&vc_cma_reserve_mutex); ++ return -EBUSY; ++ } ++ user = &vc_cma_reserve_users[vc_cma_reserve_count]; ++ user->pid = pid; ++ user->reserve = reserve; ++ delta = reserve; ++ vc_cma_reserve_count++; ++ } ++ ++ vc_cma_reserve_total += delta; ++ ++ send_vc_msg(VC_CMA_MSG_RESERVE, ++ vc_cma_reserve_total & 0xffff, ++ vc_cma_reserve_total >> 16); ++ ++ send_worker_msg((VCHIQ_HEADER_T *)VC_CMA_MSG_UPDATE_RESERVE); ++ ++ LOG_DBG("/proc/vc-cma: reserve %d (PID %d) - total %u", ++ reserve, pid, vc_cma_reserve_total); ++ ++ up(&vc_cma_reserve_mutex); ++ ++ return vc_cma_reserve_total; ++} ++ ++static VCHIQ_STATUS_T cma_service_callback( ++ VCHIQ_REASON_T reason, ++ VCHIQ_HEADER_T *header, ++ VCHIQ_SERVICE_HANDLE_T service, ++ void *bulk_userdata) ++{ ++ switch (reason) { ++ case VCHIQ_MESSAGE_AVAILABLE: ++ if (!send_worker_msg(header)) ++ return VCHIQ_RETRY; ++ break; ++ case VCHIQ_SERVICE_CLOSED: ++ LOG_DBG("CMA service closed"); ++ break; ++ default: ++ LOG_ERR("Unexpected CMA callback reason %d", reason); ++ break; ++ } ++ return VCHIQ_SUCCESS; ++} ++ ++static void send_vc_msg( ++ unsigned short type, ++ unsigned short param1, ++ unsigned short param2) ++{ ++ unsigned short msg[] = { type, param1, param2 }; ++ VCHIQ_ELEMENT_T elem = { &msg, sizeof(msg) }; ++ VCHIQ_STATUS_T ret; ++ vchiq_use_service(cma_service); ++ ret = vchiq_queue_message(cma_service, &elem, 1); ++ vchiq_release_service(cma_service); ++ if (ret != VCHIQ_SUCCESS) ++ LOG_ERR("vchiq_queue_message returned %x", ret); ++} ++ ++static bool send_worker_msg(VCHIQ_HEADER_T *msg) ++{ ++ if (down_interruptible(&vc_cma_worker_queue_push_mutex)) ++ return false; ++ vchiu_queue_push(&cma_msg_queue, msg); ++ up(&vc_cma_worker_queue_push_mutex); ++ return true; ++} ++ ++static int vc_cma_alloc_chunks(int num_chunks, struct cma_msg *reply) ++{ ++ int i; ++ for (i = 0; i < num_chunks; i++) { ++ struct page *chunk; ++ unsigned int chunk_num; ++ chunk = dma_alloc_from_contiguous( ++ &vc_cma_device.dev, ++ PAGES_PER_CHUNK, ++ VC_CMA_CHUNK_ORDER); ++ if (!chunk) ++ break; ++ chunk_num = ++ (page_to_phys(chunk) - vc_cma_base) / ++ VC_CMA_CHUNK_SIZE; ++ BUG_ON(((page_to_phys(chunk) - vc_cma_base) % ++ VC_CMA_CHUNK_SIZE) != 0); ++ if (chunk_num >= vc_cma_chunks) ++ { ++ LOG_ERR("%s: ===============================", ++ __func__); ++ LOG_ERR("%s: chunk phys %x, vc_cma %x-%x - " ++ "bad SPARSEMEM configuration?", ++ __func__, (unsigned int)page_to_phys(chunk), ++ vc_cma_base, vc_cma_base + vc_cma_size - 1); ++ LOG_ERR("%s: dev->cma_area = %p\n", __func__, vc_cma_device.dev.cma_area); ++ LOG_ERR("%s: ===============================", ++ __func__); ++ break; ++ } ++ reply->params[i] = chunk_num; ++ vc_cma_chunks_used++; ++ } ++ ++ if (i < num_chunks) { ++ LOG_ERR("%s: dma_alloc_from_contiguous failed " ++ "for %x bytes (alloc %d of %d, %d free)", ++ __func__, VC_CMA_CHUNK_SIZE, i, ++ num_chunks, ++ vc_cma_chunks - vc_cma_chunks_used); ++ num_chunks = i; ++ } ++ ++ LOG_DBG("CMA allocated %d chunks -> %d used", ++ num_chunks, vc_cma_chunks_used); ++ reply->type = VC_CMA_MSG_ALLOCATED; ++ ++ { ++ VCHIQ_ELEMENT_T elem = { ++ reply, ++ offsetof(struct cma_msg, params[0]) + ++ num_chunks * sizeof(reply->params[0]) ++ }; ++ VCHIQ_STATUS_T ret; ++ vchiq_use_service(cma_service); ++ ret = vchiq_queue_message(cma_service, ++ &elem, 1); ++ vchiq_release_service(cma_service); ++ if (ret != VCHIQ_SUCCESS) ++ LOG_ERR("vchiq_queue_message return " ++ "%x", ret); ++ } ++ ++ return num_chunks; ++} ++ ++static int cma_worker_proc(void *param) ++{ ++ static struct cma_msg reply; ++ (void)param; ++ ++ while (1) { ++ VCHIQ_HEADER_T *msg; ++ static struct cma_msg msg_copy; ++ struct cma_msg *cma_msg = &msg_copy; ++ int type, msg_size; ++ ++ msg = vchiu_queue_pop(&cma_msg_queue); ++ if ((unsigned int)msg >= VC_CMA_MSG_MAX) { ++ msg_size = msg->size; ++ memcpy(&msg_copy, msg->data, msg_size); ++ type = cma_msg->type; ++ vchiq_release_message(cma_service, msg); ++ } else { ++ msg_size = 0; ++ type = (int)msg; ++ if (type == VC_CMA_MSG_QUIT) ++ break; ++ else if (type == VC_CMA_MSG_UPDATE_RESERVE) { ++ msg = NULL; ++ cma_msg = NULL; ++ } else { ++ BUG(); ++ continue; ++ } ++ } ++ ++ switch (type) { ++ case VC_CMA_MSG_ALLOC: { ++ int num_chunks, free_chunks; ++ num_chunks = cma_msg->params[0]; ++ free_chunks = vc_cma_chunks - vc_cma_chunks_used; ++ LOG_DBG("CMA_MSG_ALLOC(%d chunks)", num_chunks); ++ if (num_chunks > VC_CMA_MAX_PARAMS_PER_MSG) { ++ LOG_ERR("CMA_MSG_ALLOC - chunk count (%d) " ++ "exceeds VC_CMA_MAX_PARAMS_PER_MSG (%d)", ++ num_chunks, VC_CMA_MAX_PARAMS_PER_MSG); ++ num_chunks = VC_CMA_MAX_PARAMS_PER_MSG; ++ } ++ ++ if (num_chunks > free_chunks) { ++ LOG_ERR("CMA_MSG_ALLOC - chunk count (%d) " ++ "exceeds free chunks (%d)", ++ num_chunks, free_chunks); ++ num_chunks = free_chunks; ++ } ++ ++ vc_cma_alloc_chunks(num_chunks, &reply); ++ } ++ break; ++ ++ case VC_CMA_MSG_FREE: { ++ int chunk_count = ++ (msg_size - offsetof(struct cma_msg, params))/ ++ sizeof(cma_msg->params[0]); ++ int i; ++ BUG_ON(chunk_count <= 0); ++ ++ LOG_DBG("CMA_MSG_FREE(%d chunks - %x, ...)", ++ chunk_count, cma_msg->params[0]); ++ for (i = 0; i < chunk_count; i++) { ++ int chunk_num = cma_msg->params[i]; ++ struct page *page = vc_cma_base_page + ++ chunk_num * PAGES_PER_CHUNK; ++ if (chunk_num >= vc_cma_chunks) { ++ LOG_ERR("CMA_MSG_FREE - chunk %d of %d" ++ " (value %x) exceeds maximum " ++ "(%x)", ++ i, chunk_count, chunk_num, ++ vc_cma_chunks - 1); ++ break; ++ } ++ ++ if (!dma_release_from_contiguous( ++ &vc_cma_device.dev, ++ page, PAGES_PER_CHUNK)) { ++ LOG_ERR("CMA_MSG_FREE - failed to " ++ "release chunk %d (phys %x, " ++ "page %x)", ++ chunk_num, page_to_phys(page), ++ (unsigned int)page); ++ } ++ vc_cma_chunks_used--; ++ } ++ LOG_DBG("CMA released %d chunks -> %d used", ++ i, vc_cma_chunks_used); ++ } ++ break; ++ ++ case VC_CMA_MSG_UPDATE_RESERVE: { ++ int chunks_needed = ++ ((vc_cma_reserve_total + VC_CMA_CHUNK_SIZE - 1) ++ / VC_CMA_CHUNK_SIZE) - ++ vc_cma_chunks_reserved; ++ ++ LOG_DBG("CMA_MSG_UPDATE_RESERVE(%d chunks needed)", ++ chunks_needed); ++ ++ /* Cap the reservations to what is available */ ++ if (chunks_needed > 0) { ++ if (chunks_needed > ++ (vc_cma_chunks - vc_cma_chunks_used)) ++ chunks_needed = ++ (vc_cma_chunks - ++ vc_cma_chunks_used); ++ ++ chunks_needed = vc_cma_alloc_chunks( ++ chunks_needed, &reply); ++ } ++ ++ LOG_DBG("CMA_MSG_UPDATE_RESERVE(%d chunks allocated)", ++ chunks_needed); ++ vc_cma_chunks_reserved += chunks_needed; ++ } ++ break; ++ ++ default: ++ LOG_ERR("unexpected msg type %d", type); ++ break; ++ } ++ } ++ ++ LOG_DBG("quitting..."); ++ return 0; ++} ++ ++static void vc_cma_connected_init(void) ++{ ++ VCHIQ_SERVICE_PARAMS_T service_params; ++ ++ LOG_DBG("vc_cma_connected_init"); ++ ++ if (!vchiu_queue_init(&cma_msg_queue, 16)) { ++ LOG_ERR("could not create CMA msg queue"); ++ goto fail_queue; ++ } ++ ++ if (vchiq_initialise(&cma_instance) != VCHIQ_SUCCESS) ++ goto fail_vchiq_init; ++ ++ vchiq_connect(cma_instance); ++ ++ service_params.fourcc = VC_CMA_FOURCC; ++ service_params.callback = cma_service_callback; ++ service_params.userdata = NULL; ++ service_params.version = VC_CMA_VERSION; ++ service_params.version_min = VC_CMA_VERSION; ++ ++ if (vchiq_open_service(cma_instance, &service_params, ++ &cma_service) != VCHIQ_SUCCESS) { ++ LOG_ERR("failed to open service - already in use?"); ++ goto fail_vchiq_open; ++ } ++ ++ vchiq_release_service(cma_service); ++ ++ cma_worker = kthread_create(cma_worker_proc, NULL, "cma_worker"); ++ if (!cma_worker) { ++ LOG_ERR("could not create CMA worker thread"); ++ goto fail_worker; ++ } ++ set_user_nice(cma_worker, -20); ++ wake_up_process(cma_worker); ++ ++ return; ++ ++fail_worker: ++ vchiq_close_service(cma_service); ++fail_vchiq_open: ++ vchiq_shutdown(cma_instance); ++fail_vchiq_init: ++ vchiu_queue_delete(&cma_msg_queue); ++fail_queue: ++ return; ++} ++ ++ ++/**************************************************************************** ++* ++* vc_cma_connected_init ++* ++* This function is called once the videocore has been connected. ++* ++***************************************************************************/ ++ ++static int __init vc_cma_init(void) ++{ ++ int rc = -EFAULT; ++ struct device *dev; ++ ++ printk(KERN_INFO "vc-cma: Videocore CMA driver\n"); ++ printk(KERN_INFO "vc-cma: vc_cma_base = 0x%08x\n", ++ vc_cma_base); ++ printk(KERN_INFO "vc-cma: vc_cma_size = 0x%08x (%u MiB)\n", ++ vc_cma_size, vc_cma_size / (1024 * 1024)); ++ printk(KERN_INFO "vc-cma: vc_cma_initial = 0x%08x (%u MiB)\n", ++ vc_cma_initial, vc_cma_initial / (1024 * 1024)); ++ ++ vc_cma_base_page = phys_to_page(vc_cma_base); ++ if (vc_cma_chunks) { ++ int chunks_needed = vc_cma_initial / VC_CMA_CHUNK_SIZE; ++ ++ for (vc_cma_chunks_used = 0; ++ vc_cma_chunks_used < chunks_needed; ++ vc_cma_chunks_used++) { ++ struct page *chunk; ++ chunk = dma_alloc_from_contiguous(&vc_cma_device.dev, ++ PAGES_PER_CHUNK, VC_CMA_CHUNK_ORDER); ++ if (!chunk) ++ break; ++ BUG_ON(((page_to_phys(chunk) - vc_cma_base) % ++ VC_CMA_CHUNK_SIZE) != 0); ++ } ++ if (vc_cma_chunks_used != chunks_needed) { ++ LOG_ERR("%s: dma_alloc_from_contiguous failed (%d " ++ "bytes, allocation %d of %d)", ++ __func__, VC_CMA_CHUNK_SIZE, ++ vc_cma_chunks_used, ++ chunks_needed); ++ goto out_release; ++ } ++ vchiq_add_connected_callback(vc_cma_connected_init); ++ } ++ ++ rc = alloc_chrdev_region(&vc_cma_devnum, 0, 1, DRIVER_NAME); ++ if (rc < 0) { ++ LOG_ERR("%s: alloc_chrdev_region failed (rc=%d)", __func__, ++ rc); ++ goto out_release; ++ } ++ ++ cdev_init(&vc_cma_cdev, &vc_cma_fops); ++ rc = cdev_add(&vc_cma_cdev, vc_cma_devnum, 1); ++ if (rc != 0) { ++ LOG_ERR("%s: cdev_add failed (rc=%d)", __func__, rc); ++ goto out_unregister; ++ } ++ ++ vc_cma_class = class_create(THIS_MODULE, DRIVER_NAME); ++ if (IS_ERR(vc_cma_class)) { ++ rc = PTR_ERR(vc_cma_class); ++ LOG_ERR("%s: class_create failed (rc=%d)", __func__, rc); ++ goto out_cdev_del; ++ } ++ ++ dev = device_create(vc_cma_class, NULL, vc_cma_devnum, NULL, ++ DRIVER_NAME); ++ if (IS_ERR(dev)) { ++ rc = PTR_ERR(dev); ++ LOG_ERR("%s: device_create failed (rc=%d)", __func__, rc); ++ goto out_class_destroy; ++ } ++ ++ vc_cma_proc_entry = create_proc_entry(DRIVER_NAME, 0444, NULL); ++ if (vc_cma_proc_entry == NULL) { ++ rc = -EFAULT; ++ LOG_ERR("%s: create_proc_entry failed", __func__); ++ goto out_device_destroy; ++ } ++ ++ vc_cma_proc_entry->proc_fops = &vc_cma_proc_fops; ++ ++ vc_cma_inited = 1; ++ return 0; ++ ++out_device_destroy: ++ device_destroy(vc_cma_class, vc_cma_devnum); ++ ++out_class_destroy: ++ class_destroy(vc_cma_class); ++ vc_cma_class = NULL; ++ ++out_cdev_del: ++ cdev_del(&vc_cma_cdev); ++ ++out_unregister: ++ unregister_chrdev_region(vc_cma_devnum, 1); ++ ++out_release: ++ /* It is tempting to try to clean up by calling ++ dma_release_from_contiguous for all allocated chunks, but it isn't ++ a very safe thing to do. If vc_cma_initial is non-zero it is because ++ VideoCore is already using that memory, so giving it back to Linux ++ is likely to be fatal. ++ */ ++ return -1; ++} ++ ++/**************************************************************************** ++* ++* vc_cma_exit ++* ++***************************************************************************/ ++ ++static void __exit vc_cma_exit(void) ++{ ++ LOG_DBG("%s: called", __func__); ++ ++ if (vc_cma_inited) { ++ remove_proc_entry(vc_cma_proc_entry->name, NULL); ++ device_destroy(vc_cma_class, vc_cma_devnum); ++ class_destroy(vc_cma_class); ++ cdev_del(&vc_cma_cdev); ++ unregister_chrdev_region(vc_cma_devnum, 1); ++ } ++} ++ ++module_init(vc_cma_init); ++module_exit(vc_cma_exit); ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Broadcom Corporation"); +diff -Naur linux-3.6.1/drivers/char/Kconfig linux-rpi-3.6.y/drivers/char/Kconfig +--- linux-3.6.1/drivers/char/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/char/Kconfig 2012-11-11 18:15:54.577589187 +0100 +@@ -585,6 +585,8 @@ - ################################################################################## - # PowerPC platform drivers -diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c -new file mode 100755 -index 0000000..6ff1edb ---- /dev/null -+++ b/drivers/cpufreq/bcm2835-cpufreq.c + source "drivers/s390/char/Kconfig" + ++source "drivers/char/broadcom/Kconfig" ++ + config MSM_SMD_PKT + bool "Enable device interface for some SMD packet ports" + default n +diff -Naur linux-3.6.1/drivers/char/Makefile linux-rpi-3.6.y/drivers/char/Makefile +--- linux-3.6.1/drivers/char/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/char/Makefile 2012-11-11 18:15:54.438586464 +0100 +@@ -63,3 +63,6 @@ + js-rtc-y = rtc.o + + obj-$(CONFIG_TILE_SROM) += tile-srom.o ++ ++obj-$(CONFIG_BRCM_CHAR_DRIVERS) += broadcom/ ++ +diff -Naur linux-3.6.1/drivers/cpufreq/bcm2835-cpufreq.c linux-rpi-3.6.y/drivers/cpufreq/bcm2835-cpufreq.c +--- linux-3.6.1/drivers/cpufreq/bcm2835-cpufreq.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/cpufreq/bcm2835-cpufreq.c 2012-11-11 18:15:06.378645187 +0100 @@ -0,0 +1,239 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -7429,44 +8290,36 @@ index 0000000..6ff1edb +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); + -diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig -index b0a2e4c..954041a 100644 ---- a/drivers/hwmon/Kconfig -+++ b/drivers/hwmon/Kconfig -@@ -1411,6 +1411,16 @@ config SENSORS_MC13783_ADC - help - Support for the A/D converter on MC13783 and MC13892 PMIC. - -+config SENSORS_BCM2835 -+ depends on THERMAL_BCM2835=n -+ tristate "Broadcom BCM2835 HWMON Driver" +diff -Naur linux-3.6.1/drivers/cpufreq/Kconfig.arm linux-rpi-3.6.y/drivers/cpufreq/Kconfig.arm +--- linux-3.6.1/drivers/cpufreq/Kconfig.arm 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/cpufreq/Kconfig.arm 2012-11-11 18:15:06.155640819 +0100 +@@ -76,3 +76,12 @@ + help + This adds the CPUFreq driver for Samsung EXYNOS5250 + SoC. ++ ++config ARM_BCM2835_CPUFREQ ++ bool "BCM2835 Driver" ++ default y + help -+ If you say yes here you get support for the hardware -+ monitoring features of the BCM2835 Chip ++ This adds the CPUFreq driver for BCM2835 + -+ This driver can also be built as a module. If so, the module -+ will be called bcm2835-hwmon. ++ If in doubt, say N. + - if ACPI +diff -Naur linux-3.6.1/drivers/cpufreq/Makefile linux-rpi-3.6.y/drivers/cpufreq/Makefile +--- linux-3.6.1/drivers/cpufreq/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/cpufreq/Makefile 2012-11-11 18:15:06.411645833 +0100 +@@ -48,6 +48,7 @@ + obj-$(CONFIG_ARM_EXYNOS4X12_CPUFREQ) += exynos4x12-cpufreq.o + obj-$(CONFIG_ARM_EXYNOS5250_CPUFREQ) += exynos5250-cpufreq.o + obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ) += omap-cpufreq.o ++obj-$(CONFIG_ARM_BCM2835_CPUFREQ) += bcm2835-cpufreq.o - comment "ACPI drivers" -diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile -index 7aa9811..7c1162a 100644 ---- a/drivers/hwmon/Makefile -+++ b/drivers/hwmon/Makefile -@@ -129,6 +129,7 @@ obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o - obj-$(CONFIG_SENSORS_W83L786NG) += w83l786ng.o - obj-$(CONFIG_SENSORS_WM831X) += wm831x-hwmon.o - obj-$(CONFIG_SENSORS_WM8350) += wm8350-hwmon.o -+obj-$(CONFIG_SENSORS_BCM2835) += bcm2835-hwmon.o - - obj-$(CONFIG_PMBUS) += pmbus/ - -diff --git a/drivers/hwmon/bcm2835-hwmon.c b/drivers/hwmon/bcm2835-hwmon.c -new file mode 100644 -index 0000000..5bbed45 ---- /dev/null -+++ b/drivers/hwmon/bcm2835-hwmon.c + ################################################################################## + # PowerPC platform drivers +diff -Naur linux-3.6.1/drivers/hwmon/bcm2835-hwmon.c linux-rpi-3.6.y/drivers/hwmon/bcm2835-hwmon.c +--- linux-3.6.1/drivers/hwmon/bcm2835-hwmon.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/hwmon/bcm2835-hwmon.c 2012-11-11 18:15:30.188111514 +0100 @@ -0,0 +1,219 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -7687,53 +8540,40 @@ index 0000000..5bbed45 +MODULE_DESCRIPTION("HW Monitor driver for bcm2835 chip"); + +module_platform_driver(bcm2835_hwmon_driver); -diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig -index 970a161..3d7b81d 100644 ---- a/drivers/i2c/busses/Kconfig -+++ b/drivers/i2c/busses/Kconfig -@@ -314,6 +314,25 @@ config I2C_AU1550 - This driver can also be built as a module. If so, the module - will be called i2c-au1550. +diff -Naur linux-3.6.1/drivers/hwmon/Kconfig linux-rpi-3.6.y/drivers/hwmon/Kconfig +--- linux-3.6.1/drivers/hwmon/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/hwmon/Kconfig 2012-11-11 18:15:30.365114982 +0100 +@@ -1411,6 +1411,16 @@ + help + Support for the A/D converter on MC13783 and MC13892 PMIC. -+config I2C_BCM2708 -+ tristate "BCM2708 BSC" -+ depends on MACH_BCM2708 ++config SENSORS_BCM2835 ++ depends on THERMAL_BCM2835=n ++ tristate "Broadcom BCM2835 HWMON Driver" + help -+ Enabling this option will add BSC (Broadcom Serial Controller) -+ support for the BCM2708. BSC is a Broadcom proprietary bus compatible -+ with I2C/TWI/SMBus. ++ If you say yes here you get support for the hardware ++ monitoring features of the BCM2835 Chip + -+config I2C_BCM2708_BAUDRATE -+ prompt "BCM2708 I2C baudrate" -+ depends on I2C_BCM2708 -+ int -+ default 100000 -+ help -+ Set the I2C baudrate. This will alter the default value. A -+ different baudrate can be set by using a module parameter as well. If -+ no parameter is provided when loading, this is the value that will be -+ used. ++ This driver can also be built as a module. If so, the module ++ will be called bcm2835-hwmon. + - config I2C_BLACKFIN_TWI - tristate "Blackfin TWI I2C support" - depends on BLACKFIN -diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile -index 37c4182..d8ff8f9 100644 ---- a/drivers/i2c/busses/Makefile -+++ b/drivers/i2c/busses/Makefile -@@ -30,6 +30,7 @@ obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o - # Embedded system I2C/SMBus host controller drivers - obj-$(CONFIG_I2C_AT91) += i2c-at91.o - obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o -+obj-$(CONFIG_I2C_BCM2708) += i2c-bcm2708.o - obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o - obj-$(CONFIG_I2C_CPM) += i2c-cpm.o - obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o -diff --git a/drivers/i2c/busses/i2c-bcm2708.c b/drivers/i2c/busses/i2c-bcm2708.c -new file mode 100644 -index 0000000..63414a3 ---- /dev/null -+++ b/drivers/i2c/busses/i2c-bcm2708.c + if ACPI + + comment "ACPI drivers" +diff -Naur linux-3.6.1/drivers/hwmon/Makefile linux-rpi-3.6.y/drivers/hwmon/Makefile +--- linux-3.6.1/drivers/hwmon/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/hwmon/Makefile 2012-11-11 18:15:30.331114316 +0100 +@@ -129,6 +129,7 @@ + obj-$(CONFIG_SENSORS_W83L786NG) += w83l786ng.o + obj-$(CONFIG_SENSORS_WM831X) += wm831x-hwmon.o + obj-$(CONFIG_SENSORS_WM8350) += wm8350-hwmon.o ++obj-$(CONFIG_SENSORS_BCM2835) += bcm2835-hwmon.o + + obj-$(CONFIG_PMBUS) += pmbus/ + +diff -Naur linux-3.6.1/drivers/i2c/busses/i2c-bcm2708.c linux-rpi-3.6.y/drivers/i2c/busses/i2c-bcm2708.c +--- linux-3.6.1/drivers/i2c/busses/i2c-bcm2708.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/i2c/busses/i2c-bcm2708.c 2012-11-11 18:15:59.151678772 +0100 @@ -0,0 +1,400 @@ +/* + * Driver for Broadcom BCM2708 BSC Controllers @@ -8135,72 +8975,67 @@ index 0000000..63414a3 +MODULE_AUTHOR("Chris Boot "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index 98a442d..f738bf3 100644 ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -517,4 +517,6 @@ source "drivers/misc/lis3lv02d/Kconfig" +diff -Naur linux-3.6.1/drivers/i2c/busses/Kconfig linux-rpi-3.6.y/drivers/i2c/busses/Kconfig +--- linux-3.6.1/drivers/i2c/busses/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/i2c/busses/Kconfig 2012-11-11 18:15:59.194679612 +0100 +@@ -314,6 +314,25 @@ + This driver can also be built as a module. If so, the module + will be called i2c-au1550. + ++config I2C_BCM2708 ++ tristate "BCM2708 BSC" ++ depends on MACH_BCM2708 ++ help ++ Enabling this option will add BSC (Broadcom Serial Controller) ++ support for the BCM2708. BSC is a Broadcom proprietary bus compatible ++ with I2C/TWI/SMBus. ++ ++config I2C_BCM2708_BAUDRATE ++ prompt "BCM2708 I2C baudrate" ++ depends on I2C_BCM2708 ++ int ++ default 100000 ++ help ++ Set the I2C baudrate. This will alter the default value. A ++ different baudrate can be set by using a module parameter as well. If ++ no parameter is provided when loading, this is the value that will be ++ used. ++ + config I2C_BLACKFIN_TWI + tristate "Blackfin TWI I2C support" + depends on BLACKFIN +diff -Naur linux-3.6.1/drivers/i2c/busses/Makefile linux-rpi-3.6.y/drivers/i2c/busses/Makefile +--- linux-3.6.1/drivers/i2c/busses/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/i2c/busses/Makefile 2012-11-11 18:15:59.187679475 +0100 +@@ -30,6 +30,7 @@ + # Embedded system I2C/SMBus host controller drivers + obj-$(CONFIG_I2C_AT91) += i2c-at91.o + obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o ++obj-$(CONFIG_I2C_BCM2708) += i2c-bcm2708.o + obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o + obj-$(CONFIG_I2C_CPM) += i2c-cpm.o + obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o +diff -Naur linux-3.6.1/drivers/misc/Kconfig linux-rpi-3.6.y/drivers/misc/Kconfig +--- linux-3.6.1/drivers/misc/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/misc/Kconfig 2012-11-11 18:15:16.089835391 +0100 +@@ -517,4 +517,6 @@ source "drivers/misc/carma/Kconfig" source "drivers/misc/altera-stapl/Kconfig" source "drivers/misc/mei/Kconfig" +source "drivers/misc/vc04_services/Kconfig" endmenu + -diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index b88df7a..aeeb47e 100644 ---- a/drivers/misc/Makefile -+++ b/drivers/misc/Makefile -@@ -50,3 +50,5 @@ obj-y += carma/ +diff -Naur linux-3.6.1/drivers/misc/Makefile linux-rpi-3.6.y/drivers/misc/Makefile +--- linux-3.6.1/drivers/misc/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/misc/Makefile 2012-11-11 18:15:15.953832727 +0100 +@@ -50,3 +50,4 @@ obj-$(CONFIG_USB_SWITCH_FSA9480) += fsa9480.o obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/ obj-$(CONFIG_INTEL_MEI) += mei/ -+obj-y += vc04_services/ -+ -diff --git a/drivers/misc/vc04_services/Kconfig b/drivers/misc/vc04_services/Kconfig -new file mode 100644 -index 0000000..b48a3f3 ---- /dev/null -+++ b/drivers/misc/vc04_services/Kconfig -@@ -0,0 +1,10 @@ -+config BCM2708_VCHIQ -+ tristate "Videocore VCHIQ" -+ depends on MACH_BCM2708 -+ default y -+ help -+ Kernel to VideoCore communication interface for the -+ BCM2708 family of products. -+ Defaults to Y when the Broadcom Videocore services -+ are included in the build, N otherwise. -+ -diff --git a/drivers/misc/vc04_services/Makefile b/drivers/misc/vc04_services/Makefile -new file mode 100644 -index 0000000..1aeb20a ---- /dev/null -+++ b/drivers/misc/vc04_services/Makefile -@@ -0,0 +1,18 @@ -+ifeq ($(CONFIG_MACH_BCM2708),y) -+ -+obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o -+ -+vchiq-objs := \ -+ interface/vchiq_arm/vchiq_core.o \ -+ interface/vchiq_arm/vchiq_arm.o \ -+ interface/vchiq_arm/vchiq_kern_lib.o \ -+ interface/vchiq_arm/vchiq_2835_arm.o \ -+ interface/vchiq_arm/vchiq_proc.o \ -+ interface/vchiq_arm/vchiq_shim.o \ -+ interface/vchiq_arm/vchiq_util.o \ -+ interface/vchiq_arm/vchiq_connected.o \ -+ -+EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -Idrivers/misc/vc04_services -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -+ -+endif -+ -diff --git a/drivers/misc/vc04_services/interface/vchi/connections/connection.h b/drivers/misc/vc04_services/interface/vchi/connections/connection.h -new file mode 100644 -index 0000000..f4e8225 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchi/connections/connection.h ++obj-$(CONFIG_BCM2708_VCHIQ) += vc04_services/ +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchi/connections/connection.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/connections/connection.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchi/connections/connection.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/connections/connection.h 2012-11-11 18:15:15.880831297 +0100 @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2010-2012 Broadcom. All rights reserved. @@ -8515,11 +9350,9 @@ index 0000000..f4e8225 +#endif /* CONNECTION_H_ */ + +/****************************** End of file **********************************/ -diff --git a/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h b/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h -new file mode 100644 -index 0000000..1e2da83 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 2012-11-11 18:15:15.904831770 +0100 @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2010-2012 Broadcom. All rights reserved. @@ -8710,11 +9543,434 @@ index 0000000..1e2da83 +#endif // _VCHI_MESSAGE_H_ + +/****************************** End of file ***********************************/ -diff --git a/drivers/misc/vc04_services/interface/vchi/vchi.h b/drivers/misc/vc04_services/interface/vchi/vchi.h -new file mode 100644 -index 0000000..7a7612d ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchi/vchi.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 2012-11-11 18:15:15.904831770 +0100 +@@ -0,0 +1,209 @@ ++/* ++ * Copyright (c) 2010-2012 Broadcom. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef VCHI_CFG_H_ ++#define VCHI_CFG_H_ ++ ++/**************************************************************************************** ++ * Defines in this first section are part of the VCHI API and may be examined by VCHI ++ * services. ++ ***************************************************************************************/ ++ ++/* Required alignment of base addresses for bulk transfer, if unaligned transfers are not enabled */ ++/* Really determined by the message driver, and should be available from a run-time call. */ ++#ifndef VCHI_BULK_ALIGN ++# if __VCCOREVER__ >= 0x04000000 ++# define VCHI_BULK_ALIGN 32 // Allows for the need to do cache cleans ++# else ++# define VCHI_BULK_ALIGN 16 ++# endif ++#endif ++ ++/* Required length multiple for bulk transfers, if unaligned transfers are not enabled */ ++/* May be less than or greater than VCHI_BULK_ALIGN */ ++/* Really determined by the message driver, and should be available from a run-time call. */ ++#ifndef VCHI_BULK_GRANULARITY ++# if __VCCOREVER__ >= 0x04000000 ++# define VCHI_BULK_GRANULARITY 32 // Allows for the need to do cache cleans ++# else ++# define VCHI_BULK_GRANULARITY 16 ++# endif ++#endif ++ ++/* The largest possible message to be queued with vchi_msg_queue. */ ++#ifndef VCHI_MAX_MSG_SIZE ++# if defined VCHI_LOCAL_HOST_PORT ++# define VCHI_MAX_MSG_SIZE 16384 // makes file transfers fast, but should they be using bulk? ++# else ++# define VCHI_MAX_MSG_SIZE 4096 // NOTE: THIS MUST BE LARGER THAN OR EQUAL TO THE SIZE OF THE KHRONOS MERGE BUFFER!! ++# endif ++#endif ++ ++/****************************************************************************************** ++ * Defines below are system configuration options, and should not be used by VCHI services. ++ *****************************************************************************************/ ++ ++/* How many connections can we support? A localhost implementation uses 2 connections, ++ * 1 for host-app, 1 for VMCS, and these are hooked together by a loopback MPHI VCFW ++ * driver. */ ++#ifndef VCHI_MAX_NUM_CONNECTIONS ++# define VCHI_MAX_NUM_CONNECTIONS 3 ++#endif ++ ++/* How many services can we open per connection? Extending this doesn't cost processing time, just a small ++ * amount of static memory. */ ++#ifndef VCHI_MAX_SERVICES_PER_CONNECTION ++# define VCHI_MAX_SERVICES_PER_CONNECTION 36 ++#endif ++ ++/* Adjust if using a message driver that supports more logical TX channels */ ++#ifndef VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION ++# define VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION 9 // 1 MPHI + 8 CCP2 logical channels ++#endif ++ ++/* Adjust if using a message driver that supports more logical RX channels */ ++#ifndef VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION ++# define VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION 1 // 1 MPHI ++#endif ++ ++/* How many receive slots do we use. This times VCHI_MAX_MSG_SIZE gives the effective ++ * receive queue space, less message headers. */ ++#ifndef VCHI_NUM_READ_SLOTS ++# if defined(VCHI_LOCAL_HOST_PORT) ++# define VCHI_NUM_READ_SLOTS 4 ++# else ++# define VCHI_NUM_READ_SLOTS 48 ++# endif ++#endif ++ ++/* Do we utilise overrun facility for receive message slots? Can aid peer transmit ++ * performance. Only define on VideoCore end, talking to host. ++ */ ++//#define VCHI_MSG_RX_OVERRUN ++ ++/* How many transmit slots do we use. Generally don't need many, as the hardware driver ++ * underneath VCHI will usually have its own buffering. */ ++#ifndef VCHI_NUM_WRITE_SLOTS ++# define VCHI_NUM_WRITE_SLOTS 4 ++#endif ++ ++/* If a service has held or queued received messages in VCHI_XOFF_THRESHOLD or more slots, ++ * then it's taking up too much buffer space, and the peer service will be told to stop ++ * transmitting with an XOFF message. For this to be effective, the VCHI_NUM_READ_SLOTS ++ * needs to be considerably bigger than VCHI_NUM_WRITE_SLOTS, or the transmit latency ++ * is too high. */ ++#ifndef VCHI_XOFF_THRESHOLD ++# define VCHI_XOFF_THRESHOLD (VCHI_NUM_READ_SLOTS / 2) ++#endif ++ ++/* After we've sent an XOFF, the peer will be told to resume transmission once the local ++ * service has dequeued/released enough messages that it's now occupying ++ * VCHI_XON_THRESHOLD slots or fewer. */ ++#ifndef VCHI_XON_THRESHOLD ++# define VCHI_XON_THRESHOLD (VCHI_NUM_READ_SLOTS / 4) ++#endif ++ ++/* A size below which a bulk transfer omits the handshake completely and always goes ++ * via the message channel, if bulk auxiliary is being sent on that service. (The user ++ * can guarantee this by enabling unaligned transmits). ++ * Not API. */ ++#ifndef VCHI_MIN_BULK_SIZE ++# define VCHI_MIN_BULK_SIZE ( VCHI_MAX_MSG_SIZE / 2 < 4096 ? VCHI_MAX_MSG_SIZE / 2 : 4096 ) ++#endif ++ ++/* Maximum size of bulk transmission chunks, for each interface type. A trade-off between ++ * speed and latency; the smaller the chunk size the better change of messages and other ++ * bulk transmissions getting in when big bulk transfers are happening. Set to 0 to not ++ * break transmissions into chunks. ++ */ ++#ifndef VCHI_MAX_BULK_CHUNK_SIZE_MPHI ++# define VCHI_MAX_BULK_CHUNK_SIZE_MPHI (16 * 1024) ++#endif ++ ++/* NB Chunked CCP2 transmissions violate the letter of the CCP2 spec by using "JPEG8" mode ++ * with multiple-line frames. Only use if the receiver can cope. */ ++#ifndef VCHI_MAX_BULK_CHUNK_SIZE_CCP2 ++# define VCHI_MAX_BULK_CHUNK_SIZE_CCP2 0 ++#endif ++ ++/* How many TX messages can we have pending in our transmit slots. Once exhausted, ++ * vchi_msg_queue will be blocked. */ ++#ifndef VCHI_TX_MSG_QUEUE_SIZE ++# define VCHI_TX_MSG_QUEUE_SIZE 256 ++#endif ++ ++/* How many RX messages can we have parsed in the receive slots. Once exhausted, parsing ++ * will be suspended until older messages are dequeued/released. */ ++#ifndef VCHI_RX_MSG_QUEUE_SIZE ++# define VCHI_RX_MSG_QUEUE_SIZE 256 ++#endif ++ ++/* Really should be able to cope if we run out of received message descriptors, by ++ * suspending parsing as the comment above says, but we don't. This sweeps the issue ++ * under the carpet. */ ++#if VCHI_RX_MSG_QUEUE_SIZE < (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS ++# undef VCHI_RX_MSG_QUEUE_SIZE ++# define VCHI_RX_MSG_QUEUE_SIZE (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS ++#endif ++ ++/* How many bulk transmits can we have pending. Once exhausted, vchi_bulk_queue_transmit ++ * will be blocked. */ ++#ifndef VCHI_TX_BULK_QUEUE_SIZE ++# define VCHI_TX_BULK_QUEUE_SIZE 64 ++#endif ++ ++/* How many bulk receives can we have pending. Once exhausted, vchi_bulk_queue_receive ++ * will be blocked. */ ++#ifndef VCHI_RX_BULK_QUEUE_SIZE ++# define VCHI_RX_BULK_QUEUE_SIZE 64 ++#endif ++ ++/* A limit on how many outstanding bulk requests we expect the peer to give us. If ++ * the peer asks for more than this, VCHI will fail and assert. The number is determined ++ * by the peer's hardware - it's the number of outstanding requests that can be queued ++ * on all bulk channels. VC3's MPHI peripheral allows 16. */ ++#ifndef VCHI_MAX_PEER_BULK_REQUESTS ++# define VCHI_MAX_PEER_BULK_REQUESTS 32 ++#endif ++ ++/* Define VCHI_CCP2TX_MANUAL_POWER if the host tells us when to turn the CCP2 ++ * transmitter on and off. ++ */ ++/*#define VCHI_CCP2TX_MANUAL_POWER*/ ++ ++#ifndef VCHI_CCP2TX_MANUAL_POWER ++ ++/* Timeout (in milliseconds) for putting the CCP2TX interface into IDLE state. Set ++ * negative for no IDLE. ++ */ ++# ifndef VCHI_CCP2TX_IDLE_TIMEOUT ++# define VCHI_CCP2TX_IDLE_TIMEOUT 5 ++# endif ++ ++/* Timeout (in milliseconds) for putting the CCP2TX interface into OFF state. Set ++ * negative for no OFF. ++ */ ++# ifndef VCHI_CCP2TX_OFF_TIMEOUT ++# define VCHI_CCP2TX_OFF_TIMEOUT 1000 ++# endif ++ ++#endif /* VCHI_CCP2TX_MANUAL_POWER */ ++ ++#endif /* VCHI_CFG_H_ */ ++ ++/****************************** End of file **********************************/ +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 2012-11-11 18:15:15.880831297 +0100 +@@ -0,0 +1,56 @@ ++/* ++ * Copyright (c) 2010-2012 Broadcom. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef VCHI_CFG_INTERNAL_H_ ++#define VCHI_CFG_INTERNAL_H_ ++ ++/**************************************************************************************** ++ * Control optimisation attempts. ++ ***************************************************************************************/ ++ ++// Don't use lots of short-term locks - use great long ones, reducing the overall locks-per-second ++#define VCHI_COARSE_LOCKING ++ ++// Avoid lock then unlock on exit from blocking queue operations (msg tx, bulk rx/tx) ++// (only relevant if VCHI_COARSE_LOCKING) ++#define VCHI_ELIDE_BLOCK_EXIT_LOCK ++ ++// Avoid lock on non-blocking peek ++// (only relevant if VCHI_COARSE_LOCKING) ++#define VCHI_AVOID_PEEK_LOCK ++ ++// Use one slot-handler thread per connection, rather than 1 thread dealing with all connections in rotation. ++#define VCHI_MULTIPLE_HANDLER_THREADS ++ ++// Put free descriptors onto the head of the free queue, rather than the tail, so that we don't thrash ++// our way through the pool of descriptors. ++#define VCHI_PUSH_FREE_DESCRIPTORS_ONTO_HEAD ++ ++// Don't issue a MSG_AVAILABLE callback for every single message. Possibly only safe if VCHI_COARSE_LOCKING. ++#define VCHI_FEWER_MSG_AVAILABLE_CALLBACKS ++ ++// Don't use message descriptors for TX messages that don't need them ++#define VCHI_MINIMISE_TX_MSG_DESCRIPTORS ++ ++// Nano-locks for multiqueue ++//#define VCHI_MQUEUE_NANOLOCKS ++ ++// Lock-free(er) dequeuing ++//#define VCHI_RX_NANOLOCKS ++ ++#endif /*VCHI_CFG_INTERNAL_H_*/ +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi_common.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi_common.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi_common.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi_common.h 2012-11-11 18:15:15.893831549 +0100 +@@ -0,0 +1,148 @@ ++/* ++ * Copyright (c) 2010-2012 Broadcom. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef VCHI_COMMON_H_ ++#define VCHI_COMMON_H_ ++ ++ ++//flags used when sending messages (must be bitmapped) ++typedef enum ++{ ++ VCHI_FLAGS_NONE = 0x0, ++ VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE = 0x1, // waits for message to be received, or sent (NB. not the same as being seen on other side) ++ VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE = 0x2, // run a callback when message sent ++ VCHI_FLAGS_BLOCK_UNTIL_QUEUED = 0x4, // return once the transfer is in a queue ready to go ++ VCHI_FLAGS_ALLOW_PARTIAL = 0x8, ++ VCHI_FLAGS_BLOCK_UNTIL_DATA_READ = 0x10, ++ VCHI_FLAGS_CALLBACK_WHEN_DATA_READ = 0x20, ++ ++ VCHI_FLAGS_ALIGN_SLOT = 0x000080, // internal use only ++ VCHI_FLAGS_BULK_AUX_QUEUED = 0x010000, // internal use only ++ VCHI_FLAGS_BULK_AUX_COMPLETE = 0x020000, // internal use only ++ VCHI_FLAGS_BULK_DATA_QUEUED = 0x040000, // internal use only ++ VCHI_FLAGS_BULK_DATA_COMPLETE = 0x080000, // internal use only ++ VCHI_FLAGS_INTERNAL = 0xFF0000 ++} VCHI_FLAGS_T; ++ ++// constants for vchi_crc_control() ++typedef enum { ++ VCHI_CRC_NOTHING = -1, ++ VCHI_CRC_PER_SERVICE = 0, ++ VCHI_CRC_EVERYTHING = 1, ++} VCHI_CRC_CONTROL_T; ++ ++//callback reasons when an event occurs on a service ++typedef enum ++{ ++ VCHI_CALLBACK_REASON_MIN, ++ ++ //This indicates that there is data available ++ //handle is the msg id that was transmitted with the data ++ // When a message is received and there was no FULL message available previously, send callback ++ // Tasks get kicked by the callback, reset their event and try and read from the fifo until it fails ++ VCHI_CALLBACK_MSG_AVAILABLE, ++ VCHI_CALLBACK_MSG_SENT, ++ VCHI_CALLBACK_MSG_SPACE_AVAILABLE, // XXX not yet implemented ++ ++ // This indicates that a transfer from the other side has completed ++ VCHI_CALLBACK_BULK_RECEIVED, ++ //This indicates that data queued up to be sent has now gone ++ //handle is the msg id that was used when sending the data ++ VCHI_CALLBACK_BULK_SENT, ++ VCHI_CALLBACK_BULK_RX_SPACE_AVAILABLE, // XXX not yet implemented ++ VCHI_CALLBACK_BULK_TX_SPACE_AVAILABLE, // XXX not yet implemented ++ ++ VCHI_CALLBACK_SERVICE_CLOSED, ++ ++ // this side has sent XOFF to peer due to lack of data consumption by service ++ // (suggests the service may need to take some recovery action if it has ++ // been deliberately holding off consuming data) ++ VCHI_CALLBACK_SENT_XOFF, ++ VCHI_CALLBACK_SENT_XON, ++ ++ // indicates that a bulk transfer has finished reading the source buffer ++ VCHI_CALLBACK_BULK_DATA_READ, ++ ++ // power notification events (currently host side only) ++ VCHI_CALLBACK_PEER_OFF, ++ VCHI_CALLBACK_PEER_SUSPENDED, ++ VCHI_CALLBACK_PEER_ON, ++ VCHI_CALLBACK_PEER_RESUMED, ++ VCHI_CALLBACK_FORCED_POWER_OFF, ++ ++#ifdef USE_VCHIQ_ARM ++ // some extra notifications provided by vchiq_arm ++ VCHI_CALLBACK_SERVICE_OPENED, ++ VCHI_CALLBACK_BULK_RECEIVE_ABORTED, ++ VCHI_CALLBACK_BULK_TRANSMIT_ABORTED, ++#endif ++ ++ VCHI_CALLBACK_REASON_MAX ++} VCHI_CALLBACK_REASON_T; ++ ++//Calback used by all services / bulk transfers ++typedef void (*VCHI_CALLBACK_T)( void *callback_param, //my service local param ++ VCHI_CALLBACK_REASON_T reason, ++ void *handle ); //for transmitting msg's only ++ ++ ++ ++/* ++ * Define vector struct for scatter-gather (vector) operations ++ * Vectors can be nested - if a vector element has negative length, then ++ * the data pointer is treated as pointing to another vector array, with ++ * '-vec_len' elements. Thus to append a header onto an existing vector, ++ * you can do this: ++ * ++ * void foo(const VCHI_MSG_VECTOR_T *v, int n) ++ * { ++ * VCHI_MSG_VECTOR_T nv[2]; ++ * nv[0].vec_base = my_header; ++ * nv[0].vec_len = sizeof my_header; ++ * nv[1].vec_base = v; ++ * nv[1].vec_len = -n; ++ * ... ++ * ++ */ ++typedef struct vchi_msg_vector { ++ const void *vec_base; ++ int32_t vec_len; ++} VCHI_MSG_VECTOR_T; ++ ++// Opaque type for a connection API ++typedef struct opaque_vchi_connection_api_t VCHI_CONNECTION_API_T; ++ ++// Opaque type for a message driver ++typedef struct opaque_vchi_message_driver_t VCHI_MESSAGE_DRIVER_T; ++ ++ ++// Iterator structure for reading ahead through received message queue. Allocated by client, ++// initialised by vchi_msg_look_ahead. Fields are for internal VCHI use only. ++// Iterates over messages in queue at the instant of the call to vchi_msg_lookahead - ++// will not proceed to messages received since. Behaviour is undefined if an iterator ++// is used again after messages for that service are removed/dequeued by any ++// means other than vchi_msg_iter_... calls on the iterator itself. ++typedef struct { ++ struct opaque_vchi_service_t *service; ++ void *last; ++ void *next; ++ void *remove; ++} VCHI_MSG_ITER_T; ++ ++ ++#endif // VCHI_COMMON_H_ +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi.h 2012-11-11 18:15:15.904831770 +0100 @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2010-2012 Broadcom. All rights reserved. @@ -9071,442 +10327,9 @@ index 0000000..7a7612d +#endif /* VCHI_H_ */ + +/****************************** End of file **********************************/ -diff --git a/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h b/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h -new file mode 100644 -index 0000000..df02282 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h -@@ -0,0 +1,209 @@ -+/* -+ * Copyright (c) 2010-2012 Broadcom. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef VCHI_CFG_H_ -+#define VCHI_CFG_H_ -+ -+/**************************************************************************************** -+ * Defines in this first section are part of the VCHI API and may be examined by VCHI -+ * services. -+ ***************************************************************************************/ -+ -+/* Required alignment of base addresses for bulk transfer, if unaligned transfers are not enabled */ -+/* Really determined by the message driver, and should be available from a run-time call. */ -+#ifndef VCHI_BULK_ALIGN -+# if __VCCOREVER__ >= 0x04000000 -+# define VCHI_BULK_ALIGN 32 // Allows for the need to do cache cleans -+# else -+# define VCHI_BULK_ALIGN 16 -+# endif -+#endif -+ -+/* Required length multiple for bulk transfers, if unaligned transfers are not enabled */ -+/* May be less than or greater than VCHI_BULK_ALIGN */ -+/* Really determined by the message driver, and should be available from a run-time call. */ -+#ifndef VCHI_BULK_GRANULARITY -+# if __VCCOREVER__ >= 0x04000000 -+# define VCHI_BULK_GRANULARITY 32 // Allows for the need to do cache cleans -+# else -+# define VCHI_BULK_GRANULARITY 16 -+# endif -+#endif -+ -+/* The largest possible message to be queued with vchi_msg_queue. */ -+#ifndef VCHI_MAX_MSG_SIZE -+# if defined VCHI_LOCAL_HOST_PORT -+# define VCHI_MAX_MSG_SIZE 16384 // makes file transfers fast, but should they be using bulk? -+# else -+# define VCHI_MAX_MSG_SIZE 4096 // NOTE: THIS MUST BE LARGER THAN OR EQUAL TO THE SIZE OF THE KHRONOS MERGE BUFFER!! -+# endif -+#endif -+ -+/****************************************************************************************** -+ * Defines below are system configuration options, and should not be used by VCHI services. -+ *****************************************************************************************/ -+ -+/* How many connections can we support? A localhost implementation uses 2 connections, -+ * 1 for host-app, 1 for VMCS, and these are hooked together by a loopback MPHI VCFW -+ * driver. */ -+#ifndef VCHI_MAX_NUM_CONNECTIONS -+# define VCHI_MAX_NUM_CONNECTIONS 3 -+#endif -+ -+/* How many services can we open per connection? Extending this doesn't cost processing time, just a small -+ * amount of static memory. */ -+#ifndef VCHI_MAX_SERVICES_PER_CONNECTION -+# define VCHI_MAX_SERVICES_PER_CONNECTION 36 -+#endif -+ -+/* Adjust if using a message driver that supports more logical TX channels */ -+#ifndef VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION -+# define VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION 9 // 1 MPHI + 8 CCP2 logical channels -+#endif -+ -+/* Adjust if using a message driver that supports more logical RX channels */ -+#ifndef VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION -+# define VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION 1 // 1 MPHI -+#endif -+ -+/* How many receive slots do we use. This times VCHI_MAX_MSG_SIZE gives the effective -+ * receive queue space, less message headers. */ -+#ifndef VCHI_NUM_READ_SLOTS -+# if defined(VCHI_LOCAL_HOST_PORT) -+# define VCHI_NUM_READ_SLOTS 4 -+# else -+# define VCHI_NUM_READ_SLOTS 48 -+# endif -+#endif -+ -+/* Do we utilise overrun facility for receive message slots? Can aid peer transmit -+ * performance. Only define on VideoCore end, talking to host. -+ */ -+//#define VCHI_MSG_RX_OVERRUN -+ -+/* How many transmit slots do we use. Generally don't need many, as the hardware driver -+ * underneath VCHI will usually have its own buffering. */ -+#ifndef VCHI_NUM_WRITE_SLOTS -+# define VCHI_NUM_WRITE_SLOTS 4 -+#endif -+ -+/* If a service has held or queued received messages in VCHI_XOFF_THRESHOLD or more slots, -+ * then it's taking up too much buffer space, and the peer service will be told to stop -+ * transmitting with an XOFF message. For this to be effective, the VCHI_NUM_READ_SLOTS -+ * needs to be considerably bigger than VCHI_NUM_WRITE_SLOTS, or the transmit latency -+ * is too high. */ -+#ifndef VCHI_XOFF_THRESHOLD -+# define VCHI_XOFF_THRESHOLD (VCHI_NUM_READ_SLOTS / 2) -+#endif -+ -+/* After we've sent an XOFF, the peer will be told to resume transmission once the local -+ * service has dequeued/released enough messages that it's now occupying -+ * VCHI_XON_THRESHOLD slots or fewer. */ -+#ifndef VCHI_XON_THRESHOLD -+# define VCHI_XON_THRESHOLD (VCHI_NUM_READ_SLOTS / 4) -+#endif -+ -+/* A size below which a bulk transfer omits the handshake completely and always goes -+ * via the message channel, if bulk auxiliary is being sent on that service. (The user -+ * can guarantee this by enabling unaligned transmits). -+ * Not API. */ -+#ifndef VCHI_MIN_BULK_SIZE -+# define VCHI_MIN_BULK_SIZE ( VCHI_MAX_MSG_SIZE / 2 < 4096 ? VCHI_MAX_MSG_SIZE / 2 : 4096 ) -+#endif -+ -+/* Maximum size of bulk transmission chunks, for each interface type. A trade-off between -+ * speed and latency; the smaller the chunk size the better change of messages and other -+ * bulk transmissions getting in when big bulk transfers are happening. Set to 0 to not -+ * break transmissions into chunks. -+ */ -+#ifndef VCHI_MAX_BULK_CHUNK_SIZE_MPHI -+# define VCHI_MAX_BULK_CHUNK_SIZE_MPHI (16 * 1024) -+#endif -+ -+/* NB Chunked CCP2 transmissions violate the letter of the CCP2 spec by using "JPEG8" mode -+ * with multiple-line frames. Only use if the receiver can cope. */ -+#ifndef VCHI_MAX_BULK_CHUNK_SIZE_CCP2 -+# define VCHI_MAX_BULK_CHUNK_SIZE_CCP2 0 -+#endif -+ -+/* How many TX messages can we have pending in our transmit slots. Once exhausted, -+ * vchi_msg_queue will be blocked. */ -+#ifndef VCHI_TX_MSG_QUEUE_SIZE -+# define VCHI_TX_MSG_QUEUE_SIZE 256 -+#endif -+ -+/* How many RX messages can we have parsed in the receive slots. Once exhausted, parsing -+ * will be suspended until older messages are dequeued/released. */ -+#ifndef VCHI_RX_MSG_QUEUE_SIZE -+# define VCHI_RX_MSG_QUEUE_SIZE 256 -+#endif -+ -+/* Really should be able to cope if we run out of received message descriptors, by -+ * suspending parsing as the comment above says, but we don't. This sweeps the issue -+ * under the carpet. */ -+#if VCHI_RX_MSG_QUEUE_SIZE < (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS -+# undef VCHI_RX_MSG_QUEUE_SIZE -+# define VCHI_RX_MSG_QUEUE_SIZE (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS -+#endif -+ -+/* How many bulk transmits can we have pending. Once exhausted, vchi_bulk_queue_transmit -+ * will be blocked. */ -+#ifndef VCHI_TX_BULK_QUEUE_SIZE -+# define VCHI_TX_BULK_QUEUE_SIZE 64 -+#endif -+ -+/* How many bulk receives can we have pending. Once exhausted, vchi_bulk_queue_receive -+ * will be blocked. */ -+#ifndef VCHI_RX_BULK_QUEUE_SIZE -+# define VCHI_RX_BULK_QUEUE_SIZE 64 -+#endif -+ -+/* A limit on how many outstanding bulk requests we expect the peer to give us. If -+ * the peer asks for more than this, VCHI will fail and assert. The number is determined -+ * by the peer's hardware - it's the number of outstanding requests that can be queued -+ * on all bulk channels. VC3's MPHI peripheral allows 16. */ -+#ifndef VCHI_MAX_PEER_BULK_REQUESTS -+# define VCHI_MAX_PEER_BULK_REQUESTS 32 -+#endif -+ -+/* Define VCHI_CCP2TX_MANUAL_POWER if the host tells us when to turn the CCP2 -+ * transmitter on and off. -+ */ -+/*#define VCHI_CCP2TX_MANUAL_POWER*/ -+ -+#ifndef VCHI_CCP2TX_MANUAL_POWER -+ -+/* Timeout (in milliseconds) for putting the CCP2TX interface into IDLE state. Set -+ * negative for no IDLE. -+ */ -+# ifndef VCHI_CCP2TX_IDLE_TIMEOUT -+# define VCHI_CCP2TX_IDLE_TIMEOUT 5 -+# endif -+ -+/* Timeout (in milliseconds) for putting the CCP2TX interface into OFF state. Set -+ * negative for no OFF. -+ */ -+# ifndef VCHI_CCP2TX_OFF_TIMEOUT -+# define VCHI_CCP2TX_OFF_TIMEOUT 1000 -+# endif -+ -+#endif /* VCHI_CCP2TX_MANUAL_POWER */ -+ -+#endif /* VCHI_CFG_H_ */ -+ -+/****************************** End of file **********************************/ -diff --git a/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h b/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h -new file mode 100644 -index 0000000..f334e4c ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h -@@ -0,0 +1,56 @@ -+/* -+ * Copyright (c) 2010-2012 Broadcom. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef VCHI_CFG_INTERNAL_H_ -+#define VCHI_CFG_INTERNAL_H_ -+ -+/**************************************************************************************** -+ * Control optimisation attempts. -+ ***************************************************************************************/ -+ -+// Don't use lots of short-term locks - use great long ones, reducing the overall locks-per-second -+#define VCHI_COARSE_LOCKING -+ -+// Avoid lock then unlock on exit from blocking queue operations (msg tx, bulk rx/tx) -+// (only relevant if VCHI_COARSE_LOCKING) -+#define VCHI_ELIDE_BLOCK_EXIT_LOCK -+ -+// Avoid lock on non-blocking peek -+// (only relevant if VCHI_COARSE_LOCKING) -+#define VCHI_AVOID_PEEK_LOCK -+ -+// Use one slot-handler thread per connection, rather than 1 thread dealing with all connections in rotation. -+#define VCHI_MULTIPLE_HANDLER_THREADS -+ -+// Put free descriptors onto the head of the free queue, rather than the tail, so that we don't thrash -+// our way through the pool of descriptors. -+#define VCHI_PUSH_FREE_DESCRIPTORS_ONTO_HEAD -+ -+// Don't issue a MSG_AVAILABLE callback for every single message. Possibly only safe if VCHI_COARSE_LOCKING. -+#define VCHI_FEWER_MSG_AVAILABLE_CALLBACKS -+ -+// Don't use message descriptors for TX messages that don't need them -+#define VCHI_MINIMISE_TX_MSG_DESCRIPTORS -+ -+// Nano-locks for multiqueue -+//#define VCHI_MQUEUE_NANOLOCKS -+ -+// Lock-free(er) dequeuing -+//#define VCHI_RX_NANOLOCKS -+ -+#endif /*VCHI_CFG_INTERNAL_H_*/ -diff --git a/drivers/misc/vc04_services/interface/vchi/vchi_common.h b/drivers/misc/vc04_services/interface/vchi/vchi_common.h -new file mode 100644 -index 0000000..b3aa5e7 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchi/vchi_common.h -@@ -0,0 +1,148 @@ -+/* -+ * Copyright (c) 2010-2012 Broadcom. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef VCHI_COMMON_H_ -+#define VCHI_COMMON_H_ -+ -+ -+//flags used when sending messages (must be bitmapped) -+typedef enum -+{ -+ VCHI_FLAGS_NONE = 0x0, -+ VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE = 0x1, // waits for message to be received, or sent (NB. not the same as being seen on other side) -+ VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE = 0x2, // run a callback when message sent -+ VCHI_FLAGS_BLOCK_UNTIL_QUEUED = 0x4, // return once the transfer is in a queue ready to go -+ VCHI_FLAGS_ALLOW_PARTIAL = 0x8, -+ VCHI_FLAGS_BLOCK_UNTIL_DATA_READ = 0x10, -+ VCHI_FLAGS_CALLBACK_WHEN_DATA_READ = 0x20, -+ -+ VCHI_FLAGS_ALIGN_SLOT = 0x000080, // internal use only -+ VCHI_FLAGS_BULK_AUX_QUEUED = 0x010000, // internal use only -+ VCHI_FLAGS_BULK_AUX_COMPLETE = 0x020000, // internal use only -+ VCHI_FLAGS_BULK_DATA_QUEUED = 0x040000, // internal use only -+ VCHI_FLAGS_BULK_DATA_COMPLETE = 0x080000, // internal use only -+ VCHI_FLAGS_INTERNAL = 0xFF0000 -+} VCHI_FLAGS_T; -+ -+// constants for vchi_crc_control() -+typedef enum { -+ VCHI_CRC_NOTHING = -1, -+ VCHI_CRC_PER_SERVICE = 0, -+ VCHI_CRC_EVERYTHING = 1, -+} VCHI_CRC_CONTROL_T; -+ -+//callback reasons when an event occurs on a service -+typedef enum -+{ -+ VCHI_CALLBACK_REASON_MIN, -+ -+ //This indicates that there is data available -+ //handle is the msg id that was transmitted with the data -+ // When a message is received and there was no FULL message available previously, send callback -+ // Tasks get kicked by the callback, reset their event and try and read from the fifo until it fails -+ VCHI_CALLBACK_MSG_AVAILABLE, -+ VCHI_CALLBACK_MSG_SENT, -+ VCHI_CALLBACK_MSG_SPACE_AVAILABLE, // XXX not yet implemented -+ -+ // This indicates that a transfer from the other side has completed -+ VCHI_CALLBACK_BULK_RECEIVED, -+ //This indicates that data queued up to be sent has now gone -+ //handle is the msg id that was used when sending the data -+ VCHI_CALLBACK_BULK_SENT, -+ VCHI_CALLBACK_BULK_RX_SPACE_AVAILABLE, // XXX not yet implemented -+ VCHI_CALLBACK_BULK_TX_SPACE_AVAILABLE, // XXX not yet implemented -+ -+ VCHI_CALLBACK_SERVICE_CLOSED, -+ -+ // this side has sent XOFF to peer due to lack of data consumption by service -+ // (suggests the service may need to take some recovery action if it has -+ // been deliberately holding off consuming data) -+ VCHI_CALLBACK_SENT_XOFF, -+ VCHI_CALLBACK_SENT_XON, -+ -+ // indicates that a bulk transfer has finished reading the source buffer -+ VCHI_CALLBACK_BULK_DATA_READ, -+ -+ // power notification events (currently host side only) -+ VCHI_CALLBACK_PEER_OFF, -+ VCHI_CALLBACK_PEER_SUSPENDED, -+ VCHI_CALLBACK_PEER_ON, -+ VCHI_CALLBACK_PEER_RESUMED, -+ VCHI_CALLBACK_FORCED_POWER_OFF, -+ -+#ifdef USE_VCHIQ_ARM -+ // some extra notifications provided by vchiq_arm -+ VCHI_CALLBACK_SERVICE_OPENED, -+ VCHI_CALLBACK_BULK_RECEIVE_ABORTED, -+ VCHI_CALLBACK_BULK_TRANSMIT_ABORTED, -+#endif -+ -+ VCHI_CALLBACK_REASON_MAX -+} VCHI_CALLBACK_REASON_T; -+ -+//Calback used by all services / bulk transfers -+typedef void (*VCHI_CALLBACK_T)( void *callback_param, //my service local param -+ VCHI_CALLBACK_REASON_T reason, -+ void *handle ); //for transmitting msg's only -+ -+ -+ -+/* -+ * Define vector struct for scatter-gather (vector) operations -+ * Vectors can be nested - if a vector element has negative length, then -+ * the data pointer is treated as pointing to another vector array, with -+ * '-vec_len' elements. Thus to append a header onto an existing vector, -+ * you can do this: -+ * -+ * void foo(const VCHI_MSG_VECTOR_T *v, int n) -+ * { -+ * VCHI_MSG_VECTOR_T nv[2]; -+ * nv[0].vec_base = my_header; -+ * nv[0].vec_len = sizeof my_header; -+ * nv[1].vec_base = v; -+ * nv[1].vec_len = -n; -+ * ... -+ * -+ */ -+typedef struct vchi_msg_vector { -+ const void *vec_base; -+ int32_t vec_len; -+} VCHI_MSG_VECTOR_T; -+ -+// Opaque type for a connection API -+typedef struct opaque_vchi_connection_api_t VCHI_CONNECTION_API_T; -+ -+// Opaque type for a message driver -+typedef struct opaque_vchi_message_driver_t VCHI_MESSAGE_DRIVER_T; -+ -+ -+// Iterator structure for reading ahead through received message queue. Allocated by client, -+// initialised by vchi_msg_look_ahead. Fields are for internal VCHI use only. -+// Iterates over messages in queue at the instant of the call to vchi_msg_lookahead - -+// will not proceed to messages received since. Behaviour is undefined if an iterator -+// is used again after messages for that service are removed/dequeued by any -+// means other than vchi_msg_iter_... calls on the iterator itself. -+typedef struct { -+ struct opaque_vchi_service_t *service; -+ void *last; -+ void *next; -+ void *remove; -+} VCHI_MSG_ITER_T; -+ -+ -+#endif // VCHI_COMMON_H_ -diff --git a/drivers/misc/vc04_services/interface/vchi/vchi_mh.h b/drivers/misc/vc04_services/interface/vchi/vchi_mh.h -new file mode 100644 -index 0000000..9dc3a37 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchi/vchi_mh.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi_mh.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi_mh.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 2012-11-11 18:15:15.879831278 +0100 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -9535,76 +10358,9 @@ index 0000000..9dc3a37 +#define VCHI_MEM_HANDLE_INVALID 0 + +#endif -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h -new file mode 100644 -index 0000000..9c359c0 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h -@@ -0,0 +1,26 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef VCHIQ_VCHIQ_H -+#define VCHIQ_VCHIQ_H -+ -+#include "vchiq_if.h" -+#include "vchiq_util.h" -+ -+#endif -+ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h -new file mode 100644 -index 0000000..959405e ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h -@@ -0,0 +1,27 @@ -+/* -+ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -+ */ -+ -+#ifndef VCHIQ_2835_H -+#define VCHIQ_2835_H -+ -+#include "vchiq_pagelist.h" -+ -+#define VCHIQ_PLATFORM_FRAGMENTS_OFFSET_IDX 0 -+#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1 -+ -+#endif /* VCHIQ_2835_H */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c -new file mode 100644 -index 0000000..93d4c3f ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 2012-11-11 18:15:15.877831238 +0100 @@ -0,0 +1,518 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -10124,11 +10880,40 @@ index 0000000..93d4c3f + + kfree(pagelist); +} -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c -new file mode 100755 -index 0000000..81daf3e ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 2012-11-11 18:15:15.870831101 +0100 +@@ -0,0 +1,27 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef VCHIQ_2835_H ++#define VCHIQ_2835_H ++ ++#include "vchiq_pagelist.h" ++ ++#define VCHIQ_PLATFORM_FRAGMENTS_OFFSET_IDX 0 ++#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1 ++ ++#endif /* VCHIQ_2835_H */ +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 2012-11-11 18:15:15.867831043 +0100 @@ -0,0 +1,2740 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -12870,11 +13655,9 @@ index 0000000..81daf3e +module_exit(vchiq_exit); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Broadcom Corporation"); -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h -new file mode 100644 -index 0000000..6db1074 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 2012-11-11 18:15:15.870831101 +0100 @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -13077,11 +13860,9 @@ index 0000000..6db1074 + + +#endif /* VCHIQ_ARM_H */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h -new file mode 100644 -index 0000000..7c3ab94 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_build_info.h 2012-11-11 18:15:15.870831101 +0100 @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -13105,11 +13886,9 @@ index 0000000..7c3ab94 +const char *vchiq_get_build_version(void); +const char *vchiq_get_build_time(void); +const char *vchiq_get_build_date(void); -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h -new file mode 100644 -index 0000000..bd7f793 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 2012-11-11 18:15:15.879831278 +0100 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -13156,11 +13935,9 @@ index 0000000..bd7f793 +#endif + +#endif /* VCHIQ_CFG_H */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c -new file mode 100644 -index 0000000..2927d4b ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 2012-11-11 18:15:15.869831082 +0100 @@ -0,0 +1,100 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -13262,11 +14039,9 @@ index 0000000..2927d4b + mutex_unlock(&g_connected_mutex); +} +EXPORT_SYMBOL(vchiq_add_connected_callback); -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h -new file mode 100644 -index 0000000..f62faf0 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 2012-11-11 18:15:15.875831198 +0100 @@ -0,0 +1,32 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -13300,11 +14075,9 @@ index 0000000..f62faf0 + +#endif /* VCHIQ_CONNECTED_H */ + -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c -new file mode 100644 -index 0000000..0dc312b ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 2012-11-11 18:15:15.878831258 +0100 @@ -0,0 +1,3613 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -16919,11 +17692,9 @@ index 0000000..0dc312b + numBytes = 0; + } +} -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h -new file mode 100644 -index 0000000..bcdff3a ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 2012-11-11 18:15:15.877831238 +0100 @@ -0,0 +1,673 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -17598,11 +18369,9 @@ index 0000000..bcdff3a + size_t numBytes); + +#endif -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion -new file mode 100644 -index 0000000..9f5b634 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_genversion 2012-11-11 18:15:15.868831063 +0100 @@ -0,0 +1,87 @@ +#!/usr/bin/perl -w + @@ -17691,11 +18460,39 @@ index 0000000..9f5b634 + return vchiq_build_time; +} +EOF -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h -new file mode 100644 -index 0000000..d89f89e ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 2012-11-11 18:15:15.879831278 +0100 +@@ -0,0 +1,26 @@ ++/* ++ * Copyright (c) 2010-2011 Broadcom. All rights reserved. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ */ ++ ++#ifndef VCHIQ_VCHIQ_H ++#define VCHIQ_VCHIQ_H ++ ++#include "vchiq_if.h" ++#include "vchiq_util.h" ++ ++#endif ++ +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 2012-11-11 18:15:15.869831082 +0100 @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -17862,11 +18659,9 @@ index 0000000..d89f89e + void *ptr, size_t num_bytes); + +#endif /* VCHIQ_IF_H */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h -new file mode 100644 -index 0000000..9bcacd2 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 2012-11-11 18:15:15.874831178 +0100 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -17982,11 +18777,9 @@ index 0000000..9bcacd2 +#define VCHIQ_IOC_MAX 15 + +#endif -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c -new file mode 100644 -index 0000000..be1a063 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 2012-11-11 18:15:15.855830803 +0100 @@ -0,0 +1,424 @@ +/***************************************************************************** +* Copyright 2001 - 2011 Broadcom Corporation. All rights reserved. @@ -18412,11 +19205,9 @@ index 0000000..be1a063 + + return status; +} -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h -new file mode 100644 -index 0000000..e53ee0e ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 2012-11-11 18:15:15.870831101 +0100 @@ -0,0 +1,52 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -18470,11 +19261,9 @@ index 0000000..e53ee0e + const VCHIQ_PLATFORM_DATA_T * platform_data); + +#endif -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h -new file mode 100644 -index 0000000..e8d4e30 ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 2012-11-11 18:15:15.869831082 +0100 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -18519,11 +19308,9 @@ index 0000000..e8d4e30 +} FRAGMENTS_T; + +#endif /* VCHIQ_PAGELIST_H */ -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c -new file mode 100644 -index 0000000..6e06c3b ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_proc.c 2012-11-11 18:15:15.855830803 +0100 @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2012 Broadcom Corporation. All rights reserved. @@ -18748,11 +19535,9 @@ index 0000000..6e06c3b +{ + return proc_info.clients; +} -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c -new file mode 100644 -index 0000000..0ed884e ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 2012-11-11 18:15:15.869831082 +0100 @@ -0,0 +1,787 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -19541,11 +20326,9 @@ index 0000000..0ed884e + return ret; +} +EXPORT_SYMBOL(vchi_service_release); -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c -new file mode 100644 -index 0000000..8ea8bea ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 2012-11-11 18:15:15.855830803 +0100 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -19652,11 +20435,9 @@ index 0000000..8ea8bea + + return header; +} -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h -new file mode 100644 -index 0000000..948503d ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 2012-11-11 18:15:15.879831278 +0100 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -19725,11 +20506,9 @@ index 0000000..948503d + +#endif + -diff --git a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c -new file mode 100644 -index 0000000..87bea8b ---- /dev/null -+++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c +diff -Naur linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c +--- linux-3.6.1/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_version.c 2012-11-11 18:15:15.868831063 +0100 @@ -0,0 +1,27 @@ +#include "vchiq_build_info.h" +#include @@ -19758,11 +20537,46 @@ index 0000000..87bea8b +{ + return vchiq_build_time; +} -diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c -index 172a768..538cec6 100644 ---- a/drivers/mmc/card/block.c -+++ b/drivers/mmc/card/block.c -@@ -1135,7 +1135,7 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, +diff -Naur linux-3.6.1/drivers/misc/vc04_services/Kconfig linux-rpi-3.6.y/drivers/misc/vc04_services/Kconfig +--- linux-3.6.1/drivers/misc/vc04_services/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/Kconfig 2012-11-11 18:15:15.905831790 +0100 +@@ -0,0 +1,10 @@ ++config BCM2708_VCHIQ ++ tristate "Videocore VCHIQ" ++ depends on MACH_BCM2708 ++ default y ++ help ++ Kernel to VideoCore communication interface for the ++ BCM2708 family of products. ++ Defaults to Y when the Broadcom Videocore services ++ are included in the build, N otherwise. ++ +diff -Naur linux-3.6.1/drivers/misc/vc04_services/Makefile linux-rpi-3.6.y/drivers/misc/vc04_services/Makefile +--- linux-3.6.1/drivers/misc/vc04_services/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/misc/vc04_services/Makefile 2012-11-11 18:15:15.905831790 +0100 +@@ -0,0 +1,18 @@ ++ifeq ($(CONFIG_MACH_BCM2708),y) ++ ++obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o ++ ++vchiq-objs := \ ++ interface/vchiq_arm/vchiq_core.o \ ++ interface/vchiq_arm/vchiq_arm.o \ ++ interface/vchiq_arm/vchiq_kern_lib.o \ ++ interface/vchiq_arm/vchiq_2835_arm.o \ ++ interface/vchiq_arm/vchiq_proc.o \ ++ interface/vchiq_arm/vchiq_shim.o \ ++ interface/vchiq_arm/vchiq_util.o \ ++ interface/vchiq_arm/vchiq_connected.o \ ++ ++EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -Idrivers/misc/vc04_services -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 ++ ++endif ++ +diff -Naur linux-3.6.1/drivers/mmc/card/block.c linux-rpi-3.6.y/drivers/mmc/card/block.c +--- linux-3.6.1/drivers/mmc/card/block.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/mmc/card/block.c 2012-11-11 18:15:16.860850490 +0100 +@@ -1135,7 +1135,7 @@ brq->data.blocks = 1; } @@ -19771,11 +20585,10 @@ index 172a768..538cec6 100644 /* SPI multiblock writes terminate using a special * token, not a STOP_TRANSMISSION request. */ -diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig -index aa131b3..812fea6 100644 ---- a/drivers/mmc/host/Kconfig -+++ b/drivers/mmc/host/Kconfig -@@ -229,6 +229,27 @@ config MMC_SDHCI_S3C_DMA +diff -Naur linux-3.6.1/drivers/mmc/host/Kconfig linux-rpi-3.6.y/drivers/mmc/host/Kconfig +--- linux-3.6.1/drivers/mmc/host/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/mmc/host/Kconfig 2012-11-11 18:15:16.801849335 +0100 +@@ -229,6 +229,27 @@ YMMV. @@ -19803,11 +20616,10 @@ index aa131b3..812fea6 100644 config MMC_OMAP tristate "TI OMAP Multimedia Card Interface support" depends on ARCH_OMAP -diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile -index 8922b06..511710e 100644 ---- a/drivers/mmc/host/Makefile -+++ b/drivers/mmc/host/Makefile -@@ -13,6 +13,7 @@ obj-$(CONFIG_MMC_SDHCI_PXAV3) += sdhci-pxav3.o +diff -Naur linux-3.6.1/drivers/mmc/host/Makefile linux-rpi-3.6.y/drivers/mmc/host/Makefile +--- linux-3.6.1/drivers/mmc/host/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/mmc/host/Makefile 2012-11-11 18:15:16.788849081 +0100 +@@ -13,6 +13,7 @@ obj-$(CONFIG_MMC_SDHCI_PXAV2) += sdhci-pxav2.o obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o @@ -19815,11 +20627,9 @@ index 8922b06..511710e 100644 obj-$(CONFIG_MMC_WBSD) += wbsd.o obj-$(CONFIG_MMC_AU1X) += au1xmmc.o obj-$(CONFIG_MMC_OMAP) += omap.o -diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c -new file mode 100644 -index 0000000..c6f943e ---- /dev/null -+++ b/drivers/mmc/host/sdhci-bcm2708.c +diff -Naur linux-3.6.1/drivers/mmc/host/sdhci-bcm2708.c linux-rpi-3.6.y/drivers/mmc/host/sdhci-bcm2708.c +--- linux-3.6.1/drivers/mmc/host/sdhci-bcm2708.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/mmc/host/sdhci-bcm2708.c 2012-11-11 18:15:16.791849139 +0100 @@ -0,0 +1,1406 @@ +/* + * sdhci-bcm2708.c Support for SDHCI device on BCM2708 @@ -21227,10 +22037,9 @@ index 0000000..c6f943e +MODULE_PARM_DESC(enable_llm, "Enable low-latency mode"); + + -diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c -index 9a11dc3..ce98dcb 100644 ---- a/drivers/mmc/host/sdhci.c -+++ b/drivers/mmc/host/sdhci.c +diff -Naur linux-3.6.1/drivers/mmc/host/sdhci.c linux-rpi-3.6.y/drivers/mmc/host/sdhci.c +--- linux-3.6.1/drivers/mmc/host/sdhci.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/mmc/host/sdhci.c 2012-11-11 18:15:16.756848453 +0100 @@ -28,6 +28,7 @@ #include #include @@ -21239,7 +22048,7 @@ index 9a11dc3..ce98dcb 100644 #include "sdhci.h" -@@ -121,6 +122,91 @@ static void sdhci_dumpregs(struct sdhci_host *host) +@@ -121,6 +122,91 @@ * Low level functions * * * \*****************************************************************************/ @@ -21331,7 +22140,7 @@ index 9a11dc3..ce98dcb 100644 static void sdhci_clear_set_irqs(struct sdhci_host *host, u32 clear, u32 set) { -@@ -286,7 +372,7 @@ static void sdhci_led_control(struct led_classdev *led, +@@ -286,7 +372,7 @@ struct sdhci_host *host = container_of(led, struct sdhci_host, led); unsigned long flags; @@ -21340,7 +22149,7 @@ index 9a11dc3..ce98dcb 100644 if (host->runtime_suspended) goto out; -@@ -296,7 +382,7 @@ static void sdhci_led_control(struct led_classdev *led, +@@ -296,7 +382,7 @@ else sdhci_activate_led(host); out: @@ -21349,7 +22158,7 @@ index 9a11dc3..ce98dcb 100644 } #endif -@@ -313,7 +399,7 @@ static void sdhci_read_block_pio(struct sdhci_host *host) +@@ -313,7 +399,7 @@ u32 uninitialized_var(scratch); u8 *buf; @@ -21358,7 +22167,7 @@ index 9a11dc3..ce98dcb 100644 blksize = host->data->blksz; chunk = 0; -@@ -358,7 +444,7 @@ static void sdhci_write_block_pio(struct sdhci_host *host) +@@ -358,7 +444,7 @@ u32 scratch; u8 *buf; @@ -21367,7 +22176,7 @@ index 9a11dc3..ce98dcb 100644 blksize = host->data->blksz; chunk = 0; -@@ -397,19 +483,28 @@ static void sdhci_write_block_pio(struct sdhci_host *host) +@@ -397,19 +483,28 @@ local_irq_restore(flags); } @@ -21399,7 +22208,7 @@ index 9a11dc3..ce98dcb 100644 /* * Some controllers (JMicron JMB38x) mess up the buffer bits -@@ -420,7 +515,7 @@ static void sdhci_transfer_pio(struct sdhci_host *host) +@@ -420,7 +515,7 @@ (host->data->blocks == 1)) mask = ~0; @@ -21408,7 +22217,7 @@ index 9a11dc3..ce98dcb 100644 if (host->quirks & SDHCI_QUIRK_PIO_NEEDS_DELAY) udelay(100); -@@ -432,9 +527,11 @@ static void sdhci_transfer_pio(struct sdhci_host *host) +@@ -432,9 +527,11 @@ host->blocks--; if (host->blocks == 0) break; @@ -21421,7 +22230,7 @@ index 9a11dc3..ce98dcb 100644 } static char *sdhci_kmap_atomic(struct scatterlist *sg, unsigned long *flags) -@@ -707,7 +804,9 @@ static void sdhci_set_transfer_irqs(struct sdhci_host *host) +@@ -707,7 +804,9 @@ u32 pio_irqs = SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL; u32 dma_irqs = SDHCI_INT_DMA_END | SDHCI_INT_ADMA_ERROR; @@ -21432,7 +22241,7 @@ index 9a11dc3..ce98dcb 100644 sdhci_clear_set_irqs(host, pio_irqs, dma_irqs); else sdhci_clear_set_irqs(host, dma_irqs, pio_irqs); -@@ -739,44 +838,25 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) +@@ -739,44 +838,25 @@ host->data_early = 0; host->data->bytes_xfered = 0; @@ -21485,7 +22294,7 @@ index 9a11dc3..ce98dcb 100644 int broken, i; struct scatterlist *sg; -@@ -835,7 +915,8 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) +@@ -835,7 +915,8 @@ */ WARN_ON(1); host->flags &= ~SDHCI_REQ_USE_DMA; @@ -21495,7 +22304,7 @@ index 9a11dc3..ce98dcb 100644 WARN_ON(sg_cnt != 1); sdhci_writel(host, sg_dma_address(data->sg), SDHCI_DMA_ADDRESS); -@@ -851,11 +932,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) +@@ -851,11 +932,13 @@ if (host->version >= SDHCI_SPEC_200) { ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL); ctrl &= ~SDHCI_CTRL_DMA_MASK; @@ -21514,7 +22323,7 @@ index 9a11dc3..ce98dcb 100644 sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); } -@@ -907,7 +990,8 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, +@@ -907,7 +990,8 @@ if (data->flags & MMC_DATA_READ) mode |= SDHCI_TRNS_READ; @@ -21524,7 +22333,7 @@ index 9a11dc3..ce98dcb 100644 mode |= SDHCI_TRNS_DMA; sdhci_writew(host, mode, SDHCI_TRANSFER_MODE); -@@ -923,13 +1007,16 @@ static void sdhci_finish_data(struct sdhci_host *host) +@@ -923,13 +1007,16 @@ host->data = NULL; if (host->flags & SDHCI_REQ_USE_DMA) { @@ -21545,7 +22354,7 @@ index 9a11dc3..ce98dcb 100644 } /* -@@ -982,6 +1069,12 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) +@@ -982,6 +1069,12 @@ if ((cmd->data != NULL) || (cmd->flags & MMC_RSP_BUSY)) mask |= SDHCI_DATA_INHIBIT; @@ -21558,7 +22367,7 @@ index 9a11dc3..ce98dcb 100644 /* We shouldn't wait for data inihibit for stop commands, even though they might use busy signaling */ if (host->mrq->data && (cmd == host->mrq->data->stop)) -@@ -997,12 +1090,20 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) +@@ -997,12 +1090,20 @@ return; } timeout--; @@ -21579,7 +22388,7 @@ index 9a11dc3..ce98dcb 100644 sdhci_prepare_data(host, cmd); -@@ -1178,7 +1279,9 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) +@@ -1178,7 +1279,9 @@ return; } timeout--; @@ -21589,7 +22398,7 @@ index 9a11dc3..ce98dcb 100644 } clk |= SDHCI_CLOCK_CARD_EN; -@@ -1265,7 +1368,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1265,7 +1368,7 @@ sdhci_runtime_pm_get(host); @@ -21598,7 +22407,7 @@ index 9a11dc3..ce98dcb 100644 WARN_ON(host->mrq != NULL); -@@ -1311,9 +1414,9 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1311,9 +1414,9 @@ tuning_opcode = mmc->card->type == MMC_TYPE_MMC ? MMC_SEND_TUNING_BLOCK_HS200 : MMC_SEND_TUNING_BLOCK; @@ -21610,7 +22419,7 @@ index 9a11dc3..ce98dcb 100644 /* Restore original mmc_request structure */ host->mrq = mrq; -@@ -1326,7 +1429,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) +@@ -1326,7 +1429,7 @@ } mmiowb(); @@ -21619,7 +22428,7 @@ index 9a11dc3..ce98dcb 100644 } static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) -@@ -1335,7 +1438,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1335,7 +1438,7 @@ int vdd_bit = -1; u8 ctrl; @@ -21628,7 +22437,7 @@ index 9a11dc3..ce98dcb 100644 if (host->flags & SDHCI_DEVICE_DEAD) { spin_unlock_irqrestore(&host->lock, flags); -@@ -1402,7 +1505,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1402,7 +1505,7 @@ else ctrl &= ~SDHCI_CTRL_HISPD; @@ -21637,7 +22446,7 @@ index 9a11dc3..ce98dcb 100644 u16 clk, ctrl_2; unsigned int clock; -@@ -1411,7 +1514,8 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1411,7 +1514,8 @@ (ios->timing == MMC_TIMING_UHS_SDR50) || (ios->timing == MMC_TIMING_UHS_SDR104) || (ios->timing == MMC_TIMING_UHS_DDR50) || @@ -21647,7 +22456,7 @@ index 9a11dc3..ce98dcb 100644 ctrl |= SDHCI_CTRL_HISPD; ctrl_2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); -@@ -1492,7 +1596,7 @@ static void sdhci_do_set_ios(struct sdhci_host *host, struct mmc_ios *ios) +@@ -1492,7 +1596,7 @@ sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); mmiowb(); @@ -21656,7 +22465,7 @@ index 9a11dc3..ce98dcb 100644 } static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) -@@ -1509,7 +1613,7 @@ static int sdhci_check_ro(struct sdhci_host *host) +@@ -1509,7 +1613,7 @@ unsigned long flags; int is_readonly; @@ -21665,7 +22474,7 @@ index 9a11dc3..ce98dcb 100644 if (host->flags & SDHCI_DEVICE_DEAD) is_readonly = 0; -@@ -1519,7 +1623,7 @@ static int sdhci_check_ro(struct sdhci_host *host) +@@ -1519,7 +1623,7 @@ is_readonly = !(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_WRITE_PROTECT); @@ -21674,7 +22483,7 @@ index 9a11dc3..ce98dcb 100644 /* This quirk needs to be replaced by a callback-function later */ return host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT ? -@@ -1592,9 +1696,9 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) +@@ -1592,9 +1696,9 @@ struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; @@ -21686,7 +22495,7 @@ index 9a11dc3..ce98dcb 100644 } static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, -@@ -1919,7 +2023,7 @@ static void sdhci_do_enable_preset_value(struct sdhci_host *host, bool enable) +@@ -1919,7 +2023,7 @@ if (host->version < SDHCI_SPEC_300) return; @@ -21695,7 +22504,7 @@ index 9a11dc3..ce98dcb 100644 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); -@@ -1937,7 +2041,7 @@ static void sdhci_do_enable_preset_value(struct sdhci_host *host, bool enable) +@@ -1937,7 +2041,7 @@ host->flags &= ~SDHCI_PV_ENABLED; } @@ -21704,7 +22513,7 @@ index 9a11dc3..ce98dcb 100644 } static void sdhci_enable_preset_value(struct mmc_host *mmc, bool enable) -@@ -1973,7 +2077,7 @@ static void sdhci_tasklet_card(unsigned long param) +@@ -1973,7 +2077,7 @@ host = (struct sdhci_host*)param; @@ -21713,7 +22522,7 @@ index 9a11dc3..ce98dcb 100644 /* Check host->mrq first in case we are runtime suspended */ if (host->mrq && -@@ -1990,7 +2094,7 @@ static void sdhci_tasklet_card(unsigned long param) +@@ -1990,7 +2094,7 @@ tasklet_schedule(&host->finish_tasklet); } @@ -21722,7 +22531,7 @@ index 9a11dc3..ce98dcb 100644 mmc_detect_change(host->mmc, msecs_to_jiffies(200)); } -@@ -2003,14 +2107,14 @@ static void sdhci_tasklet_finish(unsigned long param) +@@ -2003,14 +2107,14 @@ host = (struct sdhci_host*)param; @@ -21739,7 +22548,7 @@ index 9a11dc3..ce98dcb 100644 return; } -@@ -2053,7 +2157,7 @@ static void sdhci_tasklet_finish(unsigned long param) +@@ -2053,7 +2157,7 @@ #endif mmiowb(); @@ -21748,7 +22557,7 @@ index 9a11dc3..ce98dcb 100644 mmc_request_done(host->mmc, mrq); sdhci_runtime_pm_put(host); -@@ -2066,11 +2170,11 @@ static void sdhci_timeout_timer(unsigned long data) +@@ -2066,11 +2170,11 @@ host = (struct sdhci_host*)data; @@ -21762,7 +22571,7 @@ index 9a11dc3..ce98dcb 100644 sdhci_dumpregs(host); if (host->data) { -@@ -2087,7 +2191,7 @@ static void sdhci_timeout_timer(unsigned long data) +@@ -2087,7 +2191,7 @@ } mmiowb(); @@ -21771,7 +22580,7 @@ index 9a11dc3..ce98dcb 100644 } static void sdhci_tuning_timer(unsigned long data) -@@ -2097,11 +2201,11 @@ static void sdhci_tuning_timer(unsigned long data) +@@ -2097,11 +2201,11 @@ host = (struct sdhci_host *)data; @@ -21785,7 +22594,7 @@ index 9a11dc3..ce98dcb 100644 } /*****************************************************************************\ -@@ -2115,10 +2219,13 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) +@@ -2115,10 +2219,13 @@ BUG_ON(intmask == 0); if (!host->cmd) { @@ -21803,7 +22612,7 @@ index 9a11dc3..ce98dcb 100644 return; } -@@ -2188,6 +2295,19 @@ static void sdhci_show_adma_error(struct sdhci_host *host) +@@ -2188,6 +2295,19 @@ static void sdhci_show_adma_error(struct sdhci_host *host) { } #endif @@ -21823,7 +22632,7 @@ index 9a11dc3..ce98dcb 100644 static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) { u32 command; -@@ -2216,34 +2336,57 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) +@@ -2216,34 +2336,57 @@ return; } } @@ -21896,7 +22705,7 @@ index 9a11dc3..ce98dcb 100644 /* * We currently don't do anything fancy with DMA -@@ -2272,18 +2415,8 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) +@@ -2272,18 +2415,8 @@ sdhci_writel(host, dmanow, SDHCI_DMA_ADDRESS); } @@ -21917,7 +22726,7 @@ index 9a11dc3..ce98dcb 100644 } } -@@ -2294,10 +2427,10 @@ static irqreturn_t sdhci_irq(int irq, void *dev_id) +@@ -2294,10 +2427,10 @@ u32 intmask, unexpected = 0; int cardint = 0, max_loops = 16; @@ -21930,7 +22739,7 @@ index 9a11dc3..ce98dcb 100644 pr_warning("%s: got irq while runtime suspended\n", mmc_hostname(host->mmc)); return IRQ_HANDLED; -@@ -2339,6 +2472,22 @@ again: +@@ -2339,6 +2472,22 @@ tasklet_schedule(&host->card_tasklet); } @@ -21953,7 +22762,7 @@ index 9a11dc3..ce98dcb 100644 if (intmask & SDHCI_INT_CMD_MASK) { sdhci_writel(host, intmask & SDHCI_INT_CMD_MASK, SDHCI_INT_STATUS); -@@ -2353,7 +2502,13 @@ again: +@@ -2353,7 +2502,13 @@ intmask &= ~(SDHCI_INT_CMD_MASK | SDHCI_INT_DATA_MASK); @@ -21968,7 +22777,7 @@ index 9a11dc3..ce98dcb 100644 if (intmask & SDHCI_INT_BUS_POWER) { pr_err("%s: Card is consuming too much power!\n", -@@ -2379,7 +2534,7 @@ again: +@@ -2379,7 +2534,7 @@ if (intmask && --max_loops) goto again; out: @@ -21977,7 +22786,7 @@ index 9a11dc3..ce98dcb 100644 if (unexpected) { pr_err("%s: Unexpected interrupt 0x%08x.\n", -@@ -2442,7 +2597,8 @@ int sdhci_resume_host(struct sdhci_host *host) +@@ -2442,7 +2597,8 @@ { int ret; @@ -21987,7 +22796,7 @@ index 9a11dc3..ce98dcb 100644 if (host->ops->enable_dma) host->ops->enable_dma(host); } -@@ -2515,15 +2671,15 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) +@@ -2515,15 +2671,15 @@ host->flags &= ~SDHCI_NEEDS_RETUNING; } @@ -22007,7 +22816,7 @@ index 9a11dc3..ce98dcb 100644 return ret; } -@@ -2554,7 +2710,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) +@@ -2554,7 +2710,7 @@ if (host->flags & SDHCI_USING_RETUNING_TIMER) host->flags |= SDHCI_NEEDS_RETUNING; @@ -22016,7 +22825,7 @@ index 9a11dc3..ce98dcb 100644 host->runtime_suspended = false; -@@ -2565,7 +2721,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host) +@@ -2565,7 +2721,7 @@ /* Enable Card Detection */ sdhci_enable_card_detection(host); @@ -22025,7 +22834,7 @@ index 9a11dc3..ce98dcb 100644 return ret; } -@@ -2660,14 +2816,16 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2660,14 +2816,16 @@ host->flags &= ~SDHCI_USE_ADMA; } @@ -22044,7 +22853,7 @@ index 9a11dc3..ce98dcb 100644 } } } -@@ -2778,7 +2936,7 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2778,7 +2936,7 @@ /* Auto-CMD23 stuff only works in ADMA or PIO. */ if ((host->version >= SDHCI_SPEC_300) && ((host->flags & SDHCI_USE_ADMA) || @@ -22053,7 +22862,7 @@ index 9a11dc3..ce98dcb 100644 host->flags |= SDHCI_AUTO_CMD23; DBG("%s: Auto-CMD23 available\n", mmc_hostname(mmc)); } else { -@@ -2930,6 +3088,12 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -2930,6 +3088,12 @@ SDHCI_MAX_CURRENT_MULTIPLIER; } @@ -22066,7 +22875,7 @@ index 9a11dc3..ce98dcb 100644 mmc->ocr_avail = ocr_avail; mmc->ocr_avail_sdio = ocr_avail; if (host->ocr_avail_sdio) -@@ -3024,7 +3188,7 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -3024,7 +3188,7 @@ host->tuning_timer.function = sdhci_tuning_timer; } @@ -22075,7 +22884,7 @@ index 9a11dc3..ce98dcb 100644 mmc_hostname(mmc), host); if (ret) { pr_err("%s: Failed to request IRQ %d: %d\n", -@@ -3060,6 +3224,7 @@ int sdhci_add_host(struct sdhci_host *host) +@@ -3060,6 +3224,7 @@ pr_info("%s: SDHCI controller on %s [%s] using %s\n", mmc_hostname(mmc), host->hw_name, dev_name(mmc_dev(mmc)), @@ -22083,7 +22892,7 @@ index 9a11dc3..ce98dcb 100644 (host->flags & SDHCI_USE_ADMA) ? "ADMA" : (host->flags & SDHCI_USE_SDMA) ? "DMA" : "PIO"); -@@ -3086,7 +3251,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) +@@ -3086,7 +3251,7 @@ unsigned long flags; if (dead) { @@ -22092,7 +22901,7 @@ index 9a11dc3..ce98dcb 100644 host->flags |= SDHCI_DEVICE_DEAD; -@@ -3098,7 +3263,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) +@@ -3098,7 +3263,7 @@ tasklet_schedule(&host->finish_tasklet); } @@ -22101,11 +22910,10 @@ index 9a11dc3..ce98dcb 100644 } sdhci_disable_card_detection(host); -diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h -index 97653ea..9270ff4 100644 ---- a/drivers/mmc/host/sdhci.h -+++ b/drivers/mmc/host/sdhci.h -@@ -275,6 +275,20 @@ struct sdhci_ops { +diff -Naur linux-3.6.1/drivers/mmc/host/sdhci.h linux-rpi-3.6.y/drivers/mmc/host/sdhci.h +--- linux-3.6.1/drivers/mmc/host/sdhci.h 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/mmc/host/sdhci.h 2012-11-11 18:15:16.759848513 +0100 +@@ -275,6 +275,20 @@ void (*platform_reset_enter)(struct sdhci_host *host, u8 mask); void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); @@ -22126,7 +22934,7 @@ index 97653ea..9270ff4 100644 void (*hw_reset)(struct sdhci_host *host); void (*platform_suspend)(struct sdhci_host *host); void (*platform_resume)(struct sdhci_host *host); -@@ -383,9 +397,38 @@ extern int sdhci_resume_host(struct sdhci_host *host); +@@ -383,9 +397,38 @@ extern void sdhci_enable_irq_wakeups(struct sdhci_host *host); #endif @@ -22165,30 +22973,432 @@ index 97653ea..9270ff4 100644 + + #endif /* __SDHCI_HW_H */ -diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index d45e539..e00ae5d 100644 ---- a/drivers/net/usb/smsc95xx.c -+++ b/drivers/net/usb/smsc95xx.c -@@ -46,6 +46,7 @@ +diff -Naur linux-3.6.1/drivers/net/usb/smsc95xx.c linux-rpi-3.6.y/drivers/net/usb/smsc95xx.c +--- linux-3.6.1/drivers/net/usb/smsc95xx.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/net/usb/smsc95xx.c 2012-11-11 18:15:21.368938786 +0100 +@@ -46,11 +46,23 @@ #define SMSC95XX_INTERNAL_PHY_ID (1) #define SMSC95XX_TX_OVERHEAD (8) #define SMSC95XX_TX_OVERHEAD_CSUM (12) +#define MAC_ADDR_LEN (6) ++#define SUPPORTED_WAKE (WAKE_MAGIC) ++ ++#define check_warn(ret, fmt, args...) \ ++ ({ if (ret < 0) netdev_warn(dev->net, fmt, ##args); }) ++ ++#define check_warn_return(ret, fmt, args...) \ ++ ({ if (ret < 0) { netdev_warn(dev->net, fmt, ##args); return ret; } }) ++ ++#define check_warn_goto_done(ret, fmt, args...) \ ++ ({ if (ret < 0) { netdev_warn(dev->net, fmt, ##args); goto done; } }) struct smsc95xx_priv { u32 mac_cr; -@@ -63,6 +64,10 @@ static bool turbo_mode = true; + u32 hash_hi; + u32 hash_lo; ++ u32 wolopts; + spinlock_t mac_cr_lock; + }; + +@@ -63,7 +75,12 @@ module_param(turbo_mode, bool, 0644); MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); +-static int smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) +static char *macaddr = ":"; +module_param(macaddr, charp, 0); +MODULE_PARM_DESC(macaddr, "MAC address"); + - static int smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) ++static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index, ++ u32 *data) { u32 *buf = kmalloc(4, GFP_KERNEL); -@@ -633,8 +638,59 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) + int ret; +@@ -88,7 +105,8 @@ + return ret; + } + +-static int smsc95xx_write_reg(struct usbnet *dev, u32 index, u32 data) ++static int __must_check smsc95xx_write_reg(struct usbnet *dev, u32 index, ++ u32 data) + { + u32 *buf = kmalloc(4, GFP_KERNEL); + int ret; +@@ -114,15 +132,41 @@ + return ret; + } + ++static int smsc95xx_set_feature(struct usbnet *dev, u32 feature) ++{ ++ if (WARN_ON_ONCE(!dev)) ++ return -EINVAL; ++ ++ cpu_to_le32s(&feature); ++ ++ return usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), ++ USB_REQ_SET_FEATURE, USB_RECIP_DEVICE, feature, 0, NULL, 0, ++ USB_CTRL_SET_TIMEOUT); ++} ++ ++static int smsc95xx_clear_feature(struct usbnet *dev, u32 feature) ++{ ++ if (WARN_ON_ONCE(!dev)) ++ return -EINVAL; ++ ++ cpu_to_le32s(&feature); ++ ++ return usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), ++ USB_REQ_CLEAR_FEATURE, USB_RECIP_DEVICE, feature, 0, NULL, 0, ++ USB_CTRL_SET_TIMEOUT); ++} ++ + /* Loop until the read is completed with timeout + * called with phy_mutex held */ +-static int smsc95xx_phy_wait_not_busy(struct usbnet *dev) ++static int __must_check smsc95xx_phy_wait_not_busy(struct usbnet *dev) + { + unsigned long start_time = jiffies; + u32 val; ++ int ret; + + do { +- smsc95xx_read_reg(dev, MII_ADDR, &val); ++ ret = smsc95xx_read_reg(dev, MII_ADDR, &val); ++ check_warn_return(ret, "Error reading MII_ACCESS"); + if (!(val & MII_BUSY_)) + return 0; + } while (!time_after(jiffies, start_time + HZ)); +@@ -134,33 +178,32 @@ + { + struct usbnet *dev = netdev_priv(netdev); + u32 val, addr; ++ int ret; + + mutex_lock(&dev->phy_mutex); + + /* confirm MII not busy */ +- if (smsc95xx_phy_wait_not_busy(dev)) { +- netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_read\n"); +- mutex_unlock(&dev->phy_mutex); +- return -EIO; +- } ++ ret = smsc95xx_phy_wait_not_busy(dev); ++ check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_read"); + + /* set the address, index & direction (read from PHY) */ + phy_id &= dev->mii.phy_id_mask; + idx &= dev->mii.reg_num_mask; + addr = (phy_id << 11) | (idx << 6) | MII_READ_; +- smsc95xx_write_reg(dev, MII_ADDR, addr); ++ ret = smsc95xx_write_reg(dev, MII_ADDR, addr); ++ check_warn_goto_done(ret, "Error writing MII_ADDR"); + +- if (smsc95xx_phy_wait_not_busy(dev)) { +- netdev_warn(dev->net, "Timed out reading MII reg %02X\n", idx); +- mutex_unlock(&dev->phy_mutex); +- return -EIO; +- } ++ ret = smsc95xx_phy_wait_not_busy(dev); ++ check_warn_goto_done(ret, "Timed out reading MII reg %02X", idx); + +- smsc95xx_read_reg(dev, MII_DATA, &val); ++ ret = smsc95xx_read_reg(dev, MII_DATA, &val); ++ check_warn_goto_done(ret, "Error reading MII_DATA"); + +- mutex_unlock(&dev->phy_mutex); ++ ret = (u16)(val & 0xFFFF); + +- return (u16)(val & 0xFFFF); ++done: ++ mutex_unlock(&dev->phy_mutex); ++ return ret; + } + + static void smsc95xx_mdio_write(struct net_device *netdev, int phy_id, int idx, +@@ -168,38 +211,41 @@ + { + struct usbnet *dev = netdev_priv(netdev); + u32 val, addr; ++ int ret; + + mutex_lock(&dev->phy_mutex); + + /* confirm MII not busy */ +- if (smsc95xx_phy_wait_not_busy(dev)) { +- netdev_warn(dev->net, "MII is busy in smsc95xx_mdio_write\n"); +- mutex_unlock(&dev->phy_mutex); +- return; +- } ++ ret = smsc95xx_phy_wait_not_busy(dev); ++ check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_write"); + + val = regval; +- smsc95xx_write_reg(dev, MII_DATA, val); ++ ret = smsc95xx_write_reg(dev, MII_DATA, val); ++ check_warn_goto_done(ret, "Error writing MII_DATA"); + + /* set the address, index & direction (write to PHY) */ + phy_id &= dev->mii.phy_id_mask; + idx &= dev->mii.reg_num_mask; + addr = (phy_id << 11) | (idx << 6) | MII_WRITE_; +- smsc95xx_write_reg(dev, MII_ADDR, addr); ++ ret = smsc95xx_write_reg(dev, MII_ADDR, addr); ++ check_warn_goto_done(ret, "Error writing MII_ADDR"); + +- if (smsc95xx_phy_wait_not_busy(dev)) +- netdev_warn(dev->net, "Timed out writing MII reg %02X\n", idx); ++ ret = smsc95xx_phy_wait_not_busy(dev); ++ check_warn_goto_done(ret, "Timed out writing MII reg %02X", idx); + ++done: + mutex_unlock(&dev->phy_mutex); + } + +-static int smsc95xx_wait_eeprom(struct usbnet *dev) ++static int __must_check smsc95xx_wait_eeprom(struct usbnet *dev) + { + unsigned long start_time = jiffies; + u32 val; ++ int ret; + + do { +- smsc95xx_read_reg(dev, E2P_CMD, &val); ++ ret = smsc95xx_read_reg(dev, E2P_CMD, &val); ++ check_warn_return(ret, "Error reading E2P_CMD"); + if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_)) + break; + udelay(40); +@@ -213,13 +259,15 @@ + return 0; + } + +-static int smsc95xx_eeprom_confirm_not_busy(struct usbnet *dev) ++static int __must_check smsc95xx_eeprom_confirm_not_busy(struct usbnet *dev) + { + unsigned long start_time = jiffies; + u32 val; ++ int ret; + + do { +- smsc95xx_read_reg(dev, E2P_CMD, &val); ++ ret = smsc95xx_read_reg(dev, E2P_CMD, &val); ++ check_warn_return(ret, "Error reading E2P_CMD"); + + if (!(val & E2P_CMD_BUSY_)) + return 0; +@@ -246,13 +294,15 @@ + + for (i = 0; i < length; i++) { + val = E2P_CMD_BUSY_ | E2P_CMD_READ_ | (offset & E2P_CMD_ADDR_); +- smsc95xx_write_reg(dev, E2P_CMD, val); ++ ret = smsc95xx_write_reg(dev, E2P_CMD, val); ++ check_warn_return(ret, "Error writing E2P_CMD"); + + ret = smsc95xx_wait_eeprom(dev); + if (ret < 0) + return ret; + +- smsc95xx_read_reg(dev, E2P_DATA, &val); ++ ret = smsc95xx_read_reg(dev, E2P_DATA, &val); ++ check_warn_return(ret, "Error reading E2P_DATA"); + + data[i] = val & 0xFF; + offset++; +@@ -276,7 +326,8 @@ + + /* Issue write/erase enable command */ + val = E2P_CMD_BUSY_ | E2P_CMD_EWEN_; +- smsc95xx_write_reg(dev, E2P_CMD, val); ++ ret = smsc95xx_write_reg(dev, E2P_CMD, val); ++ check_warn_return(ret, "Error writing E2P_DATA"); + + ret = smsc95xx_wait_eeprom(dev); + if (ret < 0) +@@ -286,11 +337,13 @@ + + /* Fill data register */ + val = data[i]; +- smsc95xx_write_reg(dev, E2P_DATA, val); ++ ret = smsc95xx_write_reg(dev, E2P_DATA, val); ++ check_warn_return(ret, "Error writing E2P_DATA"); + + /* Send "write" command */ + val = E2P_CMD_BUSY_ | E2P_CMD_WRITE_ | (offset & E2P_CMD_ADDR_); +- smsc95xx_write_reg(dev, E2P_CMD, val); ++ ret = smsc95xx_write_reg(dev, E2P_CMD, val); ++ check_warn_return(ret, "Error writing E2P_CMD"); + + ret = smsc95xx_wait_eeprom(dev); + if (ret < 0) +@@ -308,14 +361,14 @@ + struct usbnet *dev = usb_context->dev; + int status = urb->status; + +- if (status < 0) +- netdev_warn(dev->net, "async callback failed with %d\n", status); ++ check_warn(status, "async callback failed with %d\n", status); + + kfree(usb_context); + usb_free_urb(urb); + } + +-static int smsc95xx_write_reg_async(struct usbnet *dev, u16 index, u32 *data) ++static int __must_check smsc95xx_write_reg_async(struct usbnet *dev, u16 index, ++ u32 *data) + { + struct usb_context *usb_context; + int status; +@@ -371,6 +424,7 @@ + struct usbnet *dev = netdev_priv(netdev); + struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); + unsigned long flags; ++ int ret; + + pdata->hash_hi = 0; + pdata->hash_lo = 0; +@@ -411,21 +465,23 @@ + spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); + + /* Initiate async writes, as we can't wait for completion here */ +- smsc95xx_write_reg_async(dev, HASHH, &pdata->hash_hi); +- smsc95xx_write_reg_async(dev, HASHL, &pdata->hash_lo); +- smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr); ++ ret = smsc95xx_write_reg_async(dev, HASHH, &pdata->hash_hi); ++ check_warn(ret, "failed to initiate async write to HASHH"); ++ ++ ret = smsc95xx_write_reg_async(dev, HASHL, &pdata->hash_lo); ++ check_warn(ret, "failed to initiate async write to HASHL"); ++ ++ ret = smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr); ++ check_warn(ret, "failed to initiate async write to MAC_CR"); + } + +-static void smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, +- u16 lcladv, u16 rmtadv) ++static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex, ++ u16 lcladv, u16 rmtadv) + { + u32 flow, afc_cfg = 0; + + int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg); +- if (ret < 0) { +- netdev_warn(dev->net, "error reading AFC_CFG\n"); +- return; +- } ++ check_warn_return(ret, "Error reading AFC_CFG"); + + if (duplex == DUPLEX_FULL) { + u8 cap = mii_resolve_flowctrl_fdx(lcladv, rmtadv); +@@ -449,8 +505,13 @@ + afc_cfg |= 0xF; + } + +- smsc95xx_write_reg(dev, FLOW, flow); +- smsc95xx_write_reg(dev, AFC_CFG, afc_cfg); ++ ret = smsc95xx_write_reg(dev, FLOW, flow); ++ check_warn_return(ret, "Error writing FLOW"); ++ ++ ret = smsc95xx_write_reg(dev, AFC_CFG, afc_cfg); ++ check_warn_return(ret, "Error writing AFC_CFG"); ++ ++ return 0; + } + + static int smsc95xx_link_reset(struct usbnet *dev) +@@ -460,12 +521,14 @@ + struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET }; + unsigned long flags; + u16 lcladv, rmtadv; +- u32 intdata; ++ int ret; + + /* clear interrupt status */ +- smsc95xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC); +- intdata = 0xFFFFFFFF; +- smsc95xx_write_reg(dev, INT_STS, intdata); ++ ret = smsc95xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC); ++ check_warn_return(ret, "Error reading PHY_INT_SRC"); ++ ++ ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_); ++ check_warn_return(ret, "Error writing INT_STS"); + + mii_check_media(mii, 1, 1); + mii_ethtool_gset(&dev->mii, &ecmd); +@@ -486,9 +549,11 @@ + } + spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); + +- smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); ++ ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); ++ check_warn_return(ret, "Error writing MAC_CR"); + +- smsc95xx_phy_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv); ++ ret = smsc95xx_phy_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv); ++ check_warn_return(ret, "Error updating PHY flow control"); + + return 0; + } +@@ -524,10 +589,7 @@ + int ret; + + ret = smsc95xx_read_reg(dev, COE_CR, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read COE_CR: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read COE_CR: %d\n", ret); + + if (features & NETIF_F_HW_CSUM) + read_buf |= Tx_COE_EN_; +@@ -540,10 +602,7 @@ + read_buf &= ~Rx_COE_EN_; + + ret = smsc95xx_write_reg(dev, COE_CR, read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write COE_CR: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to write COE_CR: %d\n", ret); + + netif_dbg(dev, hw, dev->net, "COE_CR = 0x%08x\n", read_buf); + return 0; +@@ -608,6 +667,26 @@ + } + } + ++static void smsc95xx_ethtool_get_wol(struct net_device *net, ++ struct ethtool_wolinfo *wolinfo) ++{ ++ struct usbnet *dev = netdev_priv(net); ++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); ++ ++ wolinfo->supported = SUPPORTED_WAKE; ++ wolinfo->wolopts = pdata->wolopts; ++} ++ ++static int smsc95xx_ethtool_set_wol(struct net_device *net, ++ struct ethtool_wolinfo *wolinfo) ++{ ++ struct usbnet *dev = netdev_priv(net); ++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); ++ ++ pdata->wolopts = wolinfo->wolopts & SUPPORTED_WAKE; ++ return 0; ++} ++ + static const struct ethtool_ops smsc95xx_ethtool_ops = { + .get_link = usbnet_get_link, + .nway_reset = usbnet_nway_reset, +@@ -621,6 +700,8 @@ + .set_eeprom = smsc95xx_ethtool_set_eeprom, + .get_regs_len = smsc95xx_ethtool_getregslen, + .get_regs = smsc95xx_ethtool_getregs, ++ .get_wol = smsc95xx_ethtool_get_wol, ++ .set_wol = smsc95xx_ethtool_set_wol, + }; + + static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) +@@ -633,8 +714,59 @@ return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); } @@ -22248,506 +23458,750 @@ index d45e539..e00ae5d 100644 /* try reading mac address from EEPROM */ if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig -index 6deaae1..4b6c43c 100644 -diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile -index 062dfdf..9a124fd 100644 -diff --git a/drivers/net/wireless/rtl8192cu/Kconfig b/drivers/net/wireless/rtl8192cu/Kconfig -new file mode 100755 -index 0000000..bee5ed6 -diff --git a/drivers/net/wireless/rtl8192cu/Makefile b/drivers/net/wireless/rtl8192cu/Makefile -new file mode 100755 -index 0000000..1b4e841 -diff --git a/drivers/net/wireless/rtl8192cu/clean b/drivers/net/wireless/rtl8192cu/clean -new file mode 100755 -index 0000000..34686a0 -\ No newline at end of file -diff --git a/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c b/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c -new file mode 100755 -index 0000000..4908d6e -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c b/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c -new file mode 100755 -index 0000000..1fcdf1e -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c b/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c -new file mode 100755 -index 0000000..513e8ab -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_debug.c b/drivers/net/wireless/rtl8192cu/core/rtw_debug.c -new file mode 100755 -index 0000000..96e5bd1 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c b/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c -new file mode 100755 -index 0000000..4a0832b -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c b/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c -new file mode 100755 -index 0000000..2b85af9 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_io.c b/drivers/net/wireless/rtl8192cu/core/rtw_io.c -new file mode 100755 -index 0000000..2efe719 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c -new file mode 100755 -index 0000000..156640c -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c -new file mode 100755 -index 0000000..87348a2 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c b/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c -new file mode 100755 -index 0000000..946d875 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_iol.c b/drivers/net/wireless/rtl8192cu/core/rtw_iol.c -new file mode 100755 -index 0000000..ce3d1a9 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c b/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c -new file mode 100755 -index 0000000..647d67a -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c b/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c -new file mode 100755 -index 0000000..7aaf136 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_mp.c b/drivers/net/wireless/rtl8192cu/core/rtw_mp.c -new file mode 100755 -index 0000000..0cdc094 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c b/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c -new file mode 100755 -index 0000000..a851568 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c b/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c -new file mode 100755 -index 0000000..bdfcdf1 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c b/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c -new file mode 100755 -index 0000000..92b3cb8 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_recv.c b/drivers/net/wireless/rtl8192cu/core/rtw_recv.c -new file mode 100755 -index 0000000..0d5143b -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_rf.c b/drivers/net/wireless/rtl8192cu/core/rtw_rf.c -new file mode 100755 -index 0000000..665c7e5 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_security.c b/drivers/net/wireless/rtl8192cu/core/rtw_security.c -new file mode 100755 -index 0000000..58601b6 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c b/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c -new file mode 100755 -index 0000000..70b25c9 -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c b/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c -new file mode 100755 -index 0000000..539b74f -diff --git a/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c b/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c -new file mode 100755 -index 0000000..178a5b7 -diff --git a/drivers/net/wireless/rtl8192cu/hal/hal_init.c b/drivers/net/wireless/rtl8192cu/hal/hal_init.c -new file mode 100755 -index 0000000..edef678 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c -new file mode 100755 -index 0000000..6c53f89 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c -new file mode 100755 -index 0000000..1adeae2 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c -new file mode 100755 -index 0000000..e3e2ae9 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c -new file mode 100755 -index 0000000..28a8cc3 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c -new file mode 100755 -index 0000000..d8394df -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c -new file mode 100755 -index 0000000..d17c23f -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c -new file mode 100755 -index 0000000..5aa6e61 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c -new file mode 100755 -index 0000000..3f9adb5 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c -new file mode 100755 -index 0000000..23969fc -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c -new file mode 100755 -index 0000000..27a31ce -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c -new file mode 100755 -index 0000000..6665648 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c -new file mode 100755 -index 0000000..4285d60 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c -new file mode 100755 -index 0000000..c276b51 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c -new file mode 100755 -index 0000000..47be445 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c -new file mode 100755 -index 0000000..4d01b3c -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c -new file mode 100755 -index 0000000..d6f3376 -diff --git a/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c b/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c -new file mode 100755 -index 0000000..82adeff -diff --git a/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 b/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 -new file mode 100755 -index 0000000..20dcbec -\ No newline at end of file -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h -new file mode 100755 -index 0000000..e7c6869 -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h -new file mode 100755 -index 0000000..2e76d2a -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h -new file mode 100755 -index 0000000..5f2d451 -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h -new file mode 100755 -index 0000000..2aced69 -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h b/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h -new file mode 100755 -index 0000000..ec52f45 -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h -new file mode 100755 -index 0000000..d99403c -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DETestHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DETestHWImg.h -new file mode 100755 -index 0000000..0cb96e5 -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h -new file mode 100755 -index 0000000..8e14417 -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h -new file mode 100755 -index 0000000..bff455f -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h -new file mode 100755 -index 0000000..f43e9d1 -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h -new file mode 100755 -index 0000000..75aafee -diff --git a/drivers/net/wireless/rtl8192cu/include/Hal8192DUTestHWImg.h b/drivers/net/wireless/rtl8192cu/include/Hal8192DUTestHWImg.h -new file mode 100755 -index 0000000..3ce7a3d -diff --git a/drivers/net/wireless/rtl8192cu/include/autoconf.h b/drivers/net/wireless/rtl8192cu/include/autoconf.h -new file mode 100755 -index 0000000..4a50f8b -diff --git a/drivers/net/wireless/rtl8192cu/include/basic_types.h b/drivers/net/wireless/rtl8192cu/include/basic_types.h -new file mode 100755 -index 0000000..f880224 -diff --git a/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h b/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h -new file mode 100755 -index 0000000..eca68a6 -diff --git a/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h b/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h -new file mode 100755 -index 0000000..246ba89 -diff --git a/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h b/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h -new file mode 100755 -index 0000000..433045e -diff --git a/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h b/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h -new file mode 100755 -index 0000000..117c84d -diff --git a/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h b/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h -new file mode 100755 -index 0000000..1735349 -diff --git a/drivers/net/wireless/rtl8192cu/include/circ_buf.h b/drivers/net/wireless/rtl8192cu/include/circ_buf.h -new file mode 100755 -index 0000000..1bd4704 -diff --git a/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h b/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h -new file mode 100755 -index 0000000..077efa7 -diff --git a/drivers/net/wireless/rtl8192cu/include/drv_conf.h b/drivers/net/wireless/rtl8192cu/include/drv_conf.h -new file mode 100755 -index 0000000..a2b6cc4 -diff --git a/drivers/net/wireless/rtl8192cu/include/drv_types.h b/drivers/net/wireless/rtl8192cu/include/drv_types.h -new file mode 100755 -index 0000000..95e20cc -diff --git a/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h b/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h -new file mode 100755 -index 0000000..be0459d -diff --git a/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h b/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h -new file mode 100755 -index 0000000..db1c585 -diff --git a/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h b/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h -new file mode 100755 -index 0000000..2d51b1d -diff --git a/drivers/net/wireless/rtl8192cu/include/ethernet.h b/drivers/net/wireless/rtl8192cu/include/ethernet.h -new file mode 100755 -index 0000000..36e29c0 -diff --git a/drivers/net/wireless/rtl8192cu/include/farray.h b/drivers/net/wireless/rtl8192cu/include/farray.h -new file mode 100755 -index 0000000..79d2a42 -diff --git a/drivers/net/wireless/rtl8192cu/include/h2clbk.h b/drivers/net/wireless/rtl8192cu/include/h2clbk.h -new file mode 100755 -index 0000000..359c9e7 -diff --git a/drivers/net/wireless/rtl8192cu/include/hal_init.h b/drivers/net/wireless/rtl8192cu/include/hal_init.h -new file mode 100755 -index 0000000..ec48f83 -diff --git a/drivers/net/wireless/rtl8192cu/include/ieee80211.h b/drivers/net/wireless/rtl8192cu/include/ieee80211.h -new file mode 100755 -index 0000000..5c17a28 -diff --git a/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h b/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h -new file mode 100755 -index 0000000..0a966fa -diff --git a/drivers/net/wireless/rtl8192cu/include/if_ether.h b/drivers/net/wireless/rtl8192cu/include/if_ether.h -new file mode 100755 -index 0000000..045c067 -diff --git a/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h b/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h -new file mode 100755 -index 0000000..823e4a1 -diff --git a/drivers/net/wireless/rtl8192cu/include/ip.h b/drivers/net/wireless/rtl8192cu/include/ip.h -new file mode 100755 -index 0000000..5846347 -diff --git a/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h b/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h -new file mode 100755 -index 0000000..1583053 -diff --git a/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h b/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h -new file mode 100755 -index 0000000..5f86738 -diff --git a/drivers/net/wireless/rtl8192cu/include/nic_spec.h b/drivers/net/wireless/rtl8192cu/include/nic_spec.h -new file mode 100755 -index 0000000..18e7b2c -diff --git a/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h b/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h -new file mode 100755 -index 0000000..5f7c3e6 -diff --git a/drivers/net/wireless/rtl8192cu/include/osdep_intf.h b/drivers/net/wireless/rtl8192cu/include/osdep_intf.h -new file mode 100755 -index 0000000..86b3f1f -diff --git a/drivers/net/wireless/rtl8192cu/include/osdep_service.h b/drivers/net/wireless/rtl8192cu/include/osdep_service.h -new file mode 100755 -index 0000000..2802187 -diff --git a/drivers/net/wireless/rtl8192cu/include/pci_hal.h b/drivers/net/wireless/rtl8192cu/include/pci_hal.h -new file mode 100755 -index 0000000..1ee0ee2 -diff --git a/drivers/net/wireless/rtl8192cu/include/pci_ops.h b/drivers/net/wireless/rtl8192cu/include/pci_ops.h -new file mode 100755 -index 0000000..dd63f5f -diff --git a/drivers/net/wireless/rtl8192cu/include/pci_osintf.h b/drivers/net/wireless/rtl8192cu/include/pci_osintf.h -new file mode 100755 -index 0000000..09715af -diff --git a/drivers/net/wireless/rtl8192cu/include/recv_osdep.h b/drivers/net/wireless/rtl8192cu/include/recv_osdep.h -new file mode 100755 -index 0000000..536ed31 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h -new file mode 100755 -index 0000000..57ecadf -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h -new file mode 100755 -index 0000000..a13b5ff -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h -new file mode 100755 -index 0000000..a43f99f -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h -new file mode 100755 -index 0000000..cddd998 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h -new file mode 100755 -index 0000000..4ddd9c8 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h -new file mode 100755 -index 0000000..70a6d10 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h -new file mode 100755 -index 0000000..76c8a78 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h -new file mode 100755 -index 0000000..1e97b01 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h -new file mode 100755 -index 0000000..bd521c4 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h b/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h -new file mode 100755 -index 0000000..f4428af -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h -new file mode 100755 -index 0000000..f07a2bd -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h -new file mode 100755 -index 0000000..994d3e5 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h -new file mode 100755 -index 0000000..52be16b -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h -new file mode 100755 -index 0000000..95e20ac -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h -new file mode 100755 -index 0000000..f7b62bd -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h -new file mode 100755 -index 0000000..eea18b9 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h -new file mode 100755 -index 0000000..2d05559 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h b/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h -new file mode 100755 -index 0000000..2b1580f -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_android.h b/drivers/net/wireless/rtl8192cu/include/rtw_android.h -new file mode 100755 -index 0000000..e1a0432 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h b/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h -new file mode 100755 -index 0000000..9da3fdd -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h b/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h -new file mode 100755 -index 0000000..1313a25 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h b/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h -new file mode 100755 -index 0000000..0556d0b -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_debug.h b/drivers/net/wireless/rtl8192cu/include/rtw_debug.h -new file mode 100755 -index 0000000..7dc750b -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h b/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h -new file mode 100755 -index 0000000..9d31998 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h b/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h -new file mode 100755 -index 0000000..66be910 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_event.h b/drivers/net/wireless/rtl8192cu/include/rtw_event.h -new file mode 100755 -index 0000000..dd9f097 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ht.h b/drivers/net/wireless/rtl8192cu/include/rtw_ht.h -new file mode 100755 -index 0000000..4dcad2b -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_io.h b/drivers/net/wireless/rtl8192cu/include/rtw_io.h -new file mode 100755 -index 0000000..b1f57c1 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h -new file mode 100755 -index 0000000..e6d34f0 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h -new file mode 100755 -index 0000000..e9ad16f1 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h -new file mode 100755 -index 0000000..1ea8f21 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h b/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h -new file mode 100755 -index 0000000..577af51 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_iol.h b/drivers/net/wireless/rtl8192cu/include/rtw_iol.h -new file mode 100755 -index 0000000..2750eb3 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_led.h b/drivers/net/wireless/rtl8192cu/include/rtw_led.h -new file mode 100755 -index 0000000..bef37df -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h b/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h -new file mode 100755 -index 0000000..05af290 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h b/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h -new file mode 100755 -index 0000000..d9a203f -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mp.h b/drivers/net/wireless/rtl8192cu/include/rtw_mp.h -new file mode 100755 -index 0000000..a468714 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h b/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h -new file mode 100755 -index 0000000..e16df40 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h b/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h -new file mode 100755 -index 0000000..4906005 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h b/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h -new file mode 100755 -index 0000000..02edc6d -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h b/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h -new file mode 100755 -index 0000000..2b00beb -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_qos.h b/drivers/net/wireless/rtl8192cu/include/rtw_qos.h -new file mode 100755 -index 0000000..e35b77f -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_recv.h b/drivers/net/wireless/rtl8192cu/include/rtw_recv.h -new file mode 100755 -index 0000000..42081088 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_rf.h b/drivers/net/wireless/rtl8192cu/include/rtw_rf.h -new file mode 100755 -index 0000000..7414c1b6 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_security.h b/drivers/net/wireless/rtl8192cu/include/rtw_security.h -new file mode 100755 -index 0000000..02ef9b0 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_version.h b/drivers/net/wireless/rtl8192cu/include/rtw_version.h -new file mode 100644 -index 0000000..1a26560 -diff --git a/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h b/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h -new file mode 100755 -index 0000000..ef0c262 -diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_hal.h b/drivers/net/wireless/rtl8192cu/include/sdio_hal.h -new file mode 100755 -index 0000000..51139bb -diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_ops.h b/drivers/net/wireless/rtl8192cu/include/sdio_ops.h -new file mode 100755 -index 0000000..b1e9b63 -diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_ops_ce.h b/drivers/net/wireless/rtl8192cu/include/sdio_ops_ce.h -new file mode 100755 -index 0000000..6b0c1a2 -diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_ops_linux.h b/drivers/net/wireless/rtl8192cu/include/sdio_ops_linux.h -new file mode 100755 -index 0000000..c58ab08 -diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_ops_xp.h b/drivers/net/wireless/rtl8192cu/include/sdio_ops_xp.h -new file mode 100755 -index 0000000..3569611 -diff --git a/drivers/net/wireless/rtl8192cu/include/sdio_osintf.h b/drivers/net/wireless/rtl8192cu/include/sdio_osintf.h -new file mode 100755 -index 0000000..099262b -diff --git a/drivers/net/wireless/rtl8192cu/include/sta_info.h b/drivers/net/wireless/rtl8192cu/include/sta_info.h -new file mode 100755 -index 0000000..8f01f21 -diff --git a/drivers/net/wireless/rtl8192cu/include/usb_hal.h b/drivers/net/wireless/rtl8192cu/include/usb_hal.h -new file mode 100755 -index 0000000..9cd21f3 -diff --git a/drivers/net/wireless/rtl8192cu/include/usb_ops.h b/drivers/net/wireless/rtl8192cu/include/usb_ops.h -new file mode 100755 -index 0000000..3868bc0 -diff --git a/drivers/net/wireless/rtl8192cu/include/usb_osintf.h b/drivers/net/wireless/rtl8192cu/include/usb_osintf.h -new file mode 100755 -index 0000000..8642aa2 -diff --git a/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h b/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h -new file mode 100755 -index 0000000..72864de -diff --git a/drivers/net/wireless/rtl8192cu/include/wifi.h b/drivers/net/wireless/rtl8192cu/include/wifi.h -new file mode 100755 -index 0000000..5ae1275 -diff --git a/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h b/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h -new file mode 100755 -index 0000000..fe555c6 -diff --git a/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h b/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h -new file mode 100755 -index 0000000..7d28d43 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c -new file mode 100755 -index 0000000..b58e5c0 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c -new file mode 100755 -index 0000000..7330160 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c -new file mode 100755 -index 0000000..0175ea2 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c -new file mode 100755 -index 0000000..61e4120 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c -new file mode 100755 -index 0000000..0848297 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c -new file mode 100755 -index 0000000..4a76c3f -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c -new file mode 100755 -index 0000000..aceaaa7 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/sdio_intf.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/sdio_intf.c -new file mode 100755 -index 0000000..52faefc -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c -new file mode 100755 -index 0000000..942ea08 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c b/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c -new file mode 100755 -index 0000000..02eec93 -diff --git a/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c b/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c -new file mode 100755 -index 0000000..6e11379 -diff --git a/drivers/net/wireless/rtl8192cu/wlan0dhcp b/drivers/net/wireless/rtl8192cu/wlan0dhcp -new file mode 100755 -index 0000000..6043382 -diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig -index 5f84b55..ec934d9 100644 ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -74,6 +74,14 @@ config SPI_ATMEL +@@ -658,55 +790,56 @@ + int ret; + + ret = smsc95xx_write_reg(dev, ADDRL, addr_lo); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write ADDRL: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to write ADDRL: %d\n", ret); + + ret = smsc95xx_write_reg(dev, ADDRH, addr_hi); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write ADDRH: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to write ADDRH: %d\n", ret); + + return 0; + } + + /* starts the TX path */ +-static void smsc95xx_start_tx_path(struct usbnet *dev) ++static int smsc95xx_start_tx_path(struct usbnet *dev) + { + struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); + unsigned long flags; +- u32 reg_val; ++ int ret; + + /* Enable Tx at MAC */ + spin_lock_irqsave(&pdata->mac_cr_lock, flags); + pdata->mac_cr |= MAC_CR_TXEN_; + spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); + +- smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); ++ ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); ++ check_warn_return(ret, "Failed to write MAC_CR: %d\n", ret); + + /* Enable Tx at SCSRs */ +- reg_val = TX_CFG_ON_; +- smsc95xx_write_reg(dev, TX_CFG, reg_val); ++ ret = smsc95xx_write_reg(dev, TX_CFG, TX_CFG_ON_); ++ check_warn_return(ret, "Failed to write TX_CFG: %d\n", ret); ++ ++ return 0; + } + + /* Starts the Receive path */ +-static void smsc95xx_start_rx_path(struct usbnet *dev) ++static int smsc95xx_start_rx_path(struct usbnet *dev) + { + struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); + unsigned long flags; ++ int ret; + + spin_lock_irqsave(&pdata->mac_cr_lock, flags); + pdata->mac_cr |= MAC_CR_RXEN_; + spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); + +- smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); ++ ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr); ++ check_warn_return(ret, "Failed to write MAC_CR: %d\n", ret); ++ ++ return 0; + } + + static int smsc95xx_phy_initialize(struct usbnet *dev) + { +- int bmcr, timeout = 0; ++ int bmcr, ret, timeout = 0; + + /* Initialize MII structure */ + dev->mii.dev = dev->net; +@@ -735,7 +868,8 @@ + ADVERTISE_PAUSE_ASYM); + + /* read to clear */ +- smsc95xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); ++ ret = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); ++ check_warn_return(ret, "Failed to read PHY_INT_SRC during init"); + + smsc95xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, + PHY_INT_MASK_DEFAULT_); +@@ -753,22 +887,14 @@ + + netif_dbg(dev, ifup, dev->net, "entering smsc95xx_reset\n"); + +- write_buf = HW_CFG_LRST_; +- ret = smsc95xx_write_reg(dev, HW_CFG, write_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write HW_CFG_LRST_ bit in HW_CFG register, ret = %d\n", +- ret); +- return ret; +- } ++ ret = smsc95xx_write_reg(dev, HW_CFG, HW_CFG_LRST_); ++ check_warn_return(ret, "Failed to write HW_CFG_LRST_ bit in HW_CFG\n"); + + timeout = 0; + do { +- ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); +- return ret; +- } + msleep(10); ++ ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); ++ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); + timeout++; + } while ((read_buf & HW_CFG_LRST_) && (timeout < 100)); + +@@ -777,21 +903,14 @@ + return ret; + } + +- write_buf = PM_CTL_PHY_RST_; +- ret = smsc95xx_write_reg(dev, PM_CTRL, write_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write PM_CTRL: %d\n", ret); +- return ret; +- } ++ ret = smsc95xx_write_reg(dev, PM_CTRL, PM_CTL_PHY_RST_); ++ check_warn_return(ret, "Failed to write PM_CTRL: %d\n", ret); + + timeout = 0; + do { +- ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read PM_CTRL: %d\n", ret); +- return ret; +- } + msleep(10); ++ ret = smsc95xx_read_reg(dev, PM_CTRL, &read_buf); ++ check_warn_return(ret, "Failed to read PM_CTRL: %d\n", ret); + timeout++; + } while ((read_buf & PM_CTL_PHY_RST_) && (timeout < 100)); + +@@ -808,10 +927,7 @@ + "MAC Address: %pM\n", dev->net->dev_addr); + + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); + + netif_dbg(dev, ifup, dev->net, + "Read Value from HW_CFG : 0x%08x\n", read_buf); +@@ -819,17 +935,10 @@ + read_buf |= HW_CFG_BIR_; + + ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write HW_CFG_BIR_ bit in HW_CFG register, ret = %d\n", +- ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to write HW_CFG_BIR_ bit in HW_CFG\n"); + + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); + netif_dbg(dev, ifup, dev->net, + "Read Value from HW_CFG after writing HW_CFG_BIR_: 0x%08x\n", + read_buf); +@@ -849,41 +958,28 @@ + "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size); + + ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write BURST_CAP: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to write BURST_CAP: %d\n", ret); + + ret = smsc95xx_read_reg(dev, BURST_CAP, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read BURST_CAP: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read BURST_CAP: %d\n", ret); ++ + netif_dbg(dev, ifup, dev->net, + "Read Value from BURST_CAP after writing: 0x%08x\n", + read_buf); + +- read_buf = DEFAULT_BULK_IN_DELAY; +- ret = smsc95xx_write_reg(dev, BULK_IN_DLY, read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "ret = %d\n", ret); +- return ret; +- } ++ ret = smsc95xx_write_reg(dev, BULK_IN_DLY, DEFAULT_BULK_IN_DELAY); ++ check_warn_return(ret, "Failed to write BULK_IN_DLY: %d\n", ret); + + ret = smsc95xx_read_reg(dev, BULK_IN_DLY, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read BULK_IN_DLY: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read BULK_IN_DLY: %d\n", ret); ++ + netif_dbg(dev, ifup, dev->net, + "Read Value from BULK_IN_DLY after writing: 0x%08x\n", + read_buf); + + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); ++ + netif_dbg(dev, ifup, dev->net, + "Read Value from HW_CFG: 0x%08x\n", read_buf); + +@@ -896,101 +992,66 @@ + read_buf |= NET_IP_ALIGN << 9; + + ret = smsc95xx_write_reg(dev, HW_CFG, read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write HW_CFG register, ret=%d\n", +- ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to write HW_CFG: %d\n", ret); + + ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read HW_CFG: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret); ++ + netif_dbg(dev, ifup, dev->net, + "Read Value from HW_CFG after writing: 0x%08x\n", read_buf); + +- write_buf = 0xFFFFFFFF; +- ret = smsc95xx_write_reg(dev, INT_STS, write_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write INT_STS register, ret=%d\n", +- ret); +- return ret; +- } ++ ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_); ++ check_warn_return(ret, "Failed to write INT_STS: %d\n", ret); + + ret = smsc95xx_read_reg(dev, ID_REV, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read ID_REV: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read ID_REV: %d\n", ret); + netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", read_buf); + + /* Configure GPIO pins as LED outputs */ + write_buf = LED_GPIO_CFG_SPD_LED | LED_GPIO_CFG_LNK_LED | + LED_GPIO_CFG_FDX_LED; + ret = smsc95xx_write_reg(dev, LED_GPIO_CFG, write_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write LED_GPIO_CFG register, ret=%d\n", +- ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to write LED_GPIO_CFG: %d\n", ret); + + /* Init Tx */ +- write_buf = 0; +- ret = smsc95xx_write_reg(dev, FLOW, write_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write FLOW: %d\n", ret); +- return ret; +- } ++ ret = smsc95xx_write_reg(dev, FLOW, 0); ++ check_warn_return(ret, "Failed to write FLOW: %d\n", ret); + +- read_buf = AFC_CFG_DEFAULT; +- ret = smsc95xx_write_reg(dev, AFC_CFG, read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write AFC_CFG: %d\n", ret); +- return ret; +- } ++ ret = smsc95xx_write_reg(dev, AFC_CFG, AFC_CFG_DEFAULT); ++ check_warn_return(ret, "Failed to write AFC_CFG: %d\n", ret); + + /* Don't need mac_cr_lock during initialisation */ + ret = smsc95xx_read_reg(dev, MAC_CR, &pdata->mac_cr); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read MAC_CR: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read MAC_CR: %d\n", ret); + + /* Init Rx */ + /* Set Vlan */ +- write_buf = (u32)ETH_P_8021Q; +- ret = smsc95xx_write_reg(dev, VLAN1, write_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write VAN1: %d\n", ret); +- return ret; +- } ++ ret = smsc95xx_write_reg(dev, VLAN1, (u32)ETH_P_8021Q); ++ check_warn_return(ret, "Failed to write VLAN1: %d\n", ret); + + /* Enable or disable checksum offload engines */ +- smsc95xx_set_features(dev->net, dev->net->features); ++ ret = smsc95xx_set_features(dev->net, dev->net->features); ++ check_warn_return(ret, "Failed to set checksum offload features"); + + smsc95xx_set_multicast(dev->net); + +- if (smsc95xx_phy_initialize(dev) < 0) +- return -EIO; ++ ret = smsc95xx_phy_initialize(dev); ++ check_warn_return(ret, "Failed to init PHY"); + + ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to read INT_EP_CTL: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to read INT_EP_CTL: %d\n", ret); + + /* enable PHY interrupts */ + read_buf |= INT_EP_CTL_PHY_INT_; + + ret = smsc95xx_write_reg(dev, INT_EP_CTL, read_buf); +- if (ret < 0) { +- netdev_warn(dev->net, "Failed to write INT_EP_CTL: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "Failed to write INT_EP_CTL: %d\n", ret); + +- smsc95xx_start_tx_path(dev); +- smsc95xx_start_rx_path(dev); ++ ret = smsc95xx_start_tx_path(dev); ++ check_warn_return(ret, "Failed to start TX path"); ++ ++ ret = smsc95xx_start_rx_path(dev); ++ check_warn_return(ret, "Failed to start RX path"); + + netif_dbg(dev, ifup, dev->net, "smsc95xx_reset, return 0\n"); + return 0; +@@ -1017,10 +1078,7 @@ + printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n"); + + ret = usbnet_get_endpoints(dev, intf); +- if (ret < 0) { +- netdev_warn(dev->net, "usbnet_get_endpoints failed: %d\n", ret); +- return ret; +- } ++ check_warn_return(ret, "usbnet_get_endpoints failed: %d\n", ret); + + dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc95xx_priv), + GFP_KERNEL); +@@ -1064,6 +1122,153 @@ + } + } + ++static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) ++{ ++ struct usbnet *dev = usb_get_intfdata(intf); ++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); ++ int ret; ++ u32 val; ++ ++ ret = usbnet_suspend(intf, message); ++ check_warn_return(ret, "usbnet_suspend error"); ++ ++ /* if no wol options set, enter lowest power SUSPEND2 mode */ ++ if (!(pdata->wolopts & SUPPORTED_WAKE)) { ++ netdev_info(dev->net, "entering SUSPEND2 mode"); ++ ++ /* disable energy detect (link up) & wake up events */ ++ ret = smsc95xx_read_reg(dev, WUCSR, &val); ++ check_warn_return(ret, "Error reading WUCSR"); ++ ++ val &= ~(WUCSR_MPEN_ | WUCSR_WAKE_EN_); ++ ++ ret = smsc95xx_write_reg(dev, WUCSR, val); ++ check_warn_return(ret, "Error writing WUCSR"); ++ ++ ret = smsc95xx_read_reg(dev, PM_CTRL, &val); ++ check_warn_return(ret, "Error reading PM_CTRL"); ++ ++ val &= ~(PM_CTL_ED_EN_ | PM_CTL_WOL_EN_); ++ ++ ret = smsc95xx_write_reg(dev, PM_CTRL, val); ++ check_warn_return(ret, "Error writing PM_CTRL"); ++ ++ /* enter suspend2 mode */ ++ ret = smsc95xx_read_reg(dev, PM_CTRL, &val); ++ check_warn_return(ret, "Error reading PM_CTRL"); ++ ++ val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_); ++ val |= PM_CTL_SUS_MODE_2; ++ ++ ret = smsc95xx_write_reg(dev, PM_CTRL, val); ++ check_warn_return(ret, "Error writing PM_CTRL"); ++ ++ return 0; ++ } ++ ++ if (pdata->wolopts & WAKE_MAGIC) { ++ /* clear any pending magic packet status */ ++ ret = smsc95xx_read_reg(dev, WUCSR, &val); ++ check_warn_return(ret, "Error reading WUCSR"); ++ ++ val |= WUCSR_MPR_; ++ ++ ret = smsc95xx_write_reg(dev, WUCSR, val); ++ check_warn_return(ret, "Error writing WUCSR"); ++ } ++ ++ /* enable/disable magic packup wake */ ++ ret = smsc95xx_read_reg(dev, WUCSR, &val); ++ check_warn_return(ret, "Error reading WUCSR"); ++ ++ if (pdata->wolopts & WAKE_MAGIC) { ++ netdev_info(dev->net, "enabling magic packet wakeup"); ++ val |= WUCSR_MPEN_; ++ } else { ++ netdev_info(dev->net, "disabling magic packet wakeup"); ++ val &= ~WUCSR_MPEN_; ++ } ++ ++ ret = smsc95xx_write_reg(dev, WUCSR, val); ++ check_warn_return(ret, "Error writing WUCSR"); ++ ++ /* enable wol wakeup source */ ++ ret = smsc95xx_read_reg(dev, PM_CTRL, &val); ++ check_warn_return(ret, "Error reading PM_CTRL"); ++ ++ val |= PM_CTL_WOL_EN_; ++ ++ ret = smsc95xx_write_reg(dev, PM_CTRL, val); ++ check_warn_return(ret, "Error writing PM_CTRL"); ++ ++ /* enable receiver */ ++ smsc95xx_start_rx_path(dev); ++ ++ /* some wol options are enabled, so enter SUSPEND0 */ ++ netdev_info(dev->net, "entering SUSPEND0 mode"); ++ ++ ret = smsc95xx_read_reg(dev, PM_CTRL, &val); ++ check_warn_return(ret, "Error reading PM_CTRL"); ++ ++ val &= (~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_)); ++ val |= PM_CTL_SUS_MODE_0; ++ ++ ret = smsc95xx_write_reg(dev, PM_CTRL, val); ++ check_warn_return(ret, "Error writing PM_CTRL"); ++ ++ /* clear wol status */ ++ val &= ~PM_CTL_WUPS_; ++ val |= PM_CTL_WUPS_WOL_; ++ ret = smsc95xx_write_reg(dev, PM_CTRL, val); ++ check_warn_return(ret, "Error writing PM_CTRL"); ++ ++ /* read back PM_CTRL */ ++ ret = smsc95xx_read_reg(dev, PM_CTRL, &val); ++ check_warn_return(ret, "Error reading PM_CTRL"); ++ ++ smsc95xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP); ++ ++ return 0; ++} ++ ++static int smsc95xx_resume(struct usb_interface *intf) ++{ ++ struct usbnet *dev = usb_get_intfdata(intf); ++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); ++ int ret; ++ u32 val; ++ ++ BUG_ON(!dev); ++ ++ if (pdata->wolopts & WAKE_MAGIC) { ++ smsc95xx_clear_feature(dev, USB_DEVICE_REMOTE_WAKEUP); ++ ++ /* Disable magic packup wake */ ++ ret = smsc95xx_read_reg(dev, WUCSR, &val); ++ check_warn_return(ret, "Error reading WUCSR"); ++ ++ val &= ~WUCSR_MPEN_; ++ ++ ret = smsc95xx_write_reg(dev, WUCSR, val); ++ check_warn_return(ret, "Error writing WUCSR"); ++ ++ /* clear wake-up status */ ++ ret = smsc95xx_read_reg(dev, PM_CTRL, &val); ++ check_warn_return(ret, "Error reading PM_CTRL"); ++ ++ val &= ~PM_CTL_WOL_EN_; ++ val |= PM_CTL_WUPS_; ++ ++ ret = smsc95xx_write_reg(dev, PM_CTRL, val); ++ check_warn_return(ret, "Error writing PM_CTRL"); ++ } ++ ++ return usbnet_resume(intf); ++ check_warn_return(ret, "usbnet_resume error"); ++ ++ return 0; ++} ++ + static void smsc95xx_rx_csum_offload(struct sk_buff *skb) + { + skb->csum = *(u16 *)(skb_tail_pointer(skb) - 2); +@@ -1195,6 +1400,7 @@ + } else { + u32 csum_preamble = smsc95xx_calc_csum_preamble(skb); + skb_push(skb, 4); ++ cpu_to_le32s(&csum_preamble); + memcpy(skb->data, &csum_preamble, 4); + } + } +@@ -1326,8 +1532,9 @@ + .name = "smsc95xx", + .id_table = products, + .probe = usbnet_probe, +- .suspend = usbnet_suspend, +- .resume = usbnet_resume, ++ .suspend = smsc95xx_suspend, ++ .resume = smsc95xx_resume, ++ .reset_resume = smsc95xx_resume, + .disconnect = usbnet_disconnect, + .disable_hub_initiated_lpm = 1, + }; +diff -Naur linux-3.6.1/drivers/net/usb/smsc95xx.h linux-rpi-3.6.y/drivers/net/usb/smsc95xx.h +--- linux-3.6.1/drivers/net/usb/smsc95xx.h 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/net/usb/smsc95xx.h 2012-11-11 18:15:21.370938825 +0100 +@@ -63,6 +63,7 @@ + #define INT_STS_TDFO_ (0x00001000) + #define INT_STS_RXDF_ (0x00000800) + #define INT_STS_GPIOS_ (0x000007FF) ++#define INT_STS_CLEAR_ALL_ (0xFFFFFFFF) + + #define RX_CFG (0x0C) + #define RX_FIFO_FLUSH_ (0x00000001) +@@ -83,12 +84,16 @@ + #define HW_CFG_BCE_ (0x00000002) + #define HW_CFG_SRST_ (0x00000001) + ++#define RX_FIFO_INF (0x18) ++ + #define PM_CTRL (0x20) ++#define PM_CTL_RES_CLR_WKP_STS (0x00000200) + #define PM_CTL_DEV_RDY_ (0x00000080) + #define PM_CTL_SUS_MODE_ (0x00000060) + #define PM_CTL_SUS_MODE_0 (0x00000000) + #define PM_CTL_SUS_MODE_1 (0x00000020) +-#define PM_CTL_SUS_MODE_2 (0x00000060) ++#define PM_CTL_SUS_MODE_2 (0x00000040) ++#define PM_CTL_SUS_MODE_3 (0x00000060) + #define PM_CTL_PHY_RST_ (0x00000010) + #define PM_CTL_WOL_EN_ (0x00000008) + #define PM_CTL_ED_EN_ (0x00000004) +@@ -200,6 +205,11 @@ + #define WUFF (0x128) + + #define WUCSR (0x12C) ++#define WUCSR_GUE_ (0x00000200) ++#define WUCSR_WUFR_ (0x00000040) ++#define WUCSR_MPR_ (0x00000020) ++#define WUCSR_WAKE_EN_ (0x00000004) ++#define WUCSR_MPEN_ (0x00000002) + + #define COE_CR (0x130) + #define Tx_COE_EN_ (0x00010000) +diff -Naur linux-3.6.1/drivers/net/wireless/Kconfig linux-rpi-3.6.y/drivers/net/wireless/Kconfig +diff -Naur linux-3.6.1/drivers/net/wireless/Makefile linux-rpi-3.6.y/drivers/net/wireless/Makefile +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/clean linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/clean +\ Kein Zeilenumbruch am Dateiende. +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/efuse/rtw_efuse.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_br_ext.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_cmd.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_debug.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_debug.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_eeprom.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_ieee80211.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_io.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_io.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_query.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_rtl.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_ioctl_set.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_iol.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_iol.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_mlme.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_mlme_ext.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_mp.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_mp.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_mp_ioctl.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_p2p.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_pwrctrl.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_recv.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_recv.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_rf.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_rf.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_security.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_security.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_sta_mgt.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_wlan_util.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/core/rtw_xmit.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/hal_init.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/hal_init.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_cmd.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_dm.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_hal_init.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_mp.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_phycfg.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_rxdesc.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/rtl8192c_sreset.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/Hal8192CUHWImg_wowlan.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_led.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_recv.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/rtl8192cu_xmit.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_halinit.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_ce.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_linux.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/hal/rtl8192c/usb/usb_ops_xp.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/ifcfg-wlan0 +\ Kein Zeilenumbruch am Dateiende. +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/autoconf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/autoconf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/basic_types.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/basic_types.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/byteorder/big_endian.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/byteorder/generic.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/byteorder/little_endian.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/byteorder/swabb.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/byteorder/swab.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/circ_buf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/circ_buf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/cmd_osdep.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/drv_conf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/drv_conf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/drv_types_ce.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/drv_types.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/drv_types.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/drv_types_linux.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/drv_types_xp.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/ethernet.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/ethernet.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/farray.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/farray.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/h2clbk.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/h2clbk.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192CEHWImg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyCfg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192CPhyReg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192CUHWImg_wowlan.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192DEHWImg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192DETestHWImg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192DETestHWImg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyCfg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192DPhyReg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192DUHWImg_wowlan.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/Hal8192DUTestHWImg.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/Hal8192DUTestHWImg.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/hal_init.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/hal_init.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/ieee80211_ext.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/ieee80211.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/ieee80211.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/if_ether.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/if_ether.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/ioctl_cfg80211.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/ip.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/ip.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/mlme_osdep.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/mp_custom_oid.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/nic_spec.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/nic_spec.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/osdep_ce_service.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/osdep_intf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/osdep_intf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/osdep_service.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/osdep_service.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/pci_hal.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/pci_hal.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/pci_ops.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/pci_ops.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/pci_osintf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/pci_osintf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/recv_osdep.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/recv_osdep.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_cmd.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_dm.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_event.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_hal.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_led.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_recv.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_rf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_spec.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_sreset.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192c_xmit.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192d_cmd.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192d_dm.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192d_hal.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192d_led.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192d_recv.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192d_rf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192d_spec.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtl8192d_xmit.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_android.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_android.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_br_ext.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_byteorder.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_cmd.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_debug.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_debug.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_eeprom.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_efuse.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_event.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_event.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_ht.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_ht.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_ioctl.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_query.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_rtl.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_ioctl_set.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_io.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_io.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_iol.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_iol.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_led.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_led.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_mlme_ext.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_mlme.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_mp.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_mp.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_mp_ioctl.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_mp_phy_regdef.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_p2p.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_pwrctrl.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_qos.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_qos.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_recv.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_recv.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_rf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_rf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_security.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_security.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_version.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_version.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/rtw_xmit.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/sdio_hal.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/sdio_hal.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/sdio_ops_ce.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/sdio_ops_ce.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/sdio_ops.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/sdio_ops.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/sdio_ops_linux.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/sdio_ops_linux.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/sdio_ops_xp.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/sdio_ops_xp.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/sdio_osintf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/sdio_osintf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/sta_info.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/sta_info.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/usb_hal.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/usb_hal.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/usb_ops.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/usb_ops.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/usb_osintf.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/usb_osintf.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/usb_vendor_req.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/wifi.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/wifi.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/wlan_bssdef.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/include/xmit_osdep.h +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/Kconfig linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/Kconfig +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/Makefile linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/Makefile +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_cfg80211.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/ioctl_linux.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/mlme_linux.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/os_intfs.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/pci_intf.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/recv_linux.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/rtw_android.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/sdio_intf.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/sdio_intf.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/usb_intf.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/linux/xmit_linux.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/os_dep/osdep_service.c +diff -Naur linux-3.6.1/drivers/net/wireless/rtl8192cu/wlan0dhcp linux-rpi-3.6.y/drivers/net/wireless/rtl8192cu/wlan0dhcp +diff -Naur linux-3.6.1/drivers/spi/Kconfig linux-rpi-3.6.y/drivers/spi/Kconfig +--- linux-3.6.1/drivers/spi/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/spi/Kconfig 2012-11-11 18:15:16.414841756 +0100 +@@ -74,6 +74,14 @@ This selects a driver for the Atmel SPI Controller, present on many AT32 (AVR32) and AT91 (ARM) chips. @@ -22762,11 +24216,10 @@ index 5f84b55..ec934d9 100644 config SPI_BFIN5XX tristate "SPI controller driver for ADI Blackfin5xx" depends on BLACKFIN -diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile -index 3920dcf..1905862 100644 ---- a/drivers/spi/Makefile -+++ b/drivers/spi/Makefile -@@ -16,6 +16,7 @@ obj-$(CONFIG_SPI_ATH79) += spi-ath79.o +diff -Naur linux-3.6.1/drivers/spi/Makefile linux-rpi-3.6.y/drivers/spi/Makefile +--- linux-3.6.1/drivers/spi/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/spi/Makefile 2012-11-11 18:15:16.411841697 +0100 +@@ -16,6 +16,7 @@ obj-$(CONFIG_SPI_AU1550) += spi-au1550.o obj-$(CONFIG_SPI_BCM63XX) += spi-bcm63xx.o obj-$(CONFIG_SPI_BFIN5XX) += spi-bfin5xx.o @@ -22774,11 +24227,9 @@ index 3920dcf..1905862 100644 obj-$(CONFIG_SPI_BFIN_SPORT) += spi-bfin-sport.o obj-$(CONFIG_SPI_BITBANG) += spi-bitbang.o obj-$(CONFIG_SPI_BUTTERFLY) += spi-butterfly.o -diff --git a/drivers/spi/spi-bcm2708.c b/drivers/spi/spi-bcm2708.c -new file mode 100644 -index 0000000..ef8fef0 ---- /dev/null -+++ b/drivers/spi/spi-bcm2708.c +diff -Naur linux-3.6.1/drivers/spi/spi-bcm2708.c linux-rpi-3.6.y/drivers/spi/spi-bcm2708.c +--- linux-3.6.1/drivers/spi/spi-bcm2708.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/spi/spi-bcm2708.c 2012-11-11 18:15:16.387841226 +0100 @@ -0,0 +1,594 @@ +/* + * Driver for Broadcom BCM2708 SPI Controllers @@ -23374,42 +24825,9 @@ index 0000000..ef8fef0 +MODULE_AUTHOR("Chris Boot "); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig -index 3ab2bd5..7d12e17 100644 ---- a/drivers/thermal/Kconfig -+++ b/drivers/thermal/Kconfig -@@ -27,3 +27,14 @@ config SPEAR_THERMAL - help - Enable this to plug the SPEAr thermal sensor driver into the Linux - thermal framework -+ -+if THERMAL -+ -+config THERMAL_BCM2835 -+ tristate "BCM2835 Thermal Driver" -+ help -+ This will enable temperature monitoring for the Broadcom BCM2835 -+ chip. If built as a module, it will be called 'bcm2835-thermal'. -+ -+endif # THERMAL_BCM2835 -+ -diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile -index a9fff0b..666f93c 100644 ---- a/drivers/thermal/Makefile -+++ b/drivers/thermal/Makefile -@@ -3,4 +3,5 @@ - # - - obj-$(CONFIG_THERMAL) += thermal_sys.o --obj-$(CONFIG_SPEAR_THERMAL) += spear_thermal.o -\ No newline at end of file -+obj-$(CONFIG_SPEAR_THERMAL) += spear_thermal.o -+obj-$(CONFIG_THERMAL_BCM2835) += bcm2835-thermal.o -diff --git a/drivers/thermal/bcm2835-thermal.c b/drivers/thermal/bcm2835-thermal.c -new file mode 100644 -index 0000000..091510b ---- /dev/null -+++ b/drivers/thermal/bcm2835-thermal.c +diff -Naur linux-3.6.1/drivers/thermal/bcm2835-thermal.c linux-rpi-3.6.y/drivers/thermal/bcm2835-thermal.c +--- linux-3.6.1/drivers/thermal/bcm2835-thermal.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/thermal/bcm2835-thermal.c 2012-11-11 18:15:19.681905745 +0100 @@ -0,0 +1,208 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -23619,23 +25037,39 @@ index 0000000..091510b +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); + +module_platform_driver(bcm2835_thermal_driver); -diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile -index f5ed3d7..15cde5c 100644 ---- a/drivers/usb/Makefile -+++ b/drivers/usb/Makefile -@@ -25,6 +25,7 @@ obj-$(CONFIG_USB_U132_HCD) += host/ - obj-$(CONFIG_USB_R8A66597_HCD) += host/ - obj-$(CONFIG_USB_HWA_HCD) += host/ - obj-$(CONFIG_USB_ISP1760_HCD) += host/ -+obj-$(CONFIG_USB_DWCOTG) += host/ - obj-$(CONFIG_USB_IMX21_HCD) += host/ - obj-$(CONFIG_USB_FSL_MPH_DR_OF) += host/ +diff -Naur linux-3.6.1/drivers/thermal/Kconfig linux-rpi-3.6.y/drivers/thermal/Kconfig +--- linux-3.6.1/drivers/thermal/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/thermal/Kconfig 2012-11-11 18:15:19.682905764 +0100 +@@ -27,3 +27,14 @@ + help + Enable this to plug the SPEAr thermal sensor driver into the Linux + thermal framework ++ ++if THERMAL ++ ++config THERMAL_BCM2835 ++ tristate "BCM2835 Thermal Driver" ++ help ++ This will enable temperature monitoring for the Broadcom BCM2835 ++ chip. If built as a module, it will be called 'bcm2835-thermal'. ++ ++endif # THERMAL_BCM2835 ++ +diff -Naur linux-3.6.1/drivers/thermal/Makefile linux-rpi-3.6.y/drivers/thermal/Makefile +--- linux-3.6.1/drivers/thermal/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/thermal/Makefile 2012-11-11 18:15:19.681905745 +0100 +@@ -3,4 +3,5 @@ + # -diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c -index 69ecd3c..0431b4e 100644 ---- a/drivers/usb/core/generic.c -+++ b/drivers/usb/core/generic.c -@@ -149,6 +149,7 @@ int usb_choose_configuration(struct usb_device *udev) + obj-$(CONFIG_THERMAL) += thermal_sys.o +-obj-$(CONFIG_SPEAR_THERMAL) += spear_thermal.o +\ Kein Zeilenumbruch am Dateiende. ++obj-$(CONFIG_SPEAR_THERMAL) += spear_thermal.o ++obj-$(CONFIG_THERMAL_BCM2835) += bcm2835-thermal.o +diff -Naur linux-3.6.1/drivers/usb/core/generic.c linux-rpi-3.6.y/drivers/usb/core/generic.c +--- linux-3.6.1/drivers/usb/core/generic.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/core/generic.c 2012-11-11 18:15:17.213857404 +0100 +@@ -149,6 +149,7 @@ dev_warn(&udev->dev, "no configuration chosen from %d choice%s\n", num_configs, plural(num_configs)); @@ -23643,10 +25077,9 @@ index 69ecd3c..0431b4e 100644 } return i; } -diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index 128a804..dd6733c 100644 ---- a/drivers/usb/core/hub.c -+++ b/drivers/usb/core/hub.c +diff -Naur linux-3.6.1/drivers/usb/core/hub.c linux-rpi-3.6.y/drivers/usb/core/hub.c +--- linux-3.6.1/drivers/usb/core/hub.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/core/hub.c 2012-11-11 18:15:17.230857737 +0100 @@ -25,7 +25,6 @@ #include #include @@ -23655,7 +25088,7 @@ index 128a804..dd6733c 100644 #include #include -@@ -1970,6 +1969,12 @@ static inline void announce_device(struct usb_device *udev) { } +@@ -1970,6 +1969,12 @@ #endif #ifdef CONFIG_USB_OTG @@ -23668,7 +25101,7 @@ index 128a804..dd6733c 100644 #include "otg_whitelist.h" #endif -@@ -2024,9 +2029,15 @@ static int usb_enumerate_device_otg(struct usb_device *udev) +@@ -2024,9 +2029,15 @@ dev_info(&udev->dev, "can't set HNP mode: %d\n", err); @@ -23685,7 +25118,7 @@ index 128a804..dd6733c 100644 } } -@@ -2035,12 +2046,27 @@ static int usb_enumerate_device_otg(struct usb_device *udev) +@@ -2035,12 +2046,27 @@ /* Maybe it can talk to us, though we can't talk to it. * (Includes HNP test device.) */ @@ -23716,7 +25149,7 @@ index 128a804..dd6733c 100644 goto fail; } fail: -@@ -2182,14 +2208,6 @@ int usb_new_device(struct usb_device *udev) +@@ -2182,14 +2208,6 @@ /* Tell the world! */ announce_device(udev); @@ -23731,7 +25164,7 @@ index 128a804..dd6733c 100644 device_enable_async_suspend(&udev->dev); /* -@@ -2810,9 +2828,9 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg) +@@ -2810,9 +2828,9 @@ status = 0; } else { /* device has up to 10 msec to fully suspend */ @@ -23743,7 +25176,7 @@ index 128a804..dd6733c 100644 usb_set_device_state(udev, USB_STATE_SUSPENDED); msleep(10); } -@@ -3805,7 +3823,9 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, +@@ -3805,7 +3823,9 @@ buf->bMaxPacketSize0 = 0; r = usb_control_msg(udev, usb_rcvaddr0pipe(), USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, @@ -23754,7 +25187,7 @@ index 128a804..dd6733c 100644 buf, GET_DESCRIPTOR_BUFSIZE, initial_descriptor_timeout); switch (buf->bMaxPacketSize0) { -@@ -4257,8 +4277,10 @@ loop: +@@ -4257,8 +4277,10 @@ release_devnum(udev); hub_free_dev(udev); usb_put_dev(udev); @@ -23767,11 +25200,10 @@ index 128a804..dd6733c 100644 } if (hub->hdev->parent || !hcd->driver->port_handed_over || -diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c -index 0ab7da2..84e6595 100644 ---- a/drivers/usb/core/message.c -+++ b/drivers/usb/core/message.c -@@ -1877,6 +1877,85 @@ free_interfaces: +diff -Naur linux-3.6.1/drivers/usb/core/message.c linux-rpi-3.6.y/drivers/usb/core/message.c +--- linux-3.6.1/drivers/usb/core/message.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/core/message.c 2012-11-11 18:15:17.231857757 +0100 +@@ -1877,6 +1877,85 @@ if (cp->string == NULL && !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) cp->string = usb_cache_string(dev, cp->desc.iConfiguration); @@ -23857,10 +25289,9 @@ index 0ab7da2..84e6595 100644 /* Now that the interfaces are installed, re-enable LPM. */ usb_unlocked_enable_lpm(dev); -diff --git a/drivers/usb/core/otg_whitelist.h b/drivers/usb/core/otg_whitelist.h -index e8cdce5..3a0da17 100644 ---- a/drivers/usb/core/otg_whitelist.h -+++ b/drivers/usb/core/otg_whitelist.h +diff -Naur linux-3.6.1/drivers/usb/core/otg_whitelist.h linux-rpi-3.6.y/drivers/usb/core/otg_whitelist.h +--- linux-3.6.1/drivers/usb/core/otg_whitelist.h 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/core/otg_whitelist.h 2012-11-11 18:15:17.214857424 +0100 @@ -19,33 +19,82 @@ static struct usb_device_id whitelist_table [] = { @@ -23950,14 +25381,20 @@ index e8cdce5..3a0da17 100644 static int is_targeted(struct usb_device *dev) { struct usb_device_id *id = whitelist_table; -@@ -55,58 +104,83 @@ static int is_targeted(struct usb_device *dev) +@@ -55,58 +104,83 @@ return 1; /* HNP test device is _never_ targeted (see OTG spec 6.6.6) */ - if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a && - le16_to_cpu(dev->descriptor.idProduct) == 0xbadd)) - return 0; -- ++ if (dev->descriptor.idVendor == 0x1a0a && ++ dev->descriptor.idProduct == 0xbadd) { ++ return 0; ++ } else if (!enable_whitelist) { ++ return 1; ++ } else { + - /* NOTE: can't use usb_match_id() since interface caches - * aren't set up yet. this is cut/paste from that code. - */ @@ -23991,13 +25428,6 @@ index e8cdce5..3a0da17 100644 - if ((id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL) && - (id->bDeviceProtocol != dev->descriptor.bDeviceProtocol)) - continue; -+ if (dev->descriptor.idVendor == 0x1a0a && -+ dev->descriptor.idProduct == 0xbadd) { -+ return 0; -+ } else if (!enable_whitelist) { -+ return 1; -+ } else { -+ +#ifdef DEBUG + dev_dbg(&dev->dev, "device V:%04x P:%04x DC:%04x SC:%04x PR:%04x \n", + dev->descriptor.idVendor, @@ -24077,28 +25507,10 @@ index e8cdce5..3a0da17 100644 #endif } -diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig -index 51ab5fd..8e78a1c 100644 ---- a/drivers/usb/gadget/Kconfig -+++ b/drivers/usb/gadget/Kconfig -@@ -505,6 +505,12 @@ config USB_GADGET_SUPERSPEED - bool - depends on USB_GADGET_DUALSPEED - -+config USB_DWC_OTG_LPM -+ boolean "Enable LPM support" -+ depends on USB && EXPERIMENTAL -+ help -+ Enables LPM support. -+ - # - # USB Gadget Drivers - # -diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c -index a896d73..18ae481 100644 ---- a/drivers/usb/gadget/file_storage.c -+++ b/drivers/usb/gadget/file_storage.c -@@ -573,8 +573,37 @@ config_desc = { +diff -Naur linux-3.6.1/drivers/usb/gadget/file_storage.c linux-rpi-3.6.y/drivers/usb/gadget/file_storage.c +--- linux-3.6.1/drivers/usb/gadget/file_storage.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/gadget/file_storage.c 2012-11-11 18:15:18.226877245 +0100 +@@ -573,8 +573,37 @@ .iConfiguration = FSG_STRING_CONFIG, .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER, .bMaxPower = CONFIG_USB_GADGET_VBUS_DRAW / 2, @@ -24136,7 +25548,7 @@ index a896d73..18ae481 100644 static struct usb_qualifier_descriptor dev_qualifier = { -@@ -984,13 +1013,29 @@ get_config: +@@ -984,13 +1013,29 @@ break; case USB_DT_BOS: @@ -24167,7 +25579,7 @@ index a896d73..18ae481 100644 break; /* One config, two speeds */ -@@ -2650,6 +2695,9 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) +@@ -2650,6 +2695,9 @@ fsg_set_halt(fsg, fsg->bulk_out); halt_bulk_in_endpoint(fsg); } @@ -24177,7 +25589,7 @@ index a896d73..18ae481 100644 return -EINVAL; } -@@ -3011,7 +3059,8 @@ static void handle_exception(struct fsg_dev *fsg) +@@ -3011,7 +3059,8 @@ * bulk endpoint, clear the halt now. (The SuperH UDC * requires this.) */ if (test_and_clear_bit(IGNORE_BULK_OUT, &fsg->atomic_bitflags)) @@ -24187,7 +25599,7 @@ index a896d73..18ae481 100644 if (transport_is_bbb()) { if (fsg->ep0_req_tag == exception_req_tag) -@@ -3085,6 +3134,9 @@ static int fsg_main_thread(void *fsg_) +@@ -3085,6 +3134,9 @@ * that expects a __user pointer and it will work okay. */ set_fs(get_ds()); @@ -24197,7 +25609,7 @@ index a896d73..18ae481 100644 /* The main loop */ while (fsg->state != FSG_STATE_TERMINATED) { if (exception_in_progress(fsg) || signal_pending(current)) { -@@ -3232,6 +3284,13 @@ static int __init check_parameters(struct fsg_dev *fsg) +@@ -3232,6 +3284,13 @@ gcnum = usb_gadget_controller_number(fsg->gadget); if (gcnum >= 0) mod_data.release = 0x0300 + gcnum; @@ -24211,7 +25623,7 @@ index a896d73..18ae481 100644 else { WARNING(fsg, "controller '%s' not recognized\n", fsg->gadget->name); -@@ -3493,6 +3552,13 @@ static int __init fsg_bind(struct usb_gadget *gadget) +@@ -3493,6 +3552,13 @@ rc = -ENOMEM; @@ -24225,190 +25637,25 @@ index a896d73..18ae481 100644 /* Allocate the request and buffer for endpoint 0 */ fsg->ep0req = req = usb_ep_alloc_request(fsg->ep0, GFP_KERNEL); if (!req) -diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index 075d2ec..b257ac2 100644 ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -610,6 +610,19 @@ config USB_HWA_HCD - To compile this driver a module, choose M here: the module - will be called "hwa-hc". +diff -Naur linux-3.6.1/drivers/usb/gadget/Kconfig linux-rpi-3.6.y/drivers/usb/gadget/Kconfig +--- linux-3.6.1/drivers/usb/gadget/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/gadget/Kconfig 2012-11-11 18:15:18.226877245 +0100 +@@ -505,6 +505,12 @@ + bool + depends on USB_GADGET_DUALSPEED -+config USB_DWCOTG -+ tristate "Synopsis DWC host support" -+ depends on USB ++config USB_DWC_OTG_LPM ++ boolean "Enable LPM support" ++ depends on USB && EXPERIMENTAL + help -+ The Synopsis DWC controller is a dual-role -+ host/peripheral/OTG ("On The Go") USB controllers. ++ Enables LPM support. + -+ Enable this option to support this IP in host controller mode. -+ If unsure, say N. -+ -+ To compile this driver as a module, choose M here: the -+ modules built will be called dwc_otg and dwc_common_port. -+ - config USB_IMX21_HCD - tristate "i.MX21 HCD support" - depends on USB && ARM && ARCH_MXC -diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile -index 9e0a89c..f767684 100644 ---- a/drivers/usb/host/Makefile -+++ b/drivers/usb/host/Makefile -@@ -37,6 +37,8 @@ obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o - obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o - obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o - obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o -+ -+obj-$(CONFIG_USB_DWCOTG) += dwc_otg/ dwc_common_port/ - obj-$(CONFIG_USB_IMX21_HCD) += imx21-hcd.o - obj-$(CONFIG_USB_FSL_MPH_DR_OF) += fsl-mph-dr-of.o - obj-$(CONFIG_USB_OCTEON2_COMMON) += octeon2-common.o -diff --git a/drivers/usb/host/dwc_common_port/Makefile b/drivers/usb/host/dwc_common_port/Makefile -new file mode 100644 -index 0000000..63e3485 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/Makefile -@@ -0,0 +1,58 @@ -+# -+# Makefile for DWC_common library -+# -+ -+ifneq ($(KERNELRELEASE),) -+ -+EXTRA_CFLAGS += -DDWC_LINUX -+#EXTRA_CFLAGS += -DDEBUG -+#EXTRA_CFLAGS += -DDWC_DEBUG_REGS -+#EXTRA_CFLAGS += -DDWC_DEBUG_MEMORY -+ -+EXTRA_CFLAGS += -DDWC_LIBMODULE -+EXTRA_CFLAGS += -DDWC_CCLIB -+#EXTRA_CFLAGS += -DDWC_CRYPTOLIB -+EXTRA_CFLAGS += -DDWC_NOTIFYLIB -+EXTRA_CFLAGS += -DDWC_UTFLIB -+ -+obj-$(CONFIG_USB_DWCOTG) += dwc_common_port_lib.o -+dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \ -+ dwc_crypto.o dwc_notifier.o \ -+ dwc_common_linux.o dwc_mem.o -+ -+kernrelwd := $(subst ., ,$(KERNELRELEASE)) -+kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd)) -+ -+ifneq ($(kernrel3),2.6.20) -+# grayg - I only know that we use EXTRA_CFLAGS in 2.6.31 actually -+EXTRA_CFLAGS += $(CPPFLAGS) -+endif -+ -+else -+ -+#ifeq ($(KDIR),) -+#$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment) -+#endif -+ -+ifeq ($(ARCH),) -+$(error Must give "ARCH=" on command line or in environment. Also, if \ -+ cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-") -+endif -+ -+ifeq ($(DOXYGEN),) -+DOXYGEN := doxygen -+endif -+ -+default: -+ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules -+ -+docs: $(wildcard *.[hc]) doc/doxygen.cfg -+ $(DOXYGEN) doc/doxygen.cfg -+ -+tags: $(wildcard *.[hc]) -+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) -+ -+endif -+ -+clean: -+ rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/ -diff --git a/drivers/usb/host/dwc_common_port/Makefile.fbsd b/drivers/usb/host/dwc_common_port/Makefile.fbsd -new file mode 100644 -index 0000000..45db991 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/Makefile.fbsd -@@ -0,0 +1,17 @@ -+CFLAGS += -I/sys/i386/compile/GENERIC -I/sys/i386/include -I/usr/include -+CFLAGS += -DDWC_FREEBSD -+CFLAGS += -DDEBUG -+#CFLAGS += -DDWC_DEBUG_REGS -+#CFLAGS += -DDWC_DEBUG_MEMORY -+ -+#CFLAGS += -DDWC_LIBMODULE -+#CFLAGS += -DDWC_CCLIB -+#CFLAGS += -DDWC_CRYPTOLIB -+#CFLAGS += -DDWC_NOTIFYLIB -+#CFLAGS += -DDWC_UTFLIB -+ -+KMOD = dwc_common_port_lib -+SRCS = dwc_cc.c dwc_modpow.c dwc_dh.c dwc_crypto.c dwc_notifier.c \ -+ dwc_common_fbsd.c dwc_mem.c -+ -+.include -diff --git a/drivers/usb/host/dwc_common_port/Makefile.linux b/drivers/usb/host/dwc_common_port/Makefile.linux -new file mode 100644 -index 0000000..961df3f ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/Makefile.linux -@@ -0,0 +1,49 @@ -+# -+# Makefile for DWC_common library -+# -+ifneq ($(KERNELRELEASE),) -+ -+EXTRA_CFLAGS += -DDWC_LINUX -+#EXTRA_CFLAGS += -DDEBUG -+#EXTRA_CFLAGS += -DDWC_DEBUG_REGS -+#EXTRA_CFLAGS += -DDWC_DEBUG_MEMORY -+ -+EXTRA_CFLAGS += -DDWC_LIBMODULE -+EXTRA_CFLAGS += -DDWC_CCLIB -+EXTRA_CFLAGS += -DDWC_CRYPTOLIB -+EXTRA_CFLAGS += -DDWC_NOTIFYLIB -+EXTRA_CFLAGS += -DDWC_UTFLIB -+ -+obj-m := dwc_common_port_lib.o -+dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \ -+ dwc_crypto.o dwc_notifier.o \ -+ dwc_common_linux.o dwc_mem.o -+ -+else -+ -+ifeq ($(KDIR),) -+$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment) -+endif -+ -+ifeq ($(ARCH),) -+$(error Must give "ARCH=" on command line or in environment. Also, if \ -+ cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-") -+endif -+ -+ifeq ($(DOXYGEN),) -+DOXYGEN := doxygen -+endif -+ -+default: -+ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules -+ -+docs: $(wildcard *.[hc]) doc/doxygen.cfg -+ $(DOXYGEN) doc/doxygen.cfg -+ -+tags: $(wildcard *.[hc]) -+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) -+ -+endif -+ -+clean: -+ rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/ -diff --git a/drivers/usb/host/dwc_common_port/changes.txt b/drivers/usb/host/dwc_common_port/changes.txt -new file mode 100644 -index 0000000..6740702 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/changes.txt + # + # USB Gadget Drivers + # +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/changes.txt linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/changes.txt +--- linux-3.6.1/drivers/usb/host/dwc_common_port/changes.txt 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/changes.txt 2012-11-11 18:15:16.990853037 +0100 @@ -0,0 +1,174 @@ + +dwc_read_reg32() and friends now take an additional parameter, a pointer to an @@ -24584,11 +25831,9 @@ index 0000000..6740702 +A DWC_LIBMODULE #define has also been added. If this is not defined, then the +module code in dwc_common_linux.c is not compiled in. This allows linking the +library code directly into a driver module, instead of as a standalone module. -diff --git a/drivers/usb/host/dwc_common_port/doc/doxygen.cfg b/drivers/usb/host/dwc_common_port/doc/doxygen.cfg -new file mode 100644 -index 0000000..605b9da ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/doc/doxygen.cfg +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/doc/doxygen.cfg linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/doc/doxygen.cfg +--- linux-3.6.1/drivers/usb/host/dwc_common_port/doc/doxygen.cfg 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/doc/doxygen.cfg 2012-11-11 18:15:16.989853018 +0100 @@ -0,0 +1,270 @@ +# Doxyfile 1.4.5 + @@ -24860,11 +26105,9 @@ index 0000000..605b9da +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO -diff --git a/drivers/usb/host/dwc_common_port/dwc_cc.c b/drivers/usb/host/dwc_common_port/dwc_cc.c -new file mode 100644 -index 0000000..613c901 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_cc.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_cc.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_cc.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_cc.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_cc.c 2012-11-11 18:15:16.991853057 +0100 @@ -0,0 +1,532 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_cc.c $ @@ -25398,11 +26641,9 @@ index 0000000..613c901 +} + +#endif /* DWC_CCLIB */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_cc.h b/drivers/usb/host/dwc_common_port/dwc_cc.h -new file mode 100644 -index 0000000..6b2bbaf ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_cc.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_cc.h linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_cc.h +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_cc.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_cc.h 2012-11-11 18:15:16.993853095 +0100 @@ -0,0 +1,225 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_cc.h $ @@ -25629,11 +26870,9 @@ index 0000000..6b2bbaf + +#endif /* _DWC_CC_H_ */ + -diff --git a/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c b/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c -new file mode 100644 -index 0000000..6dd04b5 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_common_fbsd.c 2012-11-11 18:15:16.988852998 +0100 @@ -0,0 +1,1308 @@ +#include "dwc_os.h" +#include "dwc_list.h" @@ -26943,11 +28182,9 @@ index 0000000..6dd04b5 +{ + return wq->pending; +} -diff --git a/drivers/usb/host/dwc_common_port/dwc_common_linux.c b/drivers/usb/host/dwc_common_port/dwc_common_linux.c -new file mode 100644 -index 0000000..f00a9ff ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_common_linux.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_common_linux.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_common_linux.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_common_linux.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_common_linux.c 2012-11-11 18:15:16.987852978 +0100 @@ -0,0 +1,1421 @@ +#include +#include @@ -28370,11 +29607,9 @@ index 0000000..f00a9ff +MODULE_LICENSE ("GPL"); + +#endif /* DWC_LIBMODULE */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c b/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c -new file mode 100644 -index 0000000..49b07e1 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_common_nbsd.c 2012-11-11 18:15:16.987852978 +0100 @@ -0,0 +1,1275 @@ +#include "dwc_os.h" +#include "dwc_list.h" @@ -29651,11 +30886,9 @@ index 0000000..49b07e1 +{ + return wq->pending; +} -diff --git a/drivers/usb/host/dwc_common_port/dwc_crypto.c b/drivers/usb/host/dwc_common_port/dwc_crypto.c -new file mode 100644 -index 0000000..3b03532 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_crypto.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_crypto.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_crypto.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_crypto.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_crypto.c 2012-11-11 18:15:16.987852978 +0100 @@ -0,0 +1,308 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_crypto.c $ @@ -29965,11 +31198,9 @@ index 0000000..3b03532 +} + +#endif /* DWC_CRYPTOLIB */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_crypto.h b/drivers/usb/host/dwc_common_port/dwc_crypto.h -new file mode 100644 -index 0000000..26fcddc ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_crypto.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_crypto.h linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_crypto.h +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_crypto.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_crypto.h 2012-11-11 18:15:16.989853018 +0100 @@ -0,0 +1,111 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_crypto.h $ @@ -30082,11 +31313,9 @@ index 0000000..26fcddc +#endif + +#endif /* _DWC_CRYPTO_H_ */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_dh.c b/drivers/usb/host/dwc_common_port/dwc_dh.c -new file mode 100644 -index 0000000..997f753 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_dh.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_dh.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_dh.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_dh.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_dh.c 2012-11-11 18:15:16.993853095 +0100 @@ -0,0 +1,291 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_dh.c $ @@ -30379,11 +31608,9 @@ index 0000000..997f753 +#endif /* !CONFIG_MACH_IPMATE */ + +#endif /* DWC_CRYPTOLIB */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_dh.h b/drivers/usb/host/dwc_common_port/dwc_dh.h -new file mode 100644 -index 0000000..25c1cc0 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_dh.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_dh.h linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_dh.h +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_dh.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_dh.h 2012-11-11 18:15:16.988852998 +0100 @@ -0,0 +1,106 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_dh.h $ @@ -30491,11 +31718,9 @@ index 0000000..25c1cc0 +#endif + +#endif /* _DWC_DH_H_ */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_list.h b/drivers/usb/host/dwc_common_port/dwc_list.h -new file mode 100644 -index 0000000..89cc325 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_list.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_list.h linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_list.h +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_list.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_list.h 2012-11-11 18:15:16.993853095 +0100 @@ -0,0 +1,594 @@ +/* $OpenBSD: queue.h,v 1.26 2004/05/04 16:59:32 grange Exp $ */ +/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ @@ -31091,11 +32316,9 @@ index 0000000..89cc325 +#endif + +#endif /* _DWC_LIST_H_ */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_mem.c b/drivers/usb/host/dwc_common_port/dwc_mem.c -new file mode 100644 -index 0000000..ad645ff ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_mem.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_mem.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_mem.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_mem.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_mem.c 2012-11-11 18:15:16.990853037 +0100 @@ -0,0 +1,245 @@ +/* Memory Debugging */ +#ifdef DWC_DEBUG_MEMORY @@ -31342,11 +32565,9 @@ index 0000000..ad645ff +} + +#endif /* DWC_DEBUG_MEMORY */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_modpow.c b/drivers/usb/host/dwc_common_port/dwc_modpow.c -new file mode 100644 -index 0000000..b7c456b ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_modpow.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_modpow.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_modpow.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_modpow.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_modpow.c 2012-11-11 18:15:16.994853115 +0100 @@ -0,0 +1,636 @@ +/* Bignum routines adapted from PUTTY sources. PuTTY copyright notice follows. + * @@ -31984,11 +33205,9 @@ index 0000000..b7c456b +#endif /* CONFIG_MACH_IPMATE */ + +#endif /*DWC_CRYPTOLIB */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_modpow.h b/drivers/usb/host/dwc_common_port/dwc_modpow.h -new file mode 100644 -index 0000000..64f00c2 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_modpow.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_modpow.h linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_modpow.h +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_modpow.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_modpow.h 2012-11-11 18:15:16.988852998 +0100 @@ -0,0 +1,34 @@ +/* + * dwc_modpow.h @@ -32024,11 +33243,9 @@ index 0000000..64f00c2 +#endif + +#endif /* _LINUX_BIGNUM_H */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_notifier.c b/drivers/usb/host/dwc_common_port/dwc_notifier.c -new file mode 100644 -index 0000000..8b3772a ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_notifier.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_notifier.c linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_notifier.c +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_notifier.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_notifier.c 2012-11-11 18:15:16.990853037 +0100 @@ -0,0 +1,319 @@ +#ifdef DWC_NOTIFYLIB + @@ -32349,11 +33566,9 @@ index 0000000..8b3772a +} + +#endif /* DWC_NOTIFYLIB */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_notifier.h b/drivers/usb/host/dwc_common_port/dwc_notifier.h -new file mode 100644 -index 0000000..4a8cdfe ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_notifier.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_notifier.h linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_notifier.h +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_notifier.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_notifier.h 2012-11-11 18:15:16.992853076 +0100 @@ -0,0 +1,122 @@ + +#ifndef __DWC_NOTIFIER_H__ @@ -32477,11 +33692,9 @@ index 0000000..4a8cdfe +#endif + +#endif /* __DWC_NOTIFIER_H__ */ -diff --git a/drivers/usb/host/dwc_common_port/dwc_os.h b/drivers/usb/host/dwc_common_port/dwc_os.h -new file mode 100644 -index 0000000..308ddd5 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/dwc_os.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_os.h linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_os.h +--- linux-3.6.1/drivers/usb/host/dwc_common_port/dwc_os.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/dwc_os.h 2012-11-11 18:15:16.991853057 +0100 @@ -0,0 +1,1260 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port_2/dwc_os.h $ @@ -33743,11 +34956,145 @@ index 0000000..308ddd5 +#endif + +#endif /* _DWC_OS_H_ */ -diff --git a/drivers/usb/host/dwc_common_port/usb.h b/drivers/usb/host/dwc_common_port/usb.h -new file mode 100644 -index 0000000..27bda82 ---- /dev/null -+++ b/drivers/usb/host/dwc_common_port/usb.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/Makefile linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/Makefile +--- linux-3.6.1/drivers/usb/host/dwc_common_port/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/Makefile 2012-11-11 18:15:16.993853095 +0100 +@@ -0,0 +1,58 @@ ++# ++# Makefile for DWC_common library ++# ++ ++ifneq ($(KERNELRELEASE),) ++ ++EXTRA_CFLAGS += -DDWC_LINUX ++#EXTRA_CFLAGS += -DDEBUG ++#EXTRA_CFLAGS += -DDWC_DEBUG_REGS ++#EXTRA_CFLAGS += -DDWC_DEBUG_MEMORY ++ ++EXTRA_CFLAGS += -DDWC_LIBMODULE ++EXTRA_CFLAGS += -DDWC_CCLIB ++#EXTRA_CFLAGS += -DDWC_CRYPTOLIB ++EXTRA_CFLAGS += -DDWC_NOTIFYLIB ++EXTRA_CFLAGS += -DDWC_UTFLIB ++ ++obj-$(CONFIG_USB_DWCOTG) += dwc_common_port_lib.o ++dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \ ++ dwc_crypto.o dwc_notifier.o \ ++ dwc_common_linux.o dwc_mem.o ++ ++kernrelwd := $(subst ., ,$(KERNELRELEASE)) ++kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd)) ++ ++ifneq ($(kernrel3),2.6.20) ++# grayg - I only know that we use EXTRA_CFLAGS in 2.6.31 actually ++EXTRA_CFLAGS += $(CPPFLAGS) ++endif ++ ++else ++ ++#ifeq ($(KDIR),) ++#$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment) ++#endif ++ ++ifeq ($(ARCH),) ++$(error Must give "ARCH=" on command line or in environment. Also, if \ ++ cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-") ++endif ++ ++ifeq ($(DOXYGEN),) ++DOXYGEN := doxygen ++endif ++ ++default: ++ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules ++ ++docs: $(wildcard *.[hc]) doc/doxygen.cfg ++ $(DOXYGEN) doc/doxygen.cfg ++ ++tags: $(wildcard *.[hc]) ++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) ++ ++endif ++ ++clean: ++ rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/ +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/Makefile.fbsd linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/Makefile.fbsd +--- linux-3.6.1/drivers/usb/host/dwc_common_port/Makefile.fbsd 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/Makefile.fbsd 2012-11-11 18:15:16.992853076 +0100 +@@ -0,0 +1,17 @@ ++CFLAGS += -I/sys/i386/compile/GENERIC -I/sys/i386/include -I/usr/include ++CFLAGS += -DDWC_FREEBSD ++CFLAGS += -DDEBUG ++#CFLAGS += -DDWC_DEBUG_REGS ++#CFLAGS += -DDWC_DEBUG_MEMORY ++ ++#CFLAGS += -DDWC_LIBMODULE ++#CFLAGS += -DDWC_CCLIB ++#CFLAGS += -DDWC_CRYPTOLIB ++#CFLAGS += -DDWC_NOTIFYLIB ++#CFLAGS += -DDWC_UTFLIB ++ ++KMOD = dwc_common_port_lib ++SRCS = dwc_cc.c dwc_modpow.c dwc_dh.c dwc_crypto.c dwc_notifier.c \ ++ dwc_common_fbsd.c dwc_mem.c ++ ++.include +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/Makefile.linux linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/Makefile.linux +--- linux-3.6.1/drivers/usb/host/dwc_common_port/Makefile.linux 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/Makefile.linux 2012-11-11 18:15:16.990853037 +0100 +@@ -0,0 +1,49 @@ ++# ++# Makefile for DWC_common library ++# ++ifneq ($(KERNELRELEASE),) ++ ++EXTRA_CFLAGS += -DDWC_LINUX ++#EXTRA_CFLAGS += -DDEBUG ++#EXTRA_CFLAGS += -DDWC_DEBUG_REGS ++#EXTRA_CFLAGS += -DDWC_DEBUG_MEMORY ++ ++EXTRA_CFLAGS += -DDWC_LIBMODULE ++EXTRA_CFLAGS += -DDWC_CCLIB ++EXTRA_CFLAGS += -DDWC_CRYPTOLIB ++EXTRA_CFLAGS += -DDWC_NOTIFYLIB ++EXTRA_CFLAGS += -DDWC_UTFLIB ++ ++obj-m := dwc_common_port_lib.o ++dwc_common_port_lib-objs := dwc_cc.o dwc_modpow.o dwc_dh.o \ ++ dwc_crypto.o dwc_notifier.o \ ++ dwc_common_linux.o dwc_mem.o ++ ++else ++ ++ifeq ($(KDIR),) ++$(error Must give "KDIR=/path/to/kernel/source" on command line or in environment) ++endif ++ ++ifeq ($(ARCH),) ++$(error Must give "ARCH=" on command line or in environment. Also, if \ ++ cross-compiling, must give "CROSS_COMPILE=/path/to/compiler/plus/tool-prefix-") ++endif ++ ++ifeq ($(DOXYGEN),) ++DOXYGEN := doxygen ++endif ++ ++default: ++ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules ++ ++docs: $(wildcard *.[hc]) doc/doxygen.cfg ++ $(DOXYGEN) doc/doxygen.cfg ++ ++tags: $(wildcard *.[hc]) ++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) ++ ++endif ++ ++clean: ++ rm -rf *.o *.ko .*.cmd *.mod.c .*.o.d .*.o.tmp modules.order Module.markers Module.symvers .tmp_versions/ +diff -Naur linux-3.6.1/drivers/usb/host/dwc_common_port/usb.h linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/usb.h +--- linux-3.6.1/drivers/usb/host/dwc_common_port/usb.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_common_port/usb.h 2012-11-11 18:15:16.992853076 +0100 @@ -0,0 +1,946 @@ +/* + * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -34695,98 +36042,9 @@ index 0000000..27bda82 +#endif + +#endif /* _USB_H_ */ -diff --git a/drivers/usb/host/dwc_otg/Makefile b/drivers/usb/host/dwc_otg/Makefile -new file mode 100644 -index 0000000..6bd6a2e ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/Makefile -@@ -0,0 +1,81 @@ -+# -+# Makefile for DWC_otg Highspeed USB controller driver -+# -+ -+ifneq ($(KERNELRELEASE),) -+ -+# Use the BUS_INTERFACE variable to compile the software for either -+# PCI(PCI_INTERFACE) or LM(LM_INTERFACE) bus. -+ifeq ($(BUS_INTERFACE),) -+# BUS_INTERFACE = -DPCI_INTERFACE -+# BUS_INTERFACE = -DLM_INTERFACE -+ BUS_INTERFACE = -DPLATFORM_INTERFACE -+endif -+ -+#EXTRA_CFLAGS += -DDEBUG -+#EXTRA_CFLAGS += -DDWC_OTG_DEBUGLEV=1 # reduce common debug msgs -+ -+# Use one of the following flags to compile the software in host-only or -+# device-only mode. -+#EXTRA_CFLAGS += -DDWC_HOST_ONLY -+#EXTRA_CFLAGS += -DDWC_DEVICE_ONLY -+ -+EXTRA_CFLAGS += -Dlinux -DDWC_HS_ELECT_TST -+#EXTRA_CFLAGS += -DDWC_EN_ISOC -+EXTRA_CFLAGS += -I$(obj)/../dwc_common_port -+#EXTRA_CFLAGS += -I$(PORTLIB) -+EXTRA_CFLAGS += -DDWC_LINUX -+EXTRA_CFLAGS += $(CFI) -+EXTRA_CFLAGS += $(BUS_INTERFACE) -+#EXTRA_CFLAGS += -DDWC_DEV_SRPCAP -+ -+obj-$(CONFIG_USB_DWCOTG) += dwc_otg.o -+ -+dwc_otg-objs := dwc_otg_driver.o dwc_otg_attr.o -+dwc_otg-objs += dwc_otg_cil.o dwc_otg_cil_intr.o -+dwc_otg-objs += dwc_otg_pcd_linux.o dwc_otg_pcd.o dwc_otg_pcd_intr.o -+dwc_otg-objs += dwc_otg_hcd.o dwc_otg_hcd_linux.o dwc_otg_hcd_intr.o dwc_otg_hcd_queue.o dwc_otg_hcd_ddma.o -+dwc_otg-objs += dwc_otg_adp.o -+dwc_otg-objs += dwc_otg_mphi_fix.o -+ifneq ($(CFI),) -+dwc_otg-objs += dwc_otg_cfi.o -+endif -+ -+kernrelwd := $(subst ., ,$(KERNELRELEASE)) -+kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd)) -+ -+ifneq ($(kernrel3),2.6.20) -+EXTRA_CFLAGS += $(CPPFLAGS) -+endif -+ -+else -+ -+PWD := $(shell pwd) -+PORTLIB := $(PWD)/../dwc_common_port -+ -+# Command paths -+CTAGS := $(CTAGS) -+DOXYGEN := $(DOXYGEN) -+ -+default: portlib -+ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules -+ -+install: default -+ $(MAKE) -C$(KDIR) M=$(PORTLIB) modules_install -+ $(MAKE) -C$(KDIR) M=$(PWD) modules_install -+ -+portlib: -+ $(MAKE) -C$(KDIR) M=$(PORTLIB) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules -+ cp $(PORTLIB)/Module.symvers $(PWD)/ -+ -+docs: $(wildcard *.[hc]) doc/doxygen.cfg -+ $(DOXYGEN) doc/doxygen.cfg -+ -+tags: $(wildcard *.[hc]) -+ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) -+ -+ -+clean: -+ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers -+ -+endif -diff --git a/drivers/usb/host/dwc_otg/doc/doxygen.cfg b/drivers/usb/host/dwc_otg/doc/doxygen.cfg -new file mode 100644 -index 0000000..537c676 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/doc/doxygen.cfg +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/doc/doxygen.cfg linux-rpi-3.6.y/drivers/usb/host/dwc_otg/doc/doxygen.cfg +--- linux-3.6.1/drivers/usb/host/dwc_otg/doc/doxygen.cfg 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/doc/doxygen.cfg 2012-11-11 18:15:17.040854016 +0100 @@ -0,0 +1,224 @@ +# Doxyfile 1.3.9.1 + @@ -35012,11 +36270,9 @@ index 0000000..537c676 +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO -diff --git a/drivers/usb/host/dwc_otg/dummy_audio.c b/drivers/usb/host/dwc_otg/dummy_audio.c -new file mode 100644 -index 0000000..530ac8b ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dummy_audio.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dummy_audio.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dummy_audio.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dummy_audio.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dummy_audio.c 2012-11-11 18:15:17.058854369 +0100 @@ -0,0 +1,1575 @@ +/* + * zero.c -- Gadget Zero, for USB development @@ -36593,11 +37849,9 @@ index 0000000..530ac8b + remove_proc_entry("isoc_test", NULL); +} +module_exit (cleanup); -diff --git a/drivers/usb/host/dwc_otg/dwc_cfi_common.h b/drivers/usb/host/dwc_otg/dwc_cfi_common.h -new file mode 100644 -index 0000000..be56af4 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_cfi_common.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_cfi_common.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_cfi_common.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_cfi_common.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_cfi_common.h 2012-11-11 18:15:17.041854036 +0100 @@ -0,0 +1,142 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -36741,11 +37995,9 @@ index 0000000..be56af4 +typedef struct cfi_string cfi_string_t; + +#endif -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_adp.c b/drivers/usb/host/dwc_otg/dwc_otg_adp.c -new file mode 100644 -index 0000000..0877472 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_adp.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_adp.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_adp.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_adp.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_adp.c 2012-11-11 18:15:17.054854290 +0100 @@ -0,0 +1,854 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_adp.c $ @@ -37601,11 +38853,9 @@ index 0000000..0877472 +#endif + return 1; +} -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_adp.h b/drivers/usb/host/dwc_otg/dwc_otg_adp.h -new file mode 100644 -index 0000000..d8c3f85 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_adp.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_adp.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_adp.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_adp.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_adp.h 2012-11-11 18:15:17.045854114 +0100 @@ -0,0 +1,80 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_adp.h $ @@ -37687,11 +38937,9 @@ index 0000000..d8c3f85 +extern int32_t dwc_otg_adp_handle_srp_intr(dwc_otg_core_if_t * core_if); + +#endif //__DWC_OTG_ADP_H__ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_attr.c b/drivers/usb/host/dwc_otg/dwc_otg_attr.c -new file mode 100644 -index 0000000..95eb7f8 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_attr.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_attr.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_attr.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_attr.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_attr.c 2012-11-11 18:15:17.057854349 +0100 @@ -0,0 +1,1210 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.c $ @@ -38903,11 +40151,9 @@ index 0000000..95eb7f8 + device_remove_file(&dev->dev, &dev_attr_sleep_status); +#endif +} -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_attr.h b/drivers/usb/host/dwc_otg/dwc_otg_attr.h -new file mode 100644 -index 0000000..fc14d94 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_attr.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_attr.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_attr.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_attr.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_attr.h 2012-11-11 18:15:17.054854290 +0100 @@ -0,0 +1,89 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.h $ @@ -38998,11 +40244,9 @@ index 0000000..fc14d94 +#endif + ); +#endif -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cfi.c b/drivers/usb/host/dwc_otg/dwc_otg_cfi.c -new file mode 100644 -index 0000000..a9878d6 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_cfi.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cfi.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cfi.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 2012-11-11 18:15:17.052854251 +0100 @@ -0,0 +1,1876 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -40880,11 +42124,9 @@ index 0000000..a9878d6 +} + +#endif //DWC_UTE_CFI -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cfi.h b/drivers/usb/host/dwc_otg/dwc_otg_cfi.h -new file mode 100644 -index 0000000..cbccdab ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_cfi.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cfi.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cfi.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 2012-11-11 18:15:17.018853586 +0100 @@ -0,0 +1,320 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -41206,11 +42448,9 @@ index 0000000..cbccdab +int cfi_setup(struct dwc_otg_pcd *pcd, struct cfi_usb_ctrlrequest *ctrl); + +#endif /* (__DWC_OTG_CFI_H__) */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil.c b/drivers/usb/host/dwc_otg/dwc_otg_cil.c -new file mode 100644 -index 0000000..9b67537 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_cil.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cil.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cil.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cil.c 2012-11-11 18:15:17.056854329 +0100 @@ -0,0 +1,7151 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.c $ @@ -48363,11 +49603,9 @@ index 0000000..9b67537 + dwc_otg_pcd_start_srp_timer(core_if); + return; +} -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil.h b/drivers/usb/host/dwc_otg/dwc_otg_cil.h -new file mode 100644 -index 0000000..d367cd1 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_cil.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cil.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cil.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cil.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cil.h 2012-11-11 18:15:17.041854036 +0100 @@ -0,0 +1,1464 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.h $ @@ -49833,11 +51071,9 @@ index 0000000..d367cd1 +////////////////////////////////////////////////////////////////////// + +#endif -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c -new file mode 100644 -index 0000000..b861b55 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 2012-11-11 18:15:17.033853879 +0100 @@ -0,0 +1,1571 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil_intr.c $ @@ -51410,11 +52646,9 @@ index 0000000..b861b55 + + return retval; +} -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_core_if.h b/drivers/usb/host/dwc_otg/dwc_otg_core_if.h -new file mode 100644 -index 0000000..10b68c4 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_core_if.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_core_if.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_core_if.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 2012-11-11 18:15:17.059854389 +0100 @@ -0,0 +1,705 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_core_if.h $ @@ -52121,11 +53355,9 @@ index 0000000..10b68c4 +/** @} */ + +#endif /* __DWC_CORE_IF_H__ */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_dbg.h b/drivers/usb/host/dwc_otg/dwc_otg_dbg.h -new file mode 100644 -index 0000000..2ff1532 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_dbg.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_dbg.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_dbg.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 2012-11-11 18:15:17.046854134 +0100 @@ -0,0 +1,117 @@ +/* ========================================================================== + * @@ -52244,11 +53476,9 @@ index 0000000..2ff1532 + +#endif /*DEBUG*/ +#endif -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c -new file mode 100644 -index 0000000..d5d8c4b ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_driver.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_driver.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_driver.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_driver.c 2012-11-11 18:15:17.042854055 +0100 @@ -0,0 +1,1732 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.c $ @@ -53982,11 +55212,9 @@ index 0000000..d5d8c4b + + +*/ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.h b/drivers/usb/host/dwc_otg/dwc_otg_driver.h -new file mode 100644 -index 0000000..8a0e41b ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_driver.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_driver.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_driver.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_driver.h 2012-11-11 18:15:17.033853879 +0100 @@ -0,0 +1,86 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.h $ @@ -54074,11 +55302,9 @@ index 0000000..8a0e41b +#endif + +#endif -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -new file mode 100644 -index 0000000..2b7945a ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 2012-11-11 18:15:17.060854408 +0100 @@ -0,0 +1,3498 @@ + +/* ========================================================================== @@ -57578,846 +58804,9 @@ index 0000000..2b7945a +} + +#endif /* DWC_DEVICE_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -new file mode 100644 -index 0000000..45e44ea ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -@@ -0,0 +1,829 @@ -+/* ========================================================================== -+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $ -+ * $Revision: #58 $ -+ * $Date: 2011/09/15 $ -+ * $Change: 1846647 $ -+ * -+ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, -+ * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless -+ * otherwise expressly agreed to in writing between Synopsys and you. -+ * -+ * The Software IS NOT an item of Licensed Software or Licensed Product under -+ * any End User Software License Agreement or Agreement for Licensed Product -+ * with Synopsys or any supplement thereto. You are permitted to use and -+ * redistribute this Software in source and binary forms, with or without -+ * modification, provided that redistributions of source code must retain this -+ * notice. You may not view, use, disclose, copy or distribute this file or -+ * any information contained herein except pursuant to this license grant from -+ * Synopsys. If you do not agree with this notice, including the disclaimer -+ * below, then you are not authorized to use the Software. -+ * -+ * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS -+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT, -+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -+ * DAMAGE. -+ * ========================================================================== */ -+#ifndef DWC_DEVICE_ONLY -+#ifndef __DWC_HCD_H__ -+#define __DWC_HCD_H__ -+ -+#include "dwc_otg_os_dep.h" -+#include "usb.h" -+#include "dwc_otg_hcd_if.h" -+#include "dwc_otg_core_if.h" -+#include "dwc_list.h" -+#include "dwc_otg_cil.h" -+ -+/** -+ * @file -+ * -+ * This file contains the structures, constants, and interfaces for -+ * the Host Contoller Driver (HCD). -+ * -+ * The Host Controller Driver (HCD) is responsible for translating requests -+ * from the USB Driver into the appropriate actions on the DWC_otg controller. -+ * It isolates the USBD from the specifics of the controller by providing an -+ * API to the USBD. -+ */ -+ -+struct dwc_otg_hcd_pipe_info { -+ uint8_t dev_addr; -+ uint8_t ep_num; -+ uint8_t pipe_type; -+ uint8_t pipe_dir; -+ uint16_t mps; -+}; -+ -+struct dwc_otg_hcd_iso_packet_desc { -+ uint32_t offset; -+ uint32_t length; -+ uint32_t actual_length; -+ uint32_t status; -+}; -+ -+struct dwc_otg_qtd; -+ -+struct dwc_otg_hcd_urb { -+ void *priv; -+ struct dwc_otg_qtd *qtd; -+ void *buf; -+ dwc_dma_t dma; -+ void *setup_packet; -+ dwc_dma_t setup_dma; -+ uint32_t length; -+ uint32_t actual_length; -+ uint32_t status; -+ uint32_t error_count; -+ uint32_t packet_count; -+ uint32_t flags; -+ uint16_t interval; -+ struct dwc_otg_hcd_pipe_info pipe_info; -+ struct dwc_otg_hcd_iso_packet_desc iso_descs[0]; -+}; -+ -+static inline uint8_t dwc_otg_hcd_get_ep_num(struct dwc_otg_hcd_pipe_info *pipe) -+{ -+ return pipe->ep_num; -+} -+ -+static inline uint8_t dwc_otg_hcd_get_pipe_type(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return pipe->pipe_type; -+} -+ -+static inline uint16_t dwc_otg_hcd_get_mps(struct dwc_otg_hcd_pipe_info *pipe) -+{ -+ return pipe->mps; -+} -+ -+static inline uint8_t dwc_otg_hcd_get_dev_addr(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return pipe->dev_addr; -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_isoc(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (pipe->pipe_type == UE_ISOCHRONOUS); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_int(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (pipe->pipe_type == UE_INTERRUPT); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_bulk(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (pipe->pipe_type == UE_BULK); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_control(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (pipe->pipe_type == UE_CONTROL); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_in(struct dwc_otg_hcd_pipe_info *pipe) -+{ -+ return (pipe->pipe_dir == UE_DIR_IN); -+} -+ -+static inline uint8_t dwc_otg_hcd_is_pipe_out(struct dwc_otg_hcd_pipe_info -+ *pipe) -+{ -+ return (!dwc_otg_hcd_is_pipe_in(pipe)); -+} -+ -+static inline void dwc_otg_hcd_fill_pipe(struct dwc_otg_hcd_pipe_info *pipe, -+ uint8_t devaddr, uint8_t ep_num, -+ uint8_t pipe_type, uint8_t pipe_dir, -+ uint16_t mps) -+{ -+ pipe->dev_addr = devaddr; -+ pipe->ep_num = ep_num; -+ pipe->pipe_type = pipe_type; -+ pipe->pipe_dir = pipe_dir; -+ pipe->mps = mps; -+} -+ -+/** -+ * Phases for control transfers. -+ */ -+typedef enum dwc_otg_control_phase { -+ DWC_OTG_CONTROL_SETUP, -+ DWC_OTG_CONTROL_DATA, -+ DWC_OTG_CONTROL_STATUS -+} dwc_otg_control_phase_e; -+ -+/** Transaction types. */ -+typedef enum dwc_otg_transaction_type { -+ DWC_OTG_TRANSACTION_NONE, -+ DWC_OTG_TRANSACTION_PERIODIC, -+ DWC_OTG_TRANSACTION_NON_PERIODIC, -+ DWC_OTG_TRANSACTION_ALL -+} dwc_otg_transaction_type_e; -+ -+struct dwc_otg_qh; -+ -+/** -+ * A Queue Transfer Descriptor (QTD) holds the state of a bulk, control, -+ * interrupt, or isochronous transfer. A single QTD is created for each URB -+ * (of one of these types) submitted to the HCD. The transfer associated with -+ * a QTD may require one or multiple transactions. -+ * -+ * A QTD is linked to a Queue Head, which is entered in either the -+ * non-periodic or periodic schedule for execution. When a QTD is chosen for -+ * execution, some or all of its transactions may be executed. After -+ * execution, the state of the QTD is updated. The QTD may be retired if all -+ * its transactions are complete or if an error occurred. Otherwise, it -+ * remains in the schedule so more transactions can be executed later. -+ */ -+typedef struct dwc_otg_qtd { -+ /** -+ * Determines the PID of the next data packet for the data phase of -+ * control transfers. Ignored for other transfer types.
-+ * One of the following values: -+ * - DWC_OTG_HC_PID_DATA0 -+ * - DWC_OTG_HC_PID_DATA1 -+ */ -+ uint8_t data_toggle; -+ -+ /** Current phase for control transfers (Setup, Data, or Status). */ -+ dwc_otg_control_phase_e control_phase; -+ -+ /** Keep track of the current split type -+ * for FS/LS endpoints on a HS Hub */ -+ uint8_t complete_split; -+ -+ /** How many bytes transferred during SSPLIT OUT */ -+ uint32_t ssplit_out_xfer_count; -+ -+ /** -+ * Holds the number of bus errors that have occurred for a transaction -+ * within this transfer. -+ */ -+ uint8_t error_count; -+ -+ /** -+ * Index of the next frame descriptor for an isochronous transfer. A -+ * frame descriptor describes the buffer position and length of the -+ * data to be transferred in the next scheduled (micro)frame of an -+ * isochronous transfer. It also holds status for that transaction. -+ * The frame index starts at 0. -+ */ -+ uint16_t isoc_frame_index; -+ -+ /** Position of the ISOC split on full/low speed */ -+ uint8_t isoc_split_pos; -+ -+ /** Position of the ISOC split in the buffer for the current frame */ -+ uint16_t isoc_split_offset; -+ -+ /** URB for this transfer */ -+ struct dwc_otg_hcd_urb *urb; -+ -+ struct dwc_otg_qh *qh; -+ -+ /** This list of QTDs */ -+ DWC_CIRCLEQ_ENTRY(dwc_otg_qtd) qtd_list_entry; -+ -+ /** Indicates if this QTD is currently processed by HW. */ -+ uint8_t in_process; -+ -+ /** Number of DMA descriptors for this QTD */ -+ uint8_t n_desc; -+ -+ /** -+ * Last activated frame(packet) index. -+ * Used in Descriptor DMA mode only. -+ */ -+ uint16_t isoc_frame_index_last; -+ -+} dwc_otg_qtd_t; -+ -+DWC_CIRCLEQ_HEAD(dwc_otg_qtd_list, dwc_otg_qtd); -+ -+/** -+ * A Queue Head (QH) holds the static characteristics of an endpoint and -+ * maintains a list of transfers (QTDs) for that endpoint. A QH structure may -+ * be entered in either the non-periodic or periodic schedule. -+ */ -+typedef struct dwc_otg_qh { -+ /** -+ * Endpoint type. -+ * One of the following values: -+ * - UE_CONTROL -+ * - UE_BULK -+ * - UE_INTERRUPT -+ * - UE_ISOCHRONOUS -+ */ -+ uint8_t ep_type; -+ uint8_t ep_is_in; -+ -+ /** wMaxPacketSize Field of Endpoint Descriptor. */ -+ uint16_t maxp; -+ -+ /** -+ * Device speed. -+ * One of the following values: -+ * - DWC_OTG_EP_SPEED_LOW -+ * - DWC_OTG_EP_SPEED_FULL -+ * - DWC_OTG_EP_SPEED_HIGH -+ */ -+ uint8_t dev_speed; -+ -+ /** -+ * Determines the PID of the next data packet for non-control -+ * transfers. Ignored for control transfers.
-+ * One of the following values: -+ * - DWC_OTG_HC_PID_DATA0 -+ * - DWC_OTG_HC_PID_DATA1 -+ */ -+ uint8_t data_toggle; -+ -+ /** Ping state if 1. */ -+ uint8_t ping_state; -+ -+ /** -+ * List of QTDs for this QH. -+ */ -+ struct dwc_otg_qtd_list qtd_list; -+ -+ /** Host channel currently processing transfers for this QH. */ -+ struct dwc_hc *channel; -+ -+ /** Full/low speed endpoint on high-speed hub requires split. */ -+ uint8_t do_split; -+ -+ /** @name Periodic schedule information */ -+ /** @{ */ -+ -+ /** Bandwidth in microseconds per (micro)frame. */ -+ uint16_t usecs; -+ -+ /** Interval between transfers in (micro)frames. */ -+ uint16_t interval; -+ -+ /** -+ * (micro)frame to initialize a periodic transfer. The transfer -+ * executes in the following (micro)frame. -+ */ -+ uint16_t sched_frame; -+ -+ /* -+ ** Frame a NAK was received on this queue head, used to minimise NAK retransmission -+ */ -+ uint16_t nak_frame; -+ -+ /** (micro)frame at which last start split was initialized. */ -+ uint16_t start_split_frame; -+ -+ /** @} */ -+ -+ /** -+ * Used instead of original buffer if -+ * it(physical address) is not dword-aligned. -+ */ -+ uint8_t *dw_align_buf; -+ dwc_dma_t dw_align_buf_dma; -+ -+ /** Entry for QH in either the periodic or non-periodic schedule. */ -+ dwc_list_link_t qh_list_entry; -+ -+ /** @name Descriptor DMA support */ -+ /** @{ */ -+ -+ /** Descriptor List. */ -+ dwc_otg_host_dma_desc_t *desc_list; -+ -+ /** Descriptor List physical address. */ -+ dwc_dma_t desc_list_dma; -+ -+ /** -+ * Xfer Bytes array. -+ * Each element corresponds to a descriptor and indicates -+ * original XferSize size value for the descriptor. -+ */ -+ uint32_t *n_bytes; -+ -+ /** Actual number of transfer descriptors in a list. */ -+ uint16_t ntd; -+ -+ /** First activated isochronous transfer descriptor index. */ -+ uint8_t td_first; -+ /** Last activated isochronous transfer descriptor index. */ -+ uint8_t td_last; -+ -+ /** @} */ -+ -+ -+ uint16_t speed; -+ uint16_t frame_usecs[8]; -+} dwc_otg_qh_t; -+ -+DWC_CIRCLEQ_HEAD(hc_list, dwc_hc); -+ -+/** -+ * This structure holds the state of the HCD, including the non-periodic and -+ * periodic schedules. -+ */ -+struct dwc_otg_hcd { -+ /** The DWC otg device pointer */ -+ struct dwc_otg_device *otg_dev; -+ /** DWC OTG Core Interface Layer */ -+ dwc_otg_core_if_t *core_if; -+ -+ /** Function HCD driver callbacks */ -+ struct dwc_otg_hcd_function_ops *fops; -+ -+ /** Internal DWC HCD Flags */ -+ volatile union dwc_otg_hcd_internal_flags { -+ uint32_t d32; -+ struct { -+ unsigned port_connect_status_change:1; -+ unsigned port_connect_status:1; -+ unsigned port_reset_change:1; -+ unsigned port_enable_change:1; -+ unsigned port_suspend_change:1; -+ unsigned port_over_current_change:1; -+ unsigned port_l1_change:1; -+ unsigned reserved:26; -+ } b; -+ } flags; -+ -+ /** -+ * Inactive items in the non-periodic schedule. This is a list of -+ * Queue Heads. Transfers associated with these Queue Heads are not -+ * currently assigned to a host channel. -+ */ -+ dwc_list_link_t non_periodic_sched_inactive; -+ -+ /** -+ * Active items in the non-periodic schedule. This is a list of -+ * Queue Heads. Transfers associated with these Queue Heads are -+ * currently assigned to a host channel. -+ */ -+ dwc_list_link_t non_periodic_sched_active; -+ -+ /** -+ * Pointer to the next Queue Head to process in the active -+ * non-periodic schedule. -+ */ -+ dwc_list_link_t *non_periodic_qh_ptr; -+ -+ /** -+ * Inactive items in the periodic schedule. This is a list of QHs for -+ * periodic transfers that are _not_ scheduled for the next frame. -+ * Each QH in the list has an interval counter that determines when it -+ * needs to be scheduled for execution. This scheduling mechanism -+ * allows only a simple calculation for periodic bandwidth used (i.e. -+ * must assume that all periodic transfers may need to execute in the -+ * same frame). However, it greatly simplifies scheduling and should -+ * be sufficient for the vast majority of OTG hosts, which need to -+ * connect to a small number of peripherals at one time. -+ * -+ * Items move from this list to periodic_sched_ready when the QH -+ * interval counter is 0 at SOF. -+ */ -+ dwc_list_link_t periodic_sched_inactive; -+ -+ /** -+ * List of periodic QHs that are ready for execution in the next -+ * frame, but have not yet been assigned to host channels. -+ * -+ * Items move from this list to periodic_sched_assigned as host -+ * channels become available during the current frame. -+ */ -+ dwc_list_link_t periodic_sched_ready; -+ -+ /** -+ * List of periodic QHs to be executed in the next frame that are -+ * assigned to host channels. -+ * -+ * Items move from this list to periodic_sched_queued as the -+ * transactions for the QH are queued to the DWC_otg controller. -+ */ -+ dwc_list_link_t periodic_sched_assigned; -+ -+ /** -+ * List of periodic QHs that have been queued for execution. -+ * -+ * Items move from this list to either periodic_sched_inactive or -+ * periodic_sched_ready when the channel associated with the transfer -+ * is released. If the interval for the QH is 1, the item moves to -+ * periodic_sched_ready because it must be rescheduled for the next -+ * frame. Otherwise, the item moves to periodic_sched_inactive. -+ */ -+ dwc_list_link_t periodic_sched_queued; -+ -+ /** -+ * Total bandwidth claimed so far for periodic transfers. This value -+ * is in microseconds per (micro)frame. The assumption is that all -+ * periodic transfers may occur in the same (micro)frame. -+ */ -+ uint16_t periodic_usecs; -+ -+ /** -+ * Total bandwidth claimed so far for all periodic transfers -+ * in a frame. -+ * This will include a mixture of HS and FS transfers. -+ * Units are microseconds per (micro)frame. -+ * We have a budget per frame and have to schedule -+ * transactions accordingly. -+ * Watch out for the fact that things are actually scheduled for the -+ * "next frame". -+ */ -+ uint16_t frame_usecs[8]; -+ -+ -+ /** -+ * Frame number read from the core at SOF. The value ranges from 0 to -+ * DWC_HFNUM_MAX_FRNUM. -+ */ -+ uint16_t frame_number; -+ -+ /** -+ * Count of periodic QHs, if using several eps. For SOF enable/disable. -+ */ -+ uint16_t periodic_qh_count; -+ -+ /** -+ * Free host channels in the controller. This is a list of -+ * dwc_hc_t items. -+ */ -+ struct hc_list free_hc_list; -+ /** -+ * Number of host channels assigned to periodic transfers. Currently -+ * assuming that there is a dedicated host channel for each periodic -+ * transaction and at least one host channel available for -+ * non-periodic transactions. -+ */ -+ int periodic_channels; /* microframe_schedule==0 */ -+ -+ /** -+ * Number of host channels assigned to non-periodic transfers. -+ */ -+ int non_periodic_channels; /* microframe_schedule==0 */ -+ -+ /** -+ * Number of host channels assigned to non-periodic transfers. -+ */ -+ int available_host_channels; -+ -+ /** -+ * Array of pointers to the host channel descriptors. Allows accessing -+ * a host channel descriptor given the host channel number. This is -+ * useful in interrupt handlers. -+ */ -+ struct dwc_hc *hc_ptr_array[MAX_EPS_CHANNELS]; -+ -+ /** -+ * Buffer to use for any data received during the status phase of a -+ * control transfer. Normally no data is transferred during the status -+ * phase. This buffer is used as a bit bucket. -+ */ -+ uint8_t *status_buf; -+ -+ /** -+ * DMA address for status_buf. -+ */ -+ dma_addr_t status_buf_dma; -+#define DWC_OTG_HCD_STATUS_BUF_SIZE 64 -+ -+ /** -+ * Connection timer. An OTG host must display a message if the device -+ * does not connect. Started when the VBus power is turned on via -+ * sysfs attribute "buspower". -+ */ -+ dwc_timer_t *conn_timer; -+ -+ /* Tasket to do a reset */ -+ dwc_tasklet_t *reset_tasklet; -+ -+ /* */ -+ dwc_spinlock_t *lock; -+ dwc_spinlock_t *channel_lock; -+ /** -+ * Private data that could be used by OS wrapper. -+ */ -+ void *priv; -+ -+ uint8_t otg_port; -+ -+ /** Frame List */ -+ uint32_t *frame_list; -+ -+ /** Frame List DMA address */ -+ dma_addr_t frame_list_dma; -+ -+#ifdef DEBUG -+ uint32_t frrem_samples; -+ uint64_t frrem_accum; -+ -+ uint32_t hfnum_7_samples_a; -+ uint64_t hfnum_7_frrem_accum_a; -+ uint32_t hfnum_0_samples_a; -+ uint64_t hfnum_0_frrem_accum_a; -+ uint32_t hfnum_other_samples_a; -+ uint64_t hfnum_other_frrem_accum_a; -+ -+ uint32_t hfnum_7_samples_b; -+ uint64_t hfnum_7_frrem_accum_b; -+ uint32_t hfnum_0_samples_b; -+ uint64_t hfnum_0_frrem_accum_b; -+ uint32_t hfnum_other_samples_b; -+ uint64_t hfnum_other_frrem_accum_b; -+#endif -+}; -+ -+/** @name Transaction Execution Functions */ -+/** @{ */ -+extern dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t -+ * hcd); -+extern void dwc_otg_hcd_queue_transactions(dwc_otg_hcd_t * hcd, -+ dwc_otg_transaction_type_e tr_type); -+ -+/** @} */ -+ -+/** @name Interrupt Handler Functions */ -+/** @{ */ -+extern int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * dwc_otg_hcd, int32_t); -+extern int32_t dwc_otg_hcd_handle_rx_status_q_level_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_np_tx_fifo_empty_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_perio_tx_fifo_empty_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_incomplete_periodic_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_conn_id_status_change_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_disconnect_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_hc_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, -+ uint32_t num); -+extern int32_t dwc_otg_hcd_handle_session_req_intr(dwc_otg_hcd_t * dwc_otg_hcd); -+extern int32_t dwc_otg_hcd_handle_wakeup_detected_intr(dwc_otg_hcd_t * -+ dwc_otg_hcd); -+/** @} */ -+ -+/** @name Schedule Queue Functions */ -+/** @{ */ -+ -+/* Implemented in dwc_otg_hcd_queue.c */ -+extern dwc_otg_qh_t *dwc_otg_hcd_qh_create(dwc_otg_hcd_t * hcd, -+ dwc_otg_hcd_urb_t * urb, int atomic_alloc); -+extern void dwc_otg_hcd_qh_free(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern void dwc_otg_hcd_qh_remove(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern void dwc_otg_hcd_qh_deactivate(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, -+ int sched_csplit); -+ -+/** Remove and free a QH */ -+static inline void dwc_otg_hcd_qh_remove_and_free(dwc_otg_hcd_t * hcd, -+ dwc_otg_qh_t * qh) -+{ -+ dwc_irqflags_t flags; -+ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); -+ dwc_otg_hcd_qh_remove(hcd, qh); -+ DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); -+ dwc_otg_hcd_qh_free(hcd, qh); -+} -+ -+/** Allocates memory for a QH structure. -+ * @return Returns the memory allocate or NULL on error. */ -+static inline dwc_otg_qh_t *dwc_otg_hcd_qh_alloc(int atomic_alloc) -+{ -+ if (atomic_alloc) -+ return (dwc_otg_qh_t *) DWC_ALLOC_ATOMIC(sizeof(dwc_otg_qh_t)); -+ else -+ return (dwc_otg_qh_t *) DWC_ALLOC(sizeof(dwc_otg_qh_t)); -+} -+ -+extern dwc_otg_qtd_t *dwc_otg_hcd_qtd_create(dwc_otg_hcd_urb_t * urb, -+ int atomic_alloc); -+extern void dwc_otg_hcd_qtd_init(dwc_otg_qtd_t * qtd, dwc_otg_hcd_urb_t * urb); -+extern int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd, dwc_otg_hcd_t * dwc_otg_hcd, -+ dwc_otg_qh_t ** qh, int atomic_alloc); -+ -+/** Allocates memory for a QTD structure. -+ * @return Returns the memory allocate or NULL on error. */ -+static inline dwc_otg_qtd_t *dwc_otg_hcd_qtd_alloc(int atomic_alloc) -+{ -+ if (atomic_alloc) -+ return (dwc_otg_qtd_t *) DWC_ALLOC_ATOMIC(sizeof(dwc_otg_qtd_t)); -+ else -+ return (dwc_otg_qtd_t *) DWC_ALLOC(sizeof(dwc_otg_qtd_t)); -+} -+ -+/** Frees the memory for a QTD structure. QTD should already be removed from -+ * list. -+ * @param qtd QTD to free.*/ -+static inline void dwc_otg_hcd_qtd_free(dwc_otg_qtd_t * qtd) -+{ -+ DWC_FREE(qtd); -+} -+ -+/** Removes a QTD from list. -+ * @param hcd HCD instance. -+ * @param qtd QTD to remove from list. -+ * @param qh QTD belongs to. -+ */ -+static inline void dwc_otg_hcd_qtd_remove(dwc_otg_hcd_t * hcd, -+ dwc_otg_qtd_t * qtd, -+ dwc_otg_qh_t * qh) -+{ -+ DWC_CIRCLEQ_REMOVE(&qh->qtd_list, qtd, qtd_list_entry); -+} -+ -+/** Remove and free a QTD -+ * Need to disable IRQ and hold hcd lock while calling this function out of -+ * interrupt servicing chain */ -+static inline void dwc_otg_hcd_qtd_remove_and_free(dwc_otg_hcd_t * hcd, -+ dwc_otg_qtd_t * qtd, -+ dwc_otg_qh_t * qh) -+{ -+ dwc_otg_hcd_qtd_remove(hcd, qtd, qh); -+ dwc_otg_hcd_qtd_free(qtd); -+} -+ -+/** @} */ -+ -+/** @name Descriptor DMA Supporting Functions */ -+/** @{ */ -+ -+extern void dwc_otg_hcd_start_xfer_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern void dwc_otg_hcd_complete_xfer_ddma(dwc_otg_hcd_t * hcd, -+ dwc_hc_t * hc, -+ dwc_otg_hc_regs_t * hc_regs, -+ dwc_otg_halt_status_e halt_status); -+ -+extern int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+extern void dwc_otg_hcd_qh_free_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); -+ -+/** @} */ -+ -+/** @name Internal Functions */ -+/** @{ */ -+dwc_otg_qh_t *dwc_urb_to_qh(dwc_otg_hcd_urb_t * urb); -+/** @} */ -+ -+#ifdef CONFIG_USB_DWC_OTG_LPM -+extern int dwc_otg_hcd_get_hc_for_lpm_tran(dwc_otg_hcd_t * hcd, -+ uint8_t devaddr); -+extern void dwc_otg_hcd_free_hc_from_lpm(dwc_otg_hcd_t * hcd); -+#endif -+ -+/** Gets the QH that contains the list_head */ -+#define dwc_list_to_qh(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qh_t, qh_list_entry) -+ -+/** Gets the QTD that contains the list_head */ -+#define dwc_list_to_qtd(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qtd_t, qtd_list_entry) -+ -+/** Check if QH is non-periodic */ -+#define dwc_qh_is_non_per(_qh_ptr_) ((_qh_ptr_->ep_type == UE_BULK) || \ -+ (_qh_ptr_->ep_type == UE_CONTROL)) -+ -+/** High bandwidth multiplier as encoded in highspeed endpoint descriptors */ -+#define dwc_hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03)) -+ -+/** Packet size for any kind of endpoint descriptor */ -+#define dwc_max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff) -+ -+/** -+ * Returns true if _frame1 is less than or equal to _frame2. The comparison is -+ * done modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the -+ * frame number when the max frame number is reached. -+ */ -+static inline int dwc_frame_num_le(uint16_t frame1, uint16_t frame2) -+{ -+ return ((frame2 - frame1) & DWC_HFNUM_MAX_FRNUM) <= -+ (DWC_HFNUM_MAX_FRNUM >> 1); -+} -+ -+/** -+ * Returns true if _frame1 is greater than _frame2. The comparison is done -+ * modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the frame -+ * number when the max frame number is reached. -+ */ -+static inline int dwc_frame_num_gt(uint16_t frame1, uint16_t frame2) -+{ -+ return (frame1 != frame2) && -+ (((frame1 - frame2) & DWC_HFNUM_MAX_FRNUM) < -+ (DWC_HFNUM_MAX_FRNUM >> 1)); -+} -+ -+/** -+ * Increments _frame by the amount specified by _inc. The addition is done -+ * modulo DWC_HFNUM_MAX_FRNUM. Returns the incremented value. -+ */ -+static inline uint16_t dwc_frame_num_inc(uint16_t frame, uint16_t inc) -+{ -+ return (frame + inc) & DWC_HFNUM_MAX_FRNUM; -+} -+ -+static inline uint16_t dwc_full_frame_num(uint16_t frame) -+{ -+ return (frame & DWC_HFNUM_MAX_FRNUM) >> 3; -+} -+ -+static inline uint16_t dwc_micro_frame_num(uint16_t frame) -+{ -+ return frame & 0x7; -+} -+ -+void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc, -+ dwc_otg_hc_regs_t * hc_regs, -+ dwc_otg_qtd_t * qtd); -+ -+#ifdef DEBUG -+/** -+ * Macro to sample the remaining PHY clocks left in the current frame. This -+ * may be used during debugging to determine the average time it takes to -+ * execute sections of code. There are two possible sample points, "a" and -+ * "b", so the _letter argument must be one of these values. -+ * -+ * To dump the average sample times, read the "hcd_frrem" sysfs attribute. For -+ * example, "cat /sys/devices/lm0/hcd_frrem". -+ */ -+#define dwc_sample_frrem(_hcd, _qh, _letter) \ -+{ \ -+ hfnum_data_t hfnum; \ -+ dwc_otg_qtd_t *qtd; \ -+ qtd = list_entry(_qh->qtd_list.next, dwc_otg_qtd_t, qtd_list_entry); \ -+ if (usb_pipeint(qtd->urb->pipe) && _qh->start_split_frame != 0 && !qtd->complete_split) { \ -+ hfnum.d32 = DWC_READ_REG32(&_hcd->core_if->host_if->host_global_regs->hfnum); \ -+ switch (hfnum.b.frnum & 0x7) { \ -+ case 7: \ -+ _hcd->hfnum_7_samples_##_letter++; \ -+ _hcd->hfnum_7_frrem_accum_##_letter += hfnum.b.frrem; \ -+ break; \ -+ case 0: \ -+ _hcd->hfnum_0_samples_##_letter++; \ -+ _hcd->hfnum_0_frrem_accum_##_letter += hfnum.b.frrem; \ -+ break; \ -+ default: \ -+ _hcd->hfnum_other_samples_##_letter++; \ -+ _hcd->hfnum_other_frrem_accum_##_letter += hfnum.b.frrem; \ -+ break; \ -+ } \ -+ } \ -+} -+#else -+#define dwc_sample_frrem(_hcd, _qh, _letter) -+#endif -+#endif -+#endif /* DWC_DEVICE_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c -new file mode 100644 -index 0000000..a2ceb77 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 2012-11-11 18:15:17.046854134 +0100 @@ -0,0 +1,1132 @@ +/*========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_ddma.c $ @@ -59551,11 +59940,842 @@ index 0000000..a2ceb77 +} + +#endif /* DWC_DEVICE_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h -new file mode 100644 -index 0000000..04ca4c2 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 2012-11-11 18:15:17.057854349 +0100 +@@ -0,0 +1,829 @@ ++/* ========================================================================== ++ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $ ++ * $Revision: #58 $ ++ * $Date: 2011/09/15 $ ++ * $Change: 1846647 $ ++ * ++ * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, ++ * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless ++ * otherwise expressly agreed to in writing between Synopsys and you. ++ * ++ * The Software IS NOT an item of Licensed Software or Licensed Product under ++ * any End User Software License Agreement or Agreement for Licensed Product ++ * with Synopsys or any supplement thereto. You are permitted to use and ++ * redistribute this Software in source and binary forms, with or without ++ * modification, provided that redistributions of source code must retain this ++ * notice. You may not view, use, disclose, copy or distribute this file or ++ * any information contained herein except pursuant to this license grant from ++ * Synopsys. If you do not agree with this notice, including the disclaimer ++ * below, then you are not authorized to use the Software. ++ * ++ * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS ++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT, ++ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ++ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR ++ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER ++ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH ++ * DAMAGE. ++ * ========================================================================== */ ++#ifndef DWC_DEVICE_ONLY ++#ifndef __DWC_HCD_H__ ++#define __DWC_HCD_H__ ++ ++#include "dwc_otg_os_dep.h" ++#include "usb.h" ++#include "dwc_otg_hcd_if.h" ++#include "dwc_otg_core_if.h" ++#include "dwc_list.h" ++#include "dwc_otg_cil.h" ++ ++/** ++ * @file ++ * ++ * This file contains the structures, constants, and interfaces for ++ * the Host Contoller Driver (HCD). ++ * ++ * The Host Controller Driver (HCD) is responsible for translating requests ++ * from the USB Driver into the appropriate actions on the DWC_otg controller. ++ * It isolates the USBD from the specifics of the controller by providing an ++ * API to the USBD. ++ */ ++ ++struct dwc_otg_hcd_pipe_info { ++ uint8_t dev_addr; ++ uint8_t ep_num; ++ uint8_t pipe_type; ++ uint8_t pipe_dir; ++ uint16_t mps; ++}; ++ ++struct dwc_otg_hcd_iso_packet_desc { ++ uint32_t offset; ++ uint32_t length; ++ uint32_t actual_length; ++ uint32_t status; ++}; ++ ++struct dwc_otg_qtd; ++ ++struct dwc_otg_hcd_urb { ++ void *priv; ++ struct dwc_otg_qtd *qtd; ++ void *buf; ++ dwc_dma_t dma; ++ void *setup_packet; ++ dwc_dma_t setup_dma; ++ uint32_t length; ++ uint32_t actual_length; ++ uint32_t status; ++ uint32_t error_count; ++ uint32_t packet_count; ++ uint32_t flags; ++ uint16_t interval; ++ struct dwc_otg_hcd_pipe_info pipe_info; ++ struct dwc_otg_hcd_iso_packet_desc iso_descs[0]; ++}; ++ ++static inline uint8_t dwc_otg_hcd_get_ep_num(struct dwc_otg_hcd_pipe_info *pipe) ++{ ++ return pipe->ep_num; ++} ++ ++static inline uint8_t dwc_otg_hcd_get_pipe_type(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return pipe->pipe_type; ++} ++ ++static inline uint16_t dwc_otg_hcd_get_mps(struct dwc_otg_hcd_pipe_info *pipe) ++{ ++ return pipe->mps; ++} ++ ++static inline uint8_t dwc_otg_hcd_get_dev_addr(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return pipe->dev_addr; ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_isoc(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (pipe->pipe_type == UE_ISOCHRONOUS); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_int(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (pipe->pipe_type == UE_INTERRUPT); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_bulk(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (pipe->pipe_type == UE_BULK); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_control(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (pipe->pipe_type == UE_CONTROL); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_in(struct dwc_otg_hcd_pipe_info *pipe) ++{ ++ return (pipe->pipe_dir == UE_DIR_IN); ++} ++ ++static inline uint8_t dwc_otg_hcd_is_pipe_out(struct dwc_otg_hcd_pipe_info ++ *pipe) ++{ ++ return (!dwc_otg_hcd_is_pipe_in(pipe)); ++} ++ ++static inline void dwc_otg_hcd_fill_pipe(struct dwc_otg_hcd_pipe_info *pipe, ++ uint8_t devaddr, uint8_t ep_num, ++ uint8_t pipe_type, uint8_t pipe_dir, ++ uint16_t mps) ++{ ++ pipe->dev_addr = devaddr; ++ pipe->ep_num = ep_num; ++ pipe->pipe_type = pipe_type; ++ pipe->pipe_dir = pipe_dir; ++ pipe->mps = mps; ++} ++ ++/** ++ * Phases for control transfers. ++ */ ++typedef enum dwc_otg_control_phase { ++ DWC_OTG_CONTROL_SETUP, ++ DWC_OTG_CONTROL_DATA, ++ DWC_OTG_CONTROL_STATUS ++} dwc_otg_control_phase_e; ++ ++/** Transaction types. */ ++typedef enum dwc_otg_transaction_type { ++ DWC_OTG_TRANSACTION_NONE, ++ DWC_OTG_TRANSACTION_PERIODIC, ++ DWC_OTG_TRANSACTION_NON_PERIODIC, ++ DWC_OTG_TRANSACTION_ALL ++} dwc_otg_transaction_type_e; ++ ++struct dwc_otg_qh; ++ ++/** ++ * A Queue Transfer Descriptor (QTD) holds the state of a bulk, control, ++ * interrupt, or isochronous transfer. A single QTD is created for each URB ++ * (of one of these types) submitted to the HCD. The transfer associated with ++ * a QTD may require one or multiple transactions. ++ * ++ * A QTD is linked to a Queue Head, which is entered in either the ++ * non-periodic or periodic schedule for execution. When a QTD is chosen for ++ * execution, some or all of its transactions may be executed. After ++ * execution, the state of the QTD is updated. The QTD may be retired if all ++ * its transactions are complete or if an error occurred. Otherwise, it ++ * remains in the schedule so more transactions can be executed later. ++ */ ++typedef struct dwc_otg_qtd { ++ /** ++ * Determines the PID of the next data packet for the data phase of ++ * control transfers. Ignored for other transfer types.
++ * One of the following values: ++ * - DWC_OTG_HC_PID_DATA0 ++ * - DWC_OTG_HC_PID_DATA1 ++ */ ++ uint8_t data_toggle; ++ ++ /** Current phase for control transfers (Setup, Data, or Status). */ ++ dwc_otg_control_phase_e control_phase; ++ ++ /** Keep track of the current split type ++ * for FS/LS endpoints on a HS Hub */ ++ uint8_t complete_split; ++ ++ /** How many bytes transferred during SSPLIT OUT */ ++ uint32_t ssplit_out_xfer_count; ++ ++ /** ++ * Holds the number of bus errors that have occurred for a transaction ++ * within this transfer. ++ */ ++ uint8_t error_count; ++ ++ /** ++ * Index of the next frame descriptor for an isochronous transfer. A ++ * frame descriptor describes the buffer position and length of the ++ * data to be transferred in the next scheduled (micro)frame of an ++ * isochronous transfer. It also holds status for that transaction. ++ * The frame index starts at 0. ++ */ ++ uint16_t isoc_frame_index; ++ ++ /** Position of the ISOC split on full/low speed */ ++ uint8_t isoc_split_pos; ++ ++ /** Position of the ISOC split in the buffer for the current frame */ ++ uint16_t isoc_split_offset; ++ ++ /** URB for this transfer */ ++ struct dwc_otg_hcd_urb *urb; ++ ++ struct dwc_otg_qh *qh; ++ ++ /** This list of QTDs */ ++ DWC_CIRCLEQ_ENTRY(dwc_otg_qtd) qtd_list_entry; ++ ++ /** Indicates if this QTD is currently processed by HW. */ ++ uint8_t in_process; ++ ++ /** Number of DMA descriptors for this QTD */ ++ uint8_t n_desc; ++ ++ /** ++ * Last activated frame(packet) index. ++ * Used in Descriptor DMA mode only. ++ */ ++ uint16_t isoc_frame_index_last; ++ ++} dwc_otg_qtd_t; ++ ++DWC_CIRCLEQ_HEAD(dwc_otg_qtd_list, dwc_otg_qtd); ++ ++/** ++ * A Queue Head (QH) holds the static characteristics of an endpoint and ++ * maintains a list of transfers (QTDs) for that endpoint. A QH structure may ++ * be entered in either the non-periodic or periodic schedule. ++ */ ++typedef struct dwc_otg_qh { ++ /** ++ * Endpoint type. ++ * One of the following values: ++ * - UE_CONTROL ++ * - UE_BULK ++ * - UE_INTERRUPT ++ * - UE_ISOCHRONOUS ++ */ ++ uint8_t ep_type; ++ uint8_t ep_is_in; ++ ++ /** wMaxPacketSize Field of Endpoint Descriptor. */ ++ uint16_t maxp; ++ ++ /** ++ * Device speed. ++ * One of the following values: ++ * - DWC_OTG_EP_SPEED_LOW ++ * - DWC_OTG_EP_SPEED_FULL ++ * - DWC_OTG_EP_SPEED_HIGH ++ */ ++ uint8_t dev_speed; ++ ++ /** ++ * Determines the PID of the next data packet for non-control ++ * transfers. Ignored for control transfers.
++ * One of the following values: ++ * - DWC_OTG_HC_PID_DATA0 ++ * - DWC_OTG_HC_PID_DATA1 ++ */ ++ uint8_t data_toggle; ++ ++ /** Ping state if 1. */ ++ uint8_t ping_state; ++ ++ /** ++ * List of QTDs for this QH. ++ */ ++ struct dwc_otg_qtd_list qtd_list; ++ ++ /** Host channel currently processing transfers for this QH. */ ++ struct dwc_hc *channel; ++ ++ /** Full/low speed endpoint on high-speed hub requires split. */ ++ uint8_t do_split; ++ ++ /** @name Periodic schedule information */ ++ /** @{ */ ++ ++ /** Bandwidth in microseconds per (micro)frame. */ ++ uint16_t usecs; ++ ++ /** Interval between transfers in (micro)frames. */ ++ uint16_t interval; ++ ++ /** ++ * (micro)frame to initialize a periodic transfer. The transfer ++ * executes in the following (micro)frame. ++ */ ++ uint16_t sched_frame; ++ ++ /* ++ ** Frame a NAK was received on this queue head, used to minimise NAK retransmission ++ */ ++ uint16_t nak_frame; ++ ++ /** (micro)frame at which last start split was initialized. */ ++ uint16_t start_split_frame; ++ ++ /** @} */ ++ ++ /** ++ * Used instead of original buffer if ++ * it(physical address) is not dword-aligned. ++ */ ++ uint8_t *dw_align_buf; ++ dwc_dma_t dw_align_buf_dma; ++ ++ /** Entry for QH in either the periodic or non-periodic schedule. */ ++ dwc_list_link_t qh_list_entry; ++ ++ /** @name Descriptor DMA support */ ++ /** @{ */ ++ ++ /** Descriptor List. */ ++ dwc_otg_host_dma_desc_t *desc_list; ++ ++ /** Descriptor List physical address. */ ++ dwc_dma_t desc_list_dma; ++ ++ /** ++ * Xfer Bytes array. ++ * Each element corresponds to a descriptor and indicates ++ * original XferSize size value for the descriptor. ++ */ ++ uint32_t *n_bytes; ++ ++ /** Actual number of transfer descriptors in a list. */ ++ uint16_t ntd; ++ ++ /** First activated isochronous transfer descriptor index. */ ++ uint8_t td_first; ++ /** Last activated isochronous transfer descriptor index. */ ++ uint8_t td_last; ++ ++ /** @} */ ++ ++ ++ uint16_t speed; ++ uint16_t frame_usecs[8]; ++} dwc_otg_qh_t; ++ ++DWC_CIRCLEQ_HEAD(hc_list, dwc_hc); ++ ++/** ++ * This structure holds the state of the HCD, including the non-periodic and ++ * periodic schedules. ++ */ ++struct dwc_otg_hcd { ++ /** The DWC otg device pointer */ ++ struct dwc_otg_device *otg_dev; ++ /** DWC OTG Core Interface Layer */ ++ dwc_otg_core_if_t *core_if; ++ ++ /** Function HCD driver callbacks */ ++ struct dwc_otg_hcd_function_ops *fops; ++ ++ /** Internal DWC HCD Flags */ ++ volatile union dwc_otg_hcd_internal_flags { ++ uint32_t d32; ++ struct { ++ unsigned port_connect_status_change:1; ++ unsigned port_connect_status:1; ++ unsigned port_reset_change:1; ++ unsigned port_enable_change:1; ++ unsigned port_suspend_change:1; ++ unsigned port_over_current_change:1; ++ unsigned port_l1_change:1; ++ unsigned reserved:26; ++ } b; ++ } flags; ++ ++ /** ++ * Inactive items in the non-periodic schedule. This is a list of ++ * Queue Heads. Transfers associated with these Queue Heads are not ++ * currently assigned to a host channel. ++ */ ++ dwc_list_link_t non_periodic_sched_inactive; ++ ++ /** ++ * Active items in the non-periodic schedule. This is a list of ++ * Queue Heads. Transfers associated with these Queue Heads are ++ * currently assigned to a host channel. ++ */ ++ dwc_list_link_t non_periodic_sched_active; ++ ++ /** ++ * Pointer to the next Queue Head to process in the active ++ * non-periodic schedule. ++ */ ++ dwc_list_link_t *non_periodic_qh_ptr; ++ ++ /** ++ * Inactive items in the periodic schedule. This is a list of QHs for ++ * periodic transfers that are _not_ scheduled for the next frame. ++ * Each QH in the list has an interval counter that determines when it ++ * needs to be scheduled for execution. This scheduling mechanism ++ * allows only a simple calculation for periodic bandwidth used (i.e. ++ * must assume that all periodic transfers may need to execute in the ++ * same frame). However, it greatly simplifies scheduling and should ++ * be sufficient for the vast majority of OTG hosts, which need to ++ * connect to a small number of peripherals at one time. ++ * ++ * Items move from this list to periodic_sched_ready when the QH ++ * interval counter is 0 at SOF. ++ */ ++ dwc_list_link_t periodic_sched_inactive; ++ ++ /** ++ * List of periodic QHs that are ready for execution in the next ++ * frame, but have not yet been assigned to host channels. ++ * ++ * Items move from this list to periodic_sched_assigned as host ++ * channels become available during the current frame. ++ */ ++ dwc_list_link_t periodic_sched_ready; ++ ++ /** ++ * List of periodic QHs to be executed in the next frame that are ++ * assigned to host channels. ++ * ++ * Items move from this list to periodic_sched_queued as the ++ * transactions for the QH are queued to the DWC_otg controller. ++ */ ++ dwc_list_link_t periodic_sched_assigned; ++ ++ /** ++ * List of periodic QHs that have been queued for execution. ++ * ++ * Items move from this list to either periodic_sched_inactive or ++ * periodic_sched_ready when the channel associated with the transfer ++ * is released. If the interval for the QH is 1, the item moves to ++ * periodic_sched_ready because it must be rescheduled for the next ++ * frame. Otherwise, the item moves to periodic_sched_inactive. ++ */ ++ dwc_list_link_t periodic_sched_queued; ++ ++ /** ++ * Total bandwidth claimed so far for periodic transfers. This value ++ * is in microseconds per (micro)frame. The assumption is that all ++ * periodic transfers may occur in the same (micro)frame. ++ */ ++ uint16_t periodic_usecs; ++ ++ /** ++ * Total bandwidth claimed so far for all periodic transfers ++ * in a frame. ++ * This will include a mixture of HS and FS transfers. ++ * Units are microseconds per (micro)frame. ++ * We have a budget per frame and have to schedule ++ * transactions accordingly. ++ * Watch out for the fact that things are actually scheduled for the ++ * "next frame". ++ */ ++ uint16_t frame_usecs[8]; ++ ++ ++ /** ++ * Frame number read from the core at SOF. The value ranges from 0 to ++ * DWC_HFNUM_MAX_FRNUM. ++ */ ++ uint16_t frame_number; ++ ++ /** ++ * Count of periodic QHs, if using several eps. For SOF enable/disable. ++ */ ++ uint16_t periodic_qh_count; ++ ++ /** ++ * Free host channels in the controller. This is a list of ++ * dwc_hc_t items. ++ */ ++ struct hc_list free_hc_list; ++ /** ++ * Number of host channels assigned to periodic transfers. Currently ++ * assuming that there is a dedicated host channel for each periodic ++ * transaction and at least one host channel available for ++ * non-periodic transactions. ++ */ ++ int periodic_channels; /* microframe_schedule==0 */ ++ ++ /** ++ * Number of host channels assigned to non-periodic transfers. ++ */ ++ int non_periodic_channels; /* microframe_schedule==0 */ ++ ++ /** ++ * Number of host channels assigned to non-periodic transfers. ++ */ ++ int available_host_channels; ++ ++ /** ++ * Array of pointers to the host channel descriptors. Allows accessing ++ * a host channel descriptor given the host channel number. This is ++ * useful in interrupt handlers. ++ */ ++ struct dwc_hc *hc_ptr_array[MAX_EPS_CHANNELS]; ++ ++ /** ++ * Buffer to use for any data received during the status phase of a ++ * control transfer. Normally no data is transferred during the status ++ * phase. This buffer is used as a bit bucket. ++ */ ++ uint8_t *status_buf; ++ ++ /** ++ * DMA address for status_buf. ++ */ ++ dma_addr_t status_buf_dma; ++#define DWC_OTG_HCD_STATUS_BUF_SIZE 64 ++ ++ /** ++ * Connection timer. An OTG host must display a message if the device ++ * does not connect. Started when the VBus power is turned on via ++ * sysfs attribute "buspower". ++ */ ++ dwc_timer_t *conn_timer; ++ ++ /* Tasket to do a reset */ ++ dwc_tasklet_t *reset_tasklet; ++ ++ /* */ ++ dwc_spinlock_t *lock; ++ dwc_spinlock_t *channel_lock; ++ /** ++ * Private data that could be used by OS wrapper. ++ */ ++ void *priv; ++ ++ uint8_t otg_port; ++ ++ /** Frame List */ ++ uint32_t *frame_list; ++ ++ /** Frame List DMA address */ ++ dma_addr_t frame_list_dma; ++ ++#ifdef DEBUG ++ uint32_t frrem_samples; ++ uint64_t frrem_accum; ++ ++ uint32_t hfnum_7_samples_a; ++ uint64_t hfnum_7_frrem_accum_a; ++ uint32_t hfnum_0_samples_a; ++ uint64_t hfnum_0_frrem_accum_a; ++ uint32_t hfnum_other_samples_a; ++ uint64_t hfnum_other_frrem_accum_a; ++ ++ uint32_t hfnum_7_samples_b; ++ uint64_t hfnum_7_frrem_accum_b; ++ uint32_t hfnum_0_samples_b; ++ uint64_t hfnum_0_frrem_accum_b; ++ uint32_t hfnum_other_samples_b; ++ uint64_t hfnum_other_frrem_accum_b; ++#endif ++}; ++ ++/** @name Transaction Execution Functions */ ++/** @{ */ ++extern dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t ++ * hcd); ++extern void dwc_otg_hcd_queue_transactions(dwc_otg_hcd_t * hcd, ++ dwc_otg_transaction_type_e tr_type); ++ ++/** @} */ ++ ++/** @name Interrupt Handler Functions */ ++/** @{ */ ++extern int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_sof_intr(dwc_otg_hcd_t * dwc_otg_hcd, int32_t); ++extern int32_t dwc_otg_hcd_handle_rx_status_q_level_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_np_tx_fifo_empty_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_perio_tx_fifo_empty_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_incomplete_periodic_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_conn_id_status_change_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_disconnect_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_hc_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, ++ uint32_t num); ++extern int32_t dwc_otg_hcd_handle_session_req_intr(dwc_otg_hcd_t * dwc_otg_hcd); ++extern int32_t dwc_otg_hcd_handle_wakeup_detected_intr(dwc_otg_hcd_t * ++ dwc_otg_hcd); ++/** @} */ ++ ++/** @name Schedule Queue Functions */ ++/** @{ */ ++ ++/* Implemented in dwc_otg_hcd_queue.c */ ++extern dwc_otg_qh_t *dwc_otg_hcd_qh_create(dwc_otg_hcd_t * hcd, ++ dwc_otg_hcd_urb_t * urb, int atomic_alloc); ++extern void dwc_otg_hcd_qh_free(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern int dwc_otg_hcd_qh_add(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern void dwc_otg_hcd_qh_remove(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern void dwc_otg_hcd_qh_deactivate(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, ++ int sched_csplit); ++ ++/** Remove and free a QH */ ++static inline void dwc_otg_hcd_qh_remove_and_free(dwc_otg_hcd_t * hcd, ++ dwc_otg_qh_t * qh) ++{ ++ dwc_irqflags_t flags; ++ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); ++ dwc_otg_hcd_qh_remove(hcd, qh); ++ DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); ++ dwc_otg_hcd_qh_free(hcd, qh); ++} ++ ++/** Allocates memory for a QH structure. ++ * @return Returns the memory allocate or NULL on error. */ ++static inline dwc_otg_qh_t *dwc_otg_hcd_qh_alloc(int atomic_alloc) ++{ ++ if (atomic_alloc) ++ return (dwc_otg_qh_t *) DWC_ALLOC_ATOMIC(sizeof(dwc_otg_qh_t)); ++ else ++ return (dwc_otg_qh_t *) DWC_ALLOC(sizeof(dwc_otg_qh_t)); ++} ++ ++extern dwc_otg_qtd_t *dwc_otg_hcd_qtd_create(dwc_otg_hcd_urb_t * urb, ++ int atomic_alloc); ++extern void dwc_otg_hcd_qtd_init(dwc_otg_qtd_t * qtd, dwc_otg_hcd_urb_t * urb); ++extern int dwc_otg_hcd_qtd_add(dwc_otg_qtd_t * qtd, dwc_otg_hcd_t * dwc_otg_hcd, ++ dwc_otg_qh_t ** qh, int atomic_alloc); ++ ++/** Allocates memory for a QTD structure. ++ * @return Returns the memory allocate or NULL on error. */ ++static inline dwc_otg_qtd_t *dwc_otg_hcd_qtd_alloc(int atomic_alloc) ++{ ++ if (atomic_alloc) ++ return (dwc_otg_qtd_t *) DWC_ALLOC_ATOMIC(sizeof(dwc_otg_qtd_t)); ++ else ++ return (dwc_otg_qtd_t *) DWC_ALLOC(sizeof(dwc_otg_qtd_t)); ++} ++ ++/** Frees the memory for a QTD structure. QTD should already be removed from ++ * list. ++ * @param qtd QTD to free.*/ ++static inline void dwc_otg_hcd_qtd_free(dwc_otg_qtd_t * qtd) ++{ ++ DWC_FREE(qtd); ++} ++ ++/** Removes a QTD from list. ++ * @param hcd HCD instance. ++ * @param qtd QTD to remove from list. ++ * @param qh QTD belongs to. ++ */ ++static inline void dwc_otg_hcd_qtd_remove(dwc_otg_hcd_t * hcd, ++ dwc_otg_qtd_t * qtd, ++ dwc_otg_qh_t * qh) ++{ ++ DWC_CIRCLEQ_REMOVE(&qh->qtd_list, qtd, qtd_list_entry); ++} ++ ++/** Remove and free a QTD ++ * Need to disable IRQ and hold hcd lock while calling this function out of ++ * interrupt servicing chain */ ++static inline void dwc_otg_hcd_qtd_remove_and_free(dwc_otg_hcd_t * hcd, ++ dwc_otg_qtd_t * qtd, ++ dwc_otg_qh_t * qh) ++{ ++ dwc_otg_hcd_qtd_remove(hcd, qtd, qh); ++ dwc_otg_hcd_qtd_free(qtd); ++} ++ ++/** @} */ ++ ++/** @name Descriptor DMA Supporting Functions */ ++/** @{ */ ++ ++extern void dwc_otg_hcd_start_xfer_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern void dwc_otg_hcd_complete_xfer_ddma(dwc_otg_hcd_t * hcd, ++ dwc_hc_t * hc, ++ dwc_otg_hc_regs_t * hc_regs, ++ dwc_otg_halt_status_e halt_status); ++ ++extern int dwc_otg_hcd_qh_init_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++extern void dwc_otg_hcd_qh_free_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh); ++ ++/** @} */ ++ ++/** @name Internal Functions */ ++/** @{ */ ++dwc_otg_qh_t *dwc_urb_to_qh(dwc_otg_hcd_urb_t * urb); ++/** @} */ ++ ++#ifdef CONFIG_USB_DWC_OTG_LPM ++extern int dwc_otg_hcd_get_hc_for_lpm_tran(dwc_otg_hcd_t * hcd, ++ uint8_t devaddr); ++extern void dwc_otg_hcd_free_hc_from_lpm(dwc_otg_hcd_t * hcd); ++#endif ++ ++/** Gets the QH that contains the list_head */ ++#define dwc_list_to_qh(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qh_t, qh_list_entry) ++ ++/** Gets the QTD that contains the list_head */ ++#define dwc_list_to_qtd(_list_head_ptr_) container_of(_list_head_ptr_, dwc_otg_qtd_t, qtd_list_entry) ++ ++/** Check if QH is non-periodic */ ++#define dwc_qh_is_non_per(_qh_ptr_) ((_qh_ptr_->ep_type == UE_BULK) || \ ++ (_qh_ptr_->ep_type == UE_CONTROL)) ++ ++/** High bandwidth multiplier as encoded in highspeed endpoint descriptors */ ++#define dwc_hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03)) ++ ++/** Packet size for any kind of endpoint descriptor */ ++#define dwc_max_packet(wMaxPacketSize) ((wMaxPacketSize) & 0x07ff) ++ ++/** ++ * Returns true if _frame1 is less than or equal to _frame2. The comparison is ++ * done modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the ++ * frame number when the max frame number is reached. ++ */ ++static inline int dwc_frame_num_le(uint16_t frame1, uint16_t frame2) ++{ ++ return ((frame2 - frame1) & DWC_HFNUM_MAX_FRNUM) <= ++ (DWC_HFNUM_MAX_FRNUM >> 1); ++} ++ ++/** ++ * Returns true if _frame1 is greater than _frame2. The comparison is done ++ * modulo DWC_HFNUM_MAX_FRNUM. This accounts for the rollover of the frame ++ * number when the max frame number is reached. ++ */ ++static inline int dwc_frame_num_gt(uint16_t frame1, uint16_t frame2) ++{ ++ return (frame1 != frame2) && ++ (((frame1 - frame2) & DWC_HFNUM_MAX_FRNUM) < ++ (DWC_HFNUM_MAX_FRNUM >> 1)); ++} ++ ++/** ++ * Increments _frame by the amount specified by _inc. The addition is done ++ * modulo DWC_HFNUM_MAX_FRNUM. Returns the incremented value. ++ */ ++static inline uint16_t dwc_frame_num_inc(uint16_t frame, uint16_t inc) ++{ ++ return (frame + inc) & DWC_HFNUM_MAX_FRNUM; ++} ++ ++static inline uint16_t dwc_full_frame_num(uint16_t frame) ++{ ++ return (frame & DWC_HFNUM_MAX_FRNUM) >> 3; ++} ++ ++static inline uint16_t dwc_micro_frame_num(uint16_t frame) ++{ ++ return frame & 0x7; ++} ++ ++void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc, ++ dwc_otg_hc_regs_t * hc_regs, ++ dwc_otg_qtd_t * qtd); ++ ++#ifdef DEBUG ++/** ++ * Macro to sample the remaining PHY clocks left in the current frame. This ++ * may be used during debugging to determine the average time it takes to ++ * execute sections of code. There are two possible sample points, "a" and ++ * "b", so the _letter argument must be one of these values. ++ * ++ * To dump the average sample times, read the "hcd_frrem" sysfs attribute. For ++ * example, "cat /sys/devices/lm0/hcd_frrem". ++ */ ++#define dwc_sample_frrem(_hcd, _qh, _letter) \ ++{ \ ++ hfnum_data_t hfnum; \ ++ dwc_otg_qtd_t *qtd; \ ++ qtd = list_entry(_qh->qtd_list.next, dwc_otg_qtd_t, qtd_list_entry); \ ++ if (usb_pipeint(qtd->urb->pipe) && _qh->start_split_frame != 0 && !qtd->complete_split) { \ ++ hfnum.d32 = DWC_READ_REG32(&_hcd->core_if->host_if->host_global_regs->hfnum); \ ++ switch (hfnum.b.frnum & 0x7) { \ ++ case 7: \ ++ _hcd->hfnum_7_samples_##_letter++; \ ++ _hcd->hfnum_7_frrem_accum_##_letter += hfnum.b.frrem; \ ++ break; \ ++ case 0: \ ++ _hcd->hfnum_0_samples_##_letter++; \ ++ _hcd->hfnum_0_frrem_accum_##_letter += hfnum.b.frrem; \ ++ break; \ ++ default: \ ++ _hcd->hfnum_other_samples_##_letter++; \ ++ _hcd->hfnum_other_frrem_accum_##_letter += hfnum.b.frrem; \ ++ break; \ ++ } \ ++ } \ ++} ++#else ++#define dwc_sample_frrem(_hcd, _qh, _letter) ++#endif ++#endif ++#endif /* DWC_DEVICE_ONLY */ +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 2012-11-11 18:15:17.059854389 +0100 @@ -0,0 +1,417 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_if.h $ @@ -59974,11 +61194,9 @@ index 0000000..04ca4c2 + +#endif /* __DWC_HCD_IF_H__ */ +#endif /* DWC_DEVICE_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -new file mode 100644 -index 0000000..3e762e2 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 2012-11-11 18:15:17.053854271 +0100 @@ -0,0 +1,2246 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_intr.c $ @@ -62226,11 +63444,9 @@ index 0000000..3e762e2 + return retval; +} +#endif /* DWC_DEVICE_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c -new file mode 100644 -index 0000000..f91c4b1 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 2012-11-11 18:15:17.040854016 +0100 @@ -0,0 +1,938 @@ + +/* ========================================================================== @@ -63170,11 +64386,9 @@ index 0000000..f91c4b1 +} + +#endif /* DWC_DEVICE_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -new file mode 100644 -index 0000000..e6b2a7b ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 2012-11-11 18:15:17.044854094 +0100 @@ -0,0 +1,957 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_queue.c $ @@ -64133,11 +65347,9 @@ index 0000000..e6b2a7b +} + +#endif /* DWC_DEVICE_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.c b/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.c -new file mode 100755 -index 0000000..b70ca68 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.c 2012-11-11 18:15:17.041854036 +0100 @@ -0,0 +1,113 @@ +#include "dwc_otg_regs.h" +#include "dwc_otg_dbg.h" @@ -64252,11 +65464,9 @@ index 0000000..b70ca68 + + return; +} -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h b/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h -new file mode 100755 -index 0000000..22f28e1 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_mphi_fix.h 2012-11-11 18:15:17.035853919 +0100 @@ -0,0 +1,36 @@ +#ifndef __DWC_OTG_MPHI_FIX_H__ +#define __DWC_OTG_MPHI_FIX_H__ @@ -64294,11 +65504,9 @@ index 0000000..22f28e1 +#endif + +#endif -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h b/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h -new file mode 100644 -index 0000000..bb1c42d ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_os_dep.h 2012-11-11 18:15:17.043854075 +0100 @@ -0,0 +1,188 @@ +#ifndef _DWC_OS_DEP_H_ +#define _DWC_OS_DEP_H_ @@ -64488,11 +65696,9 @@ index 0000000..bb1c42d + + +#endif /* _DWC_OS_DEP_H_ */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd.c -new file mode 100644 -index 0000000..c97d65c ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 2012-11-11 18:15:17.038853977 +0100 @@ -0,0 +1,2708 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.c $ @@ -67202,11 +68408,9 @@ index 0000000..c97d65c +} + +#endif /* DWC_HOST_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd.h b/drivers/usb/host/dwc_otg/dwc_otg_pcd.h -new file mode 100644 -index 0000000..8ef7ba6 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 2012-11-11 18:15:17.028853781 +0100 @@ -0,0 +1,266 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.h $ @@ -67474,11 +68678,9 @@ index 0000000..8ef7ba6 +extern void do_test_mode(void *data); +#endif +#endif /* DWC_HOST_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h b/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h -new file mode 100644 -index 0000000..c8d2e0e ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 2012-11-11 18:15:17.043854075 +0100 @@ -0,0 +1,360 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_if.h $ @@ -67840,11 +69042,9 @@ index 0000000..c8d2e0e +#endif /* __DWC_PCD_IF_H__ */ + +#endif /* DWC_HOST_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c -new file mode 100644 -index 0000000..27061d3 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 2012-11-11 18:15:17.045854114 +0100 @@ -0,0 +1,5147 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_intr.c $ @@ -72993,11 +74193,9 @@ index 0000000..27061d3 +} + +#endif /* DWC_HOST_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c b/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c -new file mode 100644 -index 0000000..903e670 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 2012-11-11 18:15:17.043854075 +0100 @@ -0,0 +1,1374 @@ + /* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_linux.c $ @@ -74373,11 +75571,9 @@ index 0000000..903e670 +EXPORT_SYMBOL(usb_gadget_unregister_driver); + +#endif /* DWC_HOST_ONLY */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_regs.h b/drivers/usb/host/dwc_otg/dwc_otg_regs.h -new file mode 100644 -index 0000000..0572642 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/dwc_otg_regs.h +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_regs.h linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_regs.h +--- linux-3.6.1/drivers/usb/host/dwc_otg/dwc_otg_regs.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/dwc_otg_regs.h 2012-11-11 18:15:17.058854369 +0100 @@ -0,0 +1,2550 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_regs.h $ @@ -76929,33 +78125,94 @@ index 0000000..0572642 +} gpwrdn_data_t; + +#endif -diff --git a/drivers/usb/host/dwc_otg/test/Makefile b/drivers/usb/host/dwc_otg/test/Makefile -new file mode 100644 -index 0000000..fc45375 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/test/Makefile -@@ -0,0 +1,16 @@ +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/Makefile linux-rpi-3.6.y/drivers/usb/host/dwc_otg/Makefile +--- linux-3.6.1/drivers/usb/host/dwc_otg/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/Makefile 2012-11-11 18:15:17.054854290 +0100 +@@ -0,0 +1,81 @@ ++# ++# Makefile for DWC_otg Highspeed USB controller driver ++# + -+PERL=/usr/bin/perl -+PL_TESTS=test_sysfs.pl test_mod_param.pl ++ifneq ($(KERNELRELEASE),) + -+.PHONY : test -+test : perl_tests ++# Use the BUS_INTERFACE variable to compile the software for either ++# PCI(PCI_INTERFACE) or LM(LM_INTERFACE) bus. ++ifeq ($(BUS_INTERFACE),) ++# BUS_INTERFACE = -DPCI_INTERFACE ++# BUS_INTERFACE = -DLM_INTERFACE ++ BUS_INTERFACE = -DPLATFORM_INTERFACE ++endif + -+perl_tests : -+ @echo -+ @echo Running perl tests -+ @for test in $(PL_TESTS); do \ -+ if $(PERL) ./$$test ; then \ -+ echo "=======> $$test, PASSED" ; \ -+ else echo "=======> $$test, FAILED" ; \ -+ fi \ -+ done -diff --git a/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm b/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm -new file mode 100644 -index 0000000..233b04a ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm ++#EXTRA_CFLAGS += -DDEBUG ++#EXTRA_CFLAGS += -DDWC_OTG_DEBUGLEV=1 # reduce common debug msgs ++ ++# Use one of the following flags to compile the software in host-only or ++# device-only mode. ++#EXTRA_CFLAGS += -DDWC_HOST_ONLY ++#EXTRA_CFLAGS += -DDWC_DEVICE_ONLY ++ ++EXTRA_CFLAGS += -Dlinux -DDWC_HS_ELECT_TST ++#EXTRA_CFLAGS += -DDWC_EN_ISOC ++EXTRA_CFLAGS += -I$(obj)/../dwc_common_port ++#EXTRA_CFLAGS += -I$(PORTLIB) ++EXTRA_CFLAGS += -DDWC_LINUX ++EXTRA_CFLAGS += $(CFI) ++EXTRA_CFLAGS += $(BUS_INTERFACE) ++#EXTRA_CFLAGS += -DDWC_DEV_SRPCAP ++ ++obj-$(CONFIG_USB_DWCOTG) += dwc_otg.o ++ ++dwc_otg-objs := dwc_otg_driver.o dwc_otg_attr.o ++dwc_otg-objs += dwc_otg_cil.o dwc_otg_cil_intr.o ++dwc_otg-objs += dwc_otg_pcd_linux.o dwc_otg_pcd.o dwc_otg_pcd_intr.o ++dwc_otg-objs += dwc_otg_hcd.o dwc_otg_hcd_linux.o dwc_otg_hcd_intr.o dwc_otg_hcd_queue.o dwc_otg_hcd_ddma.o ++dwc_otg-objs += dwc_otg_adp.o ++dwc_otg-objs += dwc_otg_mphi_fix.o ++ifneq ($(CFI),) ++dwc_otg-objs += dwc_otg_cfi.o ++endif ++ ++kernrelwd := $(subst ., ,$(KERNELRELEASE)) ++kernrel3 := $(word 1,$(kernrelwd)).$(word 2,$(kernrelwd)).$(word 3,$(kernrelwd)) ++ ++ifneq ($(kernrel3),2.6.20) ++EXTRA_CFLAGS += $(CPPFLAGS) ++endif ++ ++else ++ ++PWD := $(shell pwd) ++PORTLIB := $(PWD)/../dwc_common_port ++ ++# Command paths ++CTAGS := $(CTAGS) ++DOXYGEN := $(DOXYGEN) ++ ++default: portlib ++ $(MAKE) -C$(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules ++ ++install: default ++ $(MAKE) -C$(KDIR) M=$(PORTLIB) modules_install ++ $(MAKE) -C$(KDIR) M=$(PWD) modules_install ++ ++portlib: ++ $(MAKE) -C$(KDIR) M=$(PORTLIB) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules ++ cp $(PORTLIB)/Module.symvers $(PWD)/ ++ ++docs: $(wildcard *.[hc]) doc/doxygen.cfg ++ $(DOXYGEN) doc/doxygen.cfg ++ ++tags: $(wildcard *.[hc]) ++ $(CTAGS) -e $(wildcard *.[hc]) $(wildcard linux/*.[hc]) $(wildcard $(KDIR)/include/linux/usb*.h) ++ ++ ++clean: ++ rm -rf *.o *.ko .*cmd *.mod.c .tmp_versions Module.symvers ++ ++endif +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm linux-rpi-3.6.y/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm +--- linux-3.6.1/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/test/dwc_otg_test.pm 2012-11-11 18:15:17.036853938 +0100 @@ -0,0 +1,337 @@ +package dwc_otg_test; + @@ -77294,11 +78551,29 @@ index 0000000..233b04a +); + +1; -diff --git a/drivers/usb/host/dwc_otg/test/test_mod_param.pl b/drivers/usb/host/dwc_otg/test/test_mod_param.pl -new file mode 100644 -index 0000000..e887dce ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/test/test_mod_param.pl +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/test/Makefile linux-rpi-3.6.y/drivers/usb/host/dwc_otg/test/Makefile +--- linux-3.6.1/drivers/usb/host/dwc_otg/test/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/test/Makefile 2012-11-11 18:15:17.036853938 +0100 +@@ -0,0 +1,16 @@ ++ ++PERL=/usr/bin/perl ++PL_TESTS=test_sysfs.pl test_mod_param.pl ++ ++.PHONY : test ++test : perl_tests ++ ++perl_tests : ++ @echo ++ @echo Running perl tests ++ @for test in $(PL_TESTS); do \ ++ if $(PERL) ./$$test ; then \ ++ echo "=======> $$test, PASSED" ; \ ++ else echo "=======> $$test, FAILED" ; \ ++ fi \ ++ done +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/test/test_mod_param.pl linux-rpi-3.6.y/drivers/usb/host/dwc_otg/test/test_mod_param.pl +--- linux-3.6.1/drivers/usb/host/dwc_otg/test/test_mod_param.pl 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/test/test_mod_param.pl 2012-11-11 18:15:17.037853958 +0100 @@ -0,0 +1,133 @@ +#!/usr/bin/perl -w +# @@ -77433,11 +78708,9 @@ index 0000000..e887dce + +test_main(); +0; -diff --git a/drivers/usb/host/dwc_otg/test/test_sysfs.pl b/drivers/usb/host/dwc_otg/test/test_sysfs.pl -new file mode 100644 -index 0000000..abcf284 ---- /dev/null -+++ b/drivers/usb/host/dwc_otg/test/test_sysfs.pl +diff -Naur linux-3.6.1/drivers/usb/host/dwc_otg/test/test_sysfs.pl linux-rpi-3.6.y/drivers/usb/host/dwc_otg/test/test_sysfs.pl +--- linux-3.6.1/drivers/usb/host/dwc_otg/test/test_sysfs.pl 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/usb/host/dwc_otg/test/test_sysfs.pl 2012-11-11 18:15:17.035853919 +0100 @@ -0,0 +1,193 @@ +#!/usr/bin/perl -w +# @@ -77632,48 +78905,55 @@ index 0000000..abcf284 + +test_main(); +0; -diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig -index 0217f74..7b96e5f 100644 ---- a/drivers/video/Kconfig -+++ b/drivers/video/Kconfig -@@ -312,6 +312,20 @@ config FB_PM2_FIFO_DISCONNECT - help - Support the Permedia2 FIFO disconnect feature. +diff -Naur linux-3.6.1/drivers/usb/host/Kconfig linux-rpi-3.6.y/drivers/usb/host/Kconfig +--- linux-3.6.1/drivers/usb/host/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/host/Kconfig 2012-11-11 18:15:17.123855642 +0100 +@@ -610,6 +610,19 @@ + To compile this driver a module, choose M here: the module + will be called "hwa-hc". -+config FB_BCM2708 -+ tristate "BCM2708 framebuffer support" -+ depends on FB && ARM -+ select FB_CFB_FILLRECT -+ select FB_CFB_COPYAREA -+ select FB_CFB_IMAGEBLIT ++config USB_DWCOTG ++ tristate "Synopsis DWC host support" ++ depends on USB + help -+ This framebuffer device driver is for the BCM2708 framebuffer. ++ The Synopsis DWC controller is a dual-role ++ host/peripheral/OTG ("On The Go") USB controllers. + -+ If you want to compile this as a module (=code which can be -+ inserted into and removed from the running kernel), say M -+ here and read . The module -+ will be called bcm2708_fb. ++ Enable this option to support this IP in host controller mode. ++ If unsure, say N. + - config FB_ARMCLCD - tristate "ARM PrimeCell PL110 support" - depends on FB && ARM && ARM_AMBA -diff --git a/drivers/video/Makefile b/drivers/video/Makefile -index ee8dafb..3a7c1f5 100644 ---- a/drivers/video/Makefile -+++ b/drivers/video/Makefile -@@ -99,6 +99,7 @@ obj-$(CONFIG_FB_ATMEL) += atmel_lcdfb.o - obj-$(CONFIG_FB_PVR2) += pvr2fb.o - obj-$(CONFIG_FB_VOODOO1) += sstfb.o - obj-$(CONFIG_FB_ARMCLCD) += amba-clcd.o -+obj-$(CONFIG_FB_BCM2708) += bcm2708_fb.o - obj-$(CONFIG_FB_68328) += 68328fb.o - obj-$(CONFIG_FB_GBE) += gbefb.o - obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o -diff --git a/drivers/video/bcm2708_fb.c b/drivers/video/bcm2708_fb.c -new file mode 100644 -index 0000000..efdee9d ---- /dev/null -+++ b/drivers/video/bcm2708_fb.c ++ To compile this driver as a module, choose M here: the ++ modules built will be called dwc_otg and dwc_common_port. ++ + config USB_IMX21_HCD + tristate "i.MX21 HCD support" + depends on USB && ARM && ARCH_MXC +diff -Naur linux-3.6.1/drivers/usb/host/Makefile linux-rpi-3.6.y/drivers/usb/host/Makefile +--- linux-3.6.1/drivers/usb/host/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/host/Makefile 2012-11-11 18:15:17.011853448 +0100 +@@ -37,6 +37,8 @@ + obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o + obj-$(CONFIG_USB_ISP1760_HCD) += isp1760.o + obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o ++ ++obj-$(CONFIG_USB_DWCOTG) += dwc_otg/ dwc_common_port/ + obj-$(CONFIG_USB_IMX21_HCD) += imx21-hcd.o + obj-$(CONFIG_USB_FSL_MPH_DR_OF) += fsl-mph-dr-of.o + obj-$(CONFIG_USB_OCTEON2_COMMON) += octeon2-common.o +diff -Naur linux-3.6.1/drivers/usb/Makefile linux-rpi-3.6.y/drivers/usb/Makefile +--- linux-3.6.1/drivers/usb/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/usb/Makefile 2012-11-11 18:15:18.313878949 +0100 +@@ -25,6 +25,7 @@ + obj-$(CONFIG_USB_R8A66597_HCD) += host/ + obj-$(CONFIG_USB_HWA_HCD) += host/ + obj-$(CONFIG_USB_ISP1760_HCD) += host/ ++obj-$(CONFIG_USB_DWCOTG) += host/ + obj-$(CONFIG_USB_IMX21_HCD) += host/ + obj-$(CONFIG_USB_FSL_MPH_DR_OF) += host/ + +diff -Naur linux-3.6.1/drivers/video/bcm2708_fb.c linux-rpi-3.6.y/drivers/video/bcm2708_fb.c +--- linux-3.6.1/drivers/video/bcm2708_fb.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/video/bcm2708_fb.c 2012-11-11 18:15:12.802771009 +0100 @@ -0,0 +1,491 @@ +/* + * linux/drivers/video/bcm2708_fb.c @@ -78166,10 +79446,33 @@ index 0000000..efdee9d +MODULE_PARM_DESC(fbwidth, "Width of ARM Framebuffer"); +MODULE_PARM_DESC(fbheight, "Height of ARM Framebuffer"); +MODULE_PARM_DESC(fbdepth, "Bit depth of ARM Framebuffer"); -diff --git a/drivers/video/logo/logo_linux_clut224.ppm b/drivers/video/logo/logo_linux_clut224.ppm -index 3c14e43..7626beb 100644 ---- a/drivers/video/logo/logo_linux_clut224.ppm -+++ b/drivers/video/logo/logo_linux_clut224.ppm +diff -Naur linux-3.6.1/drivers/video/Kconfig linux-rpi-3.6.y/drivers/video/Kconfig +--- linux-3.6.1/drivers/video/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/video/Kconfig 2012-11-11 18:15:14.248799331 +0100 +@@ -312,6 +312,20 @@ + help + Support the Permedia2 FIFO disconnect feature. + ++config FB_BCM2708 ++ tristate "BCM2708 framebuffer support" ++ depends on FB && ARM ++ select FB_CFB_FILLRECT ++ select FB_CFB_COPYAREA ++ select FB_CFB_IMAGEBLIT ++ help ++ This framebuffer device driver is for the BCM2708 framebuffer. ++ ++ If you want to compile this as a module (=code which can be ++ inserted into and removed from the running kernel), say M ++ here and read . The module ++ will be called bcm2708_fb. ++ + config FB_ARMCLCD + tristate "ARM PrimeCell PL110 support" + depends on FB && ARM && ARM_AMBA +diff -Naur linux-3.6.1/drivers/video/logo/logo_linux_clut224.ppm linux-rpi-3.6.y/drivers/video/logo/logo_linux_clut224.ppm +--- linux-3.6.1/drivers/video/logo/logo_linux_clut224.ppm 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/video/logo/logo_linux_clut224.ppm 2012-11-11 18:15:12.531765700 +0100 @@ -1,1604 +1,883 @@ P3 -# Standard 224-color Linux logo @@ -80656,40 +81959,20 @@ index 3c14e43..7626beb 100644 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 -diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig -index 53d7571..1c89388 100644 ---- a/drivers/watchdog/Kconfig -+++ b/drivers/watchdog/Kconfig -@@ -352,6 +352,12 @@ config IMX2_WDT - To compile this driver as a module, choose M here: the - module will be called imx2_wdt. - -+config BCM2708_WDT -+ tristate "BCM2708 Watchdog" -+ depends on ARCH_BCM2708 -+ help -+ Enables BCM2708 watchdog support. -+ - # AVR32 Architecture - - config AT32AP700X_WDT -diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile -index 572b39b..d6d8fb7 100644 ---- a/drivers/watchdog/Makefile -+++ b/drivers/watchdog/Makefile -@@ -52,6 +52,7 @@ obj-$(CONFIG_STMP3XXX_WATCHDOG) += stmp3xxx_wdt.o - obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o - obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o - obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o -+obj-$(CONFIG_BCM2708_WDT) += bcm2708_wdog.o - - # AVR32 Architecture - obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o -diff --git a/drivers/watchdog/bcm2708_wdog.c b/drivers/watchdog/bcm2708_wdog.c -new file mode 100644 -index 0000000..dd33c35 ---- /dev/null -+++ b/drivers/watchdog/bcm2708_wdog.c +diff -Naur linux-3.6.1/drivers/video/Makefile linux-rpi-3.6.y/drivers/video/Makefile +--- linux-3.6.1/drivers/video/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/video/Makefile 2012-11-11 18:15:13.771789989 +0100 +@@ -99,6 +99,7 @@ + obj-$(CONFIG_FB_PVR2) += pvr2fb.o + obj-$(CONFIG_FB_VOODOO1) += sstfb.o + obj-$(CONFIG_FB_ARMCLCD) += amba-clcd.o ++obj-$(CONFIG_FB_BCM2708) += bcm2708_fb.o + obj-$(CONFIG_FB_68328) += 68328fb.o + obj-$(CONFIG_FB_GBE) += gbefb.o + obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o +diff -Naur linux-3.6.1/drivers/watchdog/bcm2708_wdog.c linux-rpi-3.6.y/drivers/watchdog/bcm2708_wdog.c +--- linux-3.6.1/drivers/watchdog/bcm2708_wdog.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/drivers/watchdog/bcm2708_wdog.c 2012-11-11 18:15:38.035265203 +0100 @@ -0,0 +1,385 @@ +/* + * Broadcom BCM2708 watchdog driver. @@ -81076,11 +82359,72 @@ index 0000000..dd33c35 +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); + -diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h -index f578a71..3824f2d 100644 ---- a/include/linux/mmc/host.h -+++ b/include/linux/mmc/host.h -@@ -257,6 +257,7 @@ struct mmc_host { +diff -Naur linux-3.6.1/drivers/watchdog/Kconfig linux-rpi-3.6.y/drivers/watchdog/Kconfig +--- linux-3.6.1/drivers/watchdog/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/watchdog/Kconfig 2012-11-11 18:15:38.279269982 +0100 +@@ -352,6 +352,12 @@ + To compile this driver as a module, choose M here: the + module will be called imx2_wdt. + ++config BCM2708_WDT ++ tristate "BCM2708 Watchdog" ++ depends on ARCH_BCM2708 ++ help ++ Enables BCM2708 watchdog support. ++ + # AVR32 Architecture + + config AT32AP700X_WDT +diff -Naur linux-3.6.1/drivers/watchdog/Makefile linux-rpi-3.6.y/drivers/watchdog/Makefile +--- linux-3.6.1/drivers/watchdog/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/drivers/watchdog/Makefile 2012-11-11 18:15:38.249269395 +0100 +@@ -52,6 +52,7 @@ + obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o + obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o + obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o ++obj-$(CONFIG_BCM2708_WDT) += bcm2708_wdog.o + + # AVR32 Architecture + obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o +diff -Naur linux-3.6.1/.gitignore linux-rpi-3.6.y/.gitignore +diff -Naur linux-3.6.1/include/linux/broadcom/vc_cma.h linux-rpi-3.6.y/include/linux/broadcom/vc_cma.h +--- linux-3.6.1/include/linux/broadcom/vc_cma.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/include/linux/broadcom/vc_cma.h 2012-11-11 18:18:42.905881123 +0100 +@@ -0,0 +1,30 @@ ++/***************************************************************************** ++* Copyright 2012 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ ++ ++#if !defined( VC_CMA_H ) ++#define VC_CMA_H ++ ++#include ++ ++#define VC_CMA_IOC_MAGIC 0xc5 ++ ++#define VC_CMA_IOC_RESERVE _IO(VC_CMA_IOC_MAGIC, 0) ++ ++#ifdef __KERNEL__ ++extern void __init vc_cma_early_init(void); ++extern void __init vc_cma_reserve(void); ++#endif ++ ++#endif /* VC_CMA_H */ ++ +diff -Naur linux-3.6.1/include/linux/mmc/host.h linux-rpi-3.6.y/include/linux/mmc/host.h +--- linux-3.6.1/include/linux/mmc/host.h 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/include/linux/mmc/host.h 2012-11-11 18:18:40.293830067 +0100 +@@ -257,6 +257,7 @@ #define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ #define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ #define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ @@ -81088,11 +82432,10 @@ index f578a71..3824f2d 100644 mmc_pm_flag_t pm_caps; /* supported pm features */ unsigned int power_notify_type; -diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h -index ac83b10..7afc5cd 100644 ---- a/include/linux/mmc/sdhci.h -+++ b/include/linux/mmc/sdhci.h -@@ -93,6 +93,7 @@ struct sdhci_host { +diff -Naur linux-3.6.1/include/linux/mmc/sdhci.h linux-rpi-3.6.y/include/linux/mmc/sdhci.h +--- linux-3.6.1/include/linux/mmc/sdhci.h 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/include/linux/mmc/sdhci.h 2012-11-11 18:18:40.319830578 +0100 +@@ -93,6 +93,7 @@ #define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0) int irq; /* Device IRQ */ @@ -81100,7 +82443,7 @@ index ac83b10..7afc5cd 100644 void __iomem *ioaddr; /* Mapped address */ const struct sdhci_ops *ops; /* Low level hw interface */ -@@ -123,6 +124,7 @@ struct sdhci_host { +@@ -123,6 +124,7 @@ #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ #define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */ #define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ @@ -81108,7 +82451,7 @@ index ac83b10..7afc5cd 100644 unsigned int version; /* SDHCI spec. version */ -@@ -137,6 +139,7 @@ struct sdhci_host { +@@ -137,6 +139,7 @@ struct mmc_request *mrq; /* Current request */ struct mmc_command *cmd; /* Current command */ @@ -81116,11 +82459,10 @@ index ac83b10..7afc5cd 100644 struct mmc_data *data; /* Current data request */ unsigned int data_early:1; /* Data finished before cmd */ -diff --git a/kernel/module.c b/kernel/module.c -index 4edbd9c..c17caf2 100644 ---- a/kernel/module.c -+++ b/kernel/module.c -@@ -2675,20 +2675,23 @@ static int move_module(struct module *mod, struct load_info *info) +diff -Naur linux-3.6.1/kernel/module.c linux-rpi-3.6.y/kernel/module.c +--- linux-3.6.1/kernel/module.c 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/kernel/module.c 2012-11-11 18:18:53.564089435 +0100 +@@ -2675,20 +2675,23 @@ memset(ptr, 0, mod->core_size); mod->module_core = ptr; @@ -81157,42 +82499,426 @@ index 4edbd9c..c17caf2 100644 /* Transfer each section which specifies SHF_ALLOC */ pr_debug("final section addresses:\n"); -diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig -index 885683a..f7ceafd 100644 ---- a/sound/arm/Kconfig -+++ b/sound/arm/Kconfig -@@ -39,5 +39,12 @@ config SND_PXA2XX_AC97 - Say Y or M if you want to support any AC97 codec attached to - the PXA2xx AC97 interface. - -+config SND_BCM2835 -+ tristate "BCM2835 ALSA driver" -+ depends on ARCH_BCM2708 && BCM2708_VCHIQ && SND -+ select SND_PCM -+ help -+ Say Y or M if you want to support BCM2835 Alsa pcm card driver +diff -Naur linux-3.6.1/sound/arm/bcm2835.c linux-rpi-3.6.y/sound/arm/bcm2835.c +--- linux-3.6.1/sound/arm/bcm2835.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/sound/arm/bcm2835.c 2012-11-11 18:19:04.603305192 +0100 +@@ -0,0 +1,413 @@ ++/***************************************************************************** ++* Copyright 2011 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ + - endif # SND_ARM - -diff --git a/sound/arm/Makefile b/sound/arm/Makefile -index 8c0c851..181cb57 100644 ---- a/sound/arm/Makefile -+++ b/sound/arm/Makefile -@@ -14,3 +14,9 @@ snd-pxa2xx-lib-$(CONFIG_SND_PXA2XX_LIB_AC97) += pxa2xx-ac97-lib.o - - obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o - snd-pxa2xx-ac97-objs := pxa2xx-ac97.o ++#include + -+obj-$(CONFIG_SND_BCM2835) += snd-bcm2835.o -+snd-bcm2835-objs := bcm2835.o bcm2835-ctl.o bcm2835-pcm.o bcm2835-vchiq.o ++#include ++#include ++#include + -+EXTRA_CFLAGS += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000 ++#include "bcm2835.h" + -diff --git a/sound/arm/bcm2835-ctl.c b/sound/arm/bcm2835-ctl.c -new file mode 100755 -index 0000000..0c1b80a ---- /dev/null -+++ b/sound/arm/bcm2835-ctl.c ++/* module parameters (see "Module Parameters") */ ++/* SNDRV_CARDS: maximum number of cards supported by this module */ ++static int index[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = -1 }; ++static char *id[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = NULL }; ++static int enable[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = 1 }; ++ ++/* HACKY global pointers needed for successive probes to work : ssp ++ * But compared against the changes we will have to do in VC audio_ipc code ++ * to export 8 audio_ipc devices as a single IPC device and then monitor all ++ * four devices in a thread, this gets things done quickly and should be easier ++ * to debug if we run into issues ++ */ ++ ++static struct snd_card *g_card = NULL; ++static bcm2835_chip_t *g_chip = NULL; ++ ++static int snd_bcm2835_free(bcm2835_chip_t * chip) ++{ ++ kfree(chip); ++ return 0; ++} ++ ++/* component-destructor ++ * (see "Management of Cards and Components") ++ */ ++static int snd_bcm2835_dev_free(struct snd_device *device) ++{ ++ return snd_bcm2835_free(device->device_data); ++} ++ ++/* chip-specific constructor ++ * (see "Management of Cards and Components") ++ */ ++static int __devinit snd_bcm2835_create(struct snd_card *card, ++ struct platform_device *pdev, ++ bcm2835_chip_t ** rchip) ++{ ++ bcm2835_chip_t *chip; ++ int err; ++ static struct snd_device_ops ops = { ++ .dev_free = snd_bcm2835_dev_free, ++ }; ++ ++ *rchip = NULL; ++ ++ chip = kzalloc(sizeof(*chip), GFP_KERNEL); ++ if (chip == NULL) ++ return -ENOMEM; ++ ++ chip->card = card; ++ ++ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); ++ if (err < 0) { ++ snd_bcm2835_free(chip); ++ return err; ++ } ++ ++ *rchip = chip; ++ return 0; ++} ++ ++static int __devinit snd_bcm2835_alsa_probe(struct platform_device *pdev) ++{ ++ static int dev; ++ bcm2835_chip_t *chip; ++ struct snd_card *card; ++ int err; ++ ++ if (dev >= MAX_SUBSTREAMS) ++ return -ENODEV; ++ ++ if (!enable[dev]) { ++ dev++; ++ return -ENOENT; ++ } ++ ++ if (dev > 0) ++ goto add_register_map; ++ ++ err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &g_card); ++ if (err < 0) ++ goto out; ++ ++ snd_card_set_dev(g_card, &pdev->dev); ++ strcpy(g_card->driver, "BRCM bcm2835 ALSA Driver"); ++ strcpy(g_card->shortname, "bcm2835 ALSA"); ++ sprintf(g_card->longname, "%s", g_card->shortname); ++ ++ err = snd_bcm2835_create(g_card, pdev, &chip); ++ if (err < 0) { ++ printk(KERN_ERR "Failed to create bcm2835 chip\n"); ++ goto out_bcm2835_create; ++ } ++ ++ g_chip = chip; ++ err = snd_bcm2835_new_pcm(chip); ++ if (err < 0) { ++ printk(KERN_ERR "Failed to create new BCM2835 pcm device\n"); ++ goto out_bcm2835_new_pcm; ++ } ++ ++ err = snd_bcm2835_new_ctl(chip); ++ if (err < 0) { ++ printk(KERN_ERR "Failed to create new BCM2835 ctl\n"); ++ goto out_bcm2835_new_ctl; ++ } ++ ++add_register_map: ++ card = g_card; ++ chip = g_chip; ++ ++ BUG_ON(!(card && chip)); ++ ++ chip->avail_substreams |= (1 << dev); ++ chip->pdev[dev] = pdev; ++ ++ if (dev == 0) { ++ err = snd_card_register(card); ++ if (err < 0) { ++ printk(KERN_ERR ++ "Failed to register bcm2835 ALSA card \n"); ++ goto out_card_register; ++ } ++ platform_set_drvdata(pdev, card); ++ printk(KERN_INFO "bcm2835 ALSA card created!\n"); ++ } else { ++ printk(KERN_INFO "bcm2835 ALSA chip created!\n"); ++ platform_set_drvdata(pdev, (void *)dev); ++ } ++ ++ dev++; ++ ++ return 0; ++ ++out_card_register: ++out_bcm2835_new_ctl: ++out_bcm2835_new_pcm: ++out_bcm2835_create: ++ BUG_ON(!g_card); ++ if (snd_card_free(g_card)) ++ printk(KERN_ERR "Failed to free Registered alsa card\n"); ++ g_card = NULL; ++out: ++ dev = SNDRV_CARDS; /* stop more avail_substreams from being probed */ ++ printk(KERN_ERR "BCM2835 ALSA Probe failed !!\n"); ++ return err; ++} ++ ++static int snd_bcm2835_alsa_remove(struct platform_device *pdev) ++{ ++ uint32_t idx; ++ void *drv_data; ++ ++ drv_data = platform_get_drvdata(pdev); ++ ++ if (drv_data == (void *)g_card) { ++ /* This is the card device */ ++ snd_card_free((struct snd_card *)drv_data); ++ g_card = NULL; ++ g_chip = NULL; ++ } else { ++ idx = (uint32_t) drv_data; ++ if (g_card != NULL) { ++ BUG_ON(!g_chip); ++ /* We pass chip device numbers in audio ipc devices ++ * other than the one we registered our card with ++ */ ++ idx = (uint32_t) drv_data; ++ BUG_ON(!idx || idx > MAX_SUBSTREAMS); ++ g_chip->avail_substreams &= ~(1 << idx); ++ /* There should be atleast one substream registered ++ * after we are done here, as it wil be removed when ++ * the *remove* is called for the card device ++ */ ++ BUG_ON(!g_chip->avail_substreams); ++ } ++ } ++ ++ platform_set_drvdata(pdev, NULL); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_PM ++static int snd_bcm2835_alsa_suspend(struct platform_device *pdev, ++ pm_message_t state) ++{ ++ return 0; ++} ++ ++static int snd_bcm2835_alsa_resume(struct platform_device *pdev) ++{ ++ return 0; ++} ++ ++#endif ++ ++static struct platform_driver bcm2835_alsa0_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD0", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa1_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD1", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa2_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD2", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa3_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD3", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa4_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD4", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa5_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD5", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa6_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD6", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static struct platform_driver bcm2835_alsa7_driver = { ++ .probe = snd_bcm2835_alsa_probe, ++ .remove = snd_bcm2835_alsa_remove, ++#ifdef CONFIG_PM ++ .suspend = snd_bcm2835_alsa_suspend, ++ .resume = snd_bcm2835_alsa_resume, ++#endif ++ .driver = { ++ .name = "bcm2835_AUD7", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __devinit bcm2835_alsa_device_init(void) ++{ ++ int err; ++ err = platform_driver_register(&bcm2835_alsa0_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa0_driver %d .\n", err); ++ goto out; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa1_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa1_driver %d .\n", err); ++ goto unregister_0; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa2_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa2_driver %d .\n", err); ++ goto unregister_1; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa3_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa3_driver %d .\n", err); ++ goto unregister_2; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa4_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa4_driver %d .\n", err); ++ goto unregister_3; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa5_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa5_driver %d .\n", err); ++ goto unregister_4; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa6_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa6_driver %d .\n", err); ++ goto unregister_5; ++ } ++ ++ err = platform_driver_register(&bcm2835_alsa7_driver); ++ if (err) { ++ printk("Error registering bcm2835_alsa7_driver %d .\n", err); ++ goto unregister_6; ++ } ++ ++ return 0; ++ ++unregister_6: ++ platform_driver_unregister(&bcm2835_alsa6_driver); ++unregister_5: ++ platform_driver_unregister(&bcm2835_alsa5_driver); ++unregister_4: ++ platform_driver_unregister(&bcm2835_alsa4_driver); ++unregister_3: ++ platform_driver_unregister(&bcm2835_alsa3_driver); ++unregister_2: ++ platform_driver_unregister(&bcm2835_alsa2_driver); ++unregister_1: ++ platform_driver_unregister(&bcm2835_alsa1_driver); ++unregister_0: ++ platform_driver_unregister(&bcm2835_alsa0_driver); ++out: ++ return err; ++} ++ ++static void __devexit bcm2835_alsa_device_exit(void) ++{ ++ platform_driver_unregister(&bcm2835_alsa0_driver); ++ platform_driver_unregister(&bcm2835_alsa1_driver); ++ platform_driver_unregister(&bcm2835_alsa2_driver); ++ platform_driver_unregister(&bcm2835_alsa3_driver); ++ platform_driver_unregister(&bcm2835_alsa4_driver); ++ platform_driver_unregister(&bcm2835_alsa5_driver); ++ platform_driver_unregister(&bcm2835_alsa6_driver); ++ platform_driver_unregister(&bcm2835_alsa7_driver); ++} ++ ++late_initcall(bcm2835_alsa_device_init); ++module_exit(bcm2835_alsa_device_exit); ++ ++MODULE_AUTHOR("Dom Cobley"); ++MODULE_DESCRIPTION("Alsa driver for BCM2835 chip"); ++MODULE_LICENSE("GPL"); ++MODULE_ALIAS("platform:bcm2835_alsa"); +diff -Naur linux-3.6.1/sound/arm/bcm2835-ctl.c linux-rpi-3.6.y/sound/arm/bcm2835-ctl.c +--- linux-3.6.1/sound/arm/bcm2835-ctl.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/sound/arm/bcm2835-ctl.c 2012-11-11 18:19:04.601305153 +0100 @@ -0,0 +1,200 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -81394,11 +83120,168 @@ index 0000000..0c1b80a + } + return 0; +} -diff --git a/sound/arm/bcm2835-pcm.c b/sound/arm/bcm2835-pcm.c -new file mode 100755 -index 0000000..2f63ac6 ---- /dev/null -+++ b/sound/arm/bcm2835-pcm.c +diff -Naur linux-3.6.1/sound/arm/bcm2835.h linux-rpi-3.6.y/sound/arm/bcm2835.h +--- linux-3.6.1/sound/arm/bcm2835.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/sound/arm/bcm2835.h 2012-11-11 18:19:04.602305172 +0100 +@@ -0,0 +1,155 @@ ++/***************************************************************************** ++* Copyright 2011 Broadcom Corporation. All rights reserved. ++* ++* Unless you and Broadcom execute a separate written software license ++* agreement governing use of this software, this software is licensed to you ++* under the terms of the GNU General Public License version 2, available at ++* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). ++* ++* Notwithstanding the above, under no circumstances may you combine this ++* software in any way with any other Broadcom software provided under a ++* license other than the GPL, without Broadcom's express prior written ++* consent. ++*****************************************************************************/ ++ ++#ifndef __SOUND_ARM_BCM2835_H ++#define __SOUND_ARM_BCM2835_H ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++#define AUDIO_DEBUG_ENABLE ++#define AUDIO_VERBOSE_DEBUG_ENABLE ++*/ ++ ++/* Debug macros */ ++ ++#ifdef AUDIO_DEBUG_ENABLE ++#ifdef AUDIO_VERBOSE_DEBUG_ENABLE ++ ++#define audio_debug(fmt, arg...) \ ++ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#define audio_info(fmt, arg...) \ ++ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#else ++ ++#define audio_debug(fmt, arg...) ++ ++#define audio_info(fmt, arg...) ++ ++#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */ ++ ++#else ++ ++#define audio_debug(fmt, arg...) ++ ++#define audio_info(fmt, arg...) ++ ++#endif /* AUDIO_DEBUG_ENABLE */ ++ ++#define audio_error(fmt, arg...) \ ++ printk(KERN_ERR"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#define audio_warning(fmt, arg...) \ ++ printk(KERN_WARNING"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#define audio_alert(fmt, arg...) \ ++ printk(KERN_ALERT"%s:%d " fmt, __func__, __LINE__, ##arg) ++ ++#define MAX_SUBSTREAMS (8) ++#define AVAIL_SUBSTREAMS_MASK (0xff) ++enum { ++ CTRL_VOL_MUTE, ++ CTRL_VOL_UNMUTE ++}; ++ ++/* macros for alsa2chip and chip2alsa, instead of functions */ ++ ++#define alsa2chip(vol) (uint)(-((vol << 8) / 100)) /* convert alsa to chip volume (defined as macro rather than function call) */ ++#define chip2alsa(vol) -((vol * 100) >> 8) /* convert chip to alsa volume */ ++ ++/* Some constants for values .. */ ++typedef enum { ++ AUDIO_DEST_AUTO = 0, ++ AUDIO_DEST_HEADPHONES = 1, ++ AUDIO_DEST_HDMI = 2, ++ AUDIO_DEST_MAX, ++} SND_BCM2835_ROUTE_T; ++ ++typedef enum { ++ PCM_PLAYBACK_VOLUME, ++ PCM_PLAYBACK_MUTE, ++ PCM_PLAYBACK_DEVICE, ++} SND_BCM2835_CTRL_T; ++ ++/* definition of the chip-specific record */ ++typedef struct bcm2835_chip { ++ struct snd_card *card; ++ struct snd_pcm *pcm; ++ /* Bitmat for valid reg_base and irq numbers */ ++ uint32_t avail_substreams; ++ struct platform_device *pdev[MAX_SUBSTREAMS]; ++ struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS]; ++ ++ int volume; ++ int old_volume; /* stores the volume value whist muted */ ++ int dest; ++ int mute; ++} bcm2835_chip_t; ++ ++typedef struct bcm2835_alsa_stream { ++ bcm2835_chip_t *chip; ++ struct snd_pcm_substream *substream; ++ ++ struct semaphore buffers_update_sem; ++ struct semaphore control_sem; ++ spinlock_t lock; ++ volatile uint32_t control; ++ volatile uint32_t status; ++ ++ int open; ++ int running; ++ int draining; ++ ++ unsigned int pos; ++ unsigned int buffer_size; ++ unsigned int period_size; ++ ++ uint32_t enable_fifo_irq; ++ irq_handler_t fifo_irq_handler; ++ ++ atomic_t retrieved; ++ struct opaque_AUDIO_INSTANCE_T *instance; ++ struct workqueue_struct *my_wq; ++ int idx; ++} bcm2835_alsa_stream_t; ++ ++int snd_bcm2835_new_ctl(bcm2835_chip_t * chip); ++int snd_bcm2835_new_pcm(bcm2835_chip_t * chip); ++ ++int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream, ++ uint32_t channels, uint32_t samplerate, ++ uint32_t bps); ++int bcm2835_audio_setup(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_start(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_stop(bcm2835_alsa_stream_t * alsa_stream); ++int bcm2835_audio_set_ctls(bcm2835_chip_t * chip); ++int bcm2835_audio_write(bcm2835_alsa_stream_t * alsa_stream, uint32_t count, ++ void *src); ++uint32_t bcm2835_audio_retrieve_buffers(bcm2835_alsa_stream_t * alsa_stream); ++void bcm2835_audio_flush_buffers(bcm2835_alsa_stream_t * alsa_stream); ++void bcm2835_audio_flush_playback_buffers(bcm2835_alsa_stream_t * alsa_stream); ++ ++#endif /* __SOUND_ARM_BCM2835_H */ +diff -Naur linux-3.6.1/sound/arm/bcm2835-pcm.c linux-rpi-3.6.y/sound/arm/bcm2835-pcm.c +--- linux-3.6.1/sound/arm/bcm2835-pcm.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/sound/arm/bcm2835-pcm.c 2012-11-11 18:19:04.597305071 +0100 @@ -0,0 +1,408 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -81808,11 +83691,9 @@ index 0000000..2f63ac6 + + return 0; +} -diff --git a/sound/arm/bcm2835-vchiq.c b/sound/arm/bcm2835-vchiq.c -new file mode 100755 -index 0000000..14ca707 ---- /dev/null -+++ b/sound/arm/bcm2835-vchiq.c +diff -Naur linux-3.6.1/sound/arm/bcm2835-vchiq.c linux-rpi-3.6.y/sound/arm/bcm2835-vchiq.c +--- linux-3.6.1/sound/arm/bcm2835-vchiq.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/sound/arm/bcm2835-vchiq.c 2012-11-11 18:19:04.600305134 +0100 @@ -0,0 +1,826 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -82640,591 +84521,38 @@ index 0000000..14ca707 + atomic_sub(count, &alsa_stream->retrieved); + return count; +} -diff --git a/sound/arm/bcm2835.c b/sound/arm/bcm2835.c -new file mode 100755 -index 0000000..9546fe6 ---- /dev/null -+++ b/sound/arm/bcm2835.c -@@ -0,0 +1,413 @@ -+/***************************************************************************** -+* Copyright 2011 Broadcom Corporation. All rights reserved. -+* -+* Unless you and Broadcom execute a separate written software license -+* agreement governing use of this software, this software is licensed to you -+* under the terms of the GNU General Public License version 2, available at -+* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). -+* -+* Notwithstanding the above, under no circumstances may you combine this -+* software in any way with any other Broadcom software provided under a -+* license other than the GPL, without Broadcom's express prior written -+* consent. -+*****************************************************************************/ -+ -+#include -+ -+#include -+#include -+#include -+ -+#include "bcm2835.h" -+ -+/* module parameters (see "Module Parameters") */ -+/* SNDRV_CARDS: maximum number of cards supported by this module */ -+static int index[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = -1 }; -+static char *id[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = NULL }; -+static int enable[MAX_SUBSTREAMS] = {[0 ... (MAX_SUBSTREAMS - 1)] = 1 }; -+ -+/* HACKY global pointers needed for successive probes to work : ssp -+ * But compared against the changes we will have to do in VC audio_ipc code -+ * to export 8 audio_ipc devices as a single IPC device and then monitor all -+ * four devices in a thread, this gets things done quickly and should be easier -+ * to debug if we run into issues -+ */ -+ -+static struct snd_card *g_card = NULL; -+static bcm2835_chip_t *g_chip = NULL; -+ -+static int snd_bcm2835_free(bcm2835_chip_t * chip) -+{ -+ kfree(chip); -+ return 0; -+} -+ -+/* component-destructor -+ * (see "Management of Cards and Components") -+ */ -+static int snd_bcm2835_dev_free(struct snd_device *device) -+{ -+ return snd_bcm2835_free(device->device_data); -+} -+ -+/* chip-specific constructor -+ * (see "Management of Cards and Components") -+ */ -+static int __devinit snd_bcm2835_create(struct snd_card *card, -+ struct platform_device *pdev, -+ bcm2835_chip_t ** rchip) -+{ -+ bcm2835_chip_t *chip; -+ int err; -+ static struct snd_device_ops ops = { -+ .dev_free = snd_bcm2835_dev_free, -+ }; -+ -+ *rchip = NULL; -+ -+ chip = kzalloc(sizeof(*chip), GFP_KERNEL); -+ if (chip == NULL) -+ return -ENOMEM; -+ -+ chip->card = card; -+ -+ err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); -+ if (err < 0) { -+ snd_bcm2835_free(chip); -+ return err; -+ } -+ -+ *rchip = chip; -+ return 0; -+} -+ -+static int __devinit snd_bcm2835_alsa_probe(struct platform_device *pdev) -+{ -+ static int dev; -+ bcm2835_chip_t *chip; -+ struct snd_card *card; -+ int err; -+ -+ if (dev >= MAX_SUBSTREAMS) -+ return -ENODEV; -+ -+ if (!enable[dev]) { -+ dev++; -+ return -ENOENT; -+ } -+ -+ if (dev > 0) -+ goto add_register_map; -+ -+ err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &g_card); -+ if (err < 0) -+ goto out; -+ -+ snd_card_set_dev(g_card, &pdev->dev); -+ strcpy(g_card->driver, "BRCM bcm2835 ALSA Driver"); -+ strcpy(g_card->shortname, "bcm2835 ALSA"); -+ sprintf(g_card->longname, "%s", g_card->shortname); -+ -+ err = snd_bcm2835_create(g_card, pdev, &chip); -+ if (err < 0) { -+ printk(KERN_ERR "Failed to create bcm2835 chip\n"); -+ goto out_bcm2835_create; -+ } -+ -+ g_chip = chip; -+ err = snd_bcm2835_new_pcm(chip); -+ if (err < 0) { -+ printk(KERN_ERR "Failed to create new BCM2835 pcm device\n"); -+ goto out_bcm2835_new_pcm; -+ } -+ -+ err = snd_bcm2835_new_ctl(chip); -+ if (err < 0) { -+ printk(KERN_ERR "Failed to create new BCM2835 ctl\n"); -+ goto out_bcm2835_new_ctl; -+ } -+ -+add_register_map: -+ card = g_card; -+ chip = g_chip; -+ -+ BUG_ON(!(card && chip)); -+ -+ chip->avail_substreams |= (1 << dev); -+ chip->pdev[dev] = pdev; -+ -+ if (dev == 0) { -+ err = snd_card_register(card); -+ if (err < 0) { -+ printk(KERN_ERR -+ "Failed to register bcm2835 ALSA card \n"); -+ goto out_card_register; -+ } -+ platform_set_drvdata(pdev, card); -+ printk(KERN_INFO "bcm2835 ALSA card created!\n"); -+ } else { -+ printk(KERN_INFO "bcm2835 ALSA chip created!\n"); -+ platform_set_drvdata(pdev, (void *)dev); -+ } -+ -+ dev++; -+ -+ return 0; -+ -+out_card_register: -+out_bcm2835_new_ctl: -+out_bcm2835_new_pcm: -+out_bcm2835_create: -+ BUG_ON(!g_card); -+ if (snd_card_free(g_card)) -+ printk(KERN_ERR "Failed to free Registered alsa card\n"); -+ g_card = NULL; -+out: -+ dev = SNDRV_CARDS; /* stop more avail_substreams from being probed */ -+ printk(KERN_ERR "BCM2835 ALSA Probe failed !!\n"); -+ return err; -+} -+ -+static int snd_bcm2835_alsa_remove(struct platform_device *pdev) -+{ -+ uint32_t idx; -+ void *drv_data; -+ -+ drv_data = platform_get_drvdata(pdev); -+ -+ if (drv_data == (void *)g_card) { -+ /* This is the card device */ -+ snd_card_free((struct snd_card *)drv_data); -+ g_card = NULL; -+ g_chip = NULL; -+ } else { -+ idx = (uint32_t) drv_data; -+ if (g_card != NULL) { -+ BUG_ON(!g_chip); -+ /* We pass chip device numbers in audio ipc devices -+ * other than the one we registered our card with -+ */ -+ idx = (uint32_t) drv_data; -+ BUG_ON(!idx || idx > MAX_SUBSTREAMS); -+ g_chip->avail_substreams &= ~(1 << idx); -+ /* There should be atleast one substream registered -+ * after we are done here, as it wil be removed when -+ * the *remove* is called for the card device -+ */ -+ BUG_ON(!g_chip->avail_substreams); -+ } -+ } -+ -+ platform_set_drvdata(pdev, NULL); -+ -+ return 0; -+} -+ -+#ifdef CONFIG_PM -+static int snd_bcm2835_alsa_suspend(struct platform_device *pdev, -+ pm_message_t state) -+{ -+ return 0; -+} -+ -+static int snd_bcm2835_alsa_resume(struct platform_device *pdev) -+{ -+ return 0; -+} -+ -+#endif -+ -+static struct platform_driver bcm2835_alsa0_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD0", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa1_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD1", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa2_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD2", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa3_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD3", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa4_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD4", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa5_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD5", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa6_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD6", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static struct platform_driver bcm2835_alsa7_driver = { -+ .probe = snd_bcm2835_alsa_probe, -+ .remove = snd_bcm2835_alsa_remove, -+#ifdef CONFIG_PM -+ .suspend = snd_bcm2835_alsa_suspend, -+ .resume = snd_bcm2835_alsa_resume, -+#endif -+ .driver = { -+ .name = "bcm2835_AUD7", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+static int __devinit bcm2835_alsa_device_init(void) -+{ -+ int err; -+ err = platform_driver_register(&bcm2835_alsa0_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa0_driver %d .\n", err); -+ goto out; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa1_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa1_driver %d .\n", err); -+ goto unregister_0; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa2_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa2_driver %d .\n", err); -+ goto unregister_1; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa3_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa3_driver %d .\n", err); -+ goto unregister_2; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa4_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa4_driver %d .\n", err); -+ goto unregister_3; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa5_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa5_driver %d .\n", err); -+ goto unregister_4; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa6_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa6_driver %d .\n", err); -+ goto unregister_5; -+ } -+ -+ err = platform_driver_register(&bcm2835_alsa7_driver); -+ if (err) { -+ printk("Error registering bcm2835_alsa7_driver %d .\n", err); -+ goto unregister_6; -+ } -+ -+ return 0; -+ -+unregister_6: -+ platform_driver_unregister(&bcm2835_alsa6_driver); -+unregister_5: -+ platform_driver_unregister(&bcm2835_alsa5_driver); -+unregister_4: -+ platform_driver_unregister(&bcm2835_alsa4_driver); -+unregister_3: -+ platform_driver_unregister(&bcm2835_alsa3_driver); -+unregister_2: -+ platform_driver_unregister(&bcm2835_alsa2_driver); -+unregister_1: -+ platform_driver_unregister(&bcm2835_alsa1_driver); -+unregister_0: -+ platform_driver_unregister(&bcm2835_alsa0_driver); -+out: -+ return err; -+} -+ -+static void __devexit bcm2835_alsa_device_exit(void) -+{ -+ platform_driver_unregister(&bcm2835_alsa0_driver); -+ platform_driver_unregister(&bcm2835_alsa1_driver); -+ platform_driver_unregister(&bcm2835_alsa2_driver); -+ platform_driver_unregister(&bcm2835_alsa3_driver); -+ platform_driver_unregister(&bcm2835_alsa4_driver); -+ platform_driver_unregister(&bcm2835_alsa5_driver); -+ platform_driver_unregister(&bcm2835_alsa6_driver); -+ platform_driver_unregister(&bcm2835_alsa7_driver); -+} -+ -+late_initcall(bcm2835_alsa_device_init); -+module_exit(bcm2835_alsa_device_exit); -+ -+MODULE_AUTHOR("Dom Cobley"); -+MODULE_DESCRIPTION("Alsa driver for BCM2835 chip"); -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS("platform:bcm2835_alsa"); -diff --git a/sound/arm/bcm2835.h b/sound/arm/bcm2835.h -new file mode 100755 -index 0000000..b966e28 ---- /dev/null -+++ b/sound/arm/bcm2835.h -@@ -0,0 +1,155 @@ -+/***************************************************************************** -+* Copyright 2011 Broadcom Corporation. All rights reserved. -+* -+* Unless you and Broadcom execute a separate written software license -+* agreement governing use of this software, this software is licensed to you -+* under the terms of the GNU General Public License version 2, available at -+* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). -+* -+* Notwithstanding the above, under no circumstances may you combine this -+* software in any way with any other Broadcom software provided under a -+* license other than the GPL, without Broadcom's express prior written -+* consent. -+*****************************************************************************/ -+ -+#ifndef __SOUND_ARM_BCM2835_H -+#define __SOUND_ARM_BCM2835_H -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* -+#define AUDIO_DEBUG_ENABLE -+#define AUDIO_VERBOSE_DEBUG_ENABLE -+*/ -+ -+/* Debug macros */ -+ -+#ifdef AUDIO_DEBUG_ENABLE -+#ifdef AUDIO_VERBOSE_DEBUG_ENABLE -+ -+#define audio_debug(fmt, arg...) \ -+ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#define audio_info(fmt, arg...) \ -+ printk(KERN_INFO"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#else -+ -+#define audio_debug(fmt, arg...) -+ -+#define audio_info(fmt, arg...) -+ -+#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */ -+ -+#else -+ -+#define audio_debug(fmt, arg...) -+ -+#define audio_info(fmt, arg...) -+ -+#endif /* AUDIO_DEBUG_ENABLE */ -+ -+#define audio_error(fmt, arg...) \ -+ printk(KERN_ERR"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#define audio_warning(fmt, arg...) \ -+ printk(KERN_WARNING"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#define audio_alert(fmt, arg...) \ -+ printk(KERN_ALERT"%s:%d " fmt, __func__, __LINE__, ##arg) -+ -+#define MAX_SUBSTREAMS (8) -+#define AVAIL_SUBSTREAMS_MASK (0xff) -+enum { -+ CTRL_VOL_MUTE, -+ CTRL_VOL_UNMUTE -+}; -+ -+/* macros for alsa2chip and chip2alsa, instead of functions */ -+ -+#define alsa2chip(vol) (uint)(-((vol << 8) / 100)) /* convert alsa to chip volume (defined as macro rather than function call) */ -+#define chip2alsa(vol) -((vol * 100) >> 8) /* convert chip to alsa volume */ -+ -+/* Some constants for values .. */ -+typedef enum { -+ AUDIO_DEST_AUTO = 0, -+ AUDIO_DEST_HEADPHONES = 1, -+ AUDIO_DEST_HDMI = 2, -+ AUDIO_DEST_MAX, -+} SND_BCM2835_ROUTE_T; -+ -+typedef enum { -+ PCM_PLAYBACK_VOLUME, -+ PCM_PLAYBACK_MUTE, -+ PCM_PLAYBACK_DEVICE, -+} SND_BCM2835_CTRL_T; -+ -+/* definition of the chip-specific record */ -+typedef struct bcm2835_chip { -+ struct snd_card *card; -+ struct snd_pcm *pcm; -+ /* Bitmat for valid reg_base and irq numbers */ -+ uint32_t avail_substreams; -+ struct platform_device *pdev[MAX_SUBSTREAMS]; -+ struct bcm2835_alsa_stream *alsa_stream[MAX_SUBSTREAMS]; -+ -+ int volume; -+ int old_volume; /* stores the volume value whist muted */ -+ int dest; -+ int mute; -+} bcm2835_chip_t; -+ -+typedef struct bcm2835_alsa_stream { -+ bcm2835_chip_t *chip; -+ struct snd_pcm_substream *substream; -+ -+ struct semaphore buffers_update_sem; -+ struct semaphore control_sem; -+ spinlock_t lock; -+ volatile uint32_t control; -+ volatile uint32_t status; -+ -+ int open; -+ int running; -+ int draining; -+ -+ unsigned int pos; -+ unsigned int buffer_size; -+ unsigned int period_size; -+ -+ uint32_t enable_fifo_irq; -+ irq_handler_t fifo_irq_handler; -+ -+ atomic_t retrieved; -+ struct opaque_AUDIO_INSTANCE_T *instance; -+ struct workqueue_struct *my_wq; -+ int idx; -+} bcm2835_alsa_stream_t; -+ -+int snd_bcm2835_new_ctl(bcm2835_chip_t * chip); -+int snd_bcm2835_new_pcm(bcm2835_chip_t * chip); -+ -+int bcm2835_audio_open(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_close(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_set_params(bcm2835_alsa_stream_t * alsa_stream, -+ uint32_t channels, uint32_t samplerate, -+ uint32_t bps); -+int bcm2835_audio_setup(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_start(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_stop(bcm2835_alsa_stream_t * alsa_stream); -+int bcm2835_audio_set_ctls(bcm2835_chip_t * chip); -+int bcm2835_audio_write(bcm2835_alsa_stream_t * alsa_stream, uint32_t count, -+ void *src); -+uint32_t bcm2835_audio_retrieve_buffers(bcm2835_alsa_stream_t * alsa_stream); -+void bcm2835_audio_flush_buffers(bcm2835_alsa_stream_t * alsa_stream); -+void bcm2835_audio_flush_playback_buffers(bcm2835_alsa_stream_t * alsa_stream); -+ -+#endif /* __SOUND_ARM_BCM2835_H */ -diff --git a/sound/arm/vc_vchi_audioserv_defs.h b/sound/arm/vc_vchi_audioserv_defs.h -new file mode 100644 -index 0000000..2020ce4 ---- /dev/null -+++ b/sound/arm/vc_vchi_audioserv_defs.h +diff -Naur linux-3.6.1/sound/arm/Kconfig linux-rpi-3.6.y/sound/arm/Kconfig +--- linux-3.6.1/sound/arm/Kconfig 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/sound/arm/Kconfig 2012-11-11 18:19:04.603305192 +0100 +@@ -39,5 +39,12 @@ + Say Y or M if you want to support any AC97 codec attached to + the PXA2xx AC97 interface. + ++config SND_BCM2835 ++ tristate "BCM2835 ALSA driver" ++ depends on ARCH_BCM2708 && BCM2708_VCHIQ && SND ++ select SND_PCM ++ help ++ Say Y or M if you want to support BCM2835 Alsa pcm card driver ++ + endif # SND_ARM + +diff -Naur linux-3.6.1/sound/arm/Makefile linux-rpi-3.6.y/sound/arm/Makefile +--- linux-3.6.1/sound/arm/Makefile 2012-10-07 17:41:28.000000000 +0200 ++++ linux-rpi-3.6.y/sound/arm/Makefile 2012-11-11 18:19:04.602305172 +0100 +@@ -14,3 +14,9 @@ + + obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o + snd-pxa2xx-ac97-objs := pxa2xx-ac97.o ++ ++obj-$(CONFIG_SND_BCM2835) += snd-bcm2835.o ++snd-bcm2835-objs := bcm2835.o bcm2835-ctl.o bcm2835-pcm.o bcm2835-vchiq.o ++ ++EXTRA_CFLAGS += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -D__VCCOREVER__=0x04000000 ++ +diff -Naur linux-3.6.1/sound/arm/vc_vchi_audioserv_defs.h linux-rpi-3.6.y/sound/arm/vc_vchi_audioserv_defs.h +--- linux-3.6.1/sound/arm/vc_vchi_audioserv_defs.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-rpi-3.6.y/sound/arm/vc_vchi_audioserv_defs.h 2012-11-11 18:19:04.582304777 +0100 @@ -0,0 +1,114 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. diff --git a/packages/linux/patches/linux-3.6.6-604-RPi_rebootfix.patch b/packages/linux/patches/linux-3.6.6-604-RPi_rebootfix.patch deleted file mode 100644 index 0902f7cedb..0000000000 --- a/packages/linux/patches/linux-3.6.6-604-RPi_rebootfix.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -Naur linux-3.6.2.buildfix_patch/arch/arm/mach-bcm2708/bcm2708.c linux-3.6.2.reboot_patch/arch/arm/mach-bcm2708/bcm2708.c ---- linux-3.6.2.buildfix_patch/arch/arm/mach-bcm2708/bcm2708.c 2012-10-21 15:18:50.011567812 +0200 -+++ linux-3.6.2.reboot_patch/arch/arm/mach-bcm2708/bcm2708.c 2012-10-25 21:25:36.797861085 +0200 -@@ -658,6 +658,21 @@ - return ret; - } - -+static void bcm2708_restart(char mode, const char *cmd) -+{ -+ uint32_t pm_rstc, pm_wdog; -+ uint32_t timeout = 10; -+ -+ /* Setup watchdog for reset */ -+ pm_rstc = readl(IO_ADDRESS(PM_RSTC)); -+ -+ pm_wdog = PM_PASSWORD | (timeout & PM_WDOG_TIME_SET); // watchdog timer = timer clock / 16; need password (31:16) + value (11:0) -+ pm_rstc = PM_PASSWORD | (pm_rstc & PM_RSTC_WRCFG_CLR) | PM_RSTC_WRCFG_FULL_RESET; -+ -+ writel(pm_wdog, IO_ADDRESS(PM_WDOG)); -+ writel(pm_rstc, IO_ADDRESS(PM_RSTC)); -+} -+ - /* We can't really power off, but if we do the normal reset scheme, and indicate to bootcode.bin not to reboot, then most of the chip will be powered off */ - static void bcm2708_power_off(void) - { -@@ -666,7 +681,7 @@ - pm_rsts = PM_PASSWORD | (pm_rsts & PM_RSTC_WRCFG_CLR) | PM_RSTS_HADWRH_SET; - writel(pm_rsts, IO_ADDRESS(PM_RSTS)); - /* continue with normal reset mechanism */ -- arch_reset(0, ""); -+ bcm2708_restart(0, ""); - } - - void __init bcm2708_init(void) -@@ -910,6 +925,7 @@ - .timer =&bcm2708_timer, - .init_machine = bcm2708_init, - .init_early = bcm2708_init_early, -+ .restart = bcm2708_restart, - MACHINE_END - - module_param(boardrev, uint, 0644); -diff -Naur linux-3.6.2.buildfix_patch/arch/arm/mach-bcm2708/include/mach/system.h linux-3.6.2.reboot_patch/arch/arm/mach-bcm2708/include/mach/system.h ---- linux-3.6.2.buildfix_patch/arch/arm/mach-bcm2708/include/mach/system.h 2012-10-21 15:18:50.011567812 +0200 -+++ linux-3.6.2.reboot_patch/arch/arm/mach-bcm2708/include/mach/system.h 2012-10-25 21:24:43.121770267 +0200 -@@ -35,19 +35,4 @@ - cpu_do_idle(); - } - --static inline void arch_reset(char mode, const char *cmd) --{ -- uint32_t pm_rstc, pm_wdog; -- uint32_t timeout = 10; -- -- /* Setup watchdog for reset */ -- pm_rstc = readl(IO_ADDRESS(PM_RSTC)); -- -- pm_wdog = PM_PASSWORD | (timeout & PM_WDOG_TIME_SET); // watchdog timer = timer clock / 16; need password (31:16) + value (11:0) -- pm_rstc = PM_PASSWORD | (pm_rstc & PM_RSTC_WRCFG_CLR) | PM_RSTC_WRCFG_FULL_RESET; -- -- writel(pm_wdog, IO_ADDRESS(PM_WDOG)); -- writel(pm_rstc, IO_ADDRESS(PM_RSTC)); --} -- - #endif diff --git a/projects/ATV/linux/linux.i386.conf b/projects/ATV/linux/linux.i386.conf index 56b2f24de0..15107ebefe 100644 --- a/projects/ATV/linux/linux.i386.conf +++ b/projects/ATV/linux/linux.i386.conf @@ -1539,6 +1539,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Fusion/linux/linux.i386.conf b/projects/Fusion/linux/linux.i386.conf index 3a4af63135..8ed588ba55 100644 --- a/projects/Fusion/linux/linux.i386.conf +++ b/projects/Fusion/linux/linux.i386.conf @@ -1605,6 +1605,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Fusion/linux/linux.x86_64.conf b/projects/Fusion/linux/linux.x86_64.conf index 39c2847833..3e340dd4ba 100644 --- a/projects/Fusion/linux/linux.x86_64.conf +++ b/projects/Fusion/linux/linux.x86_64.conf @@ -1556,6 +1556,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Generic/linux/linux.i386.conf b/projects/Generic/linux/linux.i386.conf index f24a0c2df9..6f3080563e 100644 --- a/projects/Generic/linux/linux.i386.conf +++ b/projects/Generic/linux/linux.i386.conf @@ -1687,6 +1687,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Generic_OSS/linux/linux.i386.conf b/projects/Generic_OSS/linux/linux.i386.conf index d518fbc125..d52799adad 100644 --- a/projects/Generic_OSS/linux/linux.i386.conf +++ b/projects/Generic_OSS/linux/linux.i386.conf @@ -1685,6 +1685,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/ION/linux/linux.i386.conf b/projects/ION/linux/linux.i386.conf index 482a7340af..d3a3318ddd 100644 --- a/projects/ION/linux/linux.i386.conf +++ b/projects/ION/linux/linux.i386.conf @@ -1612,6 +1612,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/ION/linux/linux.x86_64.conf b/projects/ION/linux/linux.x86_64.conf index 4c25d9072e..eac56eeb80 100644 --- a/projects/ION/linux/linux.x86_64.conf +++ b/projects/ION/linux/linux.x86_64.conf @@ -1548,6 +1548,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Intel/linux/linux.i386.conf b/projects/Intel/linux/linux.i386.conf index 4f83ae3b5e..efc0e6ca21 100644 --- a/projects/Intel/linux/linux.i386.conf +++ b/projects/Intel/linux/linux.i386.conf @@ -1630,6 +1630,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Intel/linux/linux.x86_64.conf b/projects/Intel/linux/linux.x86_64.conf index 0773d07ac6..43c156c9fa 100644 --- a/projects/Intel/linux/linux.x86_64.conf +++ b/projects/Intel/linux/linux.x86_64.conf @@ -1567,6 +1567,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/RPi/linux/linux.arm.conf b/projects/RPi/linux/linux.arm.conf index ef28e07725..a2a51c16eb 100644 --- a/projects/RPi/linux/linux.arm.conf +++ b/projects/RPi/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 3.6.3 Kernel Configuration +# Linux/arm 3.6.6 Kernel Configuration # CONFIG_ARM=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y @@ -1038,6 +1038,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_R3964 is not set # CONFIG_RAW_DRIVER is not set # CONFIG_TCG_TPM is not set +CONFIG_BRCM_CHAR_DRIVERS=y CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Ultra/linux/linux.x86_64.conf b/projects/Ultra/linux/linux.x86_64.conf index e90cc35ccb..26f67d3d46 100644 --- a/projects/Ultra/linux/linux.x86_64.conf +++ b/projects/Ultra/linux/linux.x86_64.conf @@ -1471,6 +1471,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Virtual/linux/linux.i386.conf b/projects/Virtual/linux/linux.i386.conf index 38bd739b80..0bc8d15bf8 100644 --- a/projects/Virtual/linux/linux.i386.conf +++ b/projects/Virtual/linux/linux.i386.conf @@ -1632,6 +1632,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set diff --git a/projects/Virtual/linux/linux.x86_64.conf b/projects/Virtual/linux/linux.x86_64.conf index bf5561d0dc..aa6882d6fc 100644 --- a/projects/Virtual/linux/linux.x86_64.conf +++ b/projects/Virtual/linux/linux.x86_64.conf @@ -1568,6 +1568,7 @@ CONFIG_SERIAL_CORE=y # CONFIG_TCG_TPM is not set # CONFIG_TELCLOCK is not set CONFIG_DEVPORT=y +# CONFIG_BRCM_CHAR_DRIVERS is not set CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y # CONFIG_I2C_COMPAT is not set