From c3171870628a6d2d586b5766b31c694bb56a113e Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Wed, 2 May 2012 00:33:12 +0200 Subject: [PATCH] linux: update RPi patches Signed-off-by: Stephan Raue --- .../linux-3.1.10-601-RPi_support-0.1.patch | 7067 ++++++++--------- 1 file changed, 3531 insertions(+), 3536 deletions(-) diff --git a/packages/linux/patches/linux-3.1.10-601-RPi_support-0.1.patch b/packages/linux/patches/linux-3.1.10-601-RPi_support-0.1.patch index 9d4107db07..495149e625 100644 --- a/packages/linux/patches/linux-3.1.10-601-RPi_support-0.1.patch +++ b/packages/linux/patches/linux-3.1.10-601-RPi_support-0.1.patch @@ -1,70 +1,6 @@ -diff -Naur linux-3.1.10/arch/arm/Kconfig linux-3.1.10.patch/arch/arm/Kconfig ---- linux-3.1.10/arch/arm/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/Kconfig 2012-04-28 22:26:48.527710568 +0200 -@@ -896,6 +896,19 @@ - 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 CLKDEV_LOOKUP -+ select GENERIC_CLOCKEVENTS -+ select ARM_ERRATA_411920 -+ select MACH_BCM2708 -+ select VC4 -+ help -+ This enables support for Broadcom BCM2708 boards. -+ - config ARCH_VT8500 - bool "VIA/WonderMedia 85xx" - select CPU_ARM926T -@@ -1042,6 +1055,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.1.10/arch/arm/Makefile linux-3.1.10.patch/arch/arm/Makefile ---- linux-3.1.10/arch/arm/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/Makefile 2012-04-28 22:26:48.527710568 +0200 -@@ -196,6 +196,7 @@ - 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 -Naur linux-3.1.10/arch/arm/boot/compressed/Makefile linux-3.1.10.patch/arch/arm/boot/compressed/Makefile ---- linux-3.1.10/arch/arm/boot/compressed/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/boot/compressed/Makefile 2012-04-28 22:26:48.528710588 +0200 -@@ -121,11 +121,17 @@ - LDFLAGS_vmlinux += -T - - # For __aeabi_uidivmod --lib1funcs = $(obj)/lib1funcs.o -+lib1funcs = $(obj)/lib1funcs.o $(obj)/divdi3.o - - $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE - $(call cmd,shipped) - -+$(obj)/longlong.h: $(srctree)/arch/$(SRCARCH)/lib/longlong.h FORCE -+ $(call cmd,shipped) -+ -+$(obj)/divdi3.c: $(srctree)/arch/$(SRCARCH)/lib/divdi3.c $(obj)/longlong.h FORCE -+ $(call cmd,shipped) -+ - # We need to prevent any GOTOFF relocs being used with references - # to symbols in the .bss section since we cannot relocate them - # independently from the rest at run time. This can be achieved by diff -Naur linux-3.1.10/arch/arm/boot/compressed/divdi3.c linux-3.1.10.patch/arch/arm/boot/compressed/divdi3.c --- linux-3.1.10/arch/arm/boot/compressed/divdi3.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/boot/compressed/divdi3.c 2012-04-28 22:26:48.529710608 +0200 ++++ linux-3.1.10.patch/arch/arm/boot/compressed/divdi3.c 2012-05-02 00:07:04.994249720 +0200 @@ -0,0 +1,338 @@ +/* 64-bit multiplication and division + Copyright (C) 1989, 1992-1999, 2000, 2001, 2002, 2003 @@ -406,7 +342,7 @@ diff -Naur linux-3.1.10/arch/arm/boot/compressed/divdi3.c linux-3.1.10.patch/arc +} diff -Naur linux-3.1.10/arch/arm/boot/compressed/longlong.h linux-3.1.10.patch/arch/arm/boot/compressed/longlong.h --- linux-3.1.10/arch/arm/boot/compressed/longlong.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/boot/compressed/longlong.h 2012-04-28 22:26:48.530710628 +0200 ++++ linux-3.1.10.patch/arch/arm/boot/compressed/longlong.h 2012-05-02 00:07:04.994249720 +0200 @@ -0,0 +1,151 @@ +/* longlong.h -- based on code from gcc-2.95.3 + @@ -559,9 +495,31 @@ diff -Naur linux-3.1.10/arch/arm/boot/compressed/longlong.h linux-3.1.10.patch/a + +#define UDIV_NEEDS_NORMALIZATION 1 +#define udiv_qrnnd __udiv_qrnnd_c +diff -Naur linux-3.1.10/arch/arm/boot/compressed/Makefile linux-3.1.10.patch/arch/arm/boot/compressed/Makefile +--- linux-3.1.10/arch/arm/boot/compressed/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/boot/compressed/Makefile 2012-05-02 00:07:04.993249700 +0200 +@@ -121,11 +121,17 @@ + LDFLAGS_vmlinux += -T + + # For __aeabi_uidivmod +-lib1funcs = $(obj)/lib1funcs.o ++lib1funcs = $(obj)/lib1funcs.o $(obj)/divdi3.o + + $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE + $(call cmd,shipped) + ++$(obj)/longlong.h: $(srctree)/arch/$(SRCARCH)/lib/longlong.h FORCE ++ $(call cmd,shipped) ++ ++$(obj)/divdi3.c: $(srctree)/arch/$(SRCARCH)/lib/divdi3.c $(obj)/longlong.h FORCE ++ $(call cmd,shipped) ++ + # We need to prevent any GOTOFF relocs being used with references + # to symbols in the .bss section since we cannot relocate them + # independently from the rest at run time. This can be achieved by diff -Naur linux-3.1.10/arch/arm/configs/bcmrpi_cutdown_defconfig linux-3.1.10.patch/arch/arm/configs/bcmrpi_cutdown_defconfig --- linux-3.1.10/arch/arm/configs/bcmrpi_cutdown_defconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/configs/bcmrpi_cutdown_defconfig 2012-04-28 22:26:48.891717987 +0200 ++++ linux-3.1.10.patch/arch/arm/configs/bcmrpi_cutdown_defconfig 2012-05-02 00:07:05.492259742 +0200 @@ -0,0 +1,494 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set @@ -1059,7 +1017,7 @@ diff -Naur linux-3.1.10/arch/arm/configs/bcmrpi_cutdown_defconfig linux-3.1.10.p +CONFIG_LIBCRC32C=y diff -Naur linux-3.1.10/arch/arm/configs/bcmrpi_defconfig linux-3.1.10.patch/arch/arm/configs/bcmrpi_defconfig --- linux-3.1.10/arch/arm/configs/bcmrpi_defconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/configs/bcmrpi_defconfig 2012-04-28 22:26:48.892718008 +0200 ++++ linux-3.1.10.patch/arch/arm/configs/bcmrpi_defconfig 2012-05-02 00:07:05.492259742 +0200 @@ -0,0 +1,530 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set @@ -1593,7 +1551,7 @@ diff -Naur linux-3.1.10/arch/arm/configs/bcmrpi_defconfig linux-3.1.10.patch/arc +CONFIG_LIBCRC32C=y diff -Naur linux-3.1.10/arch/arm/configs/bcmrpi_emergency_defconfig linux-3.1.10.patch/arch/arm/configs/bcmrpi_emergency_defconfig --- linux-3.1.10/arch/arm/configs/bcmrpi_emergency_defconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/configs/bcmrpi_emergency_defconfig 2012-04-28 22:26:48.809716315 +0200 ++++ linux-3.1.10.patch/arch/arm/configs/bcmrpi_emergency_defconfig 2012-05-02 00:07:05.396257809 +0200 @@ -0,0 +1,475 @@ +CONFIG_EXPERIMENTAL=y +# CONFIG_LOCALVERSION_AUTO is not set @@ -2070,9 +2028,40 @@ diff -Naur linux-3.1.10/arch/arm/configs/bcmrpi_emergency_defconfig linux-3.1.10 +# CONFIG_CRYPTO_HW is not set +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y +diff -Naur linux-3.1.10/arch/arm/Kconfig linux-3.1.10.patch/arch/arm/Kconfig +--- linux-3.1.10/arch/arm/Kconfig 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/Kconfig 2012-05-02 00:07:04.992249680 +0200 +@@ -896,6 +896,19 @@ + 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 CLKDEV_LOOKUP ++ select GENERIC_CLOCKEVENTS ++ select ARM_ERRATA_411920 ++ select MACH_BCM2708 ++ select VC4 ++ help ++ This enables support for Broadcom BCM2708 boards. ++ + config ARCH_VT8500 + bool "VIA/WonderMedia 85xx" + select CPU_ARM926T +@@ -1042,6 +1055,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.1.10/arch/arm/kernel/armksyms.c linux-3.1.10.patch/arch/arm/kernel/armksyms.c --- linux-3.1.10/arch/arm/kernel/armksyms.c 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/kernel/armksyms.c 2012-04-28 22:26:48.533710691 +0200 ++++ linux-3.1.10.patch/arch/arm/kernel/armksyms.c 2012-05-02 00:07:05.020250244 +0200 @@ -46,6 +46,8 @@ extern void __aeabi_uidiv(void); extern void __aeabi_uidivmod(void); @@ -2091,22 +2080,9 @@ diff -Naur linux-3.1.10/arch/arm/kernel/armksyms.c linux-3.1.10.patch/arch/arm/k #endif /* bitops */ -diff -Naur linux-3.1.10/arch/arm/lib/Makefile linux-3.1.10.patch/arch/arm/lib/Makefile ---- linux-3.1.10/arch/arm/lib/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/lib/Makefile 2012-04-28 22:26:48.598712009 +0200 -@@ -13,7 +13,8 @@ - testchangebit.o testclearbit.o testsetbit.o \ - ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ - ucmpdi2.o lib1funcs.o div64.o \ -- io-readsb.o io-writesb.o io-readsl.o io-writesl.o -+ io-readsb.o io-writesb.o io-readsl.o io-writesl.o \ -+ divdi3.o - - mmu-y := clear_user.o copy_page.o getuser.o putuser.o - diff -Naur linux-3.1.10/arch/arm/lib/divdi3.c linux-3.1.10.patch/arch/arm/lib/divdi3.c --- linux-3.1.10/arch/arm/lib/divdi3.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/lib/divdi3.c 2012-04-28 22:26:48.599712034 +0200 ++++ linux-3.1.10.patch/arch/arm/lib/divdi3.c 2012-05-02 00:07:05.021250264 +0200 @@ -0,0 +1,338 @@ +/* 64-bit multiplication and division + Copyright (C) 1989, 1992-1999, 2000, 2001, 2002, 2003 @@ -2448,7 +2424,7 @@ diff -Naur linux-3.1.10/arch/arm/lib/divdi3.c linux-3.1.10.patch/arch/arm/lib/di +} diff -Naur linux-3.1.10/arch/arm/lib/lib1funcs.S linux-3.1.10.patch/arch/arm/lib/lib1funcs.S --- linux-3.1.10/arch/arm/lib/lib1funcs.S 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/lib/lib1funcs.S 2012-04-28 22:26:48.600712056 +0200 ++++ linux-3.1.10.patch/arch/arm/lib/lib1funcs.S 2012-05-02 00:07:05.022250284 +0200 @@ -349,6 +349,33 @@ UNWIND(.fnend) ENDPROC(__aeabi_idivmod) @@ -2485,7 +2461,7 @@ diff -Naur linux-3.1.10/arch/arm/lib/lib1funcs.S linux-3.1.10.patch/arch/arm/lib Ldiv0: diff -Naur linux-3.1.10/arch/arm/lib/longlong.h linux-3.1.10.patch/arch/arm/lib/longlong.h --- linux-3.1.10/arch/arm/lib/longlong.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/lib/longlong.h 2012-04-28 22:26:48.601712077 +0200 ++++ linux-3.1.10.patch/arch/arm/lib/longlong.h 2012-05-02 00:07:05.022250284 +0200 @@ -0,0 +1,151 @@ +/* longlong.h -- based on code from gcc-2.95.3 + @@ -2638,64 +2614,22 @@ diff -Naur linux-3.1.10/arch/arm/lib/longlong.h linux-3.1.10.patch/arch/arm/lib/ + +#define UDIV_NEEDS_NORMALIZATION 1 +#define udiv_qrnnd __udiv_qrnnd_c -diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/Kconfig linux-3.1.10.patch/arch/arm/mach-bcm2708/Kconfig ---- linux-3.1.10/arch/arm/mach-bcm2708/Kconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/Kconfig 2012-04-28 22:26:48.811716356 +0200 -@@ -0,0 +1,32 @@ -+menu "Broadcom BCM2708 Implementations" -+ depends on ARCH_BCM2708 -+ -+config MACH_BCM2708 -+ bool "Broadcom BCM2708 Development Platform" -+ 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.1.10/arch/arm/mach-bcm2708/Makefile linux-3.1.10.patch/arch/arm/mach-bcm2708/Makefile ---- linux-3.1.10/arch/arm/mach-bcm2708/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/Makefile 2012-04-28 22:26:48.602712097 +0200 -@@ -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 -+obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o -+obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o -+ -diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/Makefile.boot linux-3.1.10.patch/arch/arm/mach-bcm2708/Makefile.boot ---- linux-3.1.10/arch/arm/mach-bcm2708/Makefile.boot 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/Makefile.boot 2012-04-28 22:26:48.602712097 +0200 -@@ -0,0 +1,3 @@ -+ zreladdr-y := 0x00008000 -+params_phys-y := 0x00000100 -+initrd_phys-y := 0x00800000 +diff -Naur linux-3.1.10/arch/arm/lib/Makefile linux-3.1.10.patch/arch/arm/lib/Makefile +--- linux-3.1.10/arch/arm/lib/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/lib/Makefile 2012-05-02 00:07:05.021250264 +0200 +@@ -13,7 +13,8 @@ + testchangebit.o testclearbit.o testsetbit.o \ + ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ + ucmpdi2.o lib1funcs.o div64.o \ +- io-readsb.o io-writesb.o io-readsl.o io-writesl.o ++ io-readsb.o io-writesb.o io-readsl.o io-writesl.o \ ++ divdi3.o + + mmu-y := clear_user.o copy_page.o getuser.o putuser.o + diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/armctrl.c linux-3.1.10.patch/arch/arm/mach-bcm2708/armctrl.c --- linux-3.1.10/arch/arm/mach-bcm2708/armctrl.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/armctrl.c 2012-04-28 22:26:48.603712117 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/armctrl.c 2012-05-02 00:07:05.024250324 +0200 @@ -0,0 +1,399 @@ +/* + * linux/arch/arm/mach-bcm2708/armctrl.c @@ -3098,7 +3032,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/armctrl.c linux-3.1.10.patch/arch/ +} diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/armctrl.h linux-3.1.10.patch/arch/arm/mach-bcm2708/armctrl.h --- linux-3.1.10/arch/arm/mach-bcm2708/armctrl.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/armctrl.h 2012-04-28 22:26:48.604712137 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/armctrl.h 2012-05-02 00:07:05.025250344 +0200 @@ -0,0 +1,27 @@ +/* + * linux/arch/arm/mach-bcm2708/armctrl.h @@ -3129,7 +3063,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/armctrl.h linux-3.1.10.patch/arch/ +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/bcm2708.c linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708.c --- linux-3.1.10/arch/arm/mach-bcm2708/bcm2708.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708.c 2012-04-28 22:26:48.893718028 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708.c 2012-05-02 00:07:05.493259762 +0200 @@ -0,0 +1,649 @@ +/* + * linux/arch/arm/mach-bcm2708/bcm2708.c @@ -3780,64 +3714,9 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/bcm2708.c linux-3.1.10.patch/arch/ + &bcm2708_timer,.init_machine = + bcm2708_init, MACHINE_END module_param(boardrev, uint, 0644); +module_param(serial, uint, 0644); -diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/bcm2708.h linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708.h ---- linux-3.1.10/arch/arm/mach-bcm2708/bcm2708.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708.h 2012-04-28 22:26:48.606712178 +0200 -@@ -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.1.10/arch/arm/mach-bcm2708/bcm2708_gpio.c linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708_gpio.c --- linux-3.1.10/arch/arm/mach-bcm2708/bcm2708_gpio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708_gpio.c 2012-04-28 22:26:48.607712199 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708_gpio.c 2012-05-02 00:07:05.027250384 +0200 @@ -0,0 +1,323 @@ +/* + * linux/arch/arm/mach-bcm2708/bcm2708_gpio.c @@ -4162,9 +4041,64 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/bcm2708_gpio.c linux-3.1.10.patch/ +MODULE_DESCRIPTION("Broadcom BCM2708 GPIO driver"); +MODULE_LICENSE("GPL"); + +diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/bcm2708.h linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708.h +--- linux-3.1.10/arch/arm/mach-bcm2708/bcm2708.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/bcm2708.h 2012-05-02 00:07:05.026250364 +0200 +@@ -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.1.10/arch/arm/mach-bcm2708/clock.c linux-3.1.10.patch/arch/arm/mach-bcm2708/clock.c --- linux-3.1.10/arch/arm/mach-bcm2708/clock.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/clock.c 2012-04-28 22:26:48.631712687 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/clock.c 2012-05-02 00:07:05.027250384 +0200 @@ -0,0 +1,61 @@ +/* + * linux/arch/arm/mach-bcm2708/clock.c @@ -4229,7 +4163,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/clock.c linux-3.1.10.patch/arch/ar +EXPORT_SYMBOL(clk_set_rate); diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/clock.h linux-3.1.10.patch/arch/arm/mach-bcm2708/clock.h --- linux-3.1.10/arch/arm/mach-bcm2708/clock.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/clock.h 2012-04-28 22:26:48.631712687 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/clock.h 2012-05-02 00:07:05.028250404 +0200 @@ -0,0 +1,24 @@ +/* + * linux/arch/arm/mach-bcm2708/clock.h @@ -4257,7 +4191,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/clock.h linux-3.1.10.patch/arch/ar +}; diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/dma.c linux-3.1.10.patch/arch/arm/mach-bcm2708/dma.c --- linux-3.1.10/arch/arm/mach-bcm2708/dma.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/dma.c 2012-04-28 22:26:48.632712707 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/dma.c 2012-05-02 00:07:05.029250424 +0200 @@ -0,0 +1,397 @@ +/* + * linux/arch/arm/mach-bcm2708/dma.c @@ -4658,7 +4592,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/dma.c linux-3.1.10.patch/arch/arm/ +MODULE_PARM_DESC(dmachans, "Bitmap of DMA channels available to the ARM"); diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/arm_control.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/arm_control.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/arm_control.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/arm_control.h 2012-04-28 22:26:48.634712748 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/arm_control.h 2012-05-02 00:07:05.030250444 +0200 @@ -0,0 +1,419 @@ +/* + * linux/arch/arm/mach-bcm2708/arm_control.h @@ -5081,7 +5015,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/arm_control.h linux-3 +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/arm_power.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/arm_power.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/arm_power.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/arm_power.h 2012-04-28 22:26:48.635712769 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/arm_power.h 2012-05-02 00:07:05.031250464 +0200 @@ -0,0 +1,60 @@ +/* + * linux/arch/arm/mach-bcm2708/include/mach/arm_power.h @@ -5145,7 +5079,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/arm_power.h linux-3.1 +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/clkdev.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/clkdev.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/clkdev.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/clkdev.h 2012-04-28 22:26:48.635712769 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/clkdev.h 2012-05-02 00:07:05.031250464 +0200 @@ -0,0 +1,7 @@ +#ifndef __ASM_MACH_CLKDEV_H +#define __ASM_MACH_CLKDEV_H @@ -5156,7 +5090,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/clkdev.h linux-3.1.10 +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/debug-macro.S linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/debug-macro.S --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/debug-macro.S 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/debug-macro.S 2012-04-28 22:26:48.635712769 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/debug-macro.S 2012-05-02 00:07:05.031250464 +0200 @@ -0,0 +1,24 @@ +/* arch/arm/mach-bcm2708/include/mach/debug-macro.S + * @@ -5184,7 +5118,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/debug-macro.S linux-3 +#include diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/dma.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/dma.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/dma.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/dma.h 2012-04-28 22:26:48.636712790 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/dma.h 2012-05-02 00:07:05.032250484 +0200 @@ -0,0 +1,84 @@ +/* + * linux/arch/arm/mach-bcm2708/include/mach/dma.h @@ -5272,7 +5206,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/dma.h linux-3.1.10.pa +#endif /* _MACH_BCM2708_DMA_H */ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/entry-macro.S linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/entry-macro.S --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/entry-macro.S 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/entry-macro.S 2012-04-28 22:26:48.637712811 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/entry-macro.S 2012-05-02 00:07:05.032250484 +0200 @@ -0,0 +1,69 @@ +/* + * arch/arm/mach-bcm2708/include/mach/entry-macro.S @@ -5345,7 +5279,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/entry-macro.S linux-3 + .endm diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/frc.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/frc.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/frc.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/frc.h 2012-04-28 22:26:48.637712811 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/frc.h 2012-05-02 00:07:05.032250484 +0200 @@ -0,0 +1,38 @@ +/* + * arch/arm/mach-bcm2708/include/mach/timex.h @@ -5387,7 +5321,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/frc.h linux-3.1.10.pa +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/gpio.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/gpio.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/gpio.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/gpio.h 2012-04-28 22:26:48.638712831 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/gpio.h 2012-05-02 00:07:05.033250504 +0200 @@ -0,0 +1,48 @@ +/* + * arch/arm/mach-bcm2708/include/mach/gpio.h @@ -5439,7 +5373,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/gpio.h linux-3.1.10.p +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/hardware.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/hardware.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/hardware.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/hardware.h 2012-04-28 22:26:48.638712831 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/hardware.h 2012-05-02 00:07:05.033250504 +0200 @@ -0,0 +1,28 @@ +/* + * arch/arm/mach-bcm2708/include/mach/hardware.h @@ -5471,7 +5405,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/hardware.h linux-3.1. +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/io.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/io.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/io.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/io.h 2012-04-28 22:26:48.639712851 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/io.h 2012-05-02 00:07:05.034250524 +0200 @@ -0,0 +1,28 @@ +/* + * arch/arm/mach-bcm2708/include/mach/io.h @@ -5503,7 +5437,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/io.h linux-3.1.10.pat +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/irqs.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/irqs.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/irqs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/irqs.h 2012-04-28 22:26:48.640712871 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/irqs.h 2012-05-02 00:07:05.035250544 +0200 @@ -0,0 +1,190 @@ +/* + * arch/arm/mach-bcm2708/include/mach/irqs.h @@ -5697,7 +5631,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/irqs.h linux-3.1.10.p +#endif /* _BCM2708_IRQS_H_ */ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/irqs.h.orig linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/irqs.h.orig --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/irqs.h.orig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/irqs.h.orig 2012-04-28 22:26:48.641712891 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/irqs.h.orig 2012-05-02 00:07:05.035250544 +0200 @@ -0,0 +1,185 @@ +/* + * arch/arm/mach-bcm2708/include/mach/irqs.h @@ -5886,7 +5820,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/irqs.h.orig linux-3.1 +#define NR_IRQS (64 + 21) diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/memory.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/memory.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/memory.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/memory.h 2012-04-28 22:26:48.811716356 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/memory.h 2012-05-02 00:07:05.397257829 +0200 @@ -0,0 +1,64 @@ +/* + * arch/arm/mach-bcm2708/include/mach/memory.h @@ -5954,7 +5888,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/memory.h linux-3.1.10 +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/platform.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/platform.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/platform.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/platform.h 2012-04-28 22:26:48.642712911 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/platform.h 2012-05-02 00:07:05.036250564 +0200 @@ -0,0 +1,210 @@ +/* + * arch/arm/mach-bcm2708/include/mach/platform.h @@ -6168,7 +6102,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/platform.h linux-3.1. +/* END */ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/platform.h.orig linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/platform.h.orig --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/platform.h.orig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/platform.h.orig 2012-04-28 22:26:48.643712931 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/platform.h.orig 2012-05-02 00:07:05.037250585 +0200 @@ -0,0 +1,210 @@ +/* + * arch/arm/mach-bcm2708/include/mach/platform.h @@ -6382,7 +6316,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/platform.h.orig linux +/* END */ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/power.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/power.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/power.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/power.h 2012-04-28 22:26:48.643712931 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/power.h 2012-05-02 00:07:05.037250585 +0200 @@ -0,0 +1,26 @@ +/* + * linux/arch/arm/mach-bcm2708/power.h @@ -6412,7 +6346,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/power.h linux-3.1.10. +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/system.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/system.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/system.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/system.h 2012-04-28 22:26:48.644712952 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/system.h 2012-05-02 00:07:05.038250605 +0200 @@ -0,0 +1,53 @@ +/* + * arch/arm/mach-bcm2708/include/mach/system.h @@ -6469,7 +6403,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/system.h linux-3.1.10 +#endif diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/timex.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/timex.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/timex.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/timex.h 2012-04-28 22:26:48.644712952 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/timex.h 2012-05-02 00:07:05.038250605 +0200 @@ -0,0 +1,23 @@ +/* + * arch/arm/mach-bcm2708/include/mach/timex.h @@ -6496,7 +6430,7 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/timex.h linux-3.1.10. +#define CLOCK_TICK_RATE (1000000) diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/uncompress.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/uncompress.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/uncompress.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/uncompress.h 2012-04-28 22:26:48.645712973 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/uncompress.h 2012-05-02 00:07:05.039250625 +0200 @@ -0,0 +1,49 @@ +/* + * arch/arm/mach-bcn2708/include/mach/uncompress.h @@ -6547,48 +6481,9 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/uncompress.h linux-3. + */ +#define arch_decomp_setup() +#define arch_decomp_wdog() -diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/vc_mem.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vc_mem.h ---- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/vc_mem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vc_mem.h 2012-04-28 22:26:48.883717824 +0200 -@@ -0,0 +1,35 @@ -+/***************************************************************************** -+* 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 ) -+ -+#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.1.10/arch/arm/mach-bcm2708/include/mach/vcio.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vcio.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/vcio.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vcio.h 2012-04-28 22:26:48.646712994 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vcio.h 2012-05-02 00:07:05.039250625 +0200 @@ -0,0 +1,42 @@ +/* + * arch/arm/mach-bcm2708/include/mach/vcio.h @@ -6632,9 +6527,48 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/vcio.h linux-3.1.10.p +extern int /*rc*/ bcm_mailbox_write(unsigned chan, uint32_t data28); + +#endif +diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/vc_mem.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vc_mem.h +--- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/vc_mem.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vc_mem.h 2012-05-02 00:07:05.471259319 +0200 +@@ -0,0 +1,35 @@ ++/***************************************************************************** ++* 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 ) ++ ++#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.1.10/arch/arm/mach-bcm2708/include/mach/vmalloc.h linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vmalloc.h --- linux-3.1.10/arch/arm/mach-bcm2708/include/mach/vmalloc.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vmalloc.h 2012-04-28 22:26:48.646712994 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/include/mach/vmalloc.h 2012-05-02 00:07:05.040250645 +0200 @@ -0,0 +1,20 @@ +/* + * arch/arm/mach-bcm2708/include/mach/vmalloc.h @@ -6656,9 +6590,64 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/include/mach/vmalloc.h linux-3.1.1 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#define VMALLOC_END (0xd8000000) +diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/Kconfig linux-3.1.10.patch/arch/arm/mach-bcm2708/Kconfig +--- linux-3.1.10/arch/arm/mach-bcm2708/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/Kconfig 2012-05-02 00:07:05.397257829 +0200 +@@ -0,0 +1,32 @@ ++menu "Broadcom BCM2708 Implementations" ++ depends on ARCH_BCM2708 ++ ++config MACH_BCM2708 ++ bool "Broadcom BCM2708 Development Platform" ++ 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.1.10/arch/arm/mach-bcm2708/Makefile linux-3.1.10.patch/arch/arm/mach-bcm2708/Makefile +--- linux-3.1.10/arch/arm/mach-bcm2708/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/Makefile 2012-05-02 00:07:05.023250304 +0200 +@@ -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 ++obj-$(CONFIG_BCM2708_GPIO) += bcm2708_gpio.o ++obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o ++ +diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/Makefile.boot linux-3.1.10.patch/arch/arm/mach-bcm2708/Makefile.boot +--- linux-3.1.10/arch/arm/mach-bcm2708/Makefile.boot 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/Makefile.boot 2012-05-02 00:07:05.024250324 +0200 +@@ -0,0 +1,3 @@ ++ zreladdr-y := 0x00008000 ++params_phys-y := 0x00000100 ++initrd_phys-y := 0x00800000 diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/power.c linux-3.1.10.patch/arch/arm/mach-bcm2708/power.c --- linux-3.1.10/arch/arm/mach-bcm2708/power.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/power.c 2012-04-28 22:26:48.817716479 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/power.c 2012-05-02 00:07:05.402257930 +0200 @@ -0,0 +1,195 @@ +/* + * linux/arch/arm/mach-bcm2708/power.c @@ -6855,9 +6844,322 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/power.c linux-3.1.10.patch/arch/ar +MODULE_AUTHOR("Phil Elwell"); +MODULE_DESCRIPTION("Interface to BCM2708 power management"); +MODULE_LICENSE("GPL"); +diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/vcio.c linux-3.1.10.patch/arch/arm/mach-bcm2708/vcio.c +--- linux-3.1.10/arch/arm/mach-bcm2708/vcio.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/vcio.c 2012-05-02 00:07:05.042250685 +0200 +@@ -0,0 +1,309 @@ ++/* ++ * 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 { ++ if (mbox->msg[chan] || ++ (down_interruptible(&mbox->sema[chan]) == 0)) { ++ *data28 = MBOX_DATA28(mbox->msg[chan]); ++ mbox->msg[chan] = 0; ++ rc = 0; ++ } else { ++ /* The wait was interrupted */ ++ rc = -EINTR; ++ } ++ } ++ 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; ++} ++ ++/* ---------------------------------------------------------------------- ++ * 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.1.10/arch/arm/mach-bcm2708/vc_mem.c linux-3.1.10.patch/arch/arm/mach-bcm2708/vc_mem.c --- linux-3.1.10/arch/arm/mach-bcm2708/vc_mem.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/vc_mem.c 2012-04-28 22:26:48.886717884 +0200 ++++ linux-3.1.10.patch/arch/arm/mach-bcm2708/vc_mem.c 2012-05-02 00:07:05.474259379 +0200 @@ -0,0 +1,466 @@ +/***************************************************************************** +* Copyright 2010 - 2011 Broadcom Corporation. All rights reserved. @@ -7325,334 +7627,20 @@ diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/vc_mem.c linux-3.1.10.patch/arch/a +module_exit(vc_mem_exit); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Broadcom Corporation"); -diff -Naur linux-3.1.10/arch/arm/mach-bcm2708/vcio.c linux-3.1.10.patch/arch/arm/mach-bcm2708/vcio.c ---- linux-3.1.10/arch/arm/mach-bcm2708/vcio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mach-bcm2708/vcio.c 2012-04-28 22:26:48.649713054 +0200 -@@ -0,0 +1,309 @@ -+/* -+ * 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 { -+ if (mbox->msg[chan] || -+ (down_interruptible(&mbox->sema[chan]) == 0)) { -+ *data28 = MBOX_DATA28(mbox->msg[chan]); -+ mbox->msg[chan] = 0; -+ rc = 0; -+ } else { -+ /* The wait was interrupted */ -+ rc = -EINTR; -+ } -+ } -+ 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; -+} -+ -+/* ---------------------------------------------------------------------- -+ * 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.1.10/arch/arm/mm/Kconfig linux-3.1.10.patch/arch/arm/mm/Kconfig ---- linux-3.1.10/arch/arm/mm/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mm/Kconfig 2012-04-28 22:26:48.650713074 +0200 -@@ -390,7 +390,7 @@ +diff -Naur linux-3.1.10/arch/arm/Makefile linux-3.1.10.patch/arch/arm/Makefile +--- linux-3.1.10/arch/arm/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/Makefile 2012-05-02 00:07:04.993249700 +0200 +@@ -196,6 +196,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 + # Platform directory name. This list is sorted alphanumerically + # by CONFIG_* macro name. diff -Naur linux-3.1.10/arch/arm/mm/alignment.c linux-3.1.10.patch/arch/arm/mm/alignment.c --- linux-3.1.10/arch/arm/mm/alignment.c 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mm/alignment.c 2012-04-28 22:26:48.651713094 +0200 ++++ linux-3.1.10.patch/arch/arm/mm/alignment.c 2012-05-02 00:07:05.043250705 +0200 @@ -855,9 +855,11 @@ case 0x08000000: /* ldm or stm, or thumb-2 32bit instruction */ if (thumb2_32b) @@ -7667,9 +7655,21 @@ diff -Naur linux-3.1.10/arch/arm/mm/alignment.c linux-3.1.10.patch/arch/arm/mm/a default: goto bad; +diff -Naur linux-3.1.10/arch/arm/mm/Kconfig linux-3.1.10.patch/arch/arm/mm/Kconfig +--- linux-3.1.10/arch/arm/mm/Kconfig 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/arch/arm/mm/Kconfig 2012-05-02 00:07:05.043250705 +0200 +@@ -390,7 +390,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.1.10/arch/arm/mm/proc-v6.S linux-3.1.10.patch/arch/arm/mm/proc-v6.S --- linux-3.1.10/arch/arm/mm/proc-v6.S 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/arch/arm/mm/proc-v6.S 2012-04-28 22:26:48.652713115 +0200 ++++ linux-3.1.10.patch/arch/arm/mm/proc-v6.S 2012-05-02 00:07:05.050250847 +0200 @@ -70,10 +70,19 @@ * * IRQs are already disabled. @@ -7695,7 +7695,7 @@ diff -Naur linux-3.1.10/arch/arm/mm/proc-v6.S linux-3.1.10.patch/arch/arm/mm/pro ENTRY(cpu_v6_dcache_clean_area) diff -Naur linux-3.1.10/drivers/misc/Kconfig linux-3.1.10.patch/drivers/misc/Kconfig --- linux-3.1.10/drivers/misc/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/Kconfig 2012-04-28 22:26:48.677713625 +0200 ++++ linux-3.1.10.patch/drivers/misc/Kconfig 2012-05-02 00:07:05.183253524 +0200 @@ -507,5 +507,6 @@ source "drivers/misc/ti-st/Kconfig" source "drivers/misc/lis3lv02d/Kconfig" @@ -7705,51 +7705,15 @@ diff -Naur linux-3.1.10/drivers/misc/Kconfig linux-3.1.10.patch/drivers/misc/Kco endif # MISC_DEVICES diff -Naur linux-3.1.10/drivers/misc/Makefile linux-3.1.10.patch/drivers/misc/Makefile --- linux-3.1.10/drivers/misc/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/Makefile 2012-04-28 22:26:48.678713645 +0200 ++++ linux-3.1.10.patch/drivers/misc/Makefile 2012-05-02 00:07:05.183253524 +0200 @@ -47,3 +47,4 @@ obj-y += lis3lv02d/ obj-y += carma/ obj-$(CONFIG_USB_SWITCH_FSA9480) += fsa9480.o +obj-y += vc04_services/ -diff -Naur linux-3.1.10/drivers/misc/vc04_services/Kconfig linux-3.1.10.patch/drivers/misc/vc04_services/Kconfig ---- linux-3.1.10/drivers/misc/vc04_services/Kconfig 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/Kconfig 2012-04-28 22:26:48.678713645 +0200 -@@ -0,0 +1,7 @@ -+config BCM2708_VCHIQ -+ tristate "Videocore VCHIQ" -+ depends on MACH_BCM2708 -+ default y -+ help -+ Helper for communication for VideoCore. -+ -diff -Naur linux-3.1.10/drivers/misc/vc04_services/Makefile linux-3.1.10.patch/drivers/misc/vc04_services/Makefile ---- linux-3.1.10/drivers/misc/vc04_services/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/Makefile 2012-04-28 22:26:48.822716579 +0200 -@@ -0,0 +1,21 @@ -+obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o -+ -+vchiq-objs := \ -+ interface/vchiq_arm/vchiq_core.o \ -+ interface/vchiq_arm/vchiq_shim.o \ -+ interface/vchiq_arm/vchiq_util.o \ -+ interface/vchiq_arm/vchiq_arm.o \ -+ interface/vchiq_arm/vchiq_kern_lib.o \ -+ interface/vchiq_arm/vchiq_2835_arm.o \ -+ interface/vcos/linuxkernel/vcos_linuxkernel.o \ -+ interface/vcos/linuxkernel/vcos_thread_map.o \ -+ interface/vcos/linuxkernel/vcos_linuxkernel_cfg.o \ -+ interface/vcos/generic/vcos_generic_event_flags.o \ -+ interface/vcos/generic/vcos_logcat.o \ -+ interface/vcos/generic/vcos_mem_from_malloc.o \ -+ interface/vcos/generic/vcos_cmd.o -+ -+EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel -+ -+ -+ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchi/connections/connection.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/connections/connection.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/connections/connection.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/connections/connection.h 2012-04-28 22:26:48.823716600 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/connections/connection.h 2012-05-02 00:07:05.407258031 +0200 @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -8062,7 +8026,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchi/connections/co +/****************************** End of file **********************************/ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 2012-04-28 22:26:48.824716621 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/message_drivers/message.h 2012-05-02 00:07:05.408258051 +0200 @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -8250,9 +8214,443 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchi/message_driver +#endif // _VCHI_MESSAGE_H_ + +/****************************** End of file ***********************************/ +diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h +--- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 2012-05-02 00:07:05.424258374 +0200 +@@ -0,0 +1,214 @@ ++/* ++ * 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 ++ */ ++ ++/*============================================================================= ++Contains the #defines for the number of servers / clients etc, these can be ++over-ridden from the platform makefile if needed ++=============================================================================*/ ++ ++#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.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h +--- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 2012-05-02 00:07:05.431258514 +0200 +@@ -0,0 +1,56 @@ ++/* ++ * 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 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.1.10/drivers/misc/vc04_services/interface/vchi/vchi_common.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_common.h +--- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_common.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_common.h 2012-05-02 00:07:05.432258534 +0200 +@@ -0,0 +1,152 @@ ++/* ++ * 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 ++ */ ++ ++/*============================================================================= ++Contains global defs used by submodules within vchi. ++=============================================================================*/ ++ ++#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.1.10/drivers/misc/vc04_services/interface/vchi/vchi.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi.h 2012-04-28 22:26:48.825716642 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi.h 2012-05-02 00:07:05.409258071 +0200 @@ -0,0 +1,347 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -8601,443 +8999,9 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi.h linux-3 +#endif /* VCHI_H_ */ + +/****************************** End of file **********************************/ -diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h ---- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg.h 2012-04-28 22:26:48.826716662 +0200 -@@ -0,0 +1,214 @@ -+/* -+ * 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 -+ */ -+ -+/*============================================================================= -+Contains the #defines for the number of servers / clients etc, these can be -+over-ridden from the platform makefile if needed -+=============================================================================*/ -+ -+#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.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h ---- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_cfg_internal.h 2012-04-28 22:26:48.826716662 +0200 -@@ -0,0 +1,56 @@ -+/* -+ * 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 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.1.10/drivers/misc/vc04_services/interface/vchi/vchi_common.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_common.h ---- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_common.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_common.h 2012-04-28 22:26:48.827716682 +0200 -@@ -0,0 +1,152 @@ -+/* -+ * 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 -+ */ -+ -+/*============================================================================= -+Contains global defs used by submodules within vchi. -+=============================================================================*/ -+ -+#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.1.10/drivers/misc/vc04_services/interface/vchi/vchi_mh.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_mh.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 2012-04-28 22:26:48.733714766 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchi/vchi_mh.h 2012-05-02 00:07:05.349256865 +0200 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -9066,71 +9030,9 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchi/vchi_mh.h linu +#define VCHI_MEM_HANDLE_INVALID 0 + +#endif -diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h ---- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 2012-04-28 22:26:48.680713685 +0200 -@@ -0,0 +1,27 @@ -+/* -+ * 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" -+#include "interface/vcos/vcos.h" -+ -+#endif -+ -diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h ---- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 2012-04-28 22:26:48.680713685 +0200 -@@ -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.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 2012-04-28 22:26:48.827716682 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c 2012-05-02 00:07:05.433258554 +0200 @@ -0,0 +1,512 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -9644,9 +9546,40 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_283 + kfree(pagelist); +} + +diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h +--- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835.h 2012-05-02 00:07:05.201253886 +0200 +@@ -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.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 2012-04-28 22:26:48.894718048 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c 2012-05-02 00:07:05.494259782 +0200 @@ -0,0 +1,1912 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -11562,7 +11495,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm +MODULE_AUTHOR("Broadcom Corporation"); diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 2012-04-28 22:26:48.830716742 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.h 2012-05-02 00:07:05.442258737 +0200 @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -11684,7 +11617,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm +#endif /* VCHIQ_ARM_H */ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 2012-04-28 22:26:48.684713768 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg.h 2012-05-02 00:07:05.212254108 +0200 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -11731,7 +11664,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cfg +#endif /* VCHIQ_CFG_H */ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 2012-04-28 22:26:48.684713768 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.c 2012-05-02 00:07:05.212254108 +0200 @@ -0,0 +1,101 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -11836,7 +11769,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_con +EXPORT_SYMBOL( vchiq_add_connected_callback ); diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 2012-04-28 22:26:48.685713788 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_connected.h 2012-05-02 00:07:05.212254108 +0200 @@ -0,0 +1,32 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -11872,7 +11805,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_con + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 2012-04-28 22:26:48.896718088 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.c 2012-05-02 00:07:05.496259822 +0200 @@ -0,0 +1,2717 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -14593,7 +14526,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cor +} diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 2012-04-28 22:26:48.896718088 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_core.h 2012-05-02 00:07:05.497259842 +0200 @@ -0,0 +1,506 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -15101,9 +15034,40 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_cor +vchiq_platform_conn_state_changed(VCHIQ_STATE_T* state, VCHIQ_CONNSTATE_T oldstate, VCHIQ_CONNSTATE_T newstate); + +#endif +diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h +--- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq.h 2012-05-02 00:07:05.193253725 +0200 +@@ -0,0 +1,27 @@ ++/* ++ * 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" ++#include "interface/vcos/vcos.h" ++ ++#endif ++ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 2012-04-28 22:26:48.834716825 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if.h 2012-05-02 00:07:05.446258817 +0200 @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -15262,7 +15226,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_if. +#endif /* VCHIQ_IF_H */ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 2012-04-28 22:26:48.897718108 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioctl.h 2012-05-02 00:07:05.497259842 +0200 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -15371,7 +15335,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ioc +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 2012-04-28 22:26:48.691713910 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_kern_lib.c 2012-05-02 00:07:05.226254389 +0200 @@ -0,0 +1,297 @@ +/***************************************************************************** +* Copyright 2001 - 2011 Broadcom Corporation. All rights reserved. @@ -15672,7 +15636,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_ker +EXPORT_SYMBOL(vchiq_open_service_params); diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c 2012-04-28 22:26:48.835716846 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib.c 2012-05-02 00:07:05.447258837 +0200 @@ -0,0 +1,1628 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -17304,7 +17268,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_lib +} diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 2012-04-28 22:26:48.695713992 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_memdrv.h 2012-05-02 00:07:05.254254953 +0200 @@ -0,0 +1,45 @@ +/***************************************************************************** +* Copyright 2001 - 2010 Broadcom Corporation. All rights reserved. @@ -17353,7 +17317,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_mem +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 2012-04-28 22:26:48.695713992 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pagelist.h 2012-05-02 00:07:05.255254973 +0200 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -17400,7 +17364,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_pag +#endif /* VCHIQ_PAGELIST_H */ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 2012-04-28 22:26:48.836716866 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shim.c 2012-05-02 00:07:05.448258857 +0200 @@ -0,0 +1,1001 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -18405,7 +18369,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_shi +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 2012-04-28 22:26:48.698714053 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.c 2012-05-02 00:07:05.257255013 +0200 @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -18506,7 +18470,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_uti +} diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 2012-04-28 22:26:48.699714073 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_util.h 2012-05-02 00:07:05.257255013 +0200 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010-2011 Broadcom Corporation. All rights reserved. @@ -18557,7 +18521,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_uti + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c 2012-04-28 22:26:48.701714113 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_cmd.c 2012-05-02 00:07:05.259255053 +0200 @@ -0,0 +1,681 @@ +/***************************************************************************** +* Copyright 2009 - 2011 Broadcom Corporation. All rights reserved. @@ -19242,7 +19206,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_c + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h 2012-04-28 22:26:48.734714787 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_common.h 2012-05-02 00:07:05.349256865 +0200 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19333,7 +19297,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_c + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h 2012-04-28 22:26:48.734714787 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_blockpool.h 2012-05-02 00:07:05.350256885 +0200 @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19608,7 +19572,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_g + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c 2012-04-28 22:26:48.735714808 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.c 2012-05-02 00:07:05.350256885 +0200 @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -19923,7 +19887,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_g +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h 2012-04-28 22:26:48.735714808 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_event_flags.h 2012-05-02 00:07:05.351256905 +0200 @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20045,7 +20009,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_g + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h 2012-04-28 22:26:48.736714828 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_named_sem.h 2012-05-02 00:07:05.351256905 +0200 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20141,7 +20105,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_g + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h 2012-04-28 22:26:48.736714828 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_quickslow_mutex.h 2012-05-02 00:07:05.352256925 +0200 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20231,7 +20195,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_g + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h 2012-04-28 22:26:48.737714848 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_reentrant_mtx.h 2012-05-02 00:07:05.352256925 +0200 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20321,7 +20285,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_g + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h 2012-04-28 22:26:48.737714848 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_generic_tls.h 2012-05-02 00:07:05.353256945 +0200 @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20480,7 +20444,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_g + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h 2012-04-28 22:26:48.738714868 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_joinable_thread_from_plain.h 2012-05-02 00:07:05.353256945 +0200 @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20698,7 +20662,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_j +#endif /* VCOS_JOINABLE_THREAD_FROM_PLAIN_H */ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h 2012-04-28 22:26:48.738714868 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_latch_from_sem.h 2012-05-02 00:07:05.354256965 +0200 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -20761,7 +20725,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_l + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c 2012-04-28 22:26:48.739714889 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_logcat.c 2012-05-02 00:07:05.354256965 +0200 @@ -0,0 +1,560 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -21325,7 +21289,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_l + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c 2012-04-28 22:26:48.739714889 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.c 2012-05-02 00:07:05.355256985 +0200 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -21413,7 +21377,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_m + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h 2012-04-28 22:26:48.740714909 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mem_from_malloc.h 2012-05-02 00:07:05.356257005 +0200 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -21482,7 +21446,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_m + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h 2012-04-28 22:26:48.740714909 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_mutexes_are_reentrant.h 2012-05-02 00:07:05.356257005 +0200 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -21565,7 +21529,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_m + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h 2012-04-28 22:26:48.741714929 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/generic/vcos_thread_reaper.h 2012-05-02 00:07:05.357257025 +0200 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -21615,7 +21579,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/generic/vcos_t + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h 2012-04-28 22:26:48.741714929 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/stdint.h 2012-05-02 00:07:05.357257025 +0200 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -21650,7 +21614,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/st +#endif /* _VCOS_PLATFORM_LINUX_STDINT_H */ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c 2012-04-28 22:26:48.742714949 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel.c 2012-05-02 00:07:05.357257025 +0200 @@ -0,0 +1,627 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -22281,7 +22245,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +EXPORT_SYMBOL( vcos_strdup ); diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c 2012-04-28 22:26:48.711714317 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_cfg.c 2012-05-02 00:07:05.269255253 +0200 @@ -0,0 +1,332 @@ +/***************************************************************************** +* Copyright 2009 - 2010 Broadcom Corporation. All rights reserved. @@ -22617,7 +22581,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c 2012-04-28 22:26:48.742714949 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_linuxkernel_misc.c 2012-05-02 00:07:05.358257045 +0200 @@ -0,0 +1,111 @@ +/***************************************************************************** +* Copyright 2009 - 2010 Broadcom Corporation. All rights reserved. @@ -22732,7 +22696,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +// ############################################################################# diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c 2012-04-28 22:26:48.713714359 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_mod_init.c 2012-05-02 00:07:05.270255274 +0200 @@ -0,0 +1,64 @@ +/***************************************************************************** +* Copyright 2006 - 2008 Broadcom Corporation. All rights reserved. @@ -22800,7 +22764,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h 2012-04-28 22:26:48.743714969 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform.h 2012-05-02 00:07:05.359257065 +0200 @@ -0,0 +1,507 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -23311,7 +23275,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h 2012-04-28 22:26:48.744714990 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_platform_types.h 2012-05-02 00:07:05.359257065 +0200 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -23373,7 +23337,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c 2012-04-28 22:26:48.715714400 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.c 2012-05-02 00:07:05.272255314 +0200 @@ -0,0 +1,129 @@ +/***************************************************************************** +* Copyright 2009 - 2010 Broadcom Corporation. All rights reserved. @@ -23506,7 +23470,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +} diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h 2012-04-28 22:26:48.716714420 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/linuxkernel/vcos_thread_map.h 2012-05-02 00:07:05.272255314 +0200 @@ -0,0 +1,39 @@ +/***************************************************************************** +* Copyright 2009 - 2010 Broadcom Corporation. All rights reserved. @@ -23547,225 +23511,9 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/linuxkernel/vc +VCOS_THREAD_T *vcos_kthread_current(void); + +#endif /*VCOS_THREAD_MAP_H */ -diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos.h ---- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos.h 2012-04-28 22:26:48.744714990 +0200 -@@ -0,0 +1,212 @@ -+/* -+ * 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 -+ */ -+ -+/*============================================================================= -+VideoCore OS Abstraction Layer - public header file -+=============================================================================*/ -+ -+/** -+ * \mainpage OS Abstraction Layer -+ * -+ * \section intro Introduction -+ * -+ * This abstraction layer is here to allow the underlying OS to be easily changed (e.g. from -+ * Nucleus to ThreadX) and to aid in porting host applications to new targets. -+ * -+ * \subsection error Error handling -+ * -+ * Wherever possible, VCOS functions assert internally and return void. The only exceptions -+ * are creation functions (which might fail due to lack of resources) and functions that -+ * might timeout or fail due to lack of space. Errors that might be reported by the underlying -+ * OS API (e.g. invalid mutex) are treated as a programming error, and are merely asserted on. -+ * -+ * \section thread_synch Threads and synchronisation -+ * -+ * \subsection thread Threads -+ * -+ * The thread API is somewhat different to that found in Nucleus. In particular, threads -+ * cannot just be destroyed at arbitrary times and nor can they merely exit. This is so -+ * that the same API can be implemented across all interesting platforms without too much -+ * difficulty. See vcos_thread.h for details. Thread attributes are configured via -+ * the VCOS_THREAD_ATTR_T structure, found in vcos_thread_attr.h. -+ * -+ * \subsection sema Semaphores -+ * -+ * Counted semaphores (c.f. Nucleus NU_SEMAPHORE) are created with VCOS_SEMAPHORE_T. -+ * Under ThreadX on VideoCore, semaphores are implemented using VideoCore spinlocks, and -+ * so are quite a lot faster than ordinary ThreadX semaphores. See vcos_semaphore.h. -+ * -+ * \subsection mtx Mutexes -+ * -+ * Mutexes are used for locking. Attempts to take a mutex twice, or to unlock it -+ * in a different thread to the one in which it was locked should be expected to fail. -+ * Mutexes are not re-entrant (see vcos_reentrant_mutex.h for a slightly slower -+ * re-entrant mutex). -+ * -+ * \subsection evflags Event flags -+ * -+ * Event flags (the ThreadX name - also known as event groups under Nucleus) provide -+ * 32 flags which can be waited on by multiple clients, and signalled by multiple clients. -+ * A timeout can be specified. See vcos_event_flags.h. An alternative to this is the -+ * VCOS_EVENT_T (see vcos_event.h) which is akin to the Win32 auto-reset event, or a -+ * saturating counted semaphore. -+ * -+ * \subsection event Events -+ * -+ * A VCOS_EVENT_T is a bit like a saturating semaphore. No matter how many times it -+ * is signalled, the waiter will only wake up once. See vcos_event.h. You might think this -+ * is useful if you suspect that the cost of reading the semaphore count (perhaps via a -+ * system call) is expensive on your platform. -+ * -+ * \subsection tls Thread local storage -+ * -+ * Thread local storage is supported using vcos_tls.h. This is emulated on Nucleus -+ * and ThreadX. -+ * -+ * \section int Interrupts -+ * -+ * The legacy LISR/HISR scheme found in Nucleus is supported via the legacy ISR API, -+ * which is also supported on ThreadX. New code should avoid this, and old code should -+ * be migrated away from it, since it is slow. See vcos_legacy_isr.h. -+ * -+ * Registering an interrupt handler, and disabling/restoring interrupts, is handled -+ * using the functions in vcos_isr.h. -+ * -+ */ -+ -+/** -+ * \file vcos.h -+ * -+ * This is the top level header file. Clients include this. It pulls in the platform-specific -+ * header file (vcos_platform.h) together with header files defining the expected APIs, such -+ * as vcos_mutex.h, vcos_semaphore.h, etc. It is also possible to include these header files -+ * directly. -+ * -+ */ -+ -+#ifndef VCOS_H -+#define VCOS_H -+ -+#include "interface/vcos/vcos_assert.h" -+#include "vcos_types.h" -+#include "vcos_platform.h" -+ -+#ifndef VCOS_INIT_H -+#include "interface/vcos/vcos_init.h" -+#endif -+ -+#ifndef VCOS_SEMAPHORE_H -+#include "interface/vcos/vcos_semaphore.h" -+#endif -+ -+#ifndef VCOS_THREAD_H -+#include "interface/vcos/vcos_thread.h" -+#endif -+ -+#ifndef VCOS_MUTEX_H -+#include "interface/vcos/vcos_mutex.h" -+#endif -+ -+#ifndef VCOS_MEM_H -+#include "interface/vcos/vcos_mem.h" -+#endif -+ -+#ifndef VCOS_LOGGING_H -+#include "interface/vcos/vcos_logging.h" -+#endif -+ -+#ifndef VCOS_STRING_H -+#include "interface/vcos/vcos_string.h" -+#endif -+ -+#ifndef VCOS_EVENT_H -+#include "interface/vcos/vcos_event.h" -+#endif -+ -+#ifndef VCOS_THREAD_ATTR_H -+#include "interface/vcos/vcos_thread_attr.h" -+#endif -+ -+#ifndef VCOS_TLS_H -+#include "interface/vcos/vcos_tls.h" -+#endif -+ -+#ifndef VCOS_REENTRANT_MUTEX_H -+#include "interface/vcos/vcos_reentrant_mutex.h" -+#endif -+ -+#ifndef VCOS_NAMED_SEMAPHORE_H -+#include "interface/vcos/vcos_named_semaphore.h" -+#endif -+ -+#ifndef VCOS_QUICKSLOW_MUTEX_H -+#include "interface/vcos/vcos_quickslow_mutex.h" -+#endif -+ -+/* Headers with predicates */ -+ -+#if VCOS_HAVE_EVENT_FLAGS -+#include "interface/vcos/vcos_event_flags.h" -+#endif -+ -+#if VCOS_HAVE_QUEUE -+#include "interface/vcos/vcos_queue.h" -+#endif -+ -+#if VCOS_HAVE_LEGACY_ISR -+#include "interface/vcos/vcos_legacy_isr.h" -+#endif -+ -+#if VCOS_HAVE_TIMER -+#include "interface/vcos/vcos_timer.h" -+#endif -+ -+#if VCOS_HAVE_MEMPOOL -+#include "interface/vcos/vcos_mempool.h" -+#endif -+ -+#if VCOS_HAVE_ISR -+#include "interface/vcos/vcos_isr.h" -+#endif -+ -+#if VCOS_HAVE_ATOMIC_FLAGS -+#include "interface/vcos/vcos_atomic_flags.h" -+#endif -+ -+#if VCOS_HAVE_ONCE -+#include "interface/vcos/vcos_once.h" -+#endif -+ -+#if VCOS_HAVE_BLOCK_POOL -+#include "interface/vcos/vcos_blockpool.h" -+#endif -+ -+#if VCOS_HAVE_FILE -+#include "interface/vcos/vcos_file.h" -+#endif -+ -+#if VCOS_HAVE_CFG -+#include "interface/vcos/vcos_cfg.h" -+#endif -+ -+#if VCOS_HAVE_CMD -+#include "interface/vcos/vcos_cmd.h" -+#endif -+ -+#endif /* VCOS_H */ -+ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_assert.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_assert.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_assert.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_assert.h 2012-04-28 22:26:48.745715011 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_assert.h 2012-05-02 00:07:05.360257085 +0200 @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24049,7 +23797,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_assert.h +#endif /* VCOS_ASSERT_H */ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h 2012-04-28 22:26:48.746715032 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_atomic_flags.h 2012-05-02 00:07:05.368257247 +0200 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24136,7 +23884,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_atomic_fl +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h 2012-04-28 22:26:48.746715032 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_build_info.h 2012-05-02 00:07:05.369257266 +0200 @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24163,7 +23911,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_build_inf + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h 2012-04-28 22:26:48.719714481 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h 2012-05-02 00:07:05.274255354 +0200 @@ -0,0 +1,113 @@ +/***************************************************************************** +* Copyright 2009 - 2011 Broadcom Corporation. All rights reserved. @@ -24280,7 +24028,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_cfg.h lin + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h 2012-04-28 22:26:48.720714501 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h 2012-05-02 00:07:05.275255374 +0200 @@ -0,0 +1,98 @@ +/***************************************************************************** +* Copyright 2009 - 2011 Broadcom Corporation. All rights reserved. @@ -24382,7 +24130,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_cmd.h lin + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h 2012-04-28 22:26:48.747715052 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h 2012-05-02 00:07:05.369257266 +0200 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24426,7 +24174,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_ctype.h l + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h 2012-04-28 22:26:48.747715052 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h 2012-05-02 00:07:05.369257266 +0200 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24508,121 +24256,9 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_dlfcn.h l +#endif + + -diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_event.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_event.h ---- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_event.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_event.h 2012-04-28 22:26:48.747715052 +0200 -@@ -0,0 +1,108 @@ -+/* -+ * 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 -+ */ -+ -+/*============================================================================= -+VideoCore OS Abstraction Layer - public header file for events -+=============================================================================*/ -+ -+#ifndef VCOS_EVENT_H -+#define VCOS_EVENT_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+#include "interface/vcos/vcos_types.h" -+#include "vcos_platform.h" -+ -+/** -+ * \file -+ * -+ * An event is akin to the Win32 auto-reset event. -+ * -+ * -+ * Signalling an event will wake up one waiting thread only. Once one -+ * thread has been woken the event atomically returns to the unsignalled -+ * state. -+ * -+ * If no threads are waiting on the event when it is signalled it remains -+ * signalled. -+ * -+ * This is almost, but not quite, completely unlike the "event flags" -+ * object based on Nucleus event groups and ThreadX event flags. -+ * -+ * In particular, it should be similar in speed to a semaphore, unlike -+ * the event flags. -+ */ -+ -+/** -+ * Create an event instance. -+ * -+ * @param event Filled in with constructed event. -+ * @param name Name of the event (for debugging) -+ * -+ * @return VCOS_SUCCESS on success, or error code. -+ */ -+VCOS_INLINE_DECL -+VCOS_STATUS_T vcos_event_create(VCOS_EVENT_T *event, const char *name); -+ -+#ifndef vcos_event_signal -+ -+/** -+ * Signal the event. The event will return to being unsignalled -+ * after exactly one waiting thread has been woken up. If no -+ * threads are waiting it remains signalled. -+ * -+ * @param event The event to signal -+ */ -+VCOS_INLINE_DECL -+void vcos_event_signal(VCOS_EVENT_T *event); -+ -+/** -+ * Wait for the event. -+ * -+ * @param event The event to wait for -+ * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the wait was interrupted. -+ */ -+VCOS_INLINE_DECL -+VCOS_STATUS_T vcos_event_wait(VCOS_EVENT_T *event); -+ -+/** -+ * Try event, but don't block. -+ * -+ * @param event The event to try -+ * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the event is not currently signalled -+ */ -+VCOS_INLINE_DECL -+VCOS_STATUS_T vcos_event_try(VCOS_EVENT_T *event); -+ -+#endif -+ -+/* -+ * Destroy an event. -+ */ -+VCOS_INLINE_DECL -+void vcos_event_delete(VCOS_EVENT_T *event); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif -+ -+ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h 2012-04-28 22:26:48.748715072 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_event_flags.h 2012-05-02 00:07:05.370257285 +0200 @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24733,9 +24369,337 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_event_fla + +#endif + +diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_event.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_event.h +--- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_event.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_event.h 2012-05-02 00:07:05.370257285 +0200 +@@ -0,0 +1,108 @@ ++/* ++ * 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 ++ */ ++ ++/*============================================================================= ++VideoCore OS Abstraction Layer - public header file for events ++=============================================================================*/ ++ ++#ifndef VCOS_EVENT_H ++#define VCOS_EVENT_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include "interface/vcos/vcos_types.h" ++#include "vcos_platform.h" ++ ++/** ++ * \file ++ * ++ * An event is akin to the Win32 auto-reset event. ++ * ++ * ++ * Signalling an event will wake up one waiting thread only. Once one ++ * thread has been woken the event atomically returns to the unsignalled ++ * state. ++ * ++ * If no threads are waiting on the event when it is signalled it remains ++ * signalled. ++ * ++ * This is almost, but not quite, completely unlike the "event flags" ++ * object based on Nucleus event groups and ThreadX event flags. ++ * ++ * In particular, it should be similar in speed to a semaphore, unlike ++ * the event flags. ++ */ ++ ++/** ++ * Create an event instance. ++ * ++ * @param event Filled in with constructed event. ++ * @param name Name of the event (for debugging) ++ * ++ * @return VCOS_SUCCESS on success, or error code. ++ */ ++VCOS_INLINE_DECL ++VCOS_STATUS_T vcos_event_create(VCOS_EVENT_T *event, const char *name); ++ ++#ifndef vcos_event_signal ++ ++/** ++ * Signal the event. The event will return to being unsignalled ++ * after exactly one waiting thread has been woken up. If no ++ * threads are waiting it remains signalled. ++ * ++ * @param event The event to signal ++ */ ++VCOS_INLINE_DECL ++void vcos_event_signal(VCOS_EVENT_T *event); ++ ++/** ++ * Wait for the event. ++ * ++ * @param event The event to wait for ++ * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the wait was interrupted. ++ */ ++VCOS_INLINE_DECL ++VCOS_STATUS_T vcos_event_wait(VCOS_EVENT_T *event); ++ ++/** ++ * Try event, but don't block. ++ * ++ * @param event The event to try ++ * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the event is not currently signalled ++ */ ++VCOS_INLINE_DECL ++VCOS_STATUS_T vcos_event_try(VCOS_EVENT_T *event); ++ ++#endif ++ ++/* ++ * Destroy an event. ++ */ ++VCOS_INLINE_DECL ++void vcos_event_delete(VCOS_EVENT_T *event); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif ++ ++ +diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos.h +--- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos.h 2012-05-02 00:07:05.360257085 +0200 +@@ -0,0 +1,212 @@ ++/* ++ * 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 ++ */ ++ ++/*============================================================================= ++VideoCore OS Abstraction Layer - public header file ++=============================================================================*/ ++ ++/** ++ * \mainpage OS Abstraction Layer ++ * ++ * \section intro Introduction ++ * ++ * This abstraction layer is here to allow the underlying OS to be easily changed (e.g. from ++ * Nucleus to ThreadX) and to aid in porting host applications to new targets. ++ * ++ * \subsection error Error handling ++ * ++ * Wherever possible, VCOS functions assert internally and return void. The only exceptions ++ * are creation functions (which might fail due to lack of resources) and functions that ++ * might timeout or fail due to lack of space. Errors that might be reported by the underlying ++ * OS API (e.g. invalid mutex) are treated as a programming error, and are merely asserted on. ++ * ++ * \section thread_synch Threads and synchronisation ++ * ++ * \subsection thread Threads ++ * ++ * The thread API is somewhat different to that found in Nucleus. In particular, threads ++ * cannot just be destroyed at arbitrary times and nor can they merely exit. This is so ++ * that the same API can be implemented across all interesting platforms without too much ++ * difficulty. See vcos_thread.h for details. Thread attributes are configured via ++ * the VCOS_THREAD_ATTR_T structure, found in vcos_thread_attr.h. ++ * ++ * \subsection sema Semaphores ++ * ++ * Counted semaphores (c.f. Nucleus NU_SEMAPHORE) are created with VCOS_SEMAPHORE_T. ++ * Under ThreadX on VideoCore, semaphores are implemented using VideoCore spinlocks, and ++ * so are quite a lot faster than ordinary ThreadX semaphores. See vcos_semaphore.h. ++ * ++ * \subsection mtx Mutexes ++ * ++ * Mutexes are used for locking. Attempts to take a mutex twice, or to unlock it ++ * in a different thread to the one in which it was locked should be expected to fail. ++ * Mutexes are not re-entrant (see vcos_reentrant_mutex.h for a slightly slower ++ * re-entrant mutex). ++ * ++ * \subsection evflags Event flags ++ * ++ * Event flags (the ThreadX name - also known as event groups under Nucleus) provide ++ * 32 flags which can be waited on by multiple clients, and signalled by multiple clients. ++ * A timeout can be specified. See vcos_event_flags.h. An alternative to this is the ++ * VCOS_EVENT_T (see vcos_event.h) which is akin to the Win32 auto-reset event, or a ++ * saturating counted semaphore. ++ * ++ * \subsection event Events ++ * ++ * A VCOS_EVENT_T is a bit like a saturating semaphore. No matter how many times it ++ * is signalled, the waiter will only wake up once. See vcos_event.h. You might think this ++ * is useful if you suspect that the cost of reading the semaphore count (perhaps via a ++ * system call) is expensive on your platform. ++ * ++ * \subsection tls Thread local storage ++ * ++ * Thread local storage is supported using vcos_tls.h. This is emulated on Nucleus ++ * and ThreadX. ++ * ++ * \section int Interrupts ++ * ++ * The legacy LISR/HISR scheme found in Nucleus is supported via the legacy ISR API, ++ * which is also supported on ThreadX. New code should avoid this, and old code should ++ * be migrated away from it, since it is slow. See vcos_legacy_isr.h. ++ * ++ * Registering an interrupt handler, and disabling/restoring interrupts, is handled ++ * using the functions in vcos_isr.h. ++ * ++ */ ++ ++/** ++ * \file vcos.h ++ * ++ * This is the top level header file. Clients include this. It pulls in the platform-specific ++ * header file (vcos_platform.h) together with header files defining the expected APIs, such ++ * as vcos_mutex.h, vcos_semaphore.h, etc. It is also possible to include these header files ++ * directly. ++ * ++ */ ++ ++#ifndef VCOS_H ++#define VCOS_H ++ ++#include "interface/vcos/vcos_assert.h" ++#include "vcos_types.h" ++#include "vcos_platform.h" ++ ++#ifndef VCOS_INIT_H ++#include "interface/vcos/vcos_init.h" ++#endif ++ ++#ifndef VCOS_SEMAPHORE_H ++#include "interface/vcos/vcos_semaphore.h" ++#endif ++ ++#ifndef VCOS_THREAD_H ++#include "interface/vcos/vcos_thread.h" ++#endif ++ ++#ifndef VCOS_MUTEX_H ++#include "interface/vcos/vcos_mutex.h" ++#endif ++ ++#ifndef VCOS_MEM_H ++#include "interface/vcos/vcos_mem.h" ++#endif ++ ++#ifndef VCOS_LOGGING_H ++#include "interface/vcos/vcos_logging.h" ++#endif ++ ++#ifndef VCOS_STRING_H ++#include "interface/vcos/vcos_string.h" ++#endif ++ ++#ifndef VCOS_EVENT_H ++#include "interface/vcos/vcos_event.h" ++#endif ++ ++#ifndef VCOS_THREAD_ATTR_H ++#include "interface/vcos/vcos_thread_attr.h" ++#endif ++ ++#ifndef VCOS_TLS_H ++#include "interface/vcos/vcos_tls.h" ++#endif ++ ++#ifndef VCOS_REENTRANT_MUTEX_H ++#include "interface/vcos/vcos_reentrant_mutex.h" ++#endif ++ ++#ifndef VCOS_NAMED_SEMAPHORE_H ++#include "interface/vcos/vcos_named_semaphore.h" ++#endif ++ ++#ifndef VCOS_QUICKSLOW_MUTEX_H ++#include "interface/vcos/vcos_quickslow_mutex.h" ++#endif ++ ++/* Headers with predicates */ ++ ++#if VCOS_HAVE_EVENT_FLAGS ++#include "interface/vcos/vcos_event_flags.h" ++#endif ++ ++#if VCOS_HAVE_QUEUE ++#include "interface/vcos/vcos_queue.h" ++#endif ++ ++#if VCOS_HAVE_LEGACY_ISR ++#include "interface/vcos/vcos_legacy_isr.h" ++#endif ++ ++#if VCOS_HAVE_TIMER ++#include "interface/vcos/vcos_timer.h" ++#endif ++ ++#if VCOS_HAVE_MEMPOOL ++#include "interface/vcos/vcos_mempool.h" ++#endif ++ ++#if VCOS_HAVE_ISR ++#include "interface/vcos/vcos_isr.h" ++#endif ++ ++#if VCOS_HAVE_ATOMIC_FLAGS ++#include "interface/vcos/vcos_atomic_flags.h" ++#endif ++ ++#if VCOS_HAVE_ONCE ++#include "interface/vcos/vcos_once.h" ++#endif ++ ++#if VCOS_HAVE_BLOCK_POOL ++#include "interface/vcos/vcos_blockpool.h" ++#endif ++ ++#if VCOS_HAVE_FILE ++#include "interface/vcos/vcos_file.h" ++#endif ++ ++#if VCOS_HAVE_CFG ++#include "interface/vcos/vcos_cfg.h" ++#endif ++ ++#if VCOS_HAVE_CMD ++#include "interface/vcos/vcos_cmd.h" ++#endif ++ ++#endif /* VCOS_H */ ++ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_init.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_init.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_init.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_init.h 2012-04-28 22:26:48.748715072 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_init.h 2012-05-02 00:07:05.371257305 +0200 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -24793,7 +24757,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_init.h li + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_logging.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_logging.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_logging.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_logging.h 2012-04-28 22:26:48.749715092 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_logging.h 2012-05-02 00:07:05.371257305 +0200 @@ -0,0 +1,290 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25087,7 +25051,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_logging.h + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h 2012-04-28 22:26:48.749715092 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_thread.h 2012-05-02 00:07:05.372257326 +0200 @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25209,7 +25173,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_lowlevel_ + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_mem.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_mem.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_mem.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_mem.h 2012-04-28 22:26:48.750715112 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_mem.h 2012-05-02 00:07:05.372257326 +0200 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25305,7 +25269,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_mem.h lin + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h 2012-04-28 22:26:48.750715112 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue.h 2012-05-02 00:07:05.373257347 +0200 @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25477,7 +25441,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_msgqueue. + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h 2012-04-28 22:26:48.751715132 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h 2012-05-02 00:07:05.381257509 +0200 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25584,7 +25548,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_mutex.h l +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_once.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_once.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_once.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_once.h 2012-04-28 22:26:48.751715132 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_once.h 2012-05-02 00:07:05.382257529 +0200 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25641,7 +25605,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_once.h li + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h 2012-04-28 22:26:48.752715153 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_semaphore.h 2012-05-02 00:07:05.382257529 +0200 @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25771,7 +25735,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_semaphore + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h 2012-04-28 22:26:48.752715153 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h 2012-05-02 00:07:05.382257529 +0200 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -25809,7 +25773,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_stdbool.h +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h 2012-04-28 22:26:48.753715174 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h 2012-05-02 00:07:05.383257549 +0200 @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -26016,7 +25980,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_stdint.h + diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_string.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_string.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_string.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_string.h 2012-04-28 22:26:48.753715174 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_string.h 2012-05-02 00:07:05.384257569 +0200 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -26102,9 +26066,100 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_string.h +} +#endif +#endif +diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h +--- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h 2012-05-02 00:07:05.385257589 +0200 +@@ -0,0 +1,87 @@ ++/* ++ * 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 ++ */ ++ ++/*============================================================================= ++VideoCore OS Abstraction Layer - thread attributes ++=============================================================================*/ ++ ++#ifndef VCOS_THREAD_ATTR_H ++#define VCOS_THREAD_ATTR_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/** ++ * \file ++ * ++ * Attributes for thread creation. ++ * ++ */ ++ ++/** Initialize thread attribute struct. This call does not allocate memory, ++ * and so cannot fail. ++ * ++ */ ++VCOSPRE_ void VCOSPOST_ vcos_thread_attr_init(VCOS_THREAD_ATTR_T *attrs); ++ ++/** Set the stack address and size. If not set, a stack will be allocated automatically. ++ * ++ * This can only be set on some platforms. It will always be possible to set the stack ++ * address on VideoCore, but on host platforms, support may well not be available. ++ */ ++#if VCOS_CAN_SET_STACK_ADDR ++VCOS_INLINE_DECL ++void vcos_thread_attr_setstack(VCOS_THREAD_ATTR_T *attrs, void *addr, VCOS_UNSIGNED sz); ++#endif ++ ++/** Set the stack size. If not set, a default size will be used. Attempting to call this after having ++ * set the stack location with vcos_thread_attr_setstack() will result in undefined behaviour. ++ */ ++VCOS_INLINE_DECL ++void vcos_thread_attr_setstacksize(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED sz); ++ ++/** Set the task priority. If not set, a default value will be used. ++ */ ++VCOS_INLINE_DECL ++void vcos_thread_attr_setpriority(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED pri); ++ ++/** Set the task cpu affinity. If not set, the default will be used. ++ */ ++VCOS_INLINE_DECL ++void vcos_thread_attr_setaffinity(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED aff); ++ ++/** Set the timeslice. If not set the default will be used. ++ */ ++VCOS_INLINE_DECL ++void vcos_thread_attr_settimeslice(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED ts); ++ ++/** The thread entry function takes (argc,argv), as per Nucleus, with ++ * argc being 0. This may be withdrawn in a future release and should not ++ * be used in new code. ++ */ ++VCOS_INLINE_DECL ++void _vcos_thread_attr_setlegacyapi(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED legacy); ++ ++VCOS_INLINE_DECL ++void vcos_thread_attr_setautostart(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED autostart); ++ ++#ifdef __cplusplus ++} ++#endif ++#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_thread.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_thread.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread.h 2012-04-28 22:26:48.754715195 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread.h 2012-05-02 00:07:05.384257569 +0200 @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -26376,100 +26431,9 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_thread.h +} +#endif +#endif -diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h ---- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_thread_attr.h 2012-04-28 22:26:48.754715195 +0200 -@@ -0,0 +1,87 @@ -+/* -+ * 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 -+ */ -+ -+/*============================================================================= -+VideoCore OS Abstraction Layer - thread attributes -+=============================================================================*/ -+ -+#ifndef VCOS_THREAD_ATTR_H -+#define VCOS_THREAD_ATTR_H -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/** -+ * \file -+ * -+ * Attributes for thread creation. -+ * -+ */ -+ -+/** Initialize thread attribute struct. This call does not allocate memory, -+ * and so cannot fail. -+ * -+ */ -+VCOSPRE_ void VCOSPOST_ vcos_thread_attr_init(VCOS_THREAD_ATTR_T *attrs); -+ -+/** Set the stack address and size. If not set, a stack will be allocated automatically. -+ * -+ * This can only be set on some platforms. It will always be possible to set the stack -+ * address on VideoCore, but on host platforms, support may well not be available. -+ */ -+#if VCOS_CAN_SET_STACK_ADDR -+VCOS_INLINE_DECL -+void vcos_thread_attr_setstack(VCOS_THREAD_ATTR_T *attrs, void *addr, VCOS_UNSIGNED sz); -+#endif -+ -+/** Set the stack size. If not set, a default size will be used. Attempting to call this after having -+ * set the stack location with vcos_thread_attr_setstack() will result in undefined behaviour. -+ */ -+VCOS_INLINE_DECL -+void vcos_thread_attr_setstacksize(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED sz); -+ -+/** Set the task priority. If not set, a default value will be used. -+ */ -+VCOS_INLINE_DECL -+void vcos_thread_attr_setpriority(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED pri); -+ -+/** Set the task cpu affinity. If not set, the default will be used. -+ */ -+VCOS_INLINE_DECL -+void vcos_thread_attr_setaffinity(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED aff); -+ -+/** Set the timeslice. If not set the default will be used. -+ */ -+VCOS_INLINE_DECL -+void vcos_thread_attr_settimeslice(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED ts); -+ -+/** The thread entry function takes (argc,argv), as per Nucleus, with -+ * argc being 0. This may be withdrawn in a future release and should not -+ * be used in new code. -+ */ -+VCOS_INLINE_DECL -+void _vcos_thread_attr_setlegacyapi(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED legacy); -+ -+VCOS_INLINE_DECL -+void vcos_thread_attr_setautostart(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED autostart); -+ -+#ifdef __cplusplus -+} -+#endif -+#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_timer.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_timer.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_timer.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_timer.h 2012-04-28 22:26:48.755715215 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_timer.h 2012-05-02 00:07:05.385257589 +0200 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -26579,7 +26543,7 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_timer.h l +#endif diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_types.h linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_types.h --- linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_types.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_types.h 2012-04-28 22:26:48.781715745 +0200 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/interface/vcos/vcos_types.h 2012-05-02 00:07:05.386257609 +0200 @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2010-2011 Broadcom. All rights reserved. @@ -26792,74 +26756,45 @@ diff -Naur linux-3.1.10/drivers/misc/vc04_services/interface/vcos/vcos_types.h l +typedef vcos_fourcc_t FOURCC_T; + +#endif -diff -Naur linux-3.1.10/drivers/mmc/host/Kconfig linux-3.1.10.patch/drivers/mmc/host/Kconfig ---- linux-3.1.10/drivers/mmc/host/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/mmc/host/Kconfig 2012-04-28 22:26:48.653713136 +0200 -@@ -229,6 +229,27 @@ - - YMMV. - -+config MMC_SDHCI_BCM2708 -+ tristate "SDHCI support on BCM2708" -+ depends on MMC_SDHCI && MACH_BCM2708 -+ select MMC_SDHCI_IO_ACCESSORS -+ help -+ This selects the Secure Digital Host Controller Interface (SDHCI) -+ often referrered to as the eMMC block. +diff -Naur linux-3.1.10/drivers/misc/vc04_services/Kconfig linux-3.1.10.patch/drivers/misc/vc04_services/Kconfig +--- linux-3.1.10/drivers/misc/vc04_services/Kconfig 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/Kconfig 2012-05-02 00:07:05.192253704 +0200 +@@ -0,0 +1,7 @@ ++config BCM2708_VCHIQ ++ tristate "Videocore VCHIQ" ++ depends on MACH_BCM2708 ++ default y ++ help ++ Helper for communication for VideoCore. + -+ If you have a controller with this interface, say Y or M here. +diff -Naur linux-3.1.10/drivers/misc/vc04_services/Makefile linux-3.1.10.patch/drivers/misc/vc04_services/Makefile +--- linux-3.1.10/drivers/misc/vc04_services/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/misc/vc04_services/Makefile 2012-05-02 00:07:05.406258011 +0200 +@@ -0,0 +1,21 @@ ++obj-$(CONFIG_BCM2708_VCHIQ) += vchiq.o + -+ If unsure, say N. ++vchiq-objs := \ ++ interface/vchiq_arm/vchiq_core.o \ ++ interface/vchiq_arm/vchiq_shim.o \ ++ interface/vchiq_arm/vchiq_util.o \ ++ interface/vchiq_arm/vchiq_arm.o \ ++ interface/vchiq_arm/vchiq_kern_lib.o \ ++ interface/vchiq_arm/vchiq_2835_arm.o \ ++ interface/vcos/linuxkernel/vcos_linuxkernel.o \ ++ interface/vcos/linuxkernel/vcos_thread_map.o \ ++ interface/vcos/linuxkernel/vcos_linuxkernel_cfg.o \ ++ interface/vcos/generic/vcos_generic_event_flags.o \ ++ interface/vcos/generic/vcos_logcat.o \ ++ interface/vcos/generic/vcos_mem_from_malloc.o \ ++ interface/vcos/generic/vcos_cmd.o + -+config MMC_SDHCI_BCM2708_DMA -+ bool "DMA support on BCM2708 Arasan controller" -+ depends on MMC_SDHCI_BCM2708 && EXPERIMENTAL -+ help -+ Enable DMA support on the Arasan SDHCI controller in Broadcom 2708 -+ based chips. ++EXTRA_CFLAGS += -DVCOS_VERIFY_BKPTS=1 -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel + -+ If unsure, say N. + - config MMC_OMAP - tristate "TI OMAP Multimedia Card Interface support" - depends on ARCH_OMAP -@@ -296,6 +317,14 @@ - If unsure, say N. - - endchoice -+config MMC_BCM2708 -+ tristate "BCM2708 Multimedia Card Interface support" -+ help -+ This selects the BCM2708 Multimedia Card Interface driver. If -+ you have a BCM2708 platform with a Multimedia Card -+ slot, say Y or M here. + -+ If unsure, say N. - - config MMC_ATMELMCI_DMA - bool "Atmel MCI DMA support" -diff -Naur linux-3.1.10/drivers/mmc/host/Makefile linux-3.1.10.patch/drivers/mmc/host/Makefile ---- linux-3.1.10/drivers/mmc/host/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/mmc/host/Makefile 2012-04-28 22:26:48.653713136 +0200 -@@ -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 -+obj-$(CONFIG_MMC_SDHCI_BCM2708) += sdhci-bcm2708.o - obj-$(CONFIG_MMC_WBSD) += wbsd.o - obj-$(CONFIG_MMC_AU1X) += au1xmmc.o - obj-$(CONFIG_MMC_OMAP) += omap.o -@@ -36,6 +37,7 @@ - obj-$(CONFIG_MMC_SDHI) += sh_mobile_sdhi.o - obj-$(CONFIG_MMC_CB710) += cb710-mmc.o - obj-$(CONFIG_MMC_VIA_SDMMC) += via-sdmmc.o -+obj-$(CONFIG_MMC_BCM2708) += bcm2708_mci.o - obj-$(CONFIG_SDH_BFIN) += bfin_sdh.o - obj-$(CONFIG_MMC_DW) += dw_mmc.o - obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o diff -Naur linux-3.1.10/drivers/mmc/host/bcm2708_mci.c linux-3.1.10.patch/drivers/mmc/host/bcm2708_mci.c --- linux-3.1.10/drivers/mmc/host/bcm2708_mci.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/mmc/host/bcm2708_mci.c 2012-04-28 22:26:48.654713157 +0200 ++++ linux-3.1.10.patch/drivers/mmc/host/bcm2708_mci.c 2012-05-02 00:07:05.067251190 +0200 @@ -0,0 +1,889 @@ +/* + * linux/drivers/mmc/host/bcm2708_mci.c - Broadcom BCM2708 MCI driver @@ -27752,7 +27687,7 @@ diff -Naur linux-3.1.10/drivers/mmc/host/bcm2708_mci.c linux-3.1.10.patch/driver +MODULE_ALIAS("platform:bcm2708_mci"); diff -Naur linux-3.1.10/drivers/mmc/host/bcm2708_mci.h linux-3.1.10.patch/drivers/mmc/host/bcm2708_mci.h --- linux-3.1.10/drivers/mmc/host/bcm2708_mci.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/mmc/host/bcm2708_mci.h 2012-04-28 22:26:48.655713177 +0200 ++++ linux-3.1.10.patch/drivers/mmc/host/bcm2708_mci.h 2012-05-02 00:07:05.067251190 +0200 @@ -0,0 +1,101 @@ +/* + * linux/drivers/mmc/host/bcm2708_mci.c - Broadcom BCM2708 MCI driver @@ -27855,9 +27790,74 @@ diff -Naur linux-3.1.10/drivers/mmc/host/bcm2708_mci.h linux-3.1.10.patch/driver + kunmap_atomic(buffer, KM_BIO_SRC_IRQ); +// local_irq_restore(*flags); +} +diff -Naur linux-3.1.10/drivers/mmc/host/Kconfig linux-3.1.10.patch/drivers/mmc/host/Kconfig +--- linux-3.1.10/drivers/mmc/host/Kconfig 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/mmc/host/Kconfig 2012-05-02 00:07:05.065251149 +0200 +@@ -229,6 +229,27 @@ + + YMMV. + ++config MMC_SDHCI_BCM2708 ++ tristate "SDHCI support on BCM2708" ++ depends on MMC_SDHCI && MACH_BCM2708 ++ select MMC_SDHCI_IO_ACCESSORS ++ help ++ This selects the Secure Digital Host Controller Interface (SDHCI) ++ often referrered to as the eMMC block. ++ ++ If you have a controller with this interface, say Y or M here. ++ ++ If unsure, say N. ++ ++config MMC_SDHCI_BCM2708_DMA ++ bool "DMA support on BCM2708 Arasan controller" ++ depends on MMC_SDHCI_BCM2708 && EXPERIMENTAL ++ help ++ Enable DMA support on the Arasan SDHCI controller in Broadcom 2708 ++ based chips. ++ ++ If unsure, say N. ++ + config MMC_OMAP + tristate "TI OMAP Multimedia Card Interface support" + depends on ARCH_OMAP +@@ -296,6 +317,14 @@ + If unsure, say N. + + endchoice ++config MMC_BCM2708 ++ tristate "BCM2708 Multimedia Card Interface support" ++ help ++ This selects the BCM2708 Multimedia Card Interface driver. If ++ you have a BCM2708 platform with a Multimedia Card ++ slot, say Y or M here. ++ ++ If unsure, say N. + + config MMC_ATMELMCI_DMA + bool "Atmel MCI DMA support" +diff -Naur linux-3.1.10/drivers/mmc/host/Makefile linux-3.1.10.patch/drivers/mmc/host/Makefile +--- linux-3.1.10/drivers/mmc/host/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/mmc/host/Makefile 2012-05-02 00:07:05.065251149 +0200 +@@ -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 ++obj-$(CONFIG_MMC_SDHCI_BCM2708) += sdhci-bcm2708.o + obj-$(CONFIG_MMC_WBSD) += wbsd.o + obj-$(CONFIG_MMC_AU1X) += au1xmmc.o + obj-$(CONFIG_MMC_OMAP) += omap.o +@@ -36,6 +37,7 @@ + obj-$(CONFIG_MMC_SDHI) += sh_mobile_sdhi.o + obj-$(CONFIG_MMC_CB710) += cb710-mmc.o + obj-$(CONFIG_MMC_VIA_SDMMC) += via-sdmmc.o ++obj-$(CONFIG_MMC_BCM2708) += bcm2708_mci.o + obj-$(CONFIG_SDH_BFIN) += bfin_sdh.o + obj-$(CONFIG_MMC_DW) += dw_mmc.o + obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o diff -Naur linux-3.1.10/drivers/mmc/host/sdhci-bcm2708.c linux-3.1.10.patch/drivers/mmc/host/sdhci-bcm2708.c --- linux-3.1.10/drivers/mmc/host/sdhci-bcm2708.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/mmc/host/sdhci-bcm2708.c 2012-04-28 22:26:48.888717924 +0200 ++++ linux-3.1.10.patch/drivers/mmc/host/sdhci-bcm2708.c 2012-05-02 00:07:05.475259399 +0200 @@ -0,0 +1,1555 @@ +/* + * sdhci-bcm2708.c Support for SDHCI device on BCM2708 @@ -29416,7 +29416,7 @@ diff -Naur linux-3.1.10/drivers/mmc/host/sdhci-bcm2708.c linux-3.1.10.patch/driv + diff -Naur linux-3.1.10/drivers/mmc/host/sdhci.c linux-3.1.10.patch/drivers/mmc/host/sdhci.c --- linux-3.1.10/drivers/mmc/host/sdhci.c 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/mmc/host/sdhci.c 2012-04-28 22:26:48.820716539 +0200 ++++ linux-3.1.10.patch/drivers/mmc/host/sdhci.c 2012-05-02 00:07:05.405257990 +0200 @@ -16,15 +16,18 @@ #include #include @@ -30696,7 +30696,7 @@ diff -Naur linux-3.1.10/drivers/mmc/host/sdhci.c linux-3.1.10.patch/drivers/mmc/ +MODULE_PARM_DESC(debug_quirks2, "Force certain other quirks."); diff -Naur linux-3.1.10/drivers/mmc/host/sdhci.h linux-3.1.10.patch/drivers/mmc/host/sdhci.h --- linux-3.1.10/drivers/mmc/host/sdhci.h 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/mmc/host/sdhci.h 2012-04-28 22:26:48.662713319 +0200 ++++ linux-3.1.10.patch/drivers/mmc/host/sdhci.h 2012-05-02 00:07:05.087251591 +0200 @@ -274,6 +274,24 @@ void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); @@ -30757,7 +30757,7 @@ diff -Naur linux-3.1.10/drivers/mmc/host/sdhci.h linux-3.1.10.patch/drivers/mmc/ #endif /* __SDHCI_HW_H */ diff -Naur linux-3.1.10/drivers/net/usb/smsc95xx.c linux-3.1.10.patch/drivers/net/usb/smsc95xx.c --- linux-3.1.10/drivers/net/usb/smsc95xx.c 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/net/usb/smsc95xx.c 2012-04-28 22:26:48.733714766 +0200 ++++ linux-3.1.10.patch/drivers/net/usb/smsc95xx.c 2012-05-02 00:07:05.348256845 +0200 @@ -46,6 +46,7 @@ #define SMSC95XX_INTERNAL_PHY_ID (1) #define SMSC95XX_TX_OVERHEAD (8) @@ -30837,20 +30837,9 @@ diff -Naur linux-3.1.10/drivers/net/usb/smsc95xx.c linux-3.1.10.patch/drivers/ne /* try reading mac address from EEPROM */ if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, dev->net->dev_addr) == 0) { -diff -Naur linux-3.1.10/drivers/usb/Makefile linux-3.1.10.patch/drivers/usb/Makefile ---- linux-3.1.10/drivers/usb/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/Makefile 2012-04-28 22:26:47.696693632 +0200 -@@ -21,6 +21,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.1.10/drivers/usb/core/generic.c linux-3.1.10.patch/drivers/usb/core/generic.c --- linux-3.1.10/drivers/usb/core/generic.c 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/core/generic.c 2012-04-28 22:26:47.696693632 +0200 ++++ linux-3.1.10.patch/drivers/usb/core/generic.c 2012-05-02 00:07:04.667243140 +0200 @@ -149,6 +149,7 @@ dev_warn(&udev->dev, "no configuration chosen from %d choice%s\n", @@ -30861,7 +30850,7 @@ diff -Naur linux-3.1.10/drivers/usb/core/generic.c linux-3.1.10.patch/drivers/us } diff -Naur linux-3.1.10/drivers/usb/core/hub.c linux-3.1.10.patch/drivers/usb/core/hub.c --- linux-3.1.10/drivers/usb/core/hub.c 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/core/hub.c 2012-04-28 22:26:48.180703496 +0200 ++++ linux-3.1.10.patch/drivers/usb/core/hub.c 2012-05-02 00:07:04.671243220 +0200 @@ -1071,6 +1071,8 @@ INIT_WORK(&hub->tt.clear_work, hub_tt_work); switch (hdev->descriptor.bDeviceProtocol) { @@ -30977,7 +30966,7 @@ diff -Naur linux-3.1.10/drivers/usb/core/hub.c linux-3.1.10.patch/drivers/usb/co !hcd->driver->port_handed_over || diff -Naur linux-3.1.10/drivers/usb/core/message.c linux-3.1.10.patch/drivers/usb/core/message.c --- linux-3.1.10/drivers/usb/core/message.c 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/core/message.c 2012-04-28 22:26:48.323706410 +0200 ++++ linux-3.1.10.patch/drivers/usb/core/message.c 2012-05-02 00:07:04.680243401 +0200 @@ -1836,6 +1836,85 @@ if (cp->string == NULL && !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) @@ -31066,7 +31055,7 @@ diff -Naur linux-3.1.10/drivers/usb/core/message.c linux-3.1.10.patch/drivers/us * to trigger binding of drivers to interfaces. probe() diff -Naur linux-3.1.10/drivers/usb/core/otg_whitelist.h linux-3.1.10.patch/drivers/usb/core/otg_whitelist.h --- linux-3.1.10/drivers/usb/core/otg_whitelist.h 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/core/otg_whitelist.h 2012-04-28 22:26:48.438708753 +0200 ++++ linux-3.1.10.patch/drivers/usb/core/otg_whitelist.h 2012-05-02 00:07:04.688243562 +0200 @@ -19,33 +19,82 @@ static struct usb_device_id whitelist_table [] = { @@ -31282,33 +31271,9 @@ diff -Naur linux-3.1.10/drivers/usb/core/otg_whitelist.h linux-3.1.10.patch/driv #endif } -diff -Naur linux-3.1.10/drivers/usb/gadget/Kconfig linux-3.1.10.patch/drivers/usb/gadget/Kconfig ---- linux-3.1.10/drivers/usb/gadget/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/gadget/Kconfig 2012-04-28 22:26:48.784715805 +0200 -@@ -525,6 +525,20 @@ - depends on USB_GADGET - depends on USB_GADGET_DUALSPEED - -+config USB_GADGET_SNPS_DWC_OTG -+ boolean "Synopsys Driver for DWC_otg Controller" -+ depends on USB && EXPERIMENTAL -+ select USB_OTG -+ select USB_GADGET_DUALSPEED -+ help -+ Selects the Synopsys Driver for the DWC_otg Controller. -+ -+config USB_DWC_OTG_LPM -+ boolean "Enable LPM support" -+ depends on USB && EXPERIMENTAL -+ help -+ Enables LPM support. -+ - # - # USB Gadget Drivers - # diff -Naur linux-3.1.10/drivers/usb/gadget/file_storage.c linux-3.1.10.patch/drivers/usb/gadget/file_storage.c --- linux-3.1.10/drivers/usb/gadget/file_storage.c 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/gadget/file_storage.c 2012-04-28 22:26:48.442708836 +0200 ++++ linux-3.1.10.patch/drivers/usb/gadget/file_storage.c 2012-05-02 00:07:04.691243622 +0200 @@ -572,8 +572,37 @@ .iConfiguration = FSG_STRING_CONFIG, .bmAttributes = USB_CONFIG_ATT_ONE | USB_CONFIG_ATT_SELFPOWER, @@ -31430,134 +31395,25 @@ diff -Naur linux-3.1.10/drivers/usb/gadget/file_storage.c linux-3.1.10.patch/dri /* Allocate the request and buffer for endpoint 0 */ fsg->ep0req = req = usb_ep_alloc_request(fsg->ep0, GFP_KERNEL); if (!req) -diff -Naur linux-3.1.10/drivers/usb/host/Kconfig linux-3.1.10.patch/drivers/usb/host/Kconfig ---- linux-3.1.10/drivers/usb/host/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/Kconfig 2012-04-28 22:26:48.443708856 +0200 -@@ -543,6 +543,19 @@ - To compile this driver a module, choose M here: the module - will be called "hwa-hc". +diff -Naur linux-3.1.10/drivers/usb/gadget/Kconfig linux-3.1.10.patch/drivers/usb/gadget/Kconfig +--- linux-3.1.10/drivers/usb/gadget/Kconfig 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/usb/gadget/Kconfig 2012-05-02 00:07:05.498259862 +0200 +@@ -525,6 +525,12 @@ + depends on USB_GADGET + 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. -+ -+ 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 "iMX21 HCD support" - depends on USB && ARM && MACH_MX21 -diff -Naur linux-3.1.10/drivers/usb/host/Makefile linux-3.1.10.patch/drivers/usb/host/Makefile ---- linux-3.1.10/drivers/usb/host/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/Makefile 2012-04-28 22:26:48.443708856 +0200 -@@ -32,6 +32,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.1.10/drivers/usb/host/dwc_common_port/Makefile linux-3.1.10.patch/drivers/usb/host/dwc_common_port/Makefile ---- linux-3.1.10/drivers/usb/host/dwc_common_port/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/Makefile 2012-04-28 22:26:48.813716396 +0200 -@@ -0,0 +1,46 @@ -+# -+# Makefile for DWC_common library -+# -+ -+ifneq ($(KERNELRELEASE),) -+ -+#CPPFLAGS += -DDEBUG_MEMORY -+ -+ifeq ($(CONFIG_USB_DEBUG),y) -+CPPFLAGS += -DDEBUG -+endif -+CPPFLAGS += -DDWC_LINUX -+ -+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 ($(DOXYGEN),) -+DOXYGEN := $(DOXYGEN) -+endif -+ -+default: -+ $(MAKE) -C$(KDIR) M=$(PWD) 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 .tmp_versions Module.symvers -+ -diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/Makefile.linux linux-3.1.10.patch/drivers/usb/host/dwc_common_port/Makefile.linux ---- linux-3.1.10/drivers/usb/host/dwc_common_port/Makefile.linux 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/Makefile.linux 2012-04-28 22:26:48.444708876 +0200 -@@ -0,0 +1,36 @@ -+# -+# Makefile for DWC_common library -+# -+ifneq ($(KERNELRELEASE),) -+ -+#CPPFLAGS += -DDEBUG_MEMORY -+ -+#CPPFLAGS += -DDEBUG -+CPPFLAGS += -DDWC_LINUX -+ -+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 ($(DOXYGEN),) -+DOXYGEN := $(DOXYGEN) -+endif -+ -+default: -+ $(MAKE) -C$(KDIR) M=$(PWD) 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 .tmp_versions Module.symvers ++ Enables LPM support. + + # + # USB Gadget Drivers + # diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_cc.c linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_cc.c --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_cc.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_cc.c 2012-04-28 22:26:48.445708896 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_cc.c 2012-05-02 00:07:04.753244870 +0200 @@ -0,0 +1,506 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_cc.c $ @@ -32067,7 +31923,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_cc.c linux-3.1.10.p +} diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_cc.h linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_cc.h --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_cc.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_cc.h 2012-04-28 22:26:48.446708916 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_cc.h 2012-05-02 00:07:04.762245050 +0200 @@ -0,0 +1,209 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_cc.h $ @@ -32280,7 +32136,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_cc.h linux-3.1.10.p + diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_common_linux.c linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_common_linux.c --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_common_linux.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_common_linux.c 2012-04-28 22:26:48.448708957 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_common_linux.c 2012-05-02 00:07:04.763245070 +0200 @@ -0,0 +1,1247 @@ +#include "dwc_cc.h" +#include "dwc_modpow.h" @@ -33531,7 +33387,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_common_linux.c linu +EXPORT_SYMBOL(DWC_WAITQ_ABORT); diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.c linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_crypto.c --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_crypto.c 2012-04-28 22:26:48.449708978 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_crypto.c 2012-05-02 00:07:04.764245091 +0200 @@ -0,0 +1,306 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_crypto.c $ @@ -33841,7 +33697,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.c linux-3.1. + diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.h linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_crypto.h --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_crypto.h 2012-04-28 22:26:48.449708978 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_crypto.h 2012-05-02 00:07:04.764245091 +0200 @@ -0,0 +1,103 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_crypto.h $ @@ -33948,7 +33804,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_crypto.h linux-3.1. +#endif /* _DWC_CRYPTO_H_ */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_dh.c linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_dh.c --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_dh.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_dh.c 2012-04-28 22:26:48.450708999 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_dh.c 2012-05-02 00:07:04.765245111 +0200 @@ -0,0 +1,286 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_dh.c $ @@ -34238,7 +34094,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_dh.c linux-3.1.10.p +#endif /* CONFIG_IPMATE_MACH */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_dh.h linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_dh.h --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_dh.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_dh.h 2012-04-28 22:26:48.450708999 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_dh.h 2012-05-02 00:07:04.766245131 +0200 @@ -0,0 +1,98 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_dh.h $ @@ -34340,7 +34196,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_dh.h linux-3.1.10.p +#endif /* _DWC_DH_H_ */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_list.h linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_list.h --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_list.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_list.h 2012-04-28 22:26:48.452709040 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_list.h 2012-05-02 00:07:04.767245151 +0200 @@ -0,0 +1,616 @@ +/* $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 $ */ @@ -34960,7 +34816,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_list.h linux-3.1.10 +#endif /* !_SYS_QUEUE_H_ */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_mem.c linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_mem.c --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_mem.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_mem.c 2012-04-28 22:26:48.453709060 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_mem.c 2012-05-02 00:07:04.767245151 +0200 @@ -0,0 +1,172 @@ +#include "dwc_os.h" +#include "dwc_list.h" @@ -35136,7 +34992,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_mem.c linux-3.1.10. +#endif /* DEBUG_MEMORY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.c linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_modpow.c --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_modpow.c 2012-04-28 22:26:48.454709080 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_modpow.c 2012-05-02 00:07:04.811246037 +0200 @@ -0,0 +1,622 @@ +/* Bignum routines adapted from PUTTY sources. PuTTY copyright notice follows. + * @@ -35762,7 +35618,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.c linux-3.1. +#endif /* CONFIG_MACH_IPMATE */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.h linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_modpow.h --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_modpow.h 2012-04-28 22:26:48.455709101 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_modpow.h 2012-05-02 00:07:04.811246037 +0200 @@ -0,0 +1,26 @@ +/* + * dwc_modpow.h @@ -35792,7 +35648,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_modpow.h linux-3.1. +#endif /* _LINUX_BIGNUM_H */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.c linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_notifier.c --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_notifier.c 2012-04-28 22:26:48.455709101 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_notifier.c 2012-05-02 00:07:04.812246057 +0200 @@ -0,0 +1,256 @@ +#include "dwc_notifier.h" +#include "dwc_list.h" @@ -36052,7 +35908,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.c linux-3. + diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.h linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_notifier.h --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_notifier.h 2012-04-28 22:26:48.456709121 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_notifier.h 2012-05-02 00:07:04.812246057 +0200 @@ -0,0 +1,112 @@ + +#ifndef __DWC_NOTIFIER_H__ @@ -36168,7 +36024,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_notifier.h linux-3. +#endif /* __DWC_NOTIFIER_H__ */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_os.h linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_os.h --- linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_os.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_os.h 2012-04-28 22:26:48.814716416 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/dwc_os.h 2012-05-02 00:07:05.399257870 +0200 @@ -0,0 +1,925 @@ +/* ========================================================================= + * $File: //dwh/usb_iip/dev/software/dwc_common_port/dwc_os.h $ @@ -37095,9 +36951,99 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/dwc_os.h linux-3.1.10.p + * threading should be able to be implemented with the defined behavior. + * + */ +diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/Makefile linux-3.1.10.patch/drivers/usb/host/dwc_common_port/Makefile +--- linux-3.1.10/drivers/usb/host/dwc_common_port/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/Makefile 2012-05-02 00:07:05.398257850 +0200 +@@ -0,0 +1,46 @@ ++# ++# Makefile for DWC_common library ++# ++ ++ifneq ($(KERNELRELEASE),) ++ ++#CPPFLAGS += -DDEBUG_MEMORY ++ ++ifeq ($(CONFIG_USB_DEBUG),y) ++CPPFLAGS += -DDEBUG ++endif ++CPPFLAGS += -DDWC_LINUX ++ ++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 ($(DOXYGEN),) ++DOXYGEN := $(DOXYGEN) ++endif ++ ++default: ++ $(MAKE) -C$(KDIR) M=$(PWD) 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 .tmp_versions Module.symvers ++ +diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/Makefile.linux linux-3.1.10.patch/drivers/usb/host/dwc_common_port/Makefile.linux +--- linux-3.1.10/drivers/usb/host/dwc_common_port/Makefile.linux 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/Makefile.linux 2012-05-02 00:07:04.752244850 +0200 +@@ -0,0 +1,36 @@ ++# ++# Makefile for DWC_common library ++# ++ifneq ($(KERNELRELEASE),) ++ ++#CPPFLAGS += -DDEBUG_MEMORY ++ ++#CPPFLAGS += -DDEBUG ++CPPFLAGS += -DDWC_LINUX ++ ++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 ($(DOXYGEN),) ++DOXYGEN := $(DOXYGEN) ++endif ++ ++default: ++ $(MAKE) -C$(KDIR) M=$(PWD) 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 .tmp_versions Module.symvers ++ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/usb.h linux-3.1.10.patch/drivers/usb/host/dwc_common_port/usb.h --- linux-3.1.10/drivers/usb/host/dwc_common_port/usb.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/usb.h 2012-04-28 22:26:48.459709181 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_common_port/usb.h 2012-05-02 00:07:04.816246137 +0200 @@ -0,0 +1,850 @@ +/* + * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37949,93 +37895,9 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_common_port/usb.h linux-3.1.10.patc + + +#endif /* _USB_H_ */ -diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/Makefile linux-3.1.10.patch/drivers/usb/host/dwc_otg/Makefile ---- linux-3.1.10/drivers/usb/host/dwc_otg/Makefile 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/Makefile 2012-04-28 22:26:48.815716437 +0200 -@@ -0,0 +1,80 @@ -+# -+# Makefile for DWC_otg Highspeed USB controller driver -+# -+ -+ifneq ($(KERNELRELEASE),) -+ -+ifeq ($(BUS_INTERFACE),) -+ # BUS_INTERFACE = -DLM_INTERFACE -+ BUS_INTERFACE = -DPLATFORM_INTERFACE=1 -+endif -+ -+ifeq ($(CONFIG_USB_DEBUG),y) -+CPPFLAGS += -DDEBUG -+endif -+ -+# Use one of the following flags to compile the software in host-only or -+# device-only mode. -+#CPPFLAGS += -DDWC_HOST_ONLY -+#CPPFLAGS += -DDWC_DEVICE_ONLY -+ -+CPPFLAGS += -Dlinux -DDWC_HS_ELECT_TST -+#CGG: CPPFLAGS += -DDWC_EN_ISOC -+CPPFLAGS += -I$(obj)/../dwc_common_port -+#CPPFLAGS += -I$(PORTLIB) -+CPPFLAGS += -DDWC_LINUX -+CPPFLAGS += $(CFI) -+CPPFLAGS += $(BUS_INTERFACE) -+ -+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 -+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 -+ifneq ($(INSTALL_MOD_PATH),) -+ $(MAKE) -C$(KDIR) M=$(PORTLIB) modules_install -+ $(MAKE) -C$(KDIR) M=$(PWD) modules_install -+else -+ @echo "No install path defined" -+endif -+ -+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 -+ -+endif diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dummy_audio.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dummy_audio.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dummy_audio.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dummy_audio.c 2012-04-28 22:26:48.464709284 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dummy_audio.c 2012-05-02 00:07:04.833246479 +0200 @@ -0,0 +1,1575 @@ +/* + * zero.c -- Gadget Zero, for USB development @@ -39614,7 +39476,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dummy_audio.c linux-3.1.10.patc +module_exit (cleanup); diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_cfi_common.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_cfi_common.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_cfi_common.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_cfi_common.h 2012-04-28 22:26:48.465709304 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_cfi_common.h 2012-05-02 00:07:04.840246621 +0200 @@ -0,0 +1,142 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -39760,7 +39622,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_cfi_common.h linux-3.1.10.p +#endif diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.c 2012-04-28 22:26:48.467709344 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.c 2012-05-02 00:07:04.843246681 +0200 @@ -0,0 +1,1316 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.c $ @@ -41080,7 +40942,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.c linux-3.1.10.pat +} diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.h 2012-04-28 22:26:48.467709344 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_attr.h 2012-05-02 00:07:04.849246804 +0200 @@ -0,0 +1,88 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.h $ @@ -41172,7 +41034,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_attr.h linux-3.1.10.pat +#endif diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 2012-04-28 22:26:48.470709406 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.c 2012-05-02 00:07:04.852246862 +0200 @@ -0,0 +1,1876 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -43052,7 +42914,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.c linux-3.1.10.patc +#endif //DWC_UTE_CFI diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 2012-04-28 22:26:48.472709448 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cfi.h 2012-05-02 00:07:04.859247004 +0200 @@ -0,0 +1,319 @@ +/* ========================================================================== + * Synopsys HS OTG Linux Software Driver and documentation (hereinafter, @@ -43375,7 +43237,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cfi.h linux-3.1.10.patc +#endif /* (__DWC_OTG_CFI_H__) */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.c 2012-04-28 22:26:48.481709630 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.c 2012-05-02 00:07:04.874247306 +0200 @@ -0,0 +1,5410 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.c $ @@ -48789,7 +48651,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.c linux-3.1.10.patc +} diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.h 2012-04-28 22:26:48.484709691 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil.h 2012-05-02 00:07:04.881247446 +0200 @@ -0,0 +1,1143 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil.h $ @@ -49936,7 +49798,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil.h linux-3.1.10.patc +#endif diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 2012-04-28 22:26:48.485709712 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c 2012-05-02 00:07:04.883247486 +0200 @@ -0,0 +1,846 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil_intr.c $ @@ -50786,7 +50648,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c linux-3.1.10 +} diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_core_if.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_core_if.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 2012-04-28 22:26:48.487709754 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_core_if.h 2012-05-02 00:07:04.891247647 +0200 @@ -0,0 +1,641 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_core_if.h $ @@ -51431,7 +51293,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_core_if.h linux-3.1.10. +#endif /* __DWC_CORE_IF_H__ */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_dbg.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_dbg.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 2012-04-28 22:26:48.488709774 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_dbg.h 2012-05-02 00:07:04.892247667 +0200 @@ -0,0 +1,113 @@ +/* ========================================================================== + * @@ -51548,7 +51410,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_dbg.h linux-3.1.10.patc +#endif diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.c 2012-04-28 22:26:48.491709834 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.c 2012-05-02 00:07:04.915248131 +0200 @@ -0,0 +1,1577 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.c $ @@ -53129,7 +52991,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.c linux-3.1.10.p +*/ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.h 2012-04-28 22:26:48.491709834 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_driver.h 2012-05-02 00:07:04.921248251 +0200 @@ -0,0 +1,101 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.h $ @@ -53234,7 +53096,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_driver.h linux-3.1.10.p +#endif diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 2012-04-28 22:26:48.890717966 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.c 2012-05-02 00:07:05.490259702 +0200 @@ -0,0 +1,3334 @@ + +/* ========================================================================== @@ -56570,817 +56432,9 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.c linux-3.1.10.patc +} + +#endif /* DWC_DEVICE_ONLY */ -diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.h ---- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 2012-04-28 22:26:48.497709957 +0200 -@@ -0,0 +1,804 @@ -+/* ========================================================================== -+ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $ -+ * $Revision: #52 $ -+ * $Date: 2009/04/21 $ -+ * $Change: 1237472 $ -+ * -+ * 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 -+#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; -+ -+ /** (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; -+ -+ /** @} */ -+ -+} dwc_otg_qh_t; -+ -+DWC_CIRCLEQ_HEAD(hc_list, dwc_hc); -+ -+#ifdef HW2937_WORKAROUND -+ -+typedef enum { -+ HW2937_XFER_MODE_IDLE, -+ HW2937_XFER_MODE_IN, -+ HW2937_XFER_MODE_OUT, -+ HW2937_XFER_MODE_PAUSEIN /* Transitioning from IN to IDLE */ -+} hw2937_xfer_mode_t; -+#endif -+ -+/** -+ * This structure holds the state of the HCD, including the non-periodic and -+ * periodic schedules. -+ */ -+struct dwc_otg_hcd { -+ /** 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; -+ -+ /** -+ * Frame number read from the core at SOF. The value ranges from 0 to -+ * DWC_HFNUM_MAX_FRNUM. -+ */ -+ uint16_t frame_number; -+ -+ /** -+ * 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; -+ -+ /** -+ * Number of host channels assigned to non-periodic transfers. -+ */ -+ int non_periodic_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; -+ -+ /** -+ * 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 HW2937_WORKAROUND -+ /** Current transfer mode (IN, OUT, or IDLE) */ -+ hw2937_xfer_mode_t hw2937_xfer_mode; -+ -+ /** Mask of channels assigned to the current mode */ -+ uint32_t hw2937_assigned_channels; -+#endif -+ -+#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); -+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); -+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_otg_hcd_qh_remove(hcd, qh); -+ 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(void) -+{ -+ 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); -+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); -+ -+/** 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(void) -+{ -+ 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) -+{ -+ uint64_t flags; -+ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); -+ DWC_CIRCLEQ_REMOVE(&qh->qtd_list, qtd, qtd_list_entry); -+ DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); -+} -+ -+/** Remove and free a QTD */ -+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.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 2012-04-28 22:26:48.499709997 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c 2012-05-02 00:07:04.935248532 +0200 @@ -0,0 +1,1106 @@ +/*========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_ddma.c $ @@ -58488,9 +57542,817 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c linux-3.1.10 +} + +#endif /* DWC_DEVICE_ONLY */ +diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.h +--- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd.h 2012-05-02 00:07:04.933248492 +0200 +@@ -0,0 +1,804 @@ ++/* ========================================================================== ++ * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $ ++ * $Revision: #52 $ ++ * $Date: 2009/04/21 $ ++ * $Change: 1237472 $ ++ * ++ * 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 ++#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; ++ ++ /** (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; ++ ++ /** @} */ ++ ++} dwc_otg_qh_t; ++ ++DWC_CIRCLEQ_HEAD(hc_list, dwc_hc); ++ ++#ifdef HW2937_WORKAROUND ++ ++typedef enum { ++ HW2937_XFER_MODE_IDLE, ++ HW2937_XFER_MODE_IN, ++ HW2937_XFER_MODE_OUT, ++ HW2937_XFER_MODE_PAUSEIN /* Transitioning from IN to IDLE */ ++} hw2937_xfer_mode_t; ++#endif ++ ++/** ++ * This structure holds the state of the HCD, including the non-periodic and ++ * periodic schedules. ++ */ ++struct dwc_otg_hcd { ++ /** 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; ++ ++ /** ++ * Frame number read from the core at SOF. The value ranges from 0 to ++ * DWC_HFNUM_MAX_FRNUM. ++ */ ++ uint16_t frame_number; ++ ++ /** ++ * 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; ++ ++ /** ++ * Number of host channels assigned to non-periodic transfers. ++ */ ++ int non_periodic_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; ++ ++ /** ++ * 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 HW2937_WORKAROUND ++ /** Current transfer mode (IN, OUT, or IDLE) */ ++ hw2937_xfer_mode_t hw2937_xfer_mode; ++ ++ /** Mask of channels assigned to the current mode */ ++ uint32_t hw2937_assigned_channels; ++#endif ++ ++#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); ++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); ++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_otg_hcd_qh_remove(hcd, qh); ++ 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(void) ++{ ++ 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); ++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); ++ ++/** 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(void) ++{ ++ 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) ++{ ++ uint64_t flags; ++ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); ++ DWC_CIRCLEQ_REMOVE(&qh->qtd_list, qtd, qtd_list_entry); ++ DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags); ++} ++ ++/** Remove and free a QTD */ ++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.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 2012-04-28 22:26:48.500710017 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h 2012-05-02 00:07:04.936248552 +0200 @@ -0,0 +1,393 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_if.h $ @@ -58887,7 +58749,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h linux-3.1.10.p +#endif /* DWC_DEVICE_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 2012-04-28 22:26:48.503710079 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c 2012-05-02 00:07:04.939248612 +0200 @@ -0,0 +1,2065 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_intr.c $ @@ -60956,8 +60818,8 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c linux-3.1.10 +#endif /* DWC_DEVICE_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 2012-04-28 22:26:48.891717987 +0200 -@@ -0,0 +1,843 @@ ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c 2012-05-02 00:07:05.499259882 +0200 +@@ -0,0 +1,846 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_linux.c $ + * $Revision: #11 $ @@ -61377,6 +61239,9 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-3.1.1 + + hcd->regs = otg_dev->base; + ++ /* Integrate TT in root hub */ ++ hcd->has_tt = 1; ++ + /* Initialize the DWC OTG HCD. */ + dwc_otg_hcd = dwc_otg_hcd_alloc_hcd(); + if (!dwc_otg_hcd) { @@ -61803,7 +61668,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c linux-3.1.1 +#endif /* DWC_DEVICE_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 2012-04-28 22:26:48.507710160 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c 2012-05-02 00:07:04.942248673 +0200 @@ -0,0 +1,732 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_queue.c $ @@ -62539,7 +62404,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c linux-3.1.1 +#endif /* DWC_DEVICE_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 2012-04-28 22:26:48.511710242 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.c 2012-05-02 00:07:04.944248713 +0200 @@ -0,0 +1,2067 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.c $ @@ -64610,7 +64475,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.c linux-3.1.10.patc +#endif /* DWC_HOST_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 2012-04-28 22:26:48.511710242 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd.h 2012-05-02 00:07:04.945248733 +0200 @@ -0,0 +1,216 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.h $ @@ -64830,7 +64695,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd.h linux-3.1.10.patc +#endif /* DWC_HOST_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 2012-04-28 22:26:48.512710263 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h 2012-05-02 00:07:04.946248753 +0200 @@ -0,0 +1,333 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_if.h $ @@ -65167,7 +65032,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_if.h linux-3.1.10.p +#endif /* DWC_HOST_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 2012-04-28 22:26:48.518710383 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c 2012-05-02 00:07:04.971249256 +0200 @@ -0,0 +1,4077 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_intr.c $ @@ -69248,7 +69113,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_intr.c linux-3.1.10 +#endif /* DWC_HOST_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 2012-04-28 22:26:48.521710446 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c 2012-05-02 00:07:04.980249439 +0200 @@ -0,0 +1,1288 @@ + /* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_linux.c $ @@ -70540,7 +70405,7 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_pcd_linux.c linux-3.1.1 +#endif /* DWC_HOST_ONLY */ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_regs.h linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_regs.h --- linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_regs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_regs.h 2012-04-28 22:26:48.524710507 +0200 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/dwc_otg_regs.h 2012-05-02 00:07:04.984249519 +0200 @@ -0,0 +1,2237 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_regs.h $ @@ -72779,44 +72644,139 @@ diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/dwc_otg_regs.h linux-3.1.10.pat +} pcgcctl_data_t; + +#endif -diff -Naur linux-3.1.10/drivers/video/Kconfig linux-3.1.10.patch/drivers/video/Kconfig ---- linux-3.1.10/drivers/video/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/video/Kconfig 2012-04-28 22:26:48.667713421 +0200 -@@ -303,6 +303,20 @@ - help - Support the Permedia2 FIFO disconnect feature. +diff -Naur linux-3.1.10/drivers/usb/host/dwc_otg/Makefile linux-3.1.10.patch/drivers/usb/host/dwc_otg/Makefile +--- linux-3.1.10/drivers/usb/host/dwc_otg/Makefile 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/drivers/usb/host/dwc_otg/Makefile 2012-05-02 00:07:05.399257870 +0200 +@@ -0,0 +1,80 @@ ++# ++# Makefile for DWC_otg Highspeed USB controller driver ++# ++ ++ifneq ($(KERNELRELEASE),) ++ ++ifeq ($(BUS_INTERFACE),) ++ # BUS_INTERFACE = -DLM_INTERFACE ++ BUS_INTERFACE = -DPLATFORM_INTERFACE=1 ++endif ++ ++ifeq ($(CONFIG_USB_DEBUG),y) ++CPPFLAGS += -DDEBUG ++endif ++ ++# Use one of the following flags to compile the software in host-only or ++# device-only mode. ++#CPPFLAGS += -DDWC_HOST_ONLY ++#CPPFLAGS += -DDWC_DEVICE_ONLY ++ ++CPPFLAGS += -Dlinux -DDWC_HS_ELECT_TST ++#CGG: CPPFLAGS += -DDWC_EN_ISOC ++CPPFLAGS += -I$(obj)/../dwc_common_port ++#CPPFLAGS += -I$(PORTLIB) ++CPPFLAGS += -DDWC_LINUX ++CPPFLAGS += $(CFI) ++CPPFLAGS += $(BUS_INTERFACE) ++ ++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 ++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 ++ifneq ($(INSTALL_MOD_PATH),) ++ $(MAKE) -C$(KDIR) M=$(PORTLIB) modules_install ++ $(MAKE) -C$(KDIR) M=$(PWD) modules_install ++else ++ @echo "No install path defined" ++endif ++ ++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 ++ ++endif +diff -Naur linux-3.1.10/drivers/usb/host/Kconfig linux-3.1.10.patch/drivers/usb/host/Kconfig +--- linux-3.1.10/drivers/usb/host/Kconfig 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/usb/host/Kconfig 2012-05-02 00:07:04.743244668 +0200 +@@ -543,6 +543,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 -Naur linux-3.1.10/drivers/video/Makefile linux-3.1.10.patch/drivers/video/Makefile ---- linux-3.1.10/drivers/video/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/video/Makefile 2012-04-28 22:26:48.669713462 +0200 -@@ -95,6 +95,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 ++ 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 "iMX21 HCD support" + depends on USB && ARM && MACH_MX21 +diff -Naur linux-3.1.10/drivers/usb/host/Makefile linux-3.1.10.patch/drivers/usb/host/Makefile +--- linux-3.1.10/drivers/usb/host/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/usb/host/Makefile 2012-05-02 00:07:04.751244830 +0200 +@@ -32,6 +32,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.1.10/drivers/usb/Makefile linux-3.1.10.patch/drivers/usb/Makefile +--- linux-3.1.10/drivers/usb/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/usb/Makefile 2012-05-02 00:07:04.667243140 +0200 +@@ -21,6 +21,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.1.10/drivers/video/bcm2708_fb.c linux-3.1.10.patch/drivers/video/bcm2708_fb.c --- linux-3.1.10/drivers/video/bcm2708_fb.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/video/bcm2708_fb.c 2012-04-28 22:26:48.886717884 +0200 ++++ linux-3.1.10.patch/drivers/video/bcm2708_fb.c 2012-05-02 00:07:05.474259379 +0200 @@ -0,0 +1,461 @@ +/* + * linux/drivers/video/bcm2708_fb.c @@ -73279,9 +73239,33 @@ diff -Naur linux-3.1.10/drivers/video/bcm2708_fb.c linux-3.1.10.patch/drivers/vi + +MODULE_PARM_DESC(fbwidth, "Width of ARM Framebuffer"); +MODULE_PARM_DESC(fbheight, "Height of ARM Framebuffer"); +diff -Naur linux-3.1.10/drivers/video/Kconfig linux-3.1.10.patch/drivers/video/Kconfig +--- linux-3.1.10/drivers/video/Kconfig 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/video/Kconfig 2012-05-02 00:07:05.092251691 +0200 +@@ -303,6 +303,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.1.10/drivers/video/logo/logo_linux_clut224.ppm linux-3.1.10.patch/drivers/video/logo/logo_linux_clut224.ppm --- linux-3.1.10/drivers/video/logo/logo_linux_clut224.ppm 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/video/logo/logo_linux_clut224.ppm 2012-04-28 22:26:48.676713605 +0200 ++++ linux-3.1.10.patch/drivers/video/logo/logo_linux_clut224.ppm 2012-05-02 00:07:05.134252538 +0200 @@ -1,1604 +1,883 @@ P3 -# Standard 224-color Linux logo @@ -75768,36 +75752,20 @@ diff -Naur linux-3.1.10/drivers/video/logo/logo_linux_clut224.ppm linux-3.1.10.p +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 -Naur linux-3.1.10/drivers/watchdog/Kconfig linux-3.1.10.patch/drivers/watchdog/Kconfig ---- linux-3.1.10/drivers/watchdog/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/watchdog/Kconfig 2012-04-28 22:26:48.664713361 +0200 -@@ -348,6 +348,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.1.10/drivers/watchdog/Makefile linux-3.1.10.patch/drivers/watchdog/Makefile ---- linux-3.1.10/drivers/watchdog/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/drivers/watchdog/Makefile 2012-04-28 22:26:48.665713381 +0200 -@@ -54,6 +54,7 @@ - obj-$(CONFIG_ADX_WATCHDOG) += adx_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.1.10/drivers/video/Makefile linux-3.1.10.patch/drivers/video/Makefile +--- linux-3.1.10/drivers/video/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/video/Makefile 2012-05-02 00:07:05.092251691 +0200 +@@ -95,6 +95,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.1.10/drivers/watchdog/bcm2708_wdog.c linux-3.1.10.patch/drivers/watchdog/bcm2708_wdog.c --- linux-3.1.10/drivers/watchdog/bcm2708_wdog.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/drivers/watchdog/bcm2708_wdog.c 2012-04-28 22:26:48.665713381 +0200 ++++ linux-3.1.10.patch/drivers/watchdog/bcm2708_wdog.c 2012-05-02 00:07:05.090251651 +0200 @@ -0,0 +1,385 @@ +/* + * Broadcom BCM2708 watchdog driver. @@ -76184,9 +76152,36 @@ diff -Naur linux-3.1.10/drivers/watchdog/bcm2708_wdog.c linux-3.1.10.patch/drive +MODULE_ALIAS_MISCDEV(TEMP_MINOR); +MODULE_LICENSE("GPL"); + +diff -Naur linux-3.1.10/drivers/watchdog/Kconfig linux-3.1.10.patch/drivers/watchdog/Kconfig +--- linux-3.1.10/drivers/watchdog/Kconfig 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/watchdog/Kconfig 2012-05-02 00:07:05.089251631 +0200 +@@ -348,6 +348,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.1.10/drivers/watchdog/Makefile linux-3.1.10.patch/drivers/watchdog/Makefile +--- linux-3.1.10/drivers/watchdog/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/drivers/watchdog/Makefile 2012-05-02 00:07:05.089251631 +0200 +@@ -54,6 +54,7 @@ + obj-$(CONFIG_ADX_WATCHDOG) += adx_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.1.10/include/linux/mmc/host.h linux-3.1.10.patch/include/linux/mmc/host.h --- linux-3.1.10/include/linux/mmc/host.h 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/include/linux/mmc/host.h 2012-04-28 22:26:48.663713340 +0200 ++++ linux-3.1.10.patch/include/linux/mmc/host.h 2012-05-02 00:07:05.087251591 +0200 @@ -12,6 +12,7 @@ #include @@ -76267,7 +76262,7 @@ diff -Naur linux-3.1.10/include/linux/mmc/host.h linux-3.1.10.patch/include/linu #endif /* LINUX_MMC_HOST_H */ diff -Naur linux-3.1.10/include/linux/mmc/sdhci.h linux-3.1.10.patch/include/linux/mmc/sdhci.h --- linux-3.1.10/include/linux/mmc/sdhci.h 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/include/linux/mmc/sdhci.h 2012-04-28 22:26:48.663713340 +0200 ++++ linux-3.1.10.patch/include/linux/mmc/sdhci.h 2012-05-02 00:07:05.088251611 +0200 @@ -88,6 +88,10 @@ /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) @@ -76301,38 +76296,436 @@ diff -Naur linux-3.1.10/include/linux/mmc/sdhci.h linux-3.1.10.patch/include/lin struct mmc_data *data; /* Current data request */ unsigned int data_early:1; /* Data finished before cmd */ -diff -Naur linux-3.1.10/sound/arm/Kconfig linux-3.1.10.patch/sound/arm/Kconfig ---- linux-3.1.10/sound/arm/Kconfig 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/sound/arm/Kconfig 2012-04-28 22:26:48.837716886 +0200 -@@ -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 && SND -+ select SND_PCM -+ help -+ Say Y or M if you want to support BCM2835 Alsa pcm card driver +diff -Naur linux-3.1.10/sound/arm/bcm2835.c linux-3.1.10.patch/sound/arm/bcm2835.c +--- linux-3.1.10/sound/arm/bcm2835.c 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/sound/arm/bcm2835.c 2012-05-02 00:07:05.470259299 +0200 +@@ -0,0 +1,423 @@ ++/***************************************************************************** ++* 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 -Naur linux-3.1.10/sound/arm/Makefile linux-3.1.10.patch/sound/arm/Makefile ---- linux-3.1.10/sound/arm/Makefile 2012-01-18 16:33:18.000000000 +0100 -+++ linux-3.1.10.patch/sound/arm/Makefile 2012-04-28 22:26:48.838716906 +0200 -@@ -14,3 +14,9 @@ - - 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 + -+EXTRA_CFLAGS += -Idrivers/misc/vc04_services -Idrivers/misc/vc04_services/interface/vcos/linuxkernel ++#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; ++ printk(KERN_INFO "### snd_bcm2835_alsa_probe %p ###", pdev); ++ ++ printk ++ ("############ PROBING FOR bcm2835 ALSA device (%d):(%d) ###############\n", ++ dev, enable[dev]); ++ ++ if (dev >= MAX_SUBSTREAMS) ++ return -ENODEV; ++ ++ if (!enable[dev]) { ++ dev++; ++ return -ENOENT; ++ } ++ ++ if (dev > 0) ++ goto add_register_map; ++ ++ printk("Creating card...\n"); ++ 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); ++ ++ printk("Creating device/chip ..\n"); ++ 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; ++ } ++ ++ printk("Adding controls ..\n"); ++ 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) { ++ printk("Registering card ....\n"); ++ 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("bcm2835 ALSA CARD CREATED!\n"); ++ } else { ++ printk("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; ++ } ++ printk(KERN_INFO "### BCM2835 ALSA driver init %s ### \n", ++ err ? "FAILED" : "OK"); ++ ++ 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.1.10/sound/arm/bcm2835-ctl.c linux-3.1.10.patch/sound/arm/bcm2835-ctl.c --- linux-3.1.10/sound/arm/bcm2835-ctl.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/sound/arm/bcm2835-ctl.c 2012-04-28 22:26:48.875717660 +0200 ++++ linux-3.1.10.patch/sound/arm/bcm2835-ctl.c 2012-05-02 00:07:05.465259199 +0200 @@ -0,0 +1,172 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -76506,9 +76899,255 @@ diff -Naur linux-3.1.10/sound/arm/bcm2835-ctl.c linux-3.1.10.patch/sound/arm/bcm + } + return 0; +} +diff -Naur linux-3.1.10/sound/arm/bcm2835.h linux-3.1.10.patch/sound/arm/bcm2835.h +--- linux-3.1.10/sound/arm/bcm2835.h 1970-01-01 01:00:00.000000000 +0100 ++++ linux-3.1.10.patch/sound/arm/bcm2835.h 2012-05-02 00:07:05.473259359 +0200 +@@ -0,0 +1,242 @@ ++/***************************************************************************** ++* 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 ++ ++#define SUBSTREAM_NUM 1 ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* #define DUMP_RAW_DATA */ ++//#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...) do {} while (0) ++ ++#define audio_info(fmt, arg...) do {} while (0) ++ ++#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */ ++ ++#else ++ ++#define audio_debug(fmt, arg...) do {} while (0) ++ ++#define audio_info(fmt, arg...) do {} while (0) ++ ++#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) ++ ++#define AUDIO_IPC_BLOCK_NUM_BUFFERS (8) ++#define AUDIO_IPC_BLOCK_BUFFER_SIZE (1024*8) ++ ++#define AUDIO_CONTROL_OFFSET (0x00) ++#define CTRL_EN_SHIFT (0) ++#define CTRL_EN_MASK (0x00000001) ++#define CTRL_PLAY_SHIFT (1) ++#define CTRL_PLAY_MASK (0x00000002) ++#define CTRL_MUTE_SHIFT (2) ++#define CTRL_MUTE_MASK (0x00000004) ++#define CTRL_SETUP_SHIFT (3) ++#define CTRL_SETUP_MASK (0x00000008) ++#define CTRL_FLUSH_SHIFT (4) ++#define CTRL_FLUSH_MASK (0x00000010) ++#define CTRL_STOPMODE_SHIFT (5) ++#define CTRL_STOPMODE_MASK (0x00000020) ++ ++#define AUDIO_STATUS_OFFSET (0x04) ++#define STAT_EN_SHIFT (0) ++#define STAT_EN_MASK (0x00000001) ++#define STAT_PLAY_SHIFT (1) ++#define STAT_PLAY_MASK (0x00000002) ++#define STAT_MUTE_SHIFT (2) ++#define STAT_MUTE_MASK (0x00000004) ++#define STAT_SETUP_SHIFT (3) ++#define STAT_SETUP_MASK (0x00000008) ++#define STAT_FLUSH_SHIFT (4) ++#define STAT_FLUSH_MASK (0x00000010) ++#define STAT_STOPMODE_SHIFT (5) ++#define STAT_STOPMODE_MASK (0x00000020) ++ ++/* Interrupt status */ ++#define AUDIO_INTSTAT_OFFSET (0x08) ++#define INTSTAT_CONTROL_SHIFT (0) ++#define INTSTAT_CONTROL_MASK (0x0000000f) ++#define INTSTAT_FIFO_SHIFT (4) ++#define INTSTAT_FIFO_MASK (0x000000f0) ++ ++/* Configuration */ ++#define AUDIO_DESTINATION_OFFSET (0x0C) ++#define AUDIO_SAMPLE_RATE_OFFSET (0x10) ++#define AUDIO_BIT_RATE_OFFSET (0x14) ++#define AUDIO_VOLUME_OFFSET (0x18) ++#define AUDIO_CHANNELS_OFFSET (0x1C) ++ ++/* Implemention of peterson's algorithm for shared memory semaphores */ ++#define AUDIO_FLAG0_OFFSET (0x20) ++#define AUDIO_FLAG1_OFFSET (0x24) ++#define AUDIO_TURN_OFFSET (0x28) ++ ++/* Fifo registers */ ++#define AUDIO_IN_WRITE_PTR_OFFSET (0x30) ++#define AUDIO_IN_READ_PTR_OFFSET (0x34) ++#define AUDIO_IN_FIFO_SIZE_OFFSET (0x38) ++#define AUDIO_IN_FIFO_ENTRY_OFFSET (0x3C) ++#define AUDIO_IN_FIFO_START_OFFSET (0x40) ++ ++/* 8 entries here of 4 words each = 0x80 gap from 0x50 */ ++#define AUDIO_IN_FIFO_OFFSET (0x50) ++ ++#define AUDIO_OUT_WRITE_PTR_OFFSET (0xD0) ++#define AUDIO_OUT_READ_PTR_OFFSET (0xD4) ++#define AUDIO_OUT_FIFO_SIZE_OFFSET (0xD8) ++#define AUDIO_OUT_FIFO_ENTRY_OFFSET (0xDC) ++#define AUDIO_OUT_FIFO_START_OFFSET (0xE0) ++ ++/* 8 entries here of 4 words each = 0x80 gap from 0xF0 */ ++#define AUDIO_OUT_FIFO_OFFSET (0xF0) ++ ++/* 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; ++ ++/* this struct is tightly packed - its size is 16bytes */ ++typedef struct { ++ uint32_t buffer_id; ++ uint32_t buffer_size; ++ uint32_t buffer_ptr; ++ uint32_t spare; ++ ++} AUDIO_FIFO_ENTRY_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 dest; ++ int mute; ++} bcm2835_chip_t; ++ ++typedef struct bcm2835_audio_buffer { ++ uint32_t buffer_id; ++ phys_addr_t bus_addr; ++ uint8_t __iomem *start; ++ uint32_t size; ++ uint32_t data_left; ++ struct list_head link; ++ ++} bcm2835_audio_buffer_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; ++ ++#ifdef DUMP_RAW_DATA ++ /* for debug */ ++ int file; ++#endif ++ 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); ++ ++void bcm2835_audio_fifo_get_lock(bcm2835_alsa_stream_t * alsa_stream); ++void bcm2835_audio_fifo_put_lock(bcm2835_alsa_stream_t * alsa_stream); ++ ++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_buffers_consumed_bytes(bcm2835_alsa_stream_t *alsa_stream); ++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.1.10/sound/arm/bcm2835-pcm.c linux-3.1.10.patch/sound/arm/bcm2835-pcm.c --- linux-3.1.10/sound/arm/bcm2835-pcm.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/sound/arm/bcm2835-pcm.c 2012-04-28 22:26:48.884717844 +0200 ++++ linux-3.1.10.patch/sound/arm/bcm2835-pcm.c 2012-05-02 00:07:05.472259339 +0200 @@ -0,0 +1,424 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -76936,7 +77575,7 @@ diff -Naur linux-3.1.10/sound/arm/bcm2835-pcm.c linux-3.1.10.patch/sound/arm/bcm +} diff -Naur linux-3.1.10/sound/arm/bcm2835-vchiq.c linux-3.1.10.patch/sound/arm/bcm2835-vchiq.c --- linux-3.1.10/sound/arm/bcm2835-vchiq.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/sound/arm/bcm2835-vchiq.c 2012-04-28 22:26:48.888717924 +0200 ++++ linux-3.1.10.patch/sound/arm/bcm2835-vchiq.c 2012-05-02 00:07:05.481259520 +0200 @@ -0,0 +1,818 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. @@ -77756,682 +78395,38 @@ diff -Naur linux-3.1.10/sound/arm/bcm2835-vchiq.c linux-3.1.10.patch/sound/arm/b + atomic_sub(count, &alsa_stream->retrieved); + return count; +} -diff -Naur linux-3.1.10/sound/arm/bcm2835.c linux-3.1.10.patch/sound/arm/bcm2835.c ---- linux-3.1.10/sound/arm/bcm2835.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/sound/arm/bcm2835.c 2012-04-28 22:26:48.880717762 +0200 -@@ -0,0 +1,423 @@ -+/***************************************************************************** -+* 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. -+*****************************************************************************/ +diff -Naur linux-3.1.10/sound/arm/Kconfig linux-3.1.10.patch/sound/arm/Kconfig +--- linux-3.1.10/sound/arm/Kconfig 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/sound/arm/Kconfig 2012-05-02 00:07:05.450258897 +0200 +@@ -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 && 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.1.10/sound/arm/Makefile linux-3.1.10.patch/sound/arm/Makefile +--- linux-3.1.10/sound/arm/Makefile 2012-01-18 16:33:18.000000000 +0100 ++++ linux-3.1.10.patch/sound/arm/Makefile 2012-05-02 00:07:05.450258897 +0200 +@@ -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 + -+#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; -+ printk(KERN_INFO "### snd_bcm2835_alsa_probe %p ###", pdev); -+ -+ printk -+ ("############ PROBING FOR bcm2835 ALSA device (%d):(%d) ###############\n", -+ dev, enable[dev]); -+ -+ if (dev >= MAX_SUBSTREAMS) -+ return -ENODEV; -+ -+ if (!enable[dev]) { -+ dev++; -+ return -ENOENT; -+ } -+ -+ if (dev > 0) -+ goto add_register_map; -+ -+ printk("Creating card...\n"); -+ 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); -+ -+ printk("Creating device/chip ..\n"); -+ 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; -+ } -+ -+ printk("Adding controls ..\n"); -+ 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) { -+ printk("Registering card ....\n"); -+ 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("bcm2835 ALSA CARD CREATED!\n"); -+ } else { -+ printk("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; -+ } -+ printk(KERN_INFO "### BCM2835 ALSA driver init %s ### \n", -+ err ? "FAILED" : "OK"); -+ -+ 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.1.10/sound/arm/bcm2835.h linux-3.1.10.patch/sound/arm/bcm2835.h ---- linux-3.1.10/sound/arm/bcm2835.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/sound/arm/bcm2835.h 2012-04-28 22:26:48.885717864 +0200 -@@ -0,0 +1,242 @@ -+/***************************************************************************** -+* 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 -+ -+#define SUBSTREAM_NUM 1 -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* #define DUMP_RAW_DATA */ -+//#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...) do {} while (0) -+ -+#define audio_info(fmt, arg...) do {} while (0) -+ -+#endif /* AUDIO_VERBOSE_DEBUG_ENABLE */ -+ -+#else -+ -+#define audio_debug(fmt, arg...) do {} while (0) -+ -+#define audio_info(fmt, arg...) do {} while (0) -+ -+#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) -+ -+#define AUDIO_IPC_BLOCK_NUM_BUFFERS (8) -+#define AUDIO_IPC_BLOCK_BUFFER_SIZE (1024*8) -+ -+#define AUDIO_CONTROL_OFFSET (0x00) -+#define CTRL_EN_SHIFT (0) -+#define CTRL_EN_MASK (0x00000001) -+#define CTRL_PLAY_SHIFT (1) -+#define CTRL_PLAY_MASK (0x00000002) -+#define CTRL_MUTE_SHIFT (2) -+#define CTRL_MUTE_MASK (0x00000004) -+#define CTRL_SETUP_SHIFT (3) -+#define CTRL_SETUP_MASK (0x00000008) -+#define CTRL_FLUSH_SHIFT (4) -+#define CTRL_FLUSH_MASK (0x00000010) -+#define CTRL_STOPMODE_SHIFT (5) -+#define CTRL_STOPMODE_MASK (0x00000020) -+ -+#define AUDIO_STATUS_OFFSET (0x04) -+#define STAT_EN_SHIFT (0) -+#define STAT_EN_MASK (0x00000001) -+#define STAT_PLAY_SHIFT (1) -+#define STAT_PLAY_MASK (0x00000002) -+#define STAT_MUTE_SHIFT (2) -+#define STAT_MUTE_MASK (0x00000004) -+#define STAT_SETUP_SHIFT (3) -+#define STAT_SETUP_MASK (0x00000008) -+#define STAT_FLUSH_SHIFT (4) -+#define STAT_FLUSH_MASK (0x00000010) -+#define STAT_STOPMODE_SHIFT (5) -+#define STAT_STOPMODE_MASK (0x00000020) -+ -+/* Interrupt status */ -+#define AUDIO_INTSTAT_OFFSET (0x08) -+#define INTSTAT_CONTROL_SHIFT (0) -+#define INTSTAT_CONTROL_MASK (0x0000000f) -+#define INTSTAT_FIFO_SHIFT (4) -+#define INTSTAT_FIFO_MASK (0x000000f0) -+ -+/* Configuration */ -+#define AUDIO_DESTINATION_OFFSET (0x0C) -+#define AUDIO_SAMPLE_RATE_OFFSET (0x10) -+#define AUDIO_BIT_RATE_OFFSET (0x14) -+#define AUDIO_VOLUME_OFFSET (0x18) -+#define AUDIO_CHANNELS_OFFSET (0x1C) -+ -+/* Implemention of peterson's algorithm for shared memory semaphores */ -+#define AUDIO_FLAG0_OFFSET (0x20) -+#define AUDIO_FLAG1_OFFSET (0x24) -+#define AUDIO_TURN_OFFSET (0x28) -+ -+/* Fifo registers */ -+#define AUDIO_IN_WRITE_PTR_OFFSET (0x30) -+#define AUDIO_IN_READ_PTR_OFFSET (0x34) -+#define AUDIO_IN_FIFO_SIZE_OFFSET (0x38) -+#define AUDIO_IN_FIFO_ENTRY_OFFSET (0x3C) -+#define AUDIO_IN_FIFO_START_OFFSET (0x40) -+ -+/* 8 entries here of 4 words each = 0x80 gap from 0x50 */ -+#define AUDIO_IN_FIFO_OFFSET (0x50) -+ -+#define AUDIO_OUT_WRITE_PTR_OFFSET (0xD0) -+#define AUDIO_OUT_READ_PTR_OFFSET (0xD4) -+#define AUDIO_OUT_FIFO_SIZE_OFFSET (0xD8) -+#define AUDIO_OUT_FIFO_ENTRY_OFFSET (0xDC) -+#define AUDIO_OUT_FIFO_START_OFFSET (0xE0) -+ -+/* 8 entries here of 4 words each = 0x80 gap from 0xF0 */ -+#define AUDIO_OUT_FIFO_OFFSET (0xF0) -+ -+/* 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; -+ -+/* this struct is tightly packed - its size is 16bytes */ -+typedef struct { -+ uint32_t buffer_id; -+ uint32_t buffer_size; -+ uint32_t buffer_ptr; -+ uint32_t spare; -+ -+} AUDIO_FIFO_ENTRY_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 dest; -+ int mute; -+} bcm2835_chip_t; -+ -+typedef struct bcm2835_audio_buffer { -+ uint32_t buffer_id; -+ phys_addr_t bus_addr; -+ uint8_t __iomem *start; -+ uint32_t size; -+ uint32_t data_left; -+ struct list_head link; -+ -+} bcm2835_audio_buffer_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; -+ -+#ifdef DUMP_RAW_DATA -+ /* for debug */ -+ int file; -+#endif -+ 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); -+ -+void bcm2835_audio_fifo_get_lock(bcm2835_alsa_stream_t * alsa_stream); -+void bcm2835_audio_fifo_put_lock(bcm2835_alsa_stream_t * alsa_stream); -+ -+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_buffers_consumed_bytes(bcm2835_alsa_stream_t *alsa_stream); -+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.1.10/sound/arm/vc_vchi_audioserv_defs.h linux-3.1.10.patch/sound/arm/vc_vchi_audioserv_defs.h --- linux-3.1.10/sound/arm/vc_vchi_audioserv_defs.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-3.1.10.patch/sound/arm/vc_vchi_audioserv_defs.h 2012-04-28 22:26:48.883717824 +0200 ++++ linux-3.1.10.patch/sound/arm/vc_vchi_audioserv_defs.h 2012-05-02 00:07:05.471259319 +0200 @@ -0,0 +1,112 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved.