Created
July 12, 2018 03:21
-
-
Save Abdillah/b439a20b07f0b8051d7ef4c945160910 to your computer and use it in GitHub Desktop.
Different between mainline and S5360 update 4 provided kernel (maybe basically unmodified Android kernel?).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Only in /path/to/linux-2.6.35.7/arch/alpha/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/arm/boot/compressed: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/boot/compressed/head.S /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/boot/compressed/head.S | |
| --- /path/to/linux-2.6.35.7/arch/arm/boot/compressed/head.S 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/boot/compressed/head.S 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -21,7 +21,7 @@ | |
| #if defined(CONFIG_DEBUG_ICEDCC) | |
| -#ifdef CONFIG_CPU_V6 | |
| +#ifdef defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V7) | |
| .macro loadsp, rb, tmp | |
| .endm | |
| .macro writeb, ch, rb | |
| @@ -627,6 +627,8 @@ | |
| @ b __arm6_mmu_cache_off | |
| @ b __armv3_mmu_cache_flush | |
| +#if !defined(CONFIG_CPU_V7) | |
| + /* This collides with some V7 IDs, preventing correct detection */ | |
| .word 0x00000000 @ old ARM ID | |
| .word 0x0000f000 | |
| mov pc, lr | |
| @@ -635,6 +637,7 @@ | |
| THUMB( nop ) | |
| mov pc, lr | |
| THUMB( nop ) | |
| +#endif | |
| .word 0x41007000 @ ARM7/710 | |
| .word 0xfff8fe00 | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/boot/compressed/misc.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/boot/compressed/misc.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/boot/compressed/misc.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/boot/compressed/misc.c 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -39,7 +39,7 @@ | |
| #ifdef CONFIG_DEBUG_ICEDCC | |
| -#ifdef CONFIG_CPU_V6 | |
| +#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V7) | |
| static void icedcc_putc(int ch) | |
| { | |
| @@ -188,6 +188,14 @@ | |
| #ifndef STANDALONE_DEBUG | |
| +static void putstrdummy(const char *ptr) | |
| +{ | |
| + char c; | |
| + | |
| + while ((c = *ptr++) != '\0') { | |
| + } | |
| +} | |
| + | |
| unsigned long | |
| decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, | |
| unsigned long free_mem_ptr_end_p, | |
| @@ -205,10 +213,10 @@ | |
| tmp = (unsigned char *) (((unsigned long)input_data_end) - 4); | |
| output_ptr = get_unaligned_le32(tmp); | |
| - putstr("Uncompressing Linux..."); | |
| + putstrdummy("Uncompressing Linux..."); | |
| do_decompress(input_data, input_data_end - input_data, | |
| output_data, error); | |
| - putstr(" done, booting the kernel.\n"); | |
| + putstrdummy(" done, booting the kernel.\n"); | |
| return output_ptr; | |
| } | |
| #else | |
| Only in /path/to/linux-2.6.35.7/arch/arm/boot: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/common: fiq_debugger.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/common: fiq_debugger_ringbuf.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/common: fiq_glue.S | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/common: fiq_glue_setup.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/common/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/common/Kconfig | |
| --- /path/to/linux-2.6.35.7/arch/arm/common/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/common/Kconfig 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -41,3 +41,46 @@ | |
| config COMMON_CLKDEV | |
| bool | |
| select HAVE_CLK | |
| + | |
| +config FIQ_GLUE | |
| + bool | |
| + select FIQ | |
| + | |
| +config FIQ_DEBUGGER | |
| + bool "FIQ Mode Serial Debugger" | |
| + select FIQ | |
| + select FIQ_GLUE | |
| + select KERNEL_DEBUGGER_CORE | |
| + default n | |
| + help | |
| + The FIQ serial debugger can accept commands even when the | |
| + kernel is unresponsive due to being stuck with interrupts | |
| + disabled. Depends on the kernel debugger core in drivers/misc. | |
| + | |
| + | |
| +config FIQ_DEBUGGER_NO_SLEEP | |
| + bool "Keep serial debugger active" | |
| + depends on FIQ_DEBUGGER | |
| + default n | |
| + help | |
| + Enables the serial debugger at boot. Passing | |
| + fiq_debugger.no_sleep on the kernel commandline will | |
| + override this config option. | |
| + | |
| +config FIQ_DEBUGGER_WAKEUP_IRQ_ALWAYS_ON | |
| + bool "Don't disable wakeup IRQ when debugger is active" | |
| + depends on FIQ_DEBUGGER | |
| + default n | |
| + help | |
| + Don't disable the wakeup irq when enabling the uart clock. This will | |
| + cause extra interrupts, but it makes the serial debugger usable with | |
| + on some MSM radio builds that ignore the uart clock request in power | |
| + collapse. | |
| + | |
| +config FIQ_DEBUGGER_CONSOLE | |
| + bool "Console on FIQ Serial Debugger port" | |
| + depends on FIQ_DEBUGGER | |
| + default n | |
| + help | |
| + Enables a console so that printk messages are displayed on | |
| + the debugger serial port as the occur. | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/common/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/common/Makefile | |
| --- /path/to/linux-2.6.35.7/arch/arm/common/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/common/Makefile 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -17,3 +17,5 @@ | |
| obj-$(CONFIG_ARCH_IXP23XX) += uengine.o | |
| obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o | |
| obj-$(CONFIG_COMMON_CLKDEV) += clkdev.o | |
| +obj-$(CONFIG_FIQ_GLUE) += fiq_glue.o fiq_glue_setup.o | |
| +obj-$(CONFIG_FIQ_DEBUGGER) += fiq_debugger.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_athenarayB1_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_athenarayEDN20_eMMC_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_cooperve_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_luisa_02_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_luisa_03_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_luisa_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_tassve_02_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_tassve_03_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_tassve_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_thunderbirdEDN31_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_thunderbirdEDN41_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_thunderbirdEDN5x_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_thunderbirdEDN5x_qvga_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_totoro_02B0_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_totoro_02B1_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_totoro_03_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_totoro_04_defconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/configs: bcm21553_totoro_05_defconfig | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/include/asm/cacheflush.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/cacheflush.h | |
| --- /path/to/linux-2.6.35.7/arch/arm/include/asm/cacheflush.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/cacheflush.h 2018-07-12 10:13:46.000000000 +0700 | |
| @@ -336,7 +336,7 @@ | |
| * Harvard caches are synchronised for the user space address range. | |
| * This is used for the ARM private sys_cacheflush system call. | |
| */ | |
| -#define flush_cache_user_range(vma,start,end) \ | |
| +#define flush_cache_user_range(start,end) \ | |
| __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end)) | |
| /* | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm: fiq_debugger.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm: fiq_glue.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/include/asm/hardware/cache-l2x0.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/hardware/cache-l2x0.h | |
| --- /path/to/linux-2.6.35.7/arch/arm/include/asm/hardware/cache-l2x0.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/hardware/cache-l2x0.h 2018-07-12 10:13:45.000000000 +0700 | |
| @@ -21,9 +21,6 @@ | |
| #define __ASM_ARM_HARDWARE_L2X0_H | |
| #define L2X0_CACHE_ID 0x000 | |
| -#define L2X0_CACHE_ID_PART_MASK (0xf << 6) | |
| -#define L2X0_CACHE_ID_PART_L210 (1 << 6) | |
| -#define L2X0_CACHE_ID_PART_L310 (3 << 6) | |
| #define L2X0_CACHE_TYPE 0x004 | |
| #define L2X0_CTRL 0x100 | |
| #define L2X0_AUX_CTRL 0x104 | |
| @@ -53,6 +50,26 @@ | |
| #define L2X0_LINE_DATA 0xF10 | |
| #define L2X0_LINE_TAG 0xF30 | |
| #define L2X0_DEBUG_CTRL 0xF40 | |
| +#define L2X0_PREFETCH_CTRL 0xF60 | |
| +#define L2X0_POWER_CTRL 0xF80 | |
| +#define L2X0_DYNAMIC_CLK_GATING_EN (1 << 1) | |
| +#define L2X0_STNDBY_MODE_EN (1 << 0) | |
| + | |
| +/* Registers shifts and masks */ | |
| +#define L2X0_CACHE_ID_PART_MASK (0xf << 6) | |
| +#define L2X0_CACHE_ID_PART_L210 (1 << 6) | |
| +#define L2X0_CACHE_ID_PART_L310 (3 << 6) | |
| + | |
| +#define L2X0_AUX_CTRL_MASK 0xc0000fff | |
| +#define L2X0_AUX_CTRL_ASSOCIATIVITY_SHIFT 16 | |
| +#define L2X0_AUX_CTRL_WAY_SIZE_SHIFT 17 | |
| +#define L2X0_AUX_CTRL_WAY_SIZE_MASK (0x3 << 17) | |
| +#define L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT 22 | |
| +#define L2X0_AUX_CTRL_NS_LOCKDOWN_SHIFT 26 | |
| +#define L2X0_AUX_CTRL_NS_INT_CTRL_SHIFT 27 | |
| +#define L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT 28 | |
| +#define L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT 29 | |
| +#define L2X0_AUX_CTRL_EARLY_BRESP_SHIFT 30 | |
| #ifndef __ASSEMBLY__ | |
| extern void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/include/asm/hardware/coresight.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/hardware/coresight.h | |
| --- /path/to/linux-2.6.35.7/arch/arm/include/asm/hardware/coresight.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/hardware/coresight.h 2018-07-12 10:13:45.000000000 +0700 | |
| @@ -17,27 +17,17 @@ | |
| #define TRACER_ACCESSED_BIT 0 | |
| #define TRACER_RUNNING_BIT 1 | |
| #define TRACER_CYCLE_ACC_BIT 2 | |
| +#define TRACER_TRACE_DATA_BIT 3 | |
| #define TRACER_ACCESSED BIT(TRACER_ACCESSED_BIT) | |
| #define TRACER_RUNNING BIT(TRACER_RUNNING_BIT) | |
| #define TRACER_CYCLE_ACC BIT(TRACER_CYCLE_ACC_BIT) | |
| - | |
| -struct tracectx { | |
| - unsigned int etb_bufsz; | |
| - void __iomem *etb_regs; | |
| - void __iomem *etm_regs; | |
| - unsigned long flags; | |
| - int ncmppairs; | |
| - int etm_portsz; | |
| - struct device *dev; | |
| - struct clk *emu_clk; | |
| - struct mutex mutex; | |
| -}; | |
| +#define TRACER_TRACE_DATA BIT(TRACER_TRACE_DATA_BIT) | |
| #define TRACER_TIMEOUT 10000 | |
| -#define etm_writel(t, v, x) \ | |
| - (__raw_writel((v), (t)->etm_regs + (x))) | |
| -#define etm_readl(t, x) (__raw_readl((t)->etm_regs + (x))) | |
| +#define etm_writel(t, id, v, x) \ | |
| + (__raw_writel((v), (t)->etm_regs[(id)] + (x))) | |
| +#define etm_readl(t, id, x) (__raw_readl((t)->etm_regs[(id)] + (x))) | |
| /* CoreSight Management Registers */ | |
| #define CSMR_LOCKACCESS 0xfb0 | |
| @@ -48,8 +38,6 @@ | |
| /* CoreSight Component Registers */ | |
| #define CSCR_CLASS 0xff4 | |
| -#define CSCR_PRSR 0x314 | |
| - | |
| #define UNLOCK_MAGIC 0xc5acce55 | |
| /* ETM control register, "ETM Architecture", 3.3.1 */ | |
| @@ -114,10 +102,10 @@ | |
| /* ETM status register, "ETM Architecture", 3.3.2 */ | |
| #define ETMR_STATUS (0x10) | |
| -#define ETMST_OVERFLOW (1 << 0) | |
| -#define ETMST_PROGBIT (1 << 1) | |
| -#define ETMST_STARTSTOP (1 << 2) | |
| -#define ETMST_TRIGGER (1 << 3) | |
| +#define ETMST_OVERFLOW BIT(0) | |
| +#define ETMST_PROGBIT BIT(1) | |
| +#define ETMST_STARTSTOP BIT(2) | |
| +#define ETMST_TRIGGER BIT(3) | |
| #define etm_progbit(t) (etm_readl((t), ETMR_STATUS) & ETMST_PROGBIT) | |
| #define etm_started(t) (etm_readl((t), ETMR_STATUS) & ETMST_STARTSTOP) | |
| @@ -125,13 +113,27 @@ | |
| #define ETMR_TRACEENCTRL2 0x1c | |
| #define ETMR_TRACEENCTRL 0x24 | |
| -#define ETMTE_INCLEXCL (1 << 24) | |
| +#define ETMTE_INCLEXCL BIT(24) | |
| #define ETMR_TRACEENEVT 0x20 | |
| + | |
| +#define ETMR_VIEWDATAEVT 0x30 | |
| +#define ETMR_VIEWDATACTRL1 0x34 | |
| +#define ETMR_VIEWDATACTRL2 0x38 | |
| +#define ETMR_VIEWDATACTRL3 0x3c | |
| +#define ETMVDC3_EXCLONLY BIT(16) | |
| + | |
| #define ETMCTRL_OPTS (ETMCTRL_DO_CPRT | \ | |
| - ETMCTRL_DATA_DO_ADDR | \ | |
| ETMCTRL_BRANCH_OUTPUT | \ | |
| ETMCTRL_DO_CONTEXTID) | |
| +#define ETMR_TRACEIDR 0x200 | |
| + | |
| +/* ETM management registers, "ETM Architecture", 3.5.24 */ | |
| +#define ETMMR_OSLAR 0x300 | |
| +#define ETMMR_OSLSR 0x304 | |
| +#define ETMMR_OSSRR 0x308 | |
| +#define ETMMR_PDSR 0x314 | |
| + | |
| /* ETB registers, "CoreSight Components TRM", 9.3 */ | |
| #define ETBR_DEPTH 0x04 | |
| #define ETBR_STATUS 0x0c | |
| @@ -142,20 +144,22 @@ | |
| #define ETBR_CTRL 0x20 | |
| #define ETBR_FORMATTERCTRL 0x304 | |
| #define ETBFF_ENFTC 1 | |
| -#define ETBFF_ENFCONT (1 << 1) | |
| -#define ETBFF_FONFLIN (1 << 4) | |
| -#define ETBFF_MANUAL_FLUSH (1 << 6) | |
| -#define ETBFF_TRIGIN (1 << 8) | |
| -#define ETBFF_TRIGEVT (1 << 9) | |
| -#define ETBFF_TRIGFL (1 << 10) | |
| +#define ETBFF_ENFCONT BIT(1) | |
| +#define ETBFF_FONFLIN BIT(4) | |
| +#define ETBFF_MANUAL_FLUSH BIT(6) | |
| +#define ETBFF_TRIGIN BIT(8) | |
| +#define ETBFF_TRIGEVT BIT(9) | |
| +#define ETBFF_TRIGFL BIT(10) | |
| +#define ETBFF_STOPFL BIT(12) | |
| #define etb_writel(t, v, x) \ | |
| (__raw_writel((v), (t)->etb_regs + (x))) | |
| #define etb_readl(t, x) (__raw_readl((t)->etb_regs + (x))) | |
| -#define etm_lock(t) do { etm_writel((t), 0, CSMR_LOCKACCESS); } while (0) | |
| -#define etm_unlock(t) \ | |
| - do { etm_writel((t), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0) | |
| +#define etm_lock(t, id) \ | |
| + do { etm_writel((t), (id), 0, CSMR_LOCKACCESS); } while (0) | |
| +#define etm_unlock(t, id) \ | |
| + do { etm_writel((t), (id), UNLOCK_MAGIC, CSMR_LOCKACCESS); } while (0) | |
| #define etb_lock(t) do { etb_writel((t), 0, CSMR_LOCKACCESS); } while (0) | |
| #define etb_unlock(t) \ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/include/asm/kexec.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/kexec.h | |
| --- /path/to/linux-2.6.35.7/arch/arm/include/asm/kexec.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/kexec.h 2018-07-12 10:13:46.000000000 +0700 | |
| @@ -19,10 +19,26 @@ | |
| #ifndef __ASSEMBLY__ | |
| -struct kimage; | |
| -/* Provide a dummy definition to avoid build failures. */ | |
| +/** | |
| + * crash_setup_regs() - save registers for the panic kernel | |
| + * @newregs: registers are saved here | |
| + * @oldregs: registers to be saved (may be %NULL) | |
| + * | |
| + * Function copies machine registers from @oldregs to @newregs. If @oldregs is | |
| + * %NULL then current registers are stored there. | |
| + */ | |
| static inline void crash_setup_regs(struct pt_regs *newregs, | |
| - struct pt_regs *oldregs) { } | |
| + struct pt_regs *oldregs) | |
| +{ | |
| + if (oldregs) { | |
| + memcpy(newregs, oldregs, sizeof(*newregs)); | |
| + } else { | |
| + __asm__ __volatile__ ("stmia %0, {r0 - r15}" | |
| + : : "r" (&newregs->ARM_r0)); | |
| + __asm__ __volatile__ ("mrs %0, cpsr" | |
| + : "=r" (newregs->ARM_cpsr)); | |
| + } | |
| +} | |
| #endif /* __ASSEMBLY__ */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/include/asm/outercache.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/outercache.h | |
| --- /path/to/linux-2.6.35.7/arch/arm/include/asm/outercache.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/include/asm/outercache.h 2018-07-12 10:13:46.000000000 +0700 | |
| @@ -25,6 +25,9 @@ | |
| void (*inv_range)(unsigned long, unsigned long); | |
| void (*clean_range)(unsigned long, unsigned long); | |
| void (*flush_range)(unsigned long, unsigned long); | |
| + void (*flush_all)(void); | |
| + void (*inv_all)(void); | |
| + void (*disable)(void); | |
| #ifdef CONFIG_OUTER_CACHE_SYNC | |
| void (*sync)(void); | |
| #endif | |
| @@ -50,6 +53,24 @@ | |
| outer_cache.flush_range(start, end); | |
| } | |
| +static inline void outer_flush_all(void) | |
| +{ | |
| + if (outer_cache.flush_all) | |
| + outer_cache.flush_all(); | |
| +} | |
| + | |
| +static inline void outer_inv_all(void) | |
| +{ | |
| + if (outer_cache.inv_all) | |
| + outer_cache.inv_all(); | |
| +} | |
| + | |
| +static inline void outer_disable(void) | |
| +{ | |
| + if (outer_cache.disable) | |
| + outer_cache.disable(); | |
| +} | |
| + | |
| #else | |
| static inline void outer_inv_range(unsigned long start, unsigned long end) | |
| @@ -58,6 +79,9 @@ | |
| { } | |
| static inline void outer_flush_range(unsigned long start, unsigned long end) | |
| { } | |
| +static inline void outer_flush_all(void) { } | |
| +static inline void outer_inv_all(void) { } | |
| +static inline void outer_disable(void) { } | |
| #endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/Kconfig | |
| --- /path/to/linux-2.6.35.7/arch/arm/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/Kconfig 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -13,7 +13,7 @@ | |
| select RTC_LIB | |
| select SYS_SUPPORTS_APM_EMULATION | |
| select GENERIC_ATOMIC64 if (!CPU_32v6K) | |
| - select HAVE_OPROFILE if (HAVE_PERF_EVENTS) | |
| + select HAVE_OPROFILE | |
| select HAVE_ARCH_KGDB | |
| select HAVE_KPROBES if (!XIP_KERNEL) | |
| select HAVE_KRETPROBES if (HAVE_KPROBES) | |
| @@ -181,6 +181,28 @@ | |
| help | |
| Setting ARM L1 cache line size to 64 Bytes. | |
| +if OPROFILE | |
| + | |
| +config OPROFILE_ARMV6 | |
| + def_bool y | |
| + depends on CPU_V6 && !SMP | |
| + select OPROFILE_ARM11_CORE | |
| + | |
| +config OPROFILE_MPCORE | |
| + def_bool y | |
| + depends on CPU_V6 && SMP | |
| + select OPROFILE_ARM11_CORE | |
| + | |
| +config OPROFILE_ARM11_CORE | |
| + bool | |
| + | |
| +config OPROFILE_ARMV7 | |
| + def_bool y | |
| + depends on CPU_V7 && !SMP | |
| + bool | |
| + | |
| +endif | |
| + | |
| config VECTORS_BASE | |
| hex | |
| default 0xffff0000 if MMU || CPU_HIGH_VECTOR | |
| @@ -289,6 +311,15 @@ | |
| help | |
| Support for Broadcom's BCMRing platform. | |
| +config PLAT_BCMAP | |
| + bool "BROADCOM family of ARM based processors" | |
| + select GENERIC_TIME | |
| + select GENERIC_CLOCKEVENTS | |
| + select GENERIC_GPIO | |
| + select ARCH_REQUIRE_GPIOLIB | |
| + help | |
| + Support for Broadcom family of ARM based application processors | |
| + | |
| config ARCH_CLPS711X | |
| bool "Cirrus Logic CLPS711x/EP721x-based" | |
| select CPU_ARM720T | |
| @@ -805,8 +836,14 @@ | |
| source "arch/arm/mach-at91/Kconfig" | |
| +source "arch/arm/plat-bcmap/Kconfig" | |
| + | |
| source "arch/arm/mach-bcmring/Kconfig" | |
| +source "arch/arm/mach-bcm116x/Kconfig" | |
| + | |
| +source "arch/arm/mach-bcm215xx/Kconfig" | |
| + | |
| source "arch/arm/mach-clps711x/Kconfig" | |
| source "arch/arm/mach-cns3xxx/Kconfig" | |
| @@ -1197,7 +1234,7 @@ | |
| config HZ | |
| int | |
| - default 128 if ARCH_L7200 | |
| + default 128 if ARCH_L7200 || ARCH_BCM116X || ARCH_BCM215XX | |
| default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P6440 || ARCH_S5P6442 || ARCH_S5PV210 | |
| default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER | |
| default AT91_TIMER_HZ if ARCH_AT91 | |
| @@ -1296,7 +1333,7 @@ | |
| config HW_PERF_EVENTS | |
| bool "Enable hardware performance counter support for perf events" | |
| - depends on PERF_EVENTS && CPU_HAS_PMU | |
| + depends on PERF_EVENTS && CPU_HAS_PMU && (CPU_V6 || CPU_V7) | |
| default y | |
| help | |
| Enable hardware performance counter support for perf events. If | |
| @@ -1497,6 +1534,18 @@ | |
| Should the atags used to boot the kernel be exported in an "atags" | |
| file in procfs. Useful with kexec. | |
| +config CRASH_DUMP | |
| + bool "Build kdump crash kernel (EXPERIMENTAL)" | |
| + depends on EXPERIMENTAL | |
| + help | |
| + Build a kernel suitable for use as kdump capture kernel. This should | |
| + be set only on dump capture kernels. Note that dump capture kernel | |
| + must be loaded into different physical address than the primary kernel | |
| + (e.g set PHYS_OFFSET and related mach/Makefile.boot parameters | |
| + to match value given in 'crashkernel=size@start'). | |
| + | |
| + For more details see Documentation/kdump/kdump.txt | |
| + | |
| endmenu | |
| menu "CPU Power Management" | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/Kconfig.debug /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/Kconfig.debug | |
| --- /path/to/linux-2.6.35.7/arch/arm/Kconfig.debug 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/Kconfig.debug 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -128,4 +128,38 @@ | |
| The uncompressor code port configuration is now handled | |
| by CONFIG_S3C_LOWLEVEL_UART_PORT. | |
| +config BRCM_CP_CRASH_DUMP | |
| + bool "Broadcom Communication Processor Crash Dump Support" | |
| + help | |
| + If you say Y here, a crash dump from CP will be available | |
| + on the SD card when kernel crashes. | |
| + | |
| +config BRCM_LOGDRV_DEBUG | |
| + bool "Broadcom Log Driver Debugging" | |
| + help | |
| + Say Y here if you want to enable Log Driver debugging. | |
| + | |
| +config BRCM_UNIFIED_LOGGING | |
| + bool "Broadcom Unified Logging" | |
| + help | |
| + Say Y here if you want to redirect printk to MTT. | |
| + | |
| +config BRCM_KPANIC_UI_IND | |
| + bool "Broadcom Kernel Panic Crash Dump UI Indication Support" | |
| + help | |
| + If you say Y here, a UI indication for crash dump will be shown | |
| + on the display. | |
| + | |
| +config BRCM_AP_PANIC_ON_CPCRASH | |
| + bool "Support for rebooting AP when CP crashes" | |
| + help | |
| + If you say Y here, AP will panic when CP has crashed. | |
| + Debug tool can be used to extract CP dump later. | |
| + | |
| +config SEC_DEBUG | |
| + bool "Enable SEC DEBUG" | |
| + | |
| +config SEC_DEBUG_USER | |
| + bool "Enable SEC USER FAULT DEBUG" | |
| + | |
| endmenu | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel: crash_dump.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/debug.S /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/debug.S | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/debug.S 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/debug.S 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -22,9 +22,9 @@ | |
| #if defined(CONFIG_DEBUG_ICEDCC) | |
| @@ debug using ARM EmbeddedICE DCC channel | |
| -#if defined(CONFIG_CPU_V6) | |
| +#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V7) | |
| - .macro addruart, rx, tmp | |
| + .macro addruart, rx | |
| .endm | |
| .macro senduart, rd, rx | |
| @@ -51,7 +51,7 @@ | |
| #elif defined(CONFIG_CPU_V7) | |
| - .macro addruart, rx, tmp | |
| + .macro addruart, rx | |
| .endm | |
| .macro senduart, rd, rx | |
| @@ -71,7 +71,7 @@ | |
| #elif defined(CONFIG_CPU_XSCALE) | |
| - .macro addruart, rx, tmp | |
| + .macro addruart, rx | |
| .endm | |
| .macro senduart, rd, rx | |
| @@ -98,7 +98,7 @@ | |
| #else | |
| - .macro addruart, rx, tmp | |
| + .macro addruart, rx | |
| .endm | |
| .macro senduart, rd, rx | |
| @@ -164,7 +164,7 @@ | |
| .ltorg | |
| ENTRY(printascii) | |
| - addruart r3, r1 | |
| + addruart r3 | |
| b 2f | |
| 1: waituart r2, r3 | |
| senduart r1, r3 | |
| @@ -180,7 +180,7 @@ | |
| ENDPROC(printascii) | |
| ENTRY(printch) | |
| - addruart r3, r1 | |
| + addruart r3 | |
| mov r1, r0 | |
| mov r0, #0 | |
| b 1b | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/entry-armv.S /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/entry-armv.S | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/entry-armv.S 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/entry-armv.S 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -737,10 +737,11 @@ | |
| #endif | |
| #if defined(CONFIG_HAS_TLS_REG) | |
| mcr p15, 0, r3, c13, c0, 3 @ set TLS register | |
| -#elif !defined(CONFIG_TLS_REG_EMUL) | |
| +//#elif !defined(CONFIG_TLS_REG_EMUL) | |
| +#endif | |
| mov r4, #0xffff0fff | |
| str r3, [r4, #-15] @ TLS val at 0xffff0ff0 | |
| -#endif | |
| +//#endif | |
| #ifdef CONFIG_MMU | |
| mcr p15, 0, r6, c3, c0, 0 @ Set domain register | |
| #endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/etm.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/etm.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/etm.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/etm.c 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -15,6 +15,7 @@ | |
| #include <linux/init.h> | |
| #include <linux/types.h> | |
| #include <linux/io.h> | |
| +#include <linux/slab.h> | |
| #include <linux/sysrq.h> | |
| #include <linux/device.h> | |
| #include <linux/clk.h> | |
| @@ -30,17 +31,42 @@ | |
| MODULE_LICENSE("GPL"); | |
| MODULE_AUTHOR("Alexander Shishkin"); | |
| -static struct tracectx tracer; | |
| +/* | |
| + * ETM tracer state | |
| + */ | |
| +struct tracectx { | |
| + unsigned int etb_bufsz; | |
| + void __iomem *etb_regs; | |
| + void __iomem **etm_regs; | |
| + int etm_regs_count; | |
| + unsigned long flags; | |
| + int ncmppairs; | |
| + int etm_portsz; | |
| + u32 etb_fc; | |
| + unsigned long range_start; | |
| + unsigned long range_end; | |
| + unsigned long data_range_start; | |
| + unsigned long data_range_end; | |
| + bool dump_initial_etb; | |
| + struct device *dev; | |
| + struct clk *emu_clk; | |
| + struct mutex mutex; | |
| +}; | |
| + | |
| +static struct tracectx tracer = { | |
| + .range_start = (unsigned long)_stext, | |
| + .range_end = (unsigned long)_etext, | |
| +}; | |
| static inline bool trace_isrunning(struct tracectx *t) | |
| { | |
| return !!(t->flags & TRACER_RUNNING); | |
| } | |
| -static int etm_setup_address_range(struct tracectx *t, int n, | |
| +static int etm_setup_address_range(struct tracectx *t, int id, int n, | |
| unsigned long start, unsigned long end, int exclude, int data) | |
| { | |
| - u32 flags = ETMAAT_ARM | ETMAAT_IGNCONTEXTID | ETMAAT_NSONLY | \ | |
| + u32 flags = ETMAAT_ARM | ETMAAT_IGNCONTEXTID | ETMAAT_IGNSECURITY | | |
| ETMAAT_NOVALCMP; | |
| if (n < 1 || n > t->ncmppairs) | |
| @@ -56,95 +82,155 @@ | |
| flags |= ETMAAT_IEXEC; | |
| /* first comparator for the range */ | |
| - etm_writel(t, flags, ETMR_COMP_ACC_TYPE(n * 2)); | |
| - etm_writel(t, start, ETMR_COMP_VAL(n * 2)); | |
| + etm_writel(t, id, flags, ETMR_COMP_ACC_TYPE(n * 2)); | |
| + etm_writel(t, id, start, ETMR_COMP_VAL(n * 2)); | |
| /* second comparator is right next to it */ | |
| - etm_writel(t, flags, ETMR_COMP_ACC_TYPE(n * 2 + 1)); | |
| - etm_writel(t, end, ETMR_COMP_VAL(n * 2 + 1)); | |
| + etm_writel(t, id, flags, ETMR_COMP_ACC_TYPE(n * 2 + 1)); | |
| + etm_writel(t, id, end, ETMR_COMP_VAL(n * 2 + 1)); | |
| - flags = exclude ? ETMTE_INCLEXCL : 0; | |
| - etm_writel(t, flags | (1 << n), ETMR_TRACEENCTRL); | |
| + if (data) { | |
| + flags = exclude ? ETMVDC3_EXCLONLY : 0; | |
| + if (exclude) | |
| + n += 8; | |
| + etm_writel(t, id, flags | BIT(n), ETMR_VIEWDATACTRL3); | |
| + } else { | |
| + flags = exclude ? ETMTE_INCLEXCL : 0; | |
| + etm_writel(t, id, flags | (1 << n), ETMR_TRACEENCTRL); | |
| + } | |
| return 0; | |
| } | |
| -static int trace_start(struct tracectx *t) | |
| +static int trace_start_etm(struct tracectx *t, int id) | |
| { | |
| u32 v; | |
| unsigned long timeout = TRACER_TIMEOUT; | |
| - etb_unlock(t); | |
| - | |
| - etb_writel(t, 0, ETBR_FORMATTERCTRL); | |
| - etb_writel(t, 1, ETBR_CTRL); | |
| - | |
| - etb_lock(t); | |
| - | |
| - /* configure etm */ | |
| v = ETMCTRL_OPTS | ETMCTRL_PROGRAM | ETMCTRL_PORTSIZE(t->etm_portsz); | |
| if (t->flags & TRACER_CYCLE_ACC) | |
| v |= ETMCTRL_CYCLEACCURATE; | |
| - etm_unlock(t); | |
| + if (t->flags & TRACER_TRACE_DATA) | |
| + v |= ETMCTRL_DATA_DO_ADDR; | |
| - etm_writel(t, v, ETMR_CTRL); | |
| + etm_unlock(t, id); | |
| - while (!(etm_readl(t, ETMR_CTRL) & ETMCTRL_PROGRAM) && --timeout) | |
| + etm_writel(t, id, v, ETMR_CTRL); | |
| + | |
| + while (!(etm_readl(t, id, ETMR_CTRL) & ETMCTRL_PROGRAM) && --timeout) | |
| ; | |
| if (!timeout) { | |
| dev_dbg(t->dev, "Waiting for progbit to assert timed out\n"); | |
| - etm_lock(t); | |
| + etm_lock(t, id); | |
| return -EFAULT; | |
| } | |
| - etm_setup_address_range(t, 1, (unsigned long)_stext, | |
| - (unsigned long)_etext, 0, 0); | |
| - etm_writel(t, 0, ETMR_TRACEENCTRL2); | |
| - etm_writel(t, 0, ETMR_TRACESSCTRL); | |
| - etm_writel(t, 0x6f, ETMR_TRACEENEVT); | |
| + if (t->range_start || t->range_end) | |
| + etm_setup_address_range(t, id, 1, | |
| + t->range_start, t->range_end, 0, 0); | |
| + else | |
| + etm_writel(t, id, ETMTE_INCLEXCL, ETMR_TRACEENCTRL); | |
| + | |
| + etm_writel(t, id, 0, ETMR_TRACEENCTRL2); | |
| + etm_writel(t, id, 0, ETMR_TRACESSCTRL); | |
| + etm_writel(t, id, 0x6f, ETMR_TRACEENEVT); | |
| + | |
| + etm_writel(t, id, 0, ETMR_VIEWDATACTRL1); | |
| + etm_writel(t, id, 0, ETMR_VIEWDATACTRL2); | |
| + | |
| + if (t->data_range_start || t->data_range_end) | |
| + etm_setup_address_range(t, id, 2, t->data_range_start, | |
| + t->data_range_end, 0, 1); | |
| + else | |
| + etm_writel(t, id, ETMVDC3_EXCLONLY, ETMR_VIEWDATACTRL3); | |
| + | |
| + etm_writel(t, id, 0x6f, ETMR_VIEWDATAEVT); | |
| v &= ~ETMCTRL_PROGRAM; | |
| v |= ETMCTRL_PORTSEL; | |
| - etm_writel(t, v, ETMR_CTRL); | |
| + etm_writel(t, id, v, ETMR_CTRL); | |
| timeout = TRACER_TIMEOUT; | |
| - while (etm_readl(t, ETMR_CTRL) & ETMCTRL_PROGRAM && --timeout) | |
| + while (etm_readl(t, id, ETMR_CTRL) & ETMCTRL_PROGRAM && --timeout) | |
| ; | |
| if (!timeout) { | |
| dev_dbg(t->dev, "Waiting for progbit to deassert timed out\n"); | |
| - etm_lock(t); | |
| + etm_lock(t, id); | |
| return -EFAULT; | |
| } | |
| - etm_lock(t); | |
| + etm_lock(t, id); | |
| + return 0; | |
| +} | |
| + | |
| +static int trace_start(struct tracectx *t) | |
| +{ | |
| + int ret; | |
| + int id; | |
| + u32 etb_fc = t->etb_fc; | |
| + | |
| + etb_unlock(t); | |
| + | |
| + t->dump_initial_etb = false; | |
| + etb_writel(t, 0, ETBR_WRITEADDR); | |
| + etb_writel(t, etb_fc, ETBR_FORMATTERCTRL); | |
| + etb_writel(t, 1, ETBR_CTRL); | |
| + | |
| + etb_lock(t); | |
| + | |
| + /* configure etm(s) */ | |
| + for (id = 0; id < t->etm_regs_count; id++) { | |
| + ret = trace_start_etm(t, id); | |
| + if (ret) | |
| + return ret; | |
| + } | |
| t->flags |= TRACER_RUNNING; | |
| return 0; | |
| } | |
| -static int trace_stop(struct tracectx *t) | |
| +static int trace_stop_etm(struct tracectx *t, int id) | |
| { | |
| unsigned long timeout = TRACER_TIMEOUT; | |
| - etm_unlock(t); | |
| + etm_unlock(t, id); | |
| - etm_writel(t, 0x440, ETMR_CTRL); | |
| - while (!(etm_readl(t, ETMR_CTRL) & ETMCTRL_PROGRAM) && --timeout) | |
| + etm_writel(t, id, 0x441, ETMR_CTRL); | |
| + while (!(etm_readl(t, id, ETMR_CTRL) & ETMCTRL_PROGRAM) && --timeout) | |
| ; | |
| if (!timeout) { | |
| dev_dbg(t->dev, "Waiting for progbit to assert timed out\n"); | |
| - etm_lock(t); | |
| + etm_lock(t, id); | |
| return -EFAULT; | |
| } | |
| - etm_lock(t); | |
| + etm_lock(t, id); | |
| + return 0; | |
| +} | |
| + | |
| +static int trace_stop(struct tracectx *t) | |
| +{ | |
| + int id; | |
| + int ret; | |
| + unsigned long timeout = TRACER_TIMEOUT; | |
| + u32 etb_fc = t->etb_fc; | |
| + | |
| + for (id = 0; id < t->etm_regs_count; id++) { | |
| + ret = trace_stop_etm(t, id); | |
| + if (ret) | |
| + return ret; | |
| + } | |
| etb_unlock(t); | |
| - etb_writel(t, ETBFF_MANUAL_FLUSH, ETBR_FORMATTERCTRL); | |
| + if (etb_fc) { | |
| + etb_fc |= ETBFF_STOPFL; | |
| + etb_writel(t, t->etb_fc, ETBR_FORMATTERCTRL); | |
| + } | |
| + etb_writel(t, etb_fc | ETBFF_MANUAL_FLUSH, ETBR_FORMATTERCTRL); | |
| timeout = TRACER_TIMEOUT; | |
| while (etb_readl(t, ETBR_FORMATTERCTRL) & | |
| @@ -169,24 +255,15 @@ | |
| static int etb_getdatalen(struct tracectx *t) | |
| { | |
| u32 v; | |
| - int rp, wp; | |
| + int wp; | |
| v = etb_readl(t, ETBR_STATUS); | |
| if (v & 1) | |
| return t->etb_bufsz; | |
| - rp = etb_readl(t, ETBR_READADDR); | |
| wp = etb_readl(t, ETBR_WRITEADDR); | |
| - | |
| - if (rp > wp) { | |
| - etb_writel(t, 0, ETBR_READADDR); | |
| - etb_writel(t, 0, ETBR_WRITEADDR); | |
| - | |
| - return 0; | |
| - } | |
| - | |
| - return wp - rp; | |
| + return wp; | |
| } | |
| /* sysrq+v will always stop the running trace and leave it at that */ | |
| @@ -219,21 +296,18 @@ | |
| printk("%08x", cpu_to_be32(etb_readl(t, ETBR_READMEM))); | |
| printk(KERN_INFO "\n--- ETB buffer end ---\n"); | |
| - /* deassert the overflow bit */ | |
| - etb_writel(t, 1, ETBR_CTRL); | |
| - etb_writel(t, 0, ETBR_CTRL); | |
| - | |
| - etb_writel(t, 0, ETBR_TRIGGERCOUNT); | |
| - etb_writel(t, 0, ETBR_READADDR); | |
| - etb_writel(t, 0, ETBR_WRITEADDR); | |
| - | |
| etb_lock(t); | |
| } | |
| static void sysrq_etm_dump(int key, struct tty_struct *tty) | |
| { | |
| + if (!mutex_trylock(&tracer.mutex)) { | |
| + printk(KERN_INFO "Tracing hardware busy\n"); | |
| + return; | |
| + } | |
| dev_dbg(tracer.dev, "Dumping ETB buffer\n"); | |
| etm_dump(); | |
| + mutex_unlock(&tracer.mutex); | |
| } | |
| static struct sysrq_key_op sysrq_etm_op = { | |
| @@ -260,6 +334,10 @@ | |
| struct tracectx *t = file->private_data; | |
| u32 first = 0; | |
| u32 *buf; | |
| + int wpos; | |
| + int skip; | |
| + long wlength; | |
| + loff_t pos = *ppos; | |
| mutex_lock(&t->mutex); | |
| @@ -271,31 +349,39 @@ | |
| etb_unlock(t); | |
| total = etb_getdatalen(t); | |
| + if (total == 0 && t->dump_initial_etb) | |
| + total = t->etb_bufsz; | |
| if (total == t->etb_bufsz) | |
| first = etb_readl(t, ETBR_WRITEADDR); | |
| - etb_writel(t, first, ETBR_READADDR); | |
| + if (pos > total * 4) { | |
| + skip = 0; | |
| + wpos = total; | |
| + } else { | |
| + skip = (int)pos % 4; | |
| + wpos = (int)pos / 4; | |
| + } | |
| + total -= wpos; | |
| + first = (first + wpos) % t->etb_bufsz; | |
| - length = min(total * 4, (int)len); | |
| - buf = vmalloc(length); | |
| + etb_writel(t, first, ETBR_READADDR); | |
| - dev_dbg(t->dev, "ETB buffer length: %d\n", total); | |
| + wlength = min(total, DIV_ROUND_UP(skip + (int)len, 4)); | |
| + length = min(total * 4 - skip, (int)len); | |
| + buf = vmalloc(wlength * 4); | |
| + | |
| + dev_dbg(t->dev, "ETB read %ld bytes to %lld from %ld words at %d\n", | |
| + length, pos, wlength, first); | |
| + dev_dbg(t->dev, "ETB buffer length: %d\n", total + wpos); | |
| dev_dbg(t->dev, "ETB status reg: %x\n", etb_readl(t, ETBR_STATUS)); | |
| - for (i = 0; i < length / 4; i++) | |
| + for (i = 0; i < wlength; i++) | |
| buf[i] = etb_readl(t, ETBR_READMEM); | |
| - /* the only way to deassert overflow bit in ETB status is this */ | |
| - etb_writel(t, 1, ETBR_CTRL); | |
| - etb_writel(t, 0, ETBR_CTRL); | |
| - | |
| - etb_writel(t, 0, ETBR_WRITEADDR); | |
| - etb_writel(t, 0, ETBR_READADDR); | |
| - etb_writel(t, 0, ETBR_TRIGGERCOUNT); | |
| - | |
| etb_lock(t); | |
| - length -= copy_to_user(data, buf, length); | |
| + length -= copy_to_user(data, (u8 *)buf + skip, length); | |
| vfree(buf); | |
| + *ppos = pos + length; | |
| out: | |
| mutex_unlock(&t->mutex); | |
| @@ -331,28 +417,17 @@ | |
| if (ret) | |
| goto out; | |
| + mutex_lock(&t->mutex); | |
| t->etb_regs = ioremap_nocache(dev->res.start, resource_size(&dev->res)); | |
| if (!t->etb_regs) { | |
| ret = -ENOMEM; | |
| goto out_release; | |
| } | |
| + t->dev = &dev->dev; | |
| + t->dump_initial_etb = true; | |
| amba_set_drvdata(dev, t); | |
| - etb_miscdev.parent = &dev->dev; | |
| - | |
| - ret = misc_register(&etb_miscdev); | |
| - if (ret) | |
| - goto out_unmap; | |
| - | |
| - t->emu_clk = clk_get(&dev->dev, "emu_src_ck"); | |
| - if (IS_ERR(t->emu_clk)) { | |
| - dev_dbg(&dev->dev, "Failed to obtain emu_src_ck.\n"); | |
| - return -EFAULT; | |
| - } | |
| - | |
| - clk_enable(t->emu_clk); | |
| - | |
| etb_unlock(t); | |
| t->etb_bufsz = etb_readl(t, ETBR_DEPTH); | |
| dev_dbg(&dev->dev, "Size: %x\n", t->etb_bufsz); | |
| @@ -361,6 +436,20 @@ | |
| etb_writel(t, 0, ETBR_CTRL); | |
| etb_writel(t, 0x1000, ETBR_FORMATTERCTRL); | |
| etb_lock(t); | |
| + mutex_unlock(&t->mutex); | |
| + | |
| + etb_miscdev.parent = &dev->dev; | |
| + | |
| + ret = misc_register(&etb_miscdev); | |
| + if (ret) | |
| + goto out_unmap; | |
| + | |
| + /* Get optional clock. Currently used to select clock source on omap3 */ | |
| + t->emu_clk = clk_get(&dev->dev, "emu_src_ck"); | |
| + if (IS_ERR(t->emu_clk)) | |
| + dev_dbg(&dev->dev, "Failed to obtain emu_src_ck.\n"); | |
| + else | |
| + clk_enable(t->emu_clk); | |
| dev_dbg(&dev->dev, "ETB AMBA driver initialized.\n"); | |
| @@ -368,10 +457,13 @@ | |
| return ret; | |
| out_unmap: | |
| + mutex_lock(&t->mutex); | |
| amba_set_drvdata(dev, NULL); | |
| iounmap(t->etb_regs); | |
| + t->etb_regs = NULL; | |
| out_release: | |
| + mutex_unlock(&t->mutex); | |
| amba_release_regions(dev); | |
| return ret; | |
| @@ -386,8 +478,10 @@ | |
| iounmap(t->etb_regs); | |
| t->etb_regs = NULL; | |
| - clk_disable(t->emu_clk); | |
| - clk_put(t->emu_clk); | |
| + if (!IS_ERR(t->emu_clk)) { | |
| + clk_disable(t->emu_clk); | |
| + clk_put(t->emu_clk); | |
| + } | |
| amba_release_regions(dev); | |
| @@ -431,7 +525,10 @@ | |
| return -EINVAL; | |
| mutex_lock(&tracer.mutex); | |
| - ret = value ? trace_start(&tracer) : trace_stop(&tracer); | |
| + if (!tracer.etb_regs) | |
| + ret = -ENODEV; | |
| + else | |
| + ret = value ? trace_start(&tracer) : trace_stop(&tracer); | |
| mutex_unlock(&tracer.mutex); | |
| return ret ? : n; | |
| @@ -446,36 +543,50 @@ | |
| { | |
| u32 etb_wa, etb_ra, etb_st, etb_fc, etm_ctrl, etm_st; | |
| int datalen; | |
| + int id; | |
| + int ret; | |
| - etb_unlock(&tracer); | |
| - datalen = etb_getdatalen(&tracer); | |
| - etb_wa = etb_readl(&tracer, ETBR_WRITEADDR); | |
| - etb_ra = etb_readl(&tracer, ETBR_READADDR); | |
| - etb_st = etb_readl(&tracer, ETBR_STATUS); | |
| - etb_fc = etb_readl(&tracer, ETBR_FORMATTERCTRL); | |
| - etb_lock(&tracer); | |
| - | |
| - etm_unlock(&tracer); | |
| - etm_ctrl = etm_readl(&tracer, ETMR_CTRL); | |
| - etm_st = etm_readl(&tracer, ETMR_STATUS); | |
| - etm_lock(&tracer); | |
| + mutex_lock(&tracer.mutex); | |
| + if (tracer.etb_regs) { | |
| + etb_unlock(&tracer); | |
| + datalen = etb_getdatalen(&tracer); | |
| + etb_wa = etb_readl(&tracer, ETBR_WRITEADDR); | |
| + etb_ra = etb_readl(&tracer, ETBR_READADDR); | |
| + etb_st = etb_readl(&tracer, ETBR_STATUS); | |
| + etb_fc = etb_readl(&tracer, ETBR_FORMATTERCTRL); | |
| + etb_lock(&tracer); | |
| + } else { | |
| + etb_wa = etb_ra = etb_st = etb_fc = ~0; | |
| + datalen = -1; | |
| + } | |
| - return sprintf(buf, "Trace buffer len: %d\nComparator pairs: %d\n" | |
| + ret = sprintf(buf, "Trace buffer len: %d\nComparator pairs: %d\n" | |
| "ETBR_WRITEADDR:\t%08x\n" | |
| "ETBR_READADDR:\t%08x\n" | |
| "ETBR_STATUS:\t%08x\n" | |
| - "ETBR_FORMATTERCTRL:\t%08x\n" | |
| - "ETMR_CTRL:\t%08x\n" | |
| - "ETMR_STATUS:\t%08x\n", | |
| + "ETBR_FORMATTERCTRL:\t%08x\n", | |
| datalen, | |
| tracer.ncmppairs, | |
| etb_wa, | |
| etb_ra, | |
| etb_st, | |
| - etb_fc, | |
| + etb_fc | |
| + ); | |
| + | |
| + for (id = 0; id < tracer.etm_regs_count; id++) { | |
| + etm_unlock(&tracer, id); | |
| + etm_ctrl = etm_readl(&tracer, id, ETMR_CTRL); | |
| + etm_st = etm_readl(&tracer, id, ETMR_STATUS); | |
| + etm_lock(&tracer, id); | |
| + ret += sprintf(buf + ret, "ETMR_CTRL:\t%08x\n" | |
| + "ETMR_STATUS:\t%08x\n", | |
| etm_ctrl, | |
| etm_st | |
| ); | |
| + } | |
| + mutex_unlock(&tracer.mutex); | |
| + | |
| + return ret; | |
| } | |
| static struct kobj_attribute trace_info_attr = | |
| @@ -514,40 +625,121 @@ | |
| static struct kobj_attribute trace_mode_attr = | |
| __ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store); | |
| +static ssize_t trace_range_show(struct kobject *kobj, | |
| + struct kobj_attribute *attr, | |
| + char *buf) | |
| +{ | |
| + return sprintf(buf, "%08lx %08lx\n", | |
| + tracer.range_start, tracer.range_end); | |
| +} | |
| + | |
| +static ssize_t trace_range_store(struct kobject *kobj, | |
| + struct kobj_attribute *attr, | |
| + const char *buf, size_t n) | |
| +{ | |
| + unsigned long range_start, range_end; | |
| + | |
| + if (sscanf(buf, "%lx %lx", &range_start, &range_end) != 2) | |
| + return -EINVAL; | |
| + | |
| + mutex_lock(&tracer.mutex); | |
| + tracer.range_start = range_start; | |
| + tracer.range_end = range_end; | |
| + mutex_unlock(&tracer.mutex); | |
| + | |
| + return n; | |
| +} | |
| + | |
| + | |
| +static struct kobj_attribute trace_range_attr = | |
| + __ATTR(trace_range, 0644, trace_range_show, trace_range_store); | |
| + | |
| +static ssize_t trace_data_range_show(struct kobject *kobj, | |
| + struct kobj_attribute *attr, | |
| + char *buf) | |
| +{ | |
| + unsigned long range_start; | |
| + u64 range_end; | |
| + mutex_lock(&tracer.mutex); | |
| + range_start = tracer.data_range_start; | |
| + range_end = tracer.data_range_end; | |
| + if (!range_end && (tracer.flags & TRACER_TRACE_DATA)) | |
| + range_end = 0x100000000ULL; | |
| + mutex_unlock(&tracer.mutex); | |
| + return sprintf(buf, "%08lx %08llx\n", range_start, range_end); | |
| +} | |
| + | |
| +static ssize_t trace_data_range_store(struct kobject *kobj, | |
| + struct kobj_attribute *attr, | |
| + const char *buf, size_t n) | |
| +{ | |
| + unsigned long range_start; | |
| + u64 range_end; | |
| + | |
| + if (sscanf(buf, "%lx %llx", &range_start, &range_end) != 2) | |
| + return -EINVAL; | |
| + | |
| + mutex_lock(&tracer.mutex); | |
| + tracer.data_range_start = range_start; | |
| + tracer.data_range_end = (unsigned long)range_end; | |
| + if (range_end) | |
| + tracer.flags |= TRACER_TRACE_DATA; | |
| + else | |
| + tracer.flags &= ~TRACER_TRACE_DATA; | |
| + mutex_unlock(&tracer.mutex); | |
| + | |
| + return n; | |
| +} | |
| + | |
| + | |
| +static struct kobj_attribute trace_data_range_attr = | |
| + __ATTR(trace_data_range, 0644, | |
| + trace_data_range_show, trace_data_range_store); | |
| + | |
| static int __init etm_probe(struct amba_device *dev, struct amba_id *id) | |
| { | |
| struct tracectx *t = &tracer; | |
| int ret = 0; | |
| + void __iomem **new_regs; | |
| + int new_count; | |
| + | |
| + mutex_lock(&t->mutex); | |
| + new_count = t->etm_regs_count + 1; | |
| + new_regs = krealloc(t->etm_regs, | |
| + sizeof(t->etm_regs[0]) * new_count, GFP_KERNEL); | |
| - if (t->etm_regs) { | |
| - dev_dbg(&dev->dev, "ETM already initialized\n"); | |
| - ret = -EBUSY; | |
| + if (!new_regs) { | |
| + dev_dbg(&dev->dev, "Failed to allocate ETM register array\n"); | |
| + ret = -ENOMEM; | |
| goto out; | |
| } | |
| + t->etm_regs = new_regs; | |
| ret = amba_request_regions(dev, NULL); | |
| if (ret) | |
| goto out; | |
| - t->etm_regs = ioremap_nocache(dev->res.start, resource_size(&dev->res)); | |
| - if (!t->etm_regs) { | |
| + t->etm_regs[t->etm_regs_count] = | |
| + ioremap_nocache(dev->res.start, resource_size(&dev->res)); | |
| + if (!t->etm_regs[t->etm_regs_count]) { | |
| ret = -ENOMEM; | |
| goto out_release; | |
| } | |
| - amba_set_drvdata(dev, t); | |
| + amba_set_drvdata(dev, t->etm_regs[t->etm_regs_count]); | |
| - mutex_init(&t->mutex); | |
| - t->dev = &dev->dev; | |
| - t->flags = TRACER_CYCLE_ACC; | |
| + t->flags = TRACER_CYCLE_ACC | TRACER_TRACE_DATA; | |
| t->etm_portsz = 1; | |
| - etm_unlock(t); | |
| - ret = etm_readl(t, CSCR_PRSR); | |
| - | |
| - t->ncmppairs = etm_readl(t, ETMR_CONFCODE) & 0xf; | |
| - etm_writel(t, 0x440, ETMR_CTRL); | |
| - etm_lock(t); | |
| + etm_unlock(t, t->etm_regs_count); | |
| + (void)etm_readl(t, t->etm_regs_count, ETMMR_PDSR); | |
| + /* dummy first read */ | |
| + (void)etm_readl(&tracer, t->etm_regs_count, ETMMR_OSSRR); | |
| + | |
| + t->ncmppairs = etm_readl(t, t->etm_regs_count, ETMR_CONFCODE) & 0xf; | |
| + etm_writel(t, t->etm_regs_count, 0x441, ETMR_CTRL); | |
| + etm_writel(t, t->etm_regs_count, new_count, ETMR_TRACEIDR); | |
| + etm_lock(t, t->etm_regs_count); | |
| ret = sysfs_create_file(&dev->dev.kobj, | |
| &trace_running_attr.attr); | |
| @@ -563,36 +755,68 @@ | |
| if (ret) | |
| dev_dbg(&dev->dev, "Failed to create trace_mode in sysfs\n"); | |
| - dev_dbg(t->dev, "ETM AMBA driver initialized.\n"); | |
| + ret = sysfs_create_file(&dev->dev.kobj, &trace_range_attr.attr); | |
| + if (ret) | |
| + dev_dbg(&dev->dev, "Failed to create trace_range in sysfs\n"); | |
| + | |
| + ret = sysfs_create_file(&dev->dev.kobj, &trace_data_range_attr.attr); | |
| + if (ret) | |
| + dev_dbg(&dev->dev, | |
| + "Failed to create trace_data_range in sysfs\n"); | |
| + | |
| + dev_dbg(&dev->dev, "ETM AMBA driver initialized.\n"); | |
| + | |
| + /* Enable formatter if there are multiple trace sources */ | |
| + if (new_count > 1) | |
| + t->etb_fc = ETBFF_ENFCONT | ETBFF_ENFTC; | |
| + | |
| + t->etm_regs_count = new_count; | |
| out: | |
| + mutex_unlock(&t->mutex); | |
| return ret; | |
| out_unmap: | |
| amba_set_drvdata(dev, NULL); | |
| - iounmap(t->etm_regs); | |
| + iounmap(t->etm_regs[t->etm_regs_count]); | |
| out_release: | |
| amba_release_regions(dev); | |
| + mutex_unlock(&t->mutex); | |
| return ret; | |
| } | |
| static int etm_remove(struct amba_device *dev) | |
| { | |
| - struct tracectx *t = amba_get_drvdata(dev); | |
| + int i; | |
| + struct tracectx *t = &tracer; | |
| + void __iomem *etm_regs = amba_get_drvdata(dev); | |
| + | |
| + sysfs_remove_file(&dev->dev.kobj, &trace_running_attr.attr); | |
| + sysfs_remove_file(&dev->dev.kobj, &trace_info_attr.attr); | |
| + sysfs_remove_file(&dev->dev.kobj, &trace_mode_attr.attr); | |
| + sysfs_remove_file(&dev->dev.kobj, &trace_range_attr.attr); | |
| + sysfs_remove_file(&dev->dev.kobj, &trace_data_range_attr.attr); | |
| amba_set_drvdata(dev, NULL); | |
| - iounmap(t->etm_regs); | |
| - t->etm_regs = NULL; | |
| + mutex_lock(&t->mutex); | |
| + for (i = 0; i < t->etm_regs_count; i++) | |
| + if (t->etm_regs[i] == etm_regs) | |
| + break; | |
| + for (; i < t->etm_regs_count - 1; i++) | |
| + t->etm_regs[i] = t->etm_regs[i + 1]; | |
| + t->etm_regs_count--; | |
| + if (!t->etm_regs_count) { | |
| + kfree(t->etm_regs); | |
| + t->etm_regs = NULL; | |
| + } | |
| + mutex_unlock(&t->mutex); | |
| + iounmap(etm_regs); | |
| amba_release_regions(dev); | |
| - sysfs_remove_file(&dev->dev.kobj, &trace_running_attr.attr); | |
| - sysfs_remove_file(&dev->dev.kobj, &trace_info_attr.attr); | |
| - sysfs_remove_file(&dev->dev.kobj, &trace_mode_attr.attr); | |
| - | |
| return 0; | |
| } | |
| @@ -601,6 +825,10 @@ | |
| .id = 0x0003b921, | |
| .mask = 0x0007ffff, | |
| }, | |
| + { | |
| + .id = 0x0003b950, | |
| + .mask = 0x0007ffff, | |
| + }, | |
| { 0, 0 }, | |
| }; | |
| @@ -618,6 +846,8 @@ | |
| { | |
| int retval; | |
| + mutex_init(&tracer.mutex); | |
| + | |
| retval = amba_driver_register(&etb_driver); | |
| if (retval) { | |
| printk(KERN_ERR "Failed to register etb\n"); | |
| Only in /path/to/linux-2.6.35.7/arch/arm/kernel: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/machine_kexec.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/machine_kexec.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/machine_kexec.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/machine_kexec.c 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -23,6 +23,8 @@ | |
| extern unsigned long kexec_mach_type; | |
| extern unsigned long kexec_boot_atags; | |
| +static atomic_t waiting_for_crash_ipi; | |
| + | |
| /* | |
| * Provide a dummy crash_notes definition while crash dump arrives to arm. | |
| * This prevents breakage of crash_notes attribute in kernel/ksysfs.c. | |
| @@ -41,8 +43,40 @@ | |
| { | |
| } | |
| +void machine_crash_nonpanic_core(void *unused) | |
| +{ | |
| + struct pt_regs regs; | |
| + | |
| + crash_setup_regs(®s, NULL); | |
| + printk(KERN_DEBUG "CPU %u will stop doing anything useful since another CPU has crashed\n", | |
| + smp_processor_id()); | |
| + crash_save_cpu(®s, smp_processor_id()); | |
| + flush_cache_all(); | |
| + | |
| + atomic_dec(&waiting_for_crash_ipi); | |
| + while (1) | |
| + cpu_relax(); | |
| +} | |
| + | |
| void machine_crash_shutdown(struct pt_regs *regs) | |
| { | |
| + unsigned long msecs; | |
| + | |
| + local_irq_disable(); | |
| + | |
| + atomic_set(&waiting_for_crash_ipi, num_online_cpus() - 1); | |
| + smp_call_function(machine_crash_nonpanic_core, NULL, false); | |
| + msecs = 1000; /* Wait at most a second for the other cpus to stop */ | |
| + while ((atomic_read(&waiting_for_crash_ipi) > 0) && msecs) { | |
| + mdelay(1); | |
| + msecs--; | |
| + } | |
| + if (atomic_read(&waiting_for_crash_ipi) > 0) | |
| + printk(KERN_WARNING "Non-crashing CPUs did not react to IPI\n"); | |
| + | |
| + crash_save_cpu(regs, smp_processor_id()); | |
| + | |
| + printk(KERN_INFO "Loading crashdump kernel...\n"); | |
| } | |
| void machine_kexec(struct kimage *image) | |
| @@ -74,7 +108,14 @@ | |
| (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); | |
| printk(KERN_INFO "Bye!\n"); | |
| - cpu_proc_fin(); | |
| + local_irq_disable(); | |
| + local_fiq_disable(); | |
| setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/ | |
| + flush_cache_all(); | |
| + outer_flush_all(); | |
| + outer_disable(); | |
| + cpu_proc_fin(); | |
| + outer_inv_all(); | |
| + flush_cache_all(); | |
| cpu_reset(reboot_code_buffer_phys); | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/Makefile | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/Makefile 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -39,6 +39,7 @@ | |
| obj-$(CONFIG_KGDB) += kgdb.o | |
| obj-$(CONFIG_ARM_UNWIND) += unwind.o | |
| obj-$(CONFIG_HAVE_TCM) += tcm.o | |
| +obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | |
| obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o | |
| AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/process.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/process.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/process.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/process.c 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -205,6 +205,77 @@ | |
| arm_pm_restart(reboot_mode, cmd); | |
| } | |
| +/* | |
| + * dump a block of kernel memory from around the given address | |
| + */ | |
| +static void show_data(unsigned long addr, int nbytes, const char *name) | |
| +{ | |
| + int i, j; | |
| + int nlines; | |
| + u32 *p; | |
| + | |
| + /* | |
| + * don't attempt to dump non-kernel addresses or | |
| + * values that are probably just small negative numbers | |
| + */ | |
| + if (addr < PAGE_OFFSET || addr > -256UL) | |
| + return; | |
| + | |
| + printk("\n%s: %#lx:\n", name, addr); | |
| + | |
| + /* | |
| + * round address down to a 32 bit boundary | |
| + * and always dump a multiple of 32 bytes | |
| + */ | |
| + p = (u32 *)(addr & ~(sizeof(u32) - 1)); | |
| + nbytes += (addr & (sizeof(u32) - 1)); | |
| + nlines = (nbytes + 31) / 32; | |
| + | |
| + | |
| + for (i = 0; i < nlines; i++) { | |
| + /* | |
| + * just display low 16 bits of address to keep | |
| + * each line of the dump < 80 characters | |
| + */ | |
| + printk("%04lx ", (unsigned long)p & 0xffff); | |
| + for (j = 0; j < 8; j++) { | |
| + u32 data; | |
| + if (probe_kernel_address(p, data)) { | |
| + printk(" ********"); | |
| + } else { | |
| + printk(" %08x", data); | |
| + } | |
| + ++p; | |
| + } | |
| + printk("\n"); | |
| + } | |
| +} | |
| + | |
| +static void show_extra_register_data(struct pt_regs *regs, int nbytes) | |
| +{ | |
| + mm_segment_t fs; | |
| + | |
| + fs = get_fs(); | |
| + set_fs(KERNEL_DS); | |
| + show_data(regs->ARM_pc - nbytes, nbytes * 2, "PC"); | |
| + show_data(regs->ARM_lr - nbytes, nbytes * 2, "LR"); | |
| + show_data(regs->ARM_sp - nbytes, nbytes * 2, "SP"); | |
| + show_data(regs->ARM_ip - nbytes, nbytes * 2, "IP"); | |
| + show_data(regs->ARM_fp - nbytes, nbytes * 2, "FP"); | |
| + show_data(regs->ARM_r0 - nbytes, nbytes * 2, "R0"); | |
| + show_data(regs->ARM_r1 - nbytes, nbytes * 2, "R1"); | |
| + show_data(regs->ARM_r2 - nbytes, nbytes * 2, "R2"); | |
| + show_data(regs->ARM_r3 - nbytes, nbytes * 2, "R3"); | |
| + show_data(regs->ARM_r4 - nbytes, nbytes * 2, "R4"); | |
| + show_data(regs->ARM_r5 - nbytes, nbytes * 2, "R5"); | |
| + show_data(regs->ARM_r6 - nbytes, nbytes * 2, "R6"); | |
| + show_data(regs->ARM_r7 - nbytes, nbytes * 2, "R7"); | |
| + show_data(regs->ARM_r8 - nbytes, nbytes * 2, "R8"); | |
| + show_data(regs->ARM_r9 - nbytes, nbytes * 2, "R9"); | |
| + show_data(regs->ARM_r10 - nbytes, nbytes * 2, "R10"); | |
| + set_fs(fs); | |
| +} | |
| + | |
| void __show_regs(struct pt_regs *regs) | |
| { | |
| unsigned long flags; | |
| @@ -264,6 +335,8 @@ | |
| printk("Control: %08x%s\n", ctrl, buf); | |
| } | |
| #endif | |
| + | |
| + show_extra_register_data(regs, 128); | |
| } | |
| void show_regs(struct pt_regs * regs) | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/relocate_kernel.S /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/relocate_kernel.S | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/relocate_kernel.S 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/relocate_kernel.S 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -10,6 +10,12 @@ | |
| ldr r0,kexec_indirection_page | |
| ldr r1,kexec_start_address | |
| + /* | |
| + * If there is no indirection page (we are doing crashdumps) | |
| + * skip any relocation. | |
| + */ | |
| + cmp r0, #0 | |
| + beq 2f | |
| 0: /* top, read another word for the indirection page */ | |
| ldr r3, [r0],#4 | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/setup.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/setup.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/setup.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/setup.c 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -19,6 +19,8 @@ | |
| #include <linux/seq_file.h> | |
| #include <linux/screen_info.h> | |
| #include <linux/init.h> | |
| +#include <linux/kexec.h> | |
| +#include <linux/crash_dump.h> | |
| #include <linux/root_dev.h> | |
| #include <linux/cpu.h> | |
| #include <linux/interrupt.h> | |
| @@ -663,6 +665,79 @@ | |
| } | |
| arch_initcall(customize_machine); | |
| +#ifdef CONFIG_KEXEC | |
| +static inline unsigned long long get_total_mem(void) | |
| +{ | |
| + unsigned long total; | |
| + | |
| + total = max_low_pfn - min_low_pfn; | |
| + return total << PAGE_SHIFT; | |
| +} | |
| + | |
| +/** | |
| + * reserve_crashkernel() - reserves memory are for crash kernel | |
| + * | |
| + * This function reserves memory area given in "crashkernel=" kernel command | |
| + * line parameter. The memory reserved is used by a dump capture kernel when | |
| + * primary kernel is crashing. | |
| + */ | |
| +static void __init reserve_crashkernel(void) | |
| +{ | |
| + unsigned long long crash_size, crash_base; | |
| + unsigned long long total_mem; | |
| + int ret; | |
| + | |
| + total_mem = get_total_mem(); | |
| + ret = parse_crashkernel(boot_command_line, total_mem, | |
| + &crash_size, &crash_base); | |
| + if (ret) | |
| + return; | |
| + | |
| + ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE); | |
| + if (ret < 0) { | |
| + printk(KERN_WARNING "crashkernel reservation failed - " | |
| + "memory is in use (0x%lx)\n", (unsigned long)crash_base); | |
| + return; | |
| + } | |
| + | |
| + printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | |
| + "for crashkernel (System RAM: %ldMB)\n", | |
| + (unsigned long)(crash_size >> 20), | |
| + (unsigned long)(crash_base >> 20), | |
| + (unsigned long)(total_mem >> 20)); | |
| + | |
| + crashk_res.start = crash_base; | |
| + crashk_res.end = crash_base + crash_size - 1; | |
| + insert_resource(&iomem_resource, &crashk_res); | |
| +} | |
| +#else | |
| +static inline void reserve_crashkernel(void) {} | |
| +#endif /* CONFIG_KEXEC */ | |
| + | |
| +/* | |
| + * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by | |
| + * is_kdump_kernel() to determine if we are booting after a panic. Hence | |
| + * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE. | |
| + */ | |
| + | |
| +#ifdef CONFIG_CRASH_DUMP | |
| +/* | |
| + * elfcorehdr= specifies the location of elf core header stored by the crashed | |
| + * kernel. This option will be passed by kexec loader to the capture kernel. | |
| + */ | |
| +static int __init setup_elfcorehdr(char *arg) | |
| +{ | |
| + char *end; | |
| + | |
| + if (!arg) | |
| + return -EINVAL; | |
| + | |
| + elfcorehdr_addr = memparse(arg, &end); | |
| + return end > arg ? 0 : -EINVAL; | |
| +} | |
| +early_param("elfcorehdr", setup_elfcorehdr); | |
| +#endif /* CONFIG_CRASH_DUMP */ | |
| + | |
| void __init setup_arch(char **cmdline_p) | |
| { | |
| struct tag *tags = (struct tag *)&init_tags; | |
| @@ -722,6 +797,7 @@ | |
| #ifdef CONFIG_SMP | |
| smp_init_cpus(); | |
| #endif | |
| + reserve_crashkernel(); | |
| cpu_init(); | |
| tcm_init(); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/signal.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/signal.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/signal.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/signal.c 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -602,6 +602,14 @@ | |
| static inline void setup_syscall_restart(struct pt_regs *regs) | |
| { | |
| + if (regs->ARM_ORIG_r0 == -ERESTARTNOHAND || | |
| + regs->ARM_ORIG_r0 == -ERESTARTSYS || | |
| + regs->ARM_ORIG_r0 == -ERESTARTNOINTR || | |
| + regs->ARM_ORIG_r0 == -ERESTART_RESTARTBLOCK) { | |
| + /* the syscall cannot be safely restarted, return -EINTR instead */ | |
| + regs->ARM_r0 = -EINTR; | |
| + return; | |
| + } | |
| regs->ARM_r0 = regs->ARM_ORIG_r0; | |
| regs->ARM_pc -= thumb_mode(regs) ? 2 : 4; | |
| } | |
| @@ -734,6 +742,7 @@ | |
| */ | |
| if (syscall) { | |
| if (regs->ARM_r0 == -ERESTART_RESTARTBLOCK) { | |
| + regs->ARM_r0 = -EAGAIN; /* prevent multiple restarts */ | |
| if (thumb_mode(regs)) { | |
| regs->ARM_r7 = __NR_restart_syscall - __NR_SYSCALL_BASE; | |
| regs->ARM_pc -= 2; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/kernel/traps.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/traps.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/kernel/traps.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/kernel/traps.c 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -35,6 +35,10 @@ | |
| #include "signal.h" | |
| static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; | |
| +#ifdef CONFIG_BRCM_KPANIC_UI_IND | |
| +#include <linux/broadcom/lcdc_dispimg.h> | |
| +extern int cp_crashed; | |
| +#endif | |
| #ifdef CONFIG_DEBUG_USER | |
| unsigned int user_debug; | |
| @@ -267,6 +271,15 @@ | |
| int ret; | |
| oops_enter(); | |
| +#ifdef CONFIG_BRCM_KPANIC_UI_IND | |
| + if (!lcdc_showing_dump()) | |
| + { | |
| + if (!cp_crashed) | |
| + lcdc_disp_img(IMG_INDEX_AP_DUMP); | |
| + else | |
| + lcdc_disp_img(IMG_INDEX_CP_DUMP); | |
| + } | |
| +#endif | |
| spin_lock_irq(&die_lock); | |
| console_verbose(); | |
| @@ -453,7 +466,9 @@ | |
| if (end > vma->vm_end) | |
| end = vma->vm_end; | |
| - flush_cache_user_range(vma, start, end); | |
| + up_read(&mm->mmap_sem); | |
| + flush_cache_user_range(start, end); | |
| + return; | |
| } | |
| up_read(&mm->mmap_sem); | |
| } | |
| @@ -520,7 +535,8 @@ | |
| thread->tp_value = regs->ARM_r0; | |
| #if defined(CONFIG_HAS_TLS_REG) | |
| asm ("mcr p15, 0, %0, c13, c0, 3" : : "r" (regs->ARM_r0) ); | |
| -#elif !defined(CONFIG_TLS_REG_EMUL) | |
| +//#elif !defined(CONFIG_TLS_REG_EMUL) | |
| +#endif | |
| /* | |
| * User space must never try to access this directly. | |
| * Expect your app to break eventually if you do so. | |
| @@ -528,7 +544,7 @@ | |
| * (see entry-armv.S for details) | |
| */ | |
| *((unsigned int *)0xffff0ff0) = regs->ARM_r0; | |
| -#endif | |
| +//#endif | |
| return 0; | |
| #ifdef CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG | |
| @@ -736,6 +752,17 @@ | |
| /* if that doesn't kill us, halt */ | |
| panic("Oops failed to kill thread"); | |
| } | |
| + | |
| +#if defined(CONFIG_SEC_DEBUG) | |
| +void cp_abort(void) | |
| +{ | |
| + //BUG(); | |
| + | |
| + /* if that doesn't kill us, halt */ | |
| + panic("CP Crash"); | |
| +} | |
| +#endif | |
| + | |
| EXPORT_SYMBOL(abort); | |
| void __init trap_init(void) | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm: mach-bcm116x | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm: mach-bcm215xx | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/Makefile | |
| --- /path/to/linux-2.6.35.7/arch/arm/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/Makefile 2018-07-12 10:13:49.000000000 +0700 | |
| @@ -186,6 +186,8 @@ | |
| machine-$(CONFIG_MACH_SPEAR310) := spear3xx | |
| machine-$(CONFIG_MACH_SPEAR320) := spear3xx | |
| machine-$(CONFIG_MACH_SPEAR600) := spear6xx | |
| +machine-$(CONFIG_ARCH_BCM116X) := bcm116x | |
| +machine-$(CONFIG_ARCH_BCM215XX) := bcm215xx | |
| # Platform directory name. This list is sorted alphanumerically | |
| # by CONFIG_* macro name. | |
| @@ -201,6 +203,7 @@ | |
| plat-$(CONFIG_PLAT_S5P) := s5p samsung | |
| plat-$(CONFIG_PLAT_SPEAR) := spear | |
| plat-$(CONFIG_PLAT_VERSATILE) := versatile | |
| +plat-$(CONFIG_PLAT_BCMAP) := bcmap | |
| ifeq ($(CONFIG_ARCH_EBSA110),y) | |
| # This is what happens if you forget the IOCS16 line. | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/mm/cache-l2x0.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/cache-l2x0.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/mm/cache-l2x0.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/cache-l2x0.c 2018-07-12 10:13:50.000000000 +0700 | |
| @@ -19,23 +19,62 @@ | |
| #include <linux/init.h> | |
| #include <linux/spinlock.h> | |
| #include <linux/io.h> | |
| +#include <linux/delay.h> | |
| #include <asm/cacheflush.h> | |
| #include <asm/hardware/cache-l2x0.h> | |
| #define CACHE_LINE_SIZE 32 | |
| +#if defined(CONFIG_ARCH_BCM215XX) | |
| +#define L2CACHE_READREG_OFFSET 0x1000 | |
| +#else | |
| +#define L2CACHE_READREG_OFFSET 0x0; | |
| +#endif | |
| static void __iomem *l2x0_base; | |
| static DEFINE_SPINLOCK(l2x0_lock); | |
| static uint32_t l2x0_way_mask; /* Bitmask of active ways */ | |
| +static uint32_t l2x0_size; | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| +extern u32 l2_evt_virt_buf; | |
| +#endif | |
| -static inline void cache_wait(void __iomem *reg, unsigned long mask) | |
| +static int l2_flushall_after_boot = 0; | |
| +static int ways; | |
| +int __init l2x0_late_init (void) | |
| +{ | |
| + l2_flushall_after_boot = 1; | |
| + return 0; | |
| +} | |
| +late_initcall(l2x0_late_init); | |
| + | |
| +static inline void cache_wait_way(void __iomem *reg, unsigned long mask) | |
| { | |
| - /* wait for the operation to complete */ | |
| - while (readl_relaxed(reg) & mask) | |
| + /* wait for cache operation by line or way to complete */ | |
| + while (readl_relaxed(L2CACHE_READREG_OFFSET + reg) & mask) | |
| ; | |
| } | |
| +#ifdef CONFIG_CACHE_PL310 | |
| +static inline void cache_wait(void __iomem *reg, unsigned long mask) | |
| +{ | |
| + /* cache operations by line are atomic on PL310 */ | |
| +} | |
| +#else | |
| +#define cache_wait cache_wait_way | |
| +#endif | |
| + | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| +static inline void cache_l2_evct(void) | |
| +{ | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| + writel_relaxed(0x0, l2_evt_virt_buf); | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| + readl_relaxed(l2_evt_virt_buf); | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +} | |
| +#endif | |
| + | |
| static inline void cache_sync(void) | |
| { | |
| void __iomem *base = l2x0_base; | |
| @@ -94,6 +133,18 @@ | |
| } | |
| #endif | |
| +static inline void l2x0_flush_way(unsigned long way_index) | |
| +{ | |
| + writel_relaxed(way_index, l2x0_base + L2X0_CLEAN_INV_WAY); | |
| + cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, way_index); | |
| +} | |
| + | |
| +static inline void l2x0_clean_way(unsigned long way_index) | |
| +{ | |
| + writel_relaxed(way_index, l2x0_base + L2X0_CLEAN_WAY); | |
| + cache_wait_way(l2x0_base + L2X0_CLEAN_WAY, way_index); | |
| +} | |
| + | |
| static void l2x0_cache_sync(void) | |
| { | |
| unsigned long flags; | |
| @@ -103,24 +154,93 @@ | |
| spin_unlock_irqrestore(&l2x0_lock, flags); | |
| } | |
| -static inline void l2x0_inv_all(void) | |
| +static void l2x0_flush_all(void) | |
| +{ | |
| + unsigned long flags; | |
| + int i; | |
| + | |
| + /* clean all ways */ | |
| + spin_lock_irqsave(&l2x0_lock, flags); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| + cache_sync(); | |
| + readl_relaxed(l2_evt_virt_buf); | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| + for (i = 0; i < ways; ++i) { | |
| + l2x0_flush_way(1 << i); | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| + cache_sync(); | |
| + cache_l2_evct(); | |
| + } | |
| +#else | |
| + writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY); | |
| + cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask); | |
| + cache_sync(); | |
| +#endif | |
| + spin_unlock_irqrestore(&l2x0_lock, flags); | |
| +} | |
| + | |
| +static void l2x0_clean_all(void) | |
| +{ | |
| + unsigned long flags; | |
| + int i; | |
| + | |
| + /* clean all ways */ | |
| + spin_lock_irqsave(&l2x0_lock, flags); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| + cache_sync(); | |
| + readl_relaxed(l2_evt_virt_buf); | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| + for (i = 0; i < ways; ++i) { | |
| + l2x0_clean_way(1 << i); | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| + cache_sync(); | |
| + cache_l2_evct(); | |
| + } | |
| +#else | |
| + writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_WAY); | |
| + cache_wait_way(l2x0_base + L2X0_CLEAN_WAY, l2x0_way_mask); | |
| + cache_sync(); | |
| +#endif | |
| + spin_unlock_irqrestore(&l2x0_lock, flags); | |
| +} | |
| + | |
| +static void l2x0_inv_all(void) | |
| { | |
| unsigned long flags; | |
| /* invalidate all ways */ | |
| spin_lock_irqsave(&l2x0_lock, flags); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +#endif | |
| + /* Invalidating when L2 is enabled is a nono */ | |
| + BUG_ON(readl(L2CACHE_READREG_OFFSET + l2x0_base + L2X0_CTRL) & 1); | |
| writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); | |
| - cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); | |
| + cache_wait_way(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +#endif | |
| cache_sync(); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + cache_l2_evct(); | |
| +#endif | |
| spin_unlock_irqrestore(&l2x0_lock, flags); | |
| } | |
| static void l2x0_inv_range(unsigned long start, unsigned long end) | |
| { | |
| void __iomem *base = l2x0_base; | |
| - unsigned long flags; | |
| + unsigned long flags, flush_required = | |
| + ((start & (CACHE_LINE_SIZE - 1)) || (end & (CACHE_LINE_SIZE - 1))); | |
| spin_lock_irqsave(&l2x0_lock, flags); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + if (flush_required) | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +#endif | |
| + /* Invalidating when L2 is enabled is a nono */ | |
| if (start & (CACHE_LINE_SIZE - 1)) { | |
| start &= ~(CACHE_LINE_SIZE - 1); | |
| debug_writel(0x03); | |
| @@ -150,7 +270,16 @@ | |
| } | |
| } | |
| cache_wait(base + L2X0_INV_LINE_PA, 1); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + if (flush_required) | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +#endif | |
| + /* Invalidating when L2 is enabled is a nono */ | |
| cache_sync(); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + if (flush_required) | |
| + cache_l2_evct(); | |
| +#endif | |
| spin_unlock_irqrestore(&l2x0_lock, flags); | |
| } | |
| @@ -159,7 +288,15 @@ | |
| void __iomem *base = l2x0_base; | |
| unsigned long flags; | |
| + if ((end - start) >= l2x0_size) { | |
| + l2x0_clean_all(); | |
| + return; | |
| + } | |
| + | |
| spin_lock_irqsave(&l2x0_lock, flags); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +#endif | |
| start &= ~(CACHE_LINE_SIZE - 1); | |
| while (start < end) { | |
| unsigned long blk_end = start + min(end - start, 4096UL); | |
| @@ -175,7 +312,13 @@ | |
| } | |
| } | |
| cache_wait(base + L2X0_CLEAN_LINE_PA, 1); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +#endif | |
| cache_sync(); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + cache_l2_evct(); | |
| +#endif | |
| spin_unlock_irqrestore(&l2x0_lock, flags); | |
| } | |
| @@ -184,7 +327,15 @@ | |
| void __iomem *base = l2x0_base; | |
| unsigned long flags; | |
| + if (l2_flushall_after_boot && ((end - start) >= l2x0_size)) { | |
| + l2x0_flush_all(); | |
| + return; | |
| + } | |
| + | |
| spin_lock_irqsave(&l2x0_lock, flags); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +#endif | |
| start &= ~(CACHE_LINE_SIZE - 1); | |
| while (start < end) { | |
| unsigned long blk_end = start + min(end - start, 4096UL); | |
| @@ -202,7 +353,22 @@ | |
| } | |
| } | |
| cache_wait(base + L2X0_CLEAN_INV_LINE_PA, 1); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + asm("mcr p15, 0, %0, c7, c10, 4"::"r"(0)); | |
| +#endif | |
| cache_sync(); | |
| +#ifdef CONFIG_BCM21553_L2_EVCT | |
| + cache_l2_evct(); | |
| +#endif | |
| + spin_unlock_irqrestore(&l2x0_lock, flags); | |
| +} | |
| + | |
| +static void l2x0_disable(void) | |
| +{ | |
| + unsigned long flags; | |
| + | |
| + spin_lock_irqsave(&l2x0_lock, flags); | |
| + writel(0, l2x0_base + L2X0_CTRL); | |
| spin_unlock_irqrestore(&l2x0_lock, flags); | |
| } | |
| @@ -210,13 +376,13 @@ | |
| { | |
| __u32 aux; | |
| __u32 cache_id; | |
| - int ways; | |
| + __u32 way_size = 0; | |
| const char *type; | |
| l2x0_base = base; | |
| - cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID); | |
| - aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); | |
| + cache_id = readl_relaxed(L2CACHE_READREG_OFFSET + l2x0_base + L2X0_CACHE_ID); | |
| + aux = readl_relaxed(L2CACHE_READREG_OFFSET + l2x0_base + L2X0_AUX_CTRL); | |
| aux &= aux_mask; | |
| aux |= aux_val; | |
| @@ -244,11 +410,18 @@ | |
| l2x0_way_mask = (1 << ways) - 1; | |
| /* | |
| + * L2 cache Size = Way size * Number of ways | |
| + */ | |
| + way_size = (aux & L2X0_AUX_CTRL_WAY_SIZE_MASK) >> 17; | |
| + way_size = 1 << (way_size + 3); | |
| + l2x0_size = ways * way_size * SZ_1K; | |
| + | |
| + /* | |
| * Check if l2x0 controller is already enabled. | |
| * If you are booting from non-secure mode | |
| * accessing the below registers will fault. | |
| */ | |
| - if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { | |
| + if (!(readl_relaxed(L2CACHE_READREG_OFFSET + l2x0_base + L2X0_CTRL) & 1)) { | |
| /* l2x0 controller is disabled */ | |
| writel_relaxed(aux, l2x0_base + L2X0_AUX_CTRL); | |
| @@ -263,8 +436,11 @@ | |
| outer_cache.clean_range = l2x0_clean_range; | |
| outer_cache.flush_range = l2x0_flush_range; | |
| outer_cache.sync = l2x0_cache_sync; | |
| + outer_cache.flush_all = l2x0_flush_all; | |
| + outer_cache.inv_all = l2x0_inv_all; | |
| + outer_cache.disable = l2x0_disable; | |
| printk(KERN_INFO "%s cache controller enabled\n", type); | |
| - printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x\n", | |
| - ways, cache_id, aux); | |
| + printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", | |
| + ways, cache_id, aux, l2x0_size); | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/mm/cache-v6.S /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/cache-v6.S | |
| --- /path/to/linux-2.6.35.7/arch/arm/mm/cache-v6.S 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/cache-v6.S 2018-07-12 10:13:50.000000000 +0700 | |
| @@ -256,6 +256,11 @@ | |
| * - end - virtual end address of region | |
| */ | |
| ENTRY(v6_dma_flush_range) | |
| +#ifdef CONFIG_CACHE_FLUSH_RANGE_LIMIT | |
| + sub r2, r1, r0 | |
| + cmp r2, #CONFIG_CACHE_FLUSH_RANGE_LIMIT | |
| + bhi v6_dma_flush_dcache_all | |
| +#endif | |
| bic r0, r0, #D_CACHE_LINE_SIZE - 1 | |
| 1: | |
| #ifdef CONFIG_DMA_CACHE_RWFO | |
| @@ -274,6 +279,18 @@ | |
| mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | |
| mov pc, lr | |
| +#ifdef CONFIG_CACHE_FLUSH_RANGE_LIMIT | |
| +v6_dma_flush_dcache_all: | |
| + mov r0, #0 | |
| +#ifdef HARVARD_CACHE | |
| + mcr p15, 0, r0, c7, c14, 0 @ D cache clean+invalidate | |
| +#else | |
| + mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate | |
| +#endif | |
| + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | |
| + mov pc, lr | |
| +#endif | |
| + | |
| /* | |
| * dma_map_area(start, size, dir) | |
| * - start - kernel virtual start address | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/mm/fault.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/fault.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/mm/fault.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/fault.c 2018-07-12 10:13:50.000000000 +0700 | |
| @@ -24,6 +24,11 @@ | |
| #include <asm/pgtable.h> | |
| #include <asm/tlbflush.h> | |
| +#if defined(CONFIG_SEC_DEBUG) | |
| +/* For saving Fault status . */ | |
| +#include <mach/sec_debug.h> | |
| +#endif | |
| + | |
| #include "fault.h" | |
| /* | |
| @@ -119,6 +124,7 @@ | |
| { } | |
| #endif /* CONFIG_MMU */ | |
| + | |
| /* | |
| * Oops. The kernel tried to access some page that wasn't present. | |
| */ | |
| @@ -126,12 +132,18 @@ | |
| __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, | |
| struct pt_regs *regs) | |
| { | |
| + | |
| /* | |
| * Are we prepared to handle this kernel fault? | |
| */ | |
| if (fixup_exception(regs)) | |
| return; | |
| +#if defined(CONFIG_SEC_DEBUG) | |
| +/* For saving Fault status . */ | |
| + sec_debug_save_pte((void *)regs, (int )current); | |
| +#endif | |
| + | |
| /* | |
| * No handler, we'll have to terminate things with extreme prejudice. | |
| */ | |
| @@ -158,6 +170,11 @@ | |
| { | |
| struct siginfo si; | |
| +#if defined(CONFIG_SEC_DEBUG) | |
| +/* For saving Fault status . */ | |
| + sec_debug_save_pte((void *)regs, (int )current); | |
| +#endif | |
| + | |
| #ifdef CONFIG_DEBUG_USER | |
| if (user_debug & UDBG_SEGV) { | |
| printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n", | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/mm/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/Kconfig | |
| --- /path/to/linux-2.6.35.7/arch/arm/mm/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/Kconfig 2018-07-12 10:13:50.000000000 +0700 | |
| @@ -720,7 +720,7 @@ | |
| config HAS_TLS_REG | |
| bool | |
| depends on !TLS_REG_EMUL | |
| - default y if SMP || CPU_32v7 | |
| + default y if SMP || CPU_32v7 || ARCH_BCM215XX | |
| help | |
| This selects support for the CP15 thread register. | |
| It is defined to be available on some ARMv6 processors (including | |
| @@ -782,7 +782,7 @@ | |
| bool "Enable the L2x0 outer cache controller" | |
| depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ | |
| REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX || \ | |
| - ARCH_NOMADIK || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 | |
| + ARCH_NOMADIK || ARCH_OMAP4 || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || ARCH_BCM215XX | |
| default y | |
| select OUTER_CACHE | |
| select OUTER_CACHE_SYNC | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/mm/mmu.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/mmu.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/mm/mmu.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/mmu.c 2018-07-12 10:13:50.000000000 +0700 | |
| @@ -402,6 +402,10 @@ | |
| if (arch_is_coherent() && cpu_is_xsc3()) | |
| mem_types[MT_MEMORY].prot_sect |= PMD_SECT_S; | |
| +#if defined(CONFIG_ARCH_BCM215XX) | |
| + mem_types[MT_MEMORY].prot_sect |= PMD_SECT_TEX(5); | |
| +#endif | |
| + | |
| /* | |
| * ARMv6 and above have extended page tables. | |
| */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/mm/proc-macros.S /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/proc-macros.S | |
| --- /path/to/linux-2.6.35.7/arch/arm/mm/proc-macros.S 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/mm/proc-macros.S 2018-07-12 10:13:50.000000000 +0700 | |
| @@ -105,7 +105,11 @@ | |
| .long 0x00 @ L_PTE_MT_UNCACHED | |
| .long PTE_EXT_TEX(1) @ L_PTE_MT_BUFFERABLE | |
| .long PTE_CACHEABLE @ L_PTE_MT_WRITETHROUGH | |
| +#if defined(CONFIG_ARCH_BCM215XX) | |
| + .long PTE_EXT_TEX(5) | PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_WRITEBACK | |
| +#else | |
| .long PTE_CACHEABLE | PTE_BUFFERABLE @ L_PTE_MT_WRITEBACK | |
| +#endif | |
| .long PTE_BUFFERABLE @ L_PTE_MT_DEV_SHARED | |
| .long 0x00 @ unused | |
| .long 0x00 @ L_PTE_MT_MINICACHE (not present) | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: backtrace.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/oprofile/common.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile/common.c | |
| --- /path/to/linux-2.6.35.7/arch/arm/oprofile/common.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile/common.c 2018-07-12 10:13:50.000000000 +0700 | |
| @@ -2,184 +2,32 @@ | |
| * @file common.c | |
| * | |
| * @remark Copyright 2004 Oprofile Authors | |
| - * @remark Copyright 2010 ARM Ltd. | |
| * @remark Read the file COPYING | |
| * | |
| * @author Zwane Mwaikambo | |
| - * @author Will Deacon [move to perf] | |
| */ | |
| -#include <linux/cpumask.h> | |
| -#include <linux/err.h> | |
| -#include <linux/errno.h> | |
| #include <linux/init.h> | |
| -#include <linux/mutex.h> | |
| #include <linux/oprofile.h> | |
| -#include <linux/perf_event.h> | |
| -#include <linux/platform_device.h> | |
| +#include <linux/errno.h> | |
| #include <linux/slab.h> | |
| -#include <asm/stacktrace.h> | |
| -#include <linux/uaccess.h> | |
| +#include <linux/sysdev.h> | |
| +#include <linux/mutex.h> | |
| -#include <asm/perf_event.h> | |
| -#include <asm/ptrace.h> | |
| - | |
| -#ifdef CONFIG_HW_PERF_EVENTS | |
| -/* | |
| - * Per performance monitor configuration as set via oprofilefs. | |
| - */ | |
| -struct op_counter_config { | |
| - unsigned long count; | |
| - unsigned long enabled; | |
| - unsigned long event; | |
| - unsigned long unit_mask; | |
| - unsigned long kernel; | |
| - unsigned long user; | |
| - struct perf_event_attr attr; | |
| -}; | |
| +#include "op_counter.h" | |
| +#include "op_arm_model.h" | |
| +static struct op_arm_model_spec *op_arm_model; | |
| static int op_arm_enabled; | |
| static DEFINE_MUTEX(op_arm_mutex); | |
| -static struct op_counter_config *counter_config; | |
| -static struct perf_event **perf_events[nr_cpumask_bits]; | |
| -static int perf_num_counters; | |
| - | |
| -/* | |
| - * Overflow callback for oprofile. | |
| - */ | |
| -static void op_overflow_handler(struct perf_event *event, int unused, | |
| - struct perf_sample_data *data, struct pt_regs *regs) | |
| -{ | |
| - int id; | |
| - u32 cpu = smp_processor_id(); | |
| - | |
| - for (id = 0; id < perf_num_counters; ++id) | |
| - if (perf_events[cpu][id] == event) | |
| - break; | |
| - | |
| - if (id != perf_num_counters) | |
| - oprofile_add_sample(regs, id); | |
| - else | |
| - pr_warning("oprofile: ignoring spurious overflow " | |
| - "on cpu %u\n", cpu); | |
| -} | |
| - | |
| -/* | |
| - * Called by op_arm_setup to create perf attributes to mirror the oprofile | |
| - * settings in counter_config. Attributes are created as `pinned' events and | |
| - * so are permanently scheduled on the PMU. | |
| - */ | |
| -static void op_perf_setup(void) | |
| -{ | |
| - int i; | |
| - u32 size = sizeof(struct perf_event_attr); | |
| - struct perf_event_attr *attr; | |
| - | |
| - for (i = 0; i < perf_num_counters; ++i) { | |
| - attr = &counter_config[i].attr; | |
| - memset(attr, 0, size); | |
| - attr->type = PERF_TYPE_RAW; | |
| - attr->size = size; | |
| - attr->config = counter_config[i].event; | |
| - attr->sample_period = counter_config[i].count; | |
| - attr->pinned = 1; | |
| - } | |
| -} | |
| - | |
| -static int op_create_counter(int cpu, int event) | |
| -{ | |
| - int ret = 0; | |
| - struct perf_event *pevent; | |
| - | |
| - if (!counter_config[event].enabled || (perf_events[cpu][event] != NULL)) | |
| - return ret; | |
| - | |
| - pevent = perf_event_create_kernel_counter(&counter_config[event].attr, | |
| - cpu, -1, | |
| - op_overflow_handler); | |
| - | |
| - if (IS_ERR(pevent)) { | |
| - ret = PTR_ERR(pevent); | |
| - } else if (pevent->state != PERF_EVENT_STATE_ACTIVE) { | |
| - pr_warning("oprofile: failed to enable event %d " | |
| - "on CPU %d\n", event, cpu); | |
| - ret = -EBUSY; | |
| - } else { | |
| - perf_events[cpu][event] = pevent; | |
| - } | |
| - | |
| - return ret; | |
| -} | |
| - | |
| -static void op_destroy_counter(int cpu, int event) | |
| -{ | |
| - struct perf_event *pevent = perf_events[cpu][event]; | |
| - | |
| - if (pevent) { | |
| - perf_event_release_kernel(pevent); | |
| - perf_events[cpu][event] = NULL; | |
| - } | |
| -} | |
| - | |
| -/* | |
| - * Called by op_arm_start to create active perf events based on the | |
| - * perviously configured attributes. | |
| - */ | |
| -static int op_perf_start(void) | |
| -{ | |
| - int cpu, event, ret = 0; | |
| - | |
| - for_each_online_cpu(cpu) { | |
| - for (event = 0; event < perf_num_counters; ++event) { | |
| - ret = op_create_counter(cpu, event); | |
| - if (ret) | |
| - goto out; | |
| - } | |
| - } | |
| - | |
| -out: | |
| - return ret; | |
| -} | |
| - | |
| -/* | |
| - * Called by op_arm_stop at the end of a profiling run. | |
| - */ | |
| -static void op_perf_stop(void) | |
| -{ | |
| - int cpu, event; | |
| - | |
| - for_each_online_cpu(cpu) | |
| - for (event = 0; event < perf_num_counters; ++event) | |
| - op_destroy_counter(cpu, event); | |
| -} | |
| - | |
| - | |
| -static char *op_name_from_perf_id(enum arm_perf_pmu_ids id) | |
| -{ | |
| - switch (id) { | |
| - case ARM_PERF_PMU_ID_XSCALE1: | |
| - return "arm/xscale1"; | |
| - case ARM_PERF_PMU_ID_XSCALE2: | |
| - return "arm/xscale2"; | |
| - case ARM_PERF_PMU_ID_V6: | |
| - return "arm/armv6"; | |
| - case ARM_PERF_PMU_ID_V6MP: | |
| - return "arm/mpcore"; | |
| - case ARM_PERF_PMU_ID_CA8: | |
| - return "arm/armv7"; | |
| - case ARM_PERF_PMU_ID_CA9: | |
| - return "arm/armv7-ca9"; | |
| - default: | |
| - return NULL; | |
| - } | |
| -} | |
| +struct op_counter_config *counter_config; | |
| static int op_arm_create_files(struct super_block *sb, struct dentry *root) | |
| { | |
| unsigned int i; | |
| - for (i = 0; i < perf_num_counters; i++) { | |
| + for (i = 0; i < op_arm_model->num_counters; i++) { | |
| struct dentry *dir; | |
| char buf[4]; | |
| @@ -198,10 +46,12 @@ | |
| static int op_arm_setup(void) | |
| { | |
| + int ret; | |
| + | |
| spin_lock(&oprofilefs_lock); | |
| - op_perf_setup(); | |
| + ret = op_arm_model->setup_ctrs(); | |
| spin_unlock(&oprofilefs_lock); | |
| - return 0; | |
| + return ret; | |
| } | |
| static int op_arm_start(void) | |
| @@ -210,9 +60,8 @@ | |
| mutex_lock(&op_arm_mutex); | |
| if (!op_arm_enabled) { | |
| - ret = 0; | |
| - op_perf_start(); | |
| - op_arm_enabled = 1; | |
| + ret = op_arm_model->start(); | |
| + op_arm_enabled = !ret; | |
| } | |
| mutex_unlock(&op_arm_mutex); | |
| return ret; | |
| @@ -222,205 +71,113 @@ | |
| { | |
| mutex_lock(&op_arm_mutex); | |
| if (op_arm_enabled) | |
| - op_perf_stop(); | |
| + op_arm_model->stop(); | |
| op_arm_enabled = 0; | |
| mutex_unlock(&op_arm_mutex); | |
| } | |
| #ifdef CONFIG_PM | |
| -static int op_arm_suspend(struct platform_device *dev, pm_message_t state) | |
| +static int op_arm_suspend(struct sys_device *dev, pm_message_t state) | |
| { | |
| mutex_lock(&op_arm_mutex); | |
| if (op_arm_enabled) | |
| - op_perf_stop(); | |
| + op_arm_model->stop(); | |
| mutex_unlock(&op_arm_mutex); | |
| return 0; | |
| } | |
| -static int op_arm_resume(struct platform_device *dev) | |
| +static int op_arm_resume(struct sys_device *dev) | |
| { | |
| mutex_lock(&op_arm_mutex); | |
| - if (op_arm_enabled && op_perf_start()) | |
| + if (op_arm_enabled && op_arm_model->start()) | |
| op_arm_enabled = 0; | |
| mutex_unlock(&op_arm_mutex); | |
| return 0; | |
| } | |
| -static struct platform_driver oprofile_driver = { | |
| - .driver = { | |
| - .name = "arm-oprofile", | |
| - }, | |
| +static struct sysdev_class oprofile_sysclass = { | |
| + .name = "oprofile", | |
| .resume = op_arm_resume, | |
| .suspend = op_arm_suspend, | |
| }; | |
| -static struct platform_device *oprofile_pdev; | |
| +static struct sys_device device_oprofile = { | |
| + .id = 0, | |
| + .cls = &oprofile_sysclass, | |
| +}; | |
| static int __init init_driverfs(void) | |
| { | |
| int ret; | |
| - ret = platform_driver_register(&oprofile_driver); | |
| - if (ret) | |
| - goto out; | |
| - | |
| - oprofile_pdev = platform_device_register_simple( | |
| - oprofile_driver.driver.name, 0, NULL, 0); | |
| - if (IS_ERR(oprofile_pdev)) { | |
| - ret = PTR_ERR(oprofile_pdev); | |
| - platform_driver_unregister(&oprofile_driver); | |
| - } | |
| + if (!(ret = sysdev_class_register(&oprofile_sysclass))) | |
| + ret = sysdev_register(&device_oprofile); | |
| -out: | |
| return ret; | |
| } | |
| static void exit_driverfs(void) | |
| { | |
| - platform_device_unregister(oprofile_pdev); | |
| - platform_driver_unregister(&oprofile_driver); | |
| + sysdev_unregister(&device_oprofile); | |
| + sysdev_class_unregister(&oprofile_sysclass); | |
| } | |
| #else | |
| -static int __init init_driverfs(void) { return 0; } | |
| +#define init_driverfs() do { } while (0) | |
| #define exit_driverfs() do { } while (0) | |
| #endif /* CONFIG_PM */ | |
| -static int report_trace(struct stackframe *frame, void *d) | |
| -{ | |
| - unsigned int *depth = d; | |
| - | |
| - if (*depth) { | |
| - oprofile_add_trace(frame->pc); | |
| - (*depth)--; | |
| - } | |
| - | |
| - return *depth == 0; | |
| -} | |
| - | |
| -/* | |
| - * The registers we're interested in are at the end of the variable | |
| - * length saved register structure. The fp points at the end of this | |
| - * structure so the address of this struct is: | |
| - * (struct frame_tail *)(xxx->fp)-1 | |
| - */ | |
| -struct frame_tail { | |
| - struct frame_tail *fp; | |
| - unsigned long sp; | |
| - unsigned long lr; | |
| -} __attribute__((packed)); | |
| - | |
| -static struct frame_tail* user_backtrace(struct frame_tail *tail) | |
| -{ | |
| - struct frame_tail buftail[2]; | |
| - | |
| - /* Also check accessibility of one struct frame_tail beyond */ | |
| - if (!access_ok(VERIFY_READ, tail, sizeof(buftail))) | |
| - return NULL; | |
| - if (__copy_from_user_inatomic(buftail, tail, sizeof(buftail))) | |
| - return NULL; | |
| - | |
| - oprofile_add_trace(buftail[0].lr); | |
| - | |
| - /* frame pointers should strictly progress back up the stack | |
| - * (towards higher addresses) */ | |
| - if (tail >= buftail[0].fp) | |
| - return NULL; | |
| - | |
| - return buftail[0].fp-1; | |
| -} | |
| - | |
| -static void arm_backtrace(struct pt_regs * const regs, unsigned int depth) | |
| -{ | |
| - struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1; | |
| - | |
| - if (!user_mode(regs)) { | |
| - struct stackframe frame; | |
| - frame.fp = regs->ARM_fp; | |
| - frame.sp = regs->ARM_sp; | |
| - frame.lr = regs->ARM_lr; | |
| - frame.pc = regs->ARM_pc; | |
| - walk_stackframe(&frame, report_trace, &depth); | |
| - return; | |
| - } | |
| - | |
| - while (depth-- && tail && !((unsigned long) tail & 3)) | |
| - tail = user_backtrace(tail); | |
| -} | |
| - | |
| int __init oprofile_arch_init(struct oprofile_operations *ops) | |
| { | |
| - int cpu, ret = 0; | |
| - | |
| - perf_num_counters = armpmu_get_max_events(); | |
| + struct op_arm_model_spec *spec = NULL; | |
| + int ret = -ENODEV; | |
| - counter_config = kcalloc(perf_num_counters, | |
| - sizeof(struct op_counter_config), GFP_KERNEL); | |
| - | |
| - if (!counter_config) { | |
| - pr_info("oprofile: failed to allocate %d " | |
| - "counters\n", perf_num_counters); | |
| - return -ENOMEM; | |
| - } | |
| + ops->backtrace = arm_backtrace; | |
| - ret = init_driverfs(); | |
| - if (ret) { | |
| - kfree(counter_config); | |
| - return ret; | |
| - } | |
| - | |
| - for_each_possible_cpu(cpu) { | |
| - perf_events[cpu] = kcalloc(perf_num_counters, | |
| - sizeof(struct perf_event *), GFP_KERNEL); | |
| - if (!perf_events[cpu]) { | |
| - pr_info("oprofile: failed to allocate %d perf events " | |
| - "for cpu %d\n", perf_num_counters, cpu); | |
| - while (--cpu >= 0) | |
| - kfree(perf_events[cpu]); | |
| +#ifdef CONFIG_CPU_XSCALE | |
| + spec = &op_xscale_spec; | |
| +#endif | |
| + | |
| +#ifdef CONFIG_OPROFILE_ARMV6 | |
| + spec = &op_armv6_spec; | |
| +#endif | |
| + | |
| +#ifdef CONFIG_OPROFILE_MPCORE | |
| + spec = &op_mpcore_spec; | |
| +#endif | |
| + | |
| +#ifdef CONFIG_OPROFILE_ARMV7 | |
| + spec = &op_armv7_spec; | |
| +#endif | |
| + | |
| + if (spec) { | |
| + ret = spec->init(); | |
| + if (ret < 0) | |
| + return ret; | |
| + | |
| + counter_config = kcalloc(spec->num_counters, sizeof(struct op_counter_config), | |
| + GFP_KERNEL); | |
| + if (!counter_config) | |
| return -ENOMEM; | |
| - } | |
| - } | |
| - ops->backtrace = arm_backtrace; | |
| - ops->create_files = op_arm_create_files; | |
| - ops->setup = op_arm_setup; | |
| - ops->start = op_arm_start; | |
| - ops->stop = op_arm_stop; | |
| - ops->shutdown = op_arm_stop; | |
| - ops->cpu_type = op_name_from_perf_id(armpmu_get_pmu_id()); | |
| - | |
| - if (!ops->cpu_type) | |
| - ret = -ENODEV; | |
| - else | |
| - pr_info("oprofile: using %s\n", ops->cpu_type); | |
| + op_arm_model = spec; | |
| + init_driverfs(); | |
| + ops->create_files = op_arm_create_files; | |
| + ops->setup = op_arm_setup; | |
| + ops->shutdown = op_arm_stop; | |
| + ops->start = op_arm_start; | |
| + ops->stop = op_arm_stop; | |
| + ops->cpu_type = op_arm_model->name; | |
| + printk(KERN_INFO "oprofile: using %s\n", spec->name); | |
| + } | |
| return ret; | |
| } | |
| void oprofile_arch_exit(void) | |
| { | |
| - int cpu, id; | |
| - struct perf_event *event; | |
| - | |
| - if (*perf_events) { | |
| + if (op_arm_model) { | |
| exit_driverfs(); | |
| - for_each_possible_cpu(cpu) { | |
| - for (id = 0; id < perf_num_counters; ++id) { | |
| - event = perf_events[cpu][id]; | |
| - if (event != NULL) | |
| - perf_event_release_kernel(event); | |
| - } | |
| - kfree(perf_events[cpu]); | |
| - } | |
| + op_arm_model = NULL; | |
| } | |
| - | |
| - if (counter_config) | |
| - kfree(counter_config); | |
| -} | |
| -#else | |
| -int __init oprofile_arch_init(struct oprofile_operations *ops) | |
| -{ | |
| - pr_info("oprofile: hardware counters not available\n"); | |
| - return -ENODEV; | |
| + kfree(counter_config); | |
| } | |
| -void oprofile_arch_exit(void) {} | |
| -#endif /* CONFIG_HW_PERF_EVENTS */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/arch/arm/oprofile/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile/Makefile | |
| --- /path/to/linux-2.6.35.7/arch/arm/oprofile/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile/Makefile 2018-07-12 10:13:50.000000000 +0700 | |
| @@ -6,4 +6,9 @@ | |
| oprofilefs.o oprofile_stats.o \ | |
| timer_int.o ) | |
| -oprofile-y := $(DRIVER_OBJS) common.o | |
| +oprofile-y := $(DRIVER_OBJS) common.o backtrace.o | |
| +oprofile-$(CONFIG_CPU_XSCALE) += op_model_xscale.o | |
| +oprofile-$(CONFIG_OPROFILE_ARM11_CORE) += op_model_arm11_core.o | |
| +oprofile-$(CONFIG_OPROFILE_ARMV6) += op_model_v6.o | |
| +oprofile-$(CONFIG_OPROFILE_MPCORE) += op_model_mpcore.o | |
| +oprofile-$(CONFIG_OPROFILE_ARMV7) += op_model_v7.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_arm_model.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_counter.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_model_arm11_core.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_model_arm11_core.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_model_mpcore.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_model_mpcore.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_model_v6.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_model_v7.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_model_v7.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm/oprofile: op_model_xscale.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/arch/arm: plat-bcmap | |
| Only in /path/to/linux-2.6.35.7/arch/avr32/boot/images: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/avr32/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/blackfin/boot: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/blackfin/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/cris/boot: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/ia64/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/m68k/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/microblaze/lib: memcpy.c | |
| Only in /path/to/linux-2.6.35.7/arch/microblaze/lib: memmove.c | |
| Only in /path/to/linux-2.6.35.7/arch/microblaze/lib: memset.c | |
| Only in /path/to/linux-2.6.35.7/arch/mips/boot: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/mips/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/mn10300/boot: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/parisc/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/powerpc/boot: dtc-src | |
| Only in /path/to/linux-2.6.35.7/arch/powerpc/boot: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/powerpc/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/powerpc/kernel/vdso32: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/powerpc/kernel/vdso64: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/powerpc/platforms/cell/spufs: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/sh/boot/compressed: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/sh/boot: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/sh/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/sh/kernel/vsyscall: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/sparc/boot: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/sparc/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/um: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/boot/compressed: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/boot: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/boot/tools: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/kernel/acpi/realmode: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/kernel/cpu: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/kernel: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/lib: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/vdso: .gitignore | |
| Only in /path/to/linux-2.6.35.7/arch/x86/vdso/vdso32: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/block/blk-core.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/block/blk-core.c | |
| --- /path/to/linux-2.6.35.7/block/blk-core.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/block/blk-core.c 2018-07-12 10:14:39.000000000 +0700 | |
| @@ -1593,11 +1593,12 @@ | |
| if (unlikely(block_dump)) { | |
| char b[BDEVNAME_SIZE]; | |
| - printk(KERN_DEBUG "%s(%d): %s block %Lu on %s\n", | |
| + printk(KERN_DEBUG "%s(%d): %s block %Lu on %s (%u sectors)\n", | |
| current->comm, task_pid_nr(current), | |
| (rw & WRITE) ? "WRITE" : "READ", | |
| (unsigned long long)bio->bi_sector, | |
| - bdevname(bio->bi_bdev, b)); | |
| + bdevname(bio->bi_bdev, b), | |
| + count); | |
| } | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/block/genhd.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/block/genhd.c | |
| --- /path/to/linux-2.6.35.7/block/genhd.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/block/genhd.c 2018-07-12 10:14:39.000000000 +0700 | |
| @@ -1006,6 +1006,22 @@ | |
| free_part_stats(&disk->part0); | |
| kfree(disk); | |
| } | |
| + | |
| +static int disk_uevent(struct device *dev, struct kobj_uevent_env *env) | |
| +{ | |
| + struct gendisk *disk = dev_to_disk(dev); | |
| + struct disk_part_iter piter; | |
| + struct hd_struct *part; | |
| + int cnt = 0; | |
| + | |
| + disk_part_iter_init(&piter, disk, 0); | |
| + while((part = disk_part_iter_next(&piter))) | |
| + cnt++; | |
| + disk_part_iter_exit(&piter); | |
| + add_uevent_var(env, "NPARTS=%u", cnt); | |
| + return 0; | |
| +} | |
| + | |
| struct class block_class = { | |
| .name = "block", | |
| }; | |
| @@ -1024,6 +1040,7 @@ | |
| .groups = disk_attr_groups, | |
| .release = disk_release, | |
| .devnode = block_devnode, | |
| + .uevent = disk_uevent, | |
| }; | |
| #ifdef CONFIG_PROC_FS | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/: .config | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/: .config.old | |
| Only in /path/to/linux-2.6.35.7/Documentation/accounting: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/Documentation: android.txt | |
| Only in /path/to/linux-2.6.35.7/Documentation/auxdisplay: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/Documentation: brcm | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/Documentation/cgroups/cpuacct.txt /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/Documentation/cgroups/cpuacct.txt | |
| --- /path/to/linux-2.6.35.7/Documentation/cgroups/cpuacct.txt 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/Documentation/cgroups/cpuacct.txt 2018-07-12 10:14:14.000000000 +0700 | |
| @@ -40,6 +40,13 @@ | |
| user and system are in USER_HZ unit. | |
| +cpuacct.cpufreq file gives CPU time (in nanoseconds) spent at each CPU | |
| +frequency. Platform hooks must be implemented inorder to properly track | |
| +time at each CPU frequency. | |
| + | |
| +cpuacct.power file gives CPU power consumed (in milliWatt seconds). Platform | |
| +must provide and implement power callback functions. | |
| + | |
| cpuacct controller uses percpu_counter interface to collect user and | |
| system times. This has two side effects: | |
| Only in /path/to/linux-2.6.35.7/Documentation/connector: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/DocBook/dvb: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/DocBook: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/DocBook/v4l: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/ia64: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/lguest: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/networking: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/networking/timestamping: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/pcmcia: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/spi: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/video4linux: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/vm: .gitignore | |
| Only in /path/to/linux-2.6.35.7/Documentation/watchdog/src: .gitignore | |
| Only in /path/to/linux-2.6.35.7/drivers/atm: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/base/power/main.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/base/power/main.c | |
| --- /path/to/linux-2.6.35.7/drivers/base/power/main.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/base/power/main.c 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -26,6 +26,7 @@ | |
| #include <linux/interrupt.h> | |
| #include <linux/sched.h> | |
| #include <linux/async.h> | |
| +#include <linux/timer.h> | |
| #include "../base.h" | |
| #include "power.h" | |
| @@ -45,6 +46,9 @@ | |
| static DEFINE_MUTEX(dpm_list_mtx); | |
| static pm_message_t pm_transition; | |
| +static void dpm_drv_timeout(unsigned long data); | |
| +static DEFINE_TIMER(dpm_drv_wd, dpm_drv_timeout, 0, 0); | |
| + | |
| /* | |
| * Set once the preparation of devices for a PM transition has started, reset | |
| * before starting to resume devices. Protected by dpm_list_mtx. | |
| @@ -523,7 +527,8 @@ | |
| TRACE_DEVICE(dev); | |
| TRACE_RESUME(0); | |
| - dpm_wait(dev->parent, async); | |
| + if (dev->parent && dev->parent->power.status >= DPM_OFF) | |
| + dpm_wait(dev->parent, async); | |
| device_lock(dev); | |
| dev->power.status = DPM_RESUMING; | |
| @@ -584,6 +589,45 @@ | |
| } | |
| /** | |
| + * dpm_drv_timeout - Driver suspend / resume watchdog handler | |
| + * @data: struct device which timed out | |
| + * | |
| + * Called when a driver has timed out suspending or resuming. | |
| + * There's not much we can do here to recover so | |
| + * BUG() out for a crash-dump | |
| + * | |
| + */ | |
| +static void dpm_drv_timeout(unsigned long data) | |
| +{ | |
| + struct device *dev = (struct device *) data; | |
| + | |
| + printk(KERN_EMERG "**** DPM device timeout: %s (%s)\n", dev_name(dev), | |
| + (dev->driver ? dev->driver->name : "no driver")); | |
| + BUG(); | |
| +} | |
| + | |
| +/** | |
| + * dpm_drv_wdset - Sets up driver suspend/resume watchdog timer. | |
| + * @dev: struct device which we're guarding. | |
| + * | |
| + */ | |
| +static void dpm_drv_wdset(struct device *dev) | |
| +{ | |
| + dpm_drv_wd.data = (unsigned long) dev; | |
| + mod_timer(&dpm_drv_wd, jiffies + (HZ * 3)); | |
| +} | |
| + | |
| +/** | |
| + * dpm_drv_wdclr - clears driver suspend/resume watchdog timer. | |
| + * @dev: struct device which we're no longer guarding. | |
| + * | |
| + */ | |
| +static void dpm_drv_wdclr(struct device *dev) | |
| +{ | |
| + del_timer_sync(&dpm_drv_wd); | |
| +} | |
| + | |
| +/** | |
| * dpm_resume - Execute "resume" callbacks for non-sysdev devices. | |
| * @state: PM transition of the system being carried out. | |
| * | |
| @@ -601,6 +645,10 @@ | |
| pm_transition = state; | |
| list_for_each_entry(dev, &dpm_list, power.entry) { | |
| + if (dev->init_name) | |
| + printk("r: %s: ", dev->init_name); | |
| + if (dev->driver && dev->driver->name) | |
| + printk("dr: %s", dev->driver->name); | |
| if (dev->power.status < DPM_OFF) | |
| continue; | |
| @@ -616,7 +664,10 @@ | |
| get_device(dev); | |
| if (dev->power.status >= DPM_OFF && !is_async(dev)) { | |
| int error; | |
| - | |
| + if (dev->init_name) | |
| + printk("r: %s: ", dev->init_name); | |
| + if (dev->driver && dev->driver->name) | |
| + printk("dr: %s", dev->driver->name); | |
| mutex_unlock(&dpm_list_mtx); | |
| error = device_resume(dev, state, false); | |
| @@ -790,6 +841,10 @@ | |
| suspend_device_irqs(); | |
| mutex_lock(&dpm_list_mtx); | |
| list_for_each_entry_reverse(dev, &dpm_list, power.entry) { | |
| + if (dev->init_name) | |
| + printk("s: %s: ", dev->init_name); | |
| + if (dev->driver && dev->driver->name) | |
| + printk("dr: %s", dev->driver->name); | |
| error = device_suspend_noirq(dev, state); | |
| if (error) { | |
| pm_dev_err(dev, state, " late", error); | |
| @@ -931,10 +986,17 @@ | |
| while (!list_empty(&dpm_list)) { | |
| struct device *dev = to_device(dpm_list.prev); | |
| + if (dev->init_name) | |
| + printk("s: %s: ", dev->init_name); | |
| + if (dev->driver && dev->driver->name) | |
| + printk("dr: %s", dev->driver->name); | |
| + | |
| get_device(dev); | |
| mutex_unlock(&dpm_list_mtx); | |
| + dpm_drv_wdset(dev); | |
| error = device_suspend(dev); | |
| + dpm_drv_wdclr(dev); | |
| mutex_lock(&dpm_list_mtx); | |
| if (error) { | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/bluetooth: bthid | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/bluetooth/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/bluetooth/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/bluetooth/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/bluetooth/Makefile 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -27,3 +27,5 @@ | |
| hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o | |
| hci_uart-$(CONFIG_BT_HCIUART_LL) += hci_ll.o | |
| hci_uart-objs := $(hci_uart-y) | |
| + | |
| +obj-$(CONFIG_BT_HID) += bthid/ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char: bcom_vibrator.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char: broadcom | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char: dcc_tty.c | |
| Only in /path/to/linux-2.6.35.7/drivers/char: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/char/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/char/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/Kconfig 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -88,6 +88,19 @@ | |
| information. For framebuffer console users, please refer to | |
| <file:Documentation/fb/fbcon.txt>. | |
| +config DEVMEM | |
| + bool "Memory device driver" | |
| + default y | |
| + help | |
| + The memory driver provides two character devices, mem and kmem, which | |
| + provide access to the system's memory. The mem device is a view of | |
| + physical memory, and each byte in the device corresponds to the | |
| + matching physical address. The kmem device is the same as mem, but | |
| + the addresses correspond to the kernel's virtual address space rather | |
| + than physical memory. These devices are standard parts of a Linux | |
| + system and most users should say Y here. You might say N if very | |
| + security conscience or memory is tight. | |
| + | |
| config DEVKMEM | |
| bool "/dev/kmem virtual device support" | |
| default y | |
| @@ -1113,12 +1126,20 @@ | |
| /sys/devices/platform/telco_clock, with a number of files for | |
| controlling the behavior of this hardware. | |
| +config BCOMVIB | |
| + tristate "BroadCom Vibrator testing menu" | |
| + default y | |
| + | |
| config DEVPORT | |
| bool | |
| depends on !M68K | |
| depends on ISA || PCI | |
| default y | |
| +config DCC_TTY | |
| + tristate "DCC tty driver" | |
| + depends on ARM | |
| + | |
| source "drivers/s390/char/Kconfig" | |
| config RAMOOPS | |
| @@ -1131,3 +1152,6 @@ | |
| endmenu | |
| +if ARCH_BCM116X || ARCH_BCM215XX | |
| +source "drivers/char/broadcom/Kconfig" | |
| +endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/char/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/char/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/Makefile 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -107,12 +107,18 @@ | |
| obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o | |
| obj-$(CONFIG_TCG_TPM) += tpm/ | |
| +obj-$(CONFIG_BCOMVIB) += bcom_vibrator.o | |
| + | |
| +obj-$(CONFIG_DCC_TTY) += dcc_tty.o | |
| obj-$(CONFIG_PS3_FLASH) += ps3flash.o | |
| obj-$(CONFIG_RAMOOPS) += ramoops.o | |
| obj-$(CONFIG_JS_RTC) += js-rtc.o | |
| js-rtc-y = rtc.o | |
| +obj-$(CONFIG_ARCH_BCM215XX) += broadcom/ | |
| +obj-$(CONFIG_ARCH_BCM116X) += broadcom/ | |
| + | |
| # Files generated that shall be removed upon make clean | |
| clean-files := consolemap_deftbl.c defkeymap.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/char/mem.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/mem.c | |
| --- /path/to/linux-2.6.35.7/drivers/char/mem.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/mem.c 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -59,6 +59,7 @@ | |
| } | |
| #endif | |
| +#if defined(CONFIG_DEVMEM) || defined(CONFIG_DEVKMEM) | |
| #ifdef CONFIG_STRICT_DEVMEM | |
| static inline int range_is_allowed(unsigned long pfn, unsigned long size) | |
| { | |
| @@ -84,7 +85,9 @@ | |
| return 1; | |
| } | |
| #endif | |
| +#endif | |
| +#ifdef CONFIG_DEVMEM | |
| void __weak unxlate_dev_mem_ptr(unsigned long phys, void *addr) | |
| { | |
| } | |
| @@ -211,6 +214,9 @@ | |
| *ppos += written; | |
| return written; | |
| } | |
| +#endif /* CONFIG_DEVMEM */ | |
| + | |
| +#if defined(CONFIG_DEVMEM) || defined(CONFIG_DEVKMEM) | |
| int __weak phys_mem_access_prot_allowed(struct file *file, | |
| unsigned long pfn, unsigned long size, pgprot_t *vma_prot) | |
| @@ -332,6 +338,7 @@ | |
| } | |
| return 0; | |
| } | |
| +#endif /* CONFIG_DEVMEM */ | |
| #ifdef CONFIG_DEVKMEM | |
| static int mmap_kmem(struct file *file, struct vm_area_struct *vma) | |
| @@ -696,6 +703,8 @@ | |
| return file->f_pos = 0; | |
| } | |
| +#if defined(CONFIG_DEVMEM) || defined(CONFIG_DEVKMEM) || defined(CONFIG_DEVPORT) | |
| + | |
| /* | |
| * The memory devices use the full 32/64 bits of the offset, and so we cannot | |
| * check against negative addresses: they are ok. The return value is weird, | |
| @@ -729,10 +738,14 @@ | |
| return ret; | |
| } | |
| +#endif | |
| + | |
| +#if defined(CONFIG_DEVMEM) || defined(CONFIG_DEVKMEM) || defined(CONFIG_DEVPORT) | |
| static int open_port(struct inode * inode, struct file * filp) | |
| { | |
| return capable(CAP_SYS_RAWIO) ? 0 : -EPERM; | |
| } | |
| +#endif | |
| #define zero_lseek null_lseek | |
| #define full_lseek null_lseek | |
| @@ -742,6 +755,7 @@ | |
| #define open_kmem open_mem | |
| #define open_oldmem open_mem | |
| +#ifdef CONFIG_DEVMEM | |
| static const struct file_operations mem_fops = { | |
| .llseek = memory_lseek, | |
| .read = read_mem, | |
| @@ -750,6 +764,7 @@ | |
| .open = open_mem, | |
| .get_unmapped_area = get_unmapped_area_mem, | |
| }; | |
| +#endif | |
| #ifdef CONFIG_DEVKMEM | |
| static const struct file_operations kmem_fops = { | |
| @@ -839,7 +854,9 @@ | |
| const struct file_operations *fops; | |
| struct backing_dev_info *dev_info; | |
| } devlist[] = { | |
| +#ifdef CONFIG_DEVMEM | |
| [1] = { "mem", 0, &mem_fops, &directly_mappable_cdev_bdi }, | |
| +#endif | |
| #ifdef CONFIG_DEVKMEM | |
| [2] = { "kmem", 0, &kmem_fops, &directly_mappable_cdev_bdi }, | |
| #endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/char/misc.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/misc.c | |
| --- /path/to/linux-2.6.35.7/drivers/char/misc.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/misc.c 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -40,6 +40,7 @@ | |
| #include <linux/miscdevice.h> | |
| #include <linux/kernel.h> | |
| #include <linux/major.h> | |
| +#include <linux/slab.h> | |
| #include <linux/mutex.h> | |
| #include <linux/proc_fs.h> | |
| #include <linux/seq_file.h> | |
| @@ -49,6 +50,7 @@ | |
| #include <linux/tty.h> | |
| #include <linux/kmod.h> | |
| #include <linux/gfp.h> | |
| +#include <linux/smp_lock.h> | |
| /* | |
| * Head entry for the doubly linked miscdevice list | |
| @@ -115,7 +117,8 @@ | |
| struct miscdevice *c; | |
| int err = -ENODEV; | |
| const struct file_operations *old_fops, *new_fops = NULL; | |
| - | |
| + | |
| + lock_kernel(); | |
| mutex_lock(&misc_mtx); | |
| list_for_each_entry(c, &misc_list, list) { | |
| @@ -144,7 +147,6 @@ | |
| old_fops = file->f_op; | |
| file->f_op = new_fops; | |
| if (file->f_op->open) { | |
| - file->private_data = c; | |
| err=file->f_op->open(inode,file); | |
| if (err) { | |
| fops_put(file->f_op); | |
| @@ -154,6 +156,7 @@ | |
| fops_put(old_fops); | |
| fail: | |
| mutex_unlock(&misc_mtx); | |
| + unlock_kernel(); | |
| return err; | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/char/vt_ioctl.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/vt_ioctl.c | |
| --- /path/to/linux-2.6.35.7/drivers/char/vt_ioctl.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/char/vt_ioctl.c 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -133,7 +133,7 @@ | |
| list_add(&vw->list, &vt_events); | |
| spin_unlock_irqrestore(&vt_event_lock, flags); | |
| /* Wait for it to pass */ | |
| - wait_event_interruptible(vt_event_waitqueue, vw->done); | |
| + wait_event_interruptible_timeout(vt_event_waitqueue, vw->done,msecs_to_jiffies(10)); | |
| /* Dequeue it */ | |
| spin_lock_irqsave(&vt_event_lock, flags); | |
| list_del(&vw->list); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/cpufreq/cpufreq_ondemand.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/cpufreq/cpufreq_ondemand.c | |
| --- /path/to/linux-2.6.35.7/drivers/cpufreq/cpufreq_ondemand.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/cpufreq/cpufreq_ondemand.c 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -610,7 +610,9 @@ | |
| /* We want all CPUs to do sampling nearly on same jiffy */ | |
| int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | |
| - delay -= jiffies % delay; | |
| + if (num_online_cpus() > 1) | |
| + delay -= jiffies % delay; | |
| + | |
| mutex_lock(&dbs_info->timer_mutex); | |
| /* Common NORMAL_SAMPLE setup */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/cpufreq/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/cpufreq/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/cpufreq/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/cpufreq/Kconfig 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -110,6 +110,16 @@ | |
| Be aware that not all cpufreq drivers support the conservative | |
| governor. If unsure have a look at the help section of the | |
| driver. Fallback governor will be the performance governor. | |
| + | |
| +config CPU_FREQ_DEFAULT_GOV_BCM21553 | |
| + bool "bcm21553" | |
| + select CPU_FREQ_GOV_BCM21553 | |
| + help | |
| + Use the CPUFreq governor 'bcm21553' as default. This option enables | |
| + CPUFReq governor implemented for Broadcom BCM21553 chip. This | |
| + governor adjusts the cpu frequency and voltage based on certain | |
| + usecases. | |
| + | |
| endchoice | |
| config CPU_FREQ_GOV_PERFORMANCE | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/crypto: brcm_blkcrypto.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/crypto: brcm_blkcrypto.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/crypto/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/crypto/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/crypto/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/crypto/Kconfig 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -243,4 +243,11 @@ | |
| OMAP processors have SHA1/MD5 hw accelerator. Select this if you | |
| want to use the OMAP module for SHA1/MD5 algorithms. | |
| +config CRYPTO_DEV_BRCM_BLKCRYPTO | |
| + tristate "Support for BRCM BLKCRYPTO hw accelerator" | |
| + depends on ARCH_BCM215XX | |
| + select CRYPTO_AES | |
| + help | |
| + Driver for BRCM Bulk Cryptography accelerator. | |
| + | |
| endif # CRYPTO_HW | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/crypto/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/crypto/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/crypto/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/crypto/Makefile 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -1,3 +1,7 @@ | |
| +ifeq ($(CONFIG_ARCH_BCM215XX), y) | |
| +EXTRA_CFLAGS += -D_ATHENA_ | |
| +endif | |
| + | |
| obj-$(CONFIG_CRYPTO_DEV_PADLOCK_AES) += padlock-aes.o | |
| obj-$(CONFIG_CRYPTO_DEV_PADLOCK_SHA) += padlock-sha.o | |
| obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o | |
| @@ -9,4 +13,5 @@ | |
| obj-$(CONFIG_CRYPTO_DEV_IXP4XX) += ixp4xx_crypto.o | |
| obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += amcc/ | |
| obj-$(CONFIG_CRYPTO_DEV_OMAP_SHAM) += omap-sham.o | |
| +obj-$(CONFIG_CRYPTO_DEV_BRCM_BLKCRYPTO) += brcm_blkcrypto.o | |
| Only in /path/to/linux-2.6.35.7/drivers/eisa: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/gpio/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/gpio/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/gpio/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/gpio/Kconfig 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -113,6 +113,12 @@ | |
| comment "I2C GPIO expanders:" | |
| +config GPIO_BCM59035 | |
| + tristate "Broadcom BCM59035 PMU GPIO Driver" | |
| + depends on MFD_BCM59035 | |
| + help | |
| + If you say yes here to enable GPIO interface for BCM59035 PMU chip | |
| + | |
| config GPIO_MAX7300 | |
| tristate "Maxim MAX7300 GPIO expander" | |
| depends on I2C | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/gpio/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/gpio/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/gpio/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/gpio/Makefile 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -30,6 +30,7 @@ | |
| obj-$(CONFIG_GPIO_IT8761E) += it8761e_gpio.o | |
| obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o | |
| obj-$(CONFIG_GPIO_WM831X) += wm831x-gpio.o | |
| +obj-$(CONFIG_GPIO_BCM59035) += bcm59035-gpio.o | |
| obj-$(CONFIG_GPIO_WM8350) += wm8350-gpiolib.o | |
| obj-$(CONFIG_GPIO_WM8994) += wm8994-gpio.o | |
| obj-$(CONFIG_GPIO_SCH) += sch_gpio.o | |
| Only in /path/to/linux-2.6.35.7/drivers/gpu/drm/radeon: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers: haptic | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/i2c/algos/i2c-algo-bit.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/algos/i2c-algo-bit.c | |
| --- /path/to/linux-2.6.35.7/drivers/i2c/algos/i2c-algo-bit.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/algos/i2c-algo-bit.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -122,20 +122,34 @@ | |
| /* --- other auxiliary functions -------------------------------------- */ | |
| static void i2c_start(struct i2c_algo_bit_data *adap) | |
| { | |
| +#ifdef CONFIG_MAX8986_WORKAROUND | |
| + sclhi(adap); | |
| + sdahi(adap); | |
| + sdalo(adap); | |
| + scllo(adap); | |
| +#else | |
| /* assert: scl, sda are high */ | |
| setsda(adap, 0); | |
| udelay(adap->udelay); | |
| scllo(adap); | |
| +#endif | |
| } | |
| static void i2c_repstart(struct i2c_algo_bit_data *adap) | |
| { | |
| +#ifdef CONFIG_MAX8986_WORKAROUND | |
| + scllo(adap); | |
| + sdalo(adap); | |
| + sclhi(adap); | |
| + sdahi(adap); | |
| +#else | |
| /* assert: scl is low */ | |
| sdahi(adap); | |
| sclhi(adap); | |
| setsda(adap, 0); | |
| udelay(adap->udelay); | |
| scllo(adap); | |
| +#endif | |
| } | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/busses: i2c-bcm1161.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/i2c/busses/i2c-gpio.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/busses/i2c-gpio.c | |
| --- /path/to/linux-2.6.35.7/drivers/i2c/busses/i2c-gpio.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/busses/i2c-gpio.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -217,7 +217,12 @@ | |
| { | |
| platform_driver_unregister(&i2c_gpio_driver); | |
| } | |
| +/* As MAX8986 uses i2c-gpio we need this early */ | |
| +//#ifdef CONFIG_MAX8986_WORKAROUND | |
| +//arch_initcall(i2c_gpio_init); | |
| +//#else | |
| module_exit(i2c_gpio_exit); | |
| +//#endif | |
| MODULE_AUTHOR("Haavard Skinnemoen <[email protected]>"); | |
| MODULE_DESCRIPTION("Platform-independent bitbanging I2C driver"); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/i2c/busses/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/busses/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/i2c/busses/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/busses/Kconfig 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -613,6 +613,13 @@ | |
| This driver can also be built as a module. If so, the module | |
| will be called xilinx_i2c. | |
| +config I2C_BCM1160 | |
| + tristate "BCM116X BCM215XX adapter" | |
| + depends on (ARCH_BCM116X || ARCH_BCMRING || ARCH_BCM215XX) && I2C | |
| + help | |
| + Enable the i2c adapter on the BCM116X or BCMRING, which is used for | |
| + Power Management. | |
| + | |
| comment "External I2C/SMBus adapter drivers" | |
| config I2C_PARPORT | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/i2c/busses/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/busses/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/i2c/busses/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/i2c/busses/Makefile 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -30,6 +30,7 @@ | |
| # Embedded system I2C/SMBus host controller drivers | |
| obj-$(CONFIG_I2C_AT91) += i2c-at91.o | |
| obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o | |
| +obj-$(CONFIG_I2C_BCM1160) += i2c-bcm1161.o | |
| obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o | |
| obj-$(CONFIG_I2C_CPM) += i2c-cpm.o | |
| obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/evdev.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/evdev.c | |
| --- /path/to/linux-2.6.35.7/drivers/input/evdev.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/evdev.c 2018-07-12 10:13:40.000000000 +0700 | |
| @@ -20,6 +20,7 @@ | |
| #include <linux/input.h> | |
| #include <linux/major.h> | |
| #include <linux/device.h> | |
| +#include <linux/wakelock.h> | |
| #include "input-compat.h" | |
| struct evdev { | |
| @@ -43,6 +44,8 @@ | |
| struct fasync_struct *fasync; | |
| struct evdev *evdev; | |
| struct list_head node; | |
| + struct wake_lock wake_lock; | |
| + char name[28]; | |
| }; | |
| static struct evdev *evdev_table[EVDEV_MINORS]; | |
| @@ -55,6 +58,7 @@ | |
| * Interrupts are disabled, just acquire the lock | |
| */ | |
| spin_lock(&client->buffer_lock); | |
| + wake_lock_timeout(&client->wake_lock, 5 * HZ); | |
| client->buffer[client->head++] = *event; | |
| client->head &= EVDEV_BUFFER_SIZE - 1; | |
| spin_unlock(&client->buffer_lock); | |
| @@ -72,8 +76,11 @@ | |
| struct evdev *evdev = handle->private; | |
| struct evdev_client *client; | |
| struct input_event event; | |
| + struct timespec ts; | |
| - do_gettimeofday(&event.time); | |
| + ktime_get_ts(&ts); | |
| + event.time.tv_sec = ts.tv_sec; | |
| + event.time.tv_usec = ts.tv_nsec / NSEC_PER_USEC; | |
| event.type = type; | |
| event.code = code; | |
| event.value = value; | |
| @@ -234,6 +241,7 @@ | |
| mutex_unlock(&evdev->mutex); | |
| evdev_detach_client(evdev, client); | |
| + wake_lock_destroy(&client->wake_lock); | |
| kfree(client); | |
| evdev_close_device(evdev); | |
| @@ -270,6 +278,9 @@ | |
| } | |
| spin_lock_init(&client->buffer_lock); | |
| + snprintf(client->name, sizeof(client->name), "%s-%d", | |
| + dev_name(&evdev->dev), task_tgid_vnr(current)); | |
| + wake_lock_init(&client->wake_lock, WAKE_LOCK_SUSPEND, client->name); | |
| client->evdev = evdev; | |
| evdev_attach_client(evdev, client); | |
| @@ -335,6 +346,8 @@ | |
| if (have_event) { | |
| *event = client->buffer[client->tail++]; | |
| client->tail &= EVDEV_BUFFER_SIZE - 1; | |
| + if (client->head == client->tail) | |
| + wake_unlock(&client->wake_lock); | |
| } | |
| spin_unlock_irq(&client->buffer_lock); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/input.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/input.c | |
| --- /path/to/linux-2.6.35.7/drivers/input/input.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/input.c 2018-07-12 10:13:40.000000000 +0700 | |
| @@ -65,6 +65,8 @@ | |
| static struct input_handler *input_table[8]; | |
| +extern int debug_level; | |
| + | |
| static inline int is_event_supported(unsigned int code, | |
| unsigned long *bm, unsigned int max) | |
| { | |
| @@ -329,6 +331,46 @@ | |
| { | |
| unsigned long flags; | |
| + // forced ramdump | |
| + static unsigned int bcm_forcedramdump = 0 ; | |
| + | |
| + if(value) | |
| + { | |
| + #if defined(CONFIG_TOUCHSCREEN_MMS128_REV04) | |
| + if((strcmp(dev->name,"max8986_ponkey")==0) && (code == KEY_POWER)) | |
| + #else | |
| + if((strcmp(dev->name,"sec_keypad")==0) && (code == KEY_HOME)) | |
| + #endif | |
| + bcm_forcedramdump = 0x01; | |
| + | |
| + if((strcmp(dev->name,"sec_keypad")==0) && (code == KEY_VOLUMEUP)) | |
| + bcm_forcedramdump += 0x02; | |
| + | |
| + #if defined(CONFIG_TOUCHSCREEN_MMS128_REV04) | |
| + if((strcmp(dev->name,"sec_keypad")==0) && (code == KEY_VOLUMEDOWN)) | |
| + bcm_forcedramdump += 0x04; | |
| + #endif | |
| + | |
| + #if defined(CONFIG_TOUCHSCREEN_MMS128_REV04) | |
| + if(bcm_forcedramdump == 0x07) | |
| + #else | |
| + if(bcm_forcedramdump == 0x03) | |
| + #endif | |
| + { | |
| + if(debug_level==2||debug_level==1) | |
| + { | |
| + bcm_forcedramdump = 0; | |
| + panic("Forced Ramdump !!\n"); | |
| + } | |
| + } | |
| + } | |
| + | |
| + if((bcm_forcedramdump > 0) && (code != 0) && (value == 0)) | |
| + { | |
| + bcm_forcedramdump = 0; | |
| + } | |
| + // forced ramdump | |
| + | |
| if (is_event_supported(type, dev->evbit, EV_MAX)) { | |
| spin_lock_irqsave(&dev->event_lock, flags); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/input/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/Kconfig 2018-07-12 10:13:40.000000000 +0700 | |
| @@ -161,6 +161,15 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called apm-power. | |
| +config INPUT_KEYRESET | |
| + tristate "Reset key" | |
| + depends on INPUT | |
| + ---help--- | |
| + Say Y here if you want to reboot when some keys are pressed; | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called keyreset. | |
| + | |
| config XEN_KBDDEV_FRONTEND | |
| tristate "Xen virtual keyboard and mouse support" | |
| depends on XEN_FBDEV_FRONTEND | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/keyboard: bcm_keypad.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/keyboard/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/keyboard/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/input/keyboard/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/keyboard/Kconfig 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -134,6 +134,13 @@ | |
| This driver can also be built as a module. If so, the module | |
| will be called qt2160. | |
| +config KEYBOARD_BCM | |
| + bool "BCM keypad" | |
| + depends on ARCH_BCM215XX || ARCH_BCM116X | |
| + default y | |
| + help | |
| + BCM keypad | |
| + | |
| config KEYBOARD_BFIN | |
| tristate "Blackfin BF54x keypad support" | |
| depends on (BF54x && !BF544) | |
| @@ -426,4 +433,15 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called w90p910_keypad. | |
| +config OFM_DRIVER | |
| + tristate "OFM based optical mouse" | |
| + depends on I2C | |
| + help | |
| + Say Y here if you have a OFM based mouse. | |
| + | |
| + If unsure, say N. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called OFM. | |
| + | |
| endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/keyboard/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/keyboard/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/input/keyboard/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/keyboard/Makefile 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -12,6 +12,7 @@ | |
| obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o | |
| obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o | |
| obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o | |
| +obj-$(CONFIG_KEYBOARD_BCM) += bcm_keypad.o | |
| obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o | |
| obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o | |
| obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o | |
| @@ -38,3 +39,4 @@ | |
| obj-$(CONFIG_KEYBOARD_TWL4030) += twl4030_keypad.o | |
| obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o | |
| obj-$(CONFIG_KEYBOARD_W90P910) += w90p910_keypad.o | |
| +obj-$(CONFIG_OFM_DRIVER) += ofm_driver.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/keyboard: ofm_driver.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input: keyreset.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/input/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/Makefile 2018-07-12 10:13:40.000000000 +0700 | |
| @@ -24,5 +24,6 @@ | |
| obj-$(CONFIG_INPUT_MISC) += misc/ | |
| obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o | |
| +obj-$(CONFIG_INPUT_KEYRESET) += keyreset.o | |
| obj-$(CONFIG_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: bma150.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: gpio_axis.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: gpio_event.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: gpio_input.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: gpio_matrix.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: gpio_output.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/misc/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/input/misc/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc/Kconfig 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -183,6 +183,17 @@ | |
| To compile this driver as a module, choose M here: the module will be | |
| called ati_remote2. | |
| +config INPUT_KEYCHORD | |
| + tristate "Key chord input driver support" | |
| + help | |
| + Say Y here if you want to enable the key chord driver | |
| + accessible at /dev/keychord. This driver can be used | |
| + for receiving notifications when client specified key | |
| + combinations are pressed. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called keychord. | |
| + | |
| config INPUT_KEYSPAN_REMOTE | |
| tristate "Keyspan DMR USB remote control (EXPERIMENTAL)" | |
| depends on EXPERIMENTAL | |
| @@ -215,6 +226,36 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called powermate. | |
| +config INPUT_BCM59035_PONKEY | |
| + tristate "Broadcom BCM59035 PMU PONKEY" | |
| + depends on MFD_BCM59035 | |
| + help | |
| + If you say yes here you will get support for the poweron button | |
| + feature of PMU BCM59035 | |
| + | |
| + This driver can also be built as a module. If so, the module | |
| + will be called "ponkey-bcm59035". | |
| + | |
| +config PONKEY_DRV_BCM59038 | |
| + tristate "Broadcom BCM59038 PMU PONKEY" | |
| + depends on MFD_BCM59038 | |
| + help | |
| + If you say yes here you will get support for the poweron button | |
| + feature of PMU BCM59038 | |
| + | |
| + This driver can also be built as a module. If so, the module | |
| + will be called "ponkey-bcm59038". | |
| + | |
| +config PONKEY_DRV_MAX8986 | |
| + tristate "Maxim MAX8986 PMU PONKEY" | |
| + depends on MFD_MAX8986 | |
| + help | |
| + If you say yes here you will get support for the poweron button | |
| + feature of PMU MAX8986 | |
| + | |
| + This driver can also be built as a module. If so, the module | |
| + will be called "ponkey-max8986". | |
| + | |
| config INPUT_YEALINK | |
| tristate "Yealink usb-p1k voip phone" | |
| depends on EXPERIMENTAL | |
| @@ -302,6 +343,11 @@ | |
| To compile this driver as a module, choose M here: the module will be | |
| called winbond_cir. | |
| +config INPUT_GPIO | |
| + tristate "GPIO driver support" | |
| + help | |
| + Say Y here if you want to support gpio based keys, wheels etc... | |
| + | |
| config HP_SDC_RTC | |
| tristate "HP SDC Real Time Clock" | |
| depends on (GSC || HP300) && SERIO | |
| @@ -390,4 +436,16 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called pcap_keys. | |
| +config INPUT_BMA150_SMB380 | |
| + tristate "Bosch BMA150 accelerometer support" | |
| + help | |
| + Say Y to enable BMA150/ SMB380 based acceleromter support | |
| + | |
| +config SENSORS_AK8973 | |
| + tristate "AK8973 3-axis Electronic Compass support" | |
| + depends on I2C=y | |
| + help | |
| + If you say yes here you get support for Asahi Kasei's | |
| + orientation sensor AK8973. | |
| + | |
| endif | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: keychord.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/misc/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/input/misc/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc/Makefile 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -16,8 +16,10 @@ | |
| obj-$(CONFIG_INPUT_CM109) += cm109.o | |
| obj-$(CONFIG_INPUT_COBALT_BTNS) += cobalt_btns.o | |
| obj-$(CONFIG_INPUT_DM355EVM) += dm355evm_keys.o | |
| +obj-$(CONFIG_INPUT_GPIO) += gpio_event.o gpio_matrix.o gpio_input.o gpio_output.o gpio_axis.o | |
| obj-$(CONFIG_HP_SDC_RTC) += hp_sdc_rtc.o | |
| obj-$(CONFIG_INPUT_IXP4XX_BEEPER) += ixp4xx-beeper.o | |
| +obj-$(CONFIG_INPUT_KEYCHORD) += keychord.o | |
| obj-$(CONFIG_INPUT_KEYSPAN_REMOTE) += keyspan_remote.o | |
| obj-$(CONFIG_INPUT_M68K_BEEP) += m68kspkr.o | |
| obj-$(CONFIG_INPUT_MAX8925_ONKEY) += max8925_onkey.o | |
| @@ -37,4 +39,8 @@ | |
| obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o | |
| obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o | |
| obj-$(CONFIG_INPUT_YEALINK) += yealink.o | |
| - | |
| +obj-$(CONFIG_INPUT_BCM59035_PONKEY) += ponkey-bcm59035.o | |
| +obj-$(CONFIG_PONKEY_DRV_BCM59038) += ponkey-bcm59038.o | |
| +obj-$(CONFIG_PONKEY_DRV_MAX8986) += ponkey-max8986.o | |
| +obj-$(CONFIG_INPUT_BMA150_SMB380) += bma150.o smb380.o smb380calib.o | |
| +obj-$(CONFIG_SENSORS_AK8973) += akm8973.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: ponkey-max8986.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: smb380.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: smb380calib.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: smb380calib.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/misc: smb380.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: bl_master.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: bootloader.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: cyttsp_core.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: cyttsp_core.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: cyttsp_i2c.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/touchscreen/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/input/touchscreen/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen/Kconfig 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -119,6 +119,23 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called dynapro. | |
| +config TOUCHSCREEN_CYTTSP_CORE | |
| + tristate "Cypress TTSP touchscreen core" | |
| + help | |
| + Always activated for Cypress TTSP touchscreen | |
| + | |
| +config TOUCHSCREEN_CYTTSP_I2C | |
| + tristate "Cypress TTSP i2c touchscreen" | |
| + depends on I2C && TOUCHSCREEN_CYTTSP_CORE | |
| + help | |
| + Say Y here if you have a Cypress TTSP touchscreen | |
| + connected to your system with an I2C interface. | |
| + | |
| + If unsure, say N. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called cyttsp-i2c. | |
| + | |
| config TOUCHSCREEN_HAMPSHIRE | |
| tristate "Hampshire serial touchscreen" | |
| select SERIO | |
| @@ -303,6 +320,36 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called migor_ts. | |
| +config TOUCHSCREEN_TAT200A | |
| + tristate "Synaptics i2c tat200a touchscreen" | |
| + depends on I2C | |
| + help | |
| + This enables support for Synaptics RMI over I2C based touchscreens. | |
| + | |
| +config TOUCHSCREEN_TMA340 | |
| + tristate "Synaptics i2c touchscreen" | |
| + depends on I2C | |
| + help | |
| + This enables support for Synaptics RMI over I2C based touchscreens. | |
| + | |
| +config TOUCHSCREEN_TMA340_COOPERVE | |
| + tristate "Synaptics i2c touchscreen" | |
| + depends on I2C | |
| + help | |
| + This enables support for Synaptics RMI over I2C based touchscreens. | |
| + | |
| +config TOUCHSCREEN_MMS128 | |
| + tristate "Melfas touchscreen" | |
| + depends on I2C | |
| + help | |
| + This enables support for Synaptics RMI over I2C based touchscreens. | |
| + | |
| +config TOUCHSCREEN_MMS128_REV04 | |
| + tristate "Melfas touchscreen" | |
| + depends on I2C | |
| + help | |
| + This enables support for Synaptics RMI over I2C based touchscreens. | |
| + | |
| config TOUCHSCREEN_TOUCHRIGHT | |
| tristate "Touchright serial touchscreen" | |
| select SERIO | |
| @@ -603,4 +650,90 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called tps6507x_ts. | |
| +config TOUCHSCREEN_QT602240 | |
| + tristate "QT602240 I2C Touchscreen" | |
| + depends on I2C | |
| + help | |
| + Say Y here if you have the AT42QT602240/ATMXT224 I2C touchscreen | |
| + connected to your system. | |
| + | |
| + If unsure, say N. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called qt602240_ts. | |
| + | |
| +config TOUCHSCREEN_QT602240_MULTITOUCH | |
| + boolean "QT602240 Touchscreen Multitouch" | |
| + depends on TOUCHSCREEN_QT602240 | |
| + help | |
| + Say Y here if you want multi touch functionality enabled | |
| + | |
| + If unsure, say N. | |
| + | |
| +config TOUCHSCREEN_TSC2017 | |
| + tristate "TSC2017 based touchscreens" | |
| + depends on I2C | |
| + help | |
| + Say Y here if you have a TSC2017 based touchscreen. | |
| + | |
| + If unsure, say N. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called tsc2017. | |
| + | |
| +config TOUCHSCREEN_EPML | |
| + tristate "EPML capacitive touchscreen controller" | |
| + help | |
| + Say Y here if you have the EPML touchscreen | |
| + controller chip in your system. | |
| + | |
| + If unsure, say N. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called epml. | |
| + | |
| +config TOUCHSCREEN_EPML_P4_POWER_SAVE | |
| + boolean "EPML capacitive touchscreen controller for Firmware versions P4 with power saving" | |
| + depends on TOUCHSCREEN_EPML | |
| + help | |
| + Say Y here if you have the P2/P3 versions of EPML touchscreen | |
| + controller chip in your system & you require power saving. | |
| + | |
| + If unsure, say N. | |
| + | |
| +config TOUCHSCREEN_PCAP7200 | |
| + tristate "EETI Projected capacitive touchscreen controller" | |
| + help | |
| + Say Y here if you have the EETI PCAP7200 touchscreen | |
| + controller chip in your system. | |
| + | |
| + If unsure, say N. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called pcap7200. | |
| + | |
| +config TOUCHSCREEN_F760 | |
| + tristate "Siliconlab touchscreens" | |
| + depends on I2C | |
| + help | |
| + Say Y here if you have a F760 based touchscreen. | |
| + | |
| + If unsure, say N. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called tsc2017. | |
| + | |
| +config TOUCHSCREEN_TMA140 | |
| + tristate "Synaptics i2c touchscreen" | |
| + depends on I2C | |
| + help | |
| + This enables support for Synaptics RMI over I2C based touchscreens. | |
| + | |
| + | |
| +config TOUCHSCREEN_MMS128_TASSCOOPER | |
| + tristate "Melfas touchscreen" | |
| + depends on I2C | |
| + help | |
| + This enables support for Synaptics RMI over I2C based touchscreens. | |
| + | |
| endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/touchscreen/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/input/touchscreen/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen/Makefile 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -14,6 +14,8 @@ | |
| obj-$(CONFIG_TOUCHSCREEN_BITSY) += h3600_ts_input.o | |
| obj-$(CONFIG_TOUCHSCREEN_DYNAPRO) += dynapro.o | |
| obj-$(CONFIG_TOUCHSCREEN_HAMPSHIRE) += hampshire.o | |
| +obj-$(CONFIG_TOUCHSCREEN_CYTTSP_CORE) += cyttsp_core.o | |
| +obj-$(CONFIG_TOUCHSCREEN_CYTTSP_I2C) += cyttsp_i2c.o | |
| obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o | |
| obj-$(CONFIG_TOUCHSCREEN_EETI) += eeti_ts.o | |
| obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o | |
| @@ -30,7 +32,15 @@ | |
| obj-$(CONFIG_TOUCHSCREEN_USB_COMPOSITE) += usbtouchscreen.o | |
| obj-$(CONFIG_TOUCHSCREEN_PCAP) += pcap_ts.o | |
| obj-$(CONFIG_TOUCHSCREEN_PENMOUNT) += penmount.o | |
| +obj-$(CONFIG_TOUCHSCREEN_QT602240) += qt602240_ts.o | |
| obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o | |
| +obj-$(CONFIG_TOUCHSCREEN_TMA340) += synaptics_i2c_rmi_tma340_tassve.o | |
| +obj-$(CONFIG_TOUCHSCREEN_TMA340_COOPERVE) += synaptics_i2c_rmi_tma340_cooperve.o | |
| +obj-$(CONFIG_TOUCHSCREEN_MMS128) += melfas_ts.o | |
| +obj-$(CONFIG_TOUCHSCREEN_MMS128_REV04) += melfas_ts_rev04.o | |
| +obj-$(CONFIG_TOUCHSCREEN_MMS128) += mcs8000_download.o | |
| +obj-$(CONFIG_TOUCHSCREEN_MMS128_REV04) += mcs8000_download_rev04.o | |
| +obj-$(CONFIG_TOUCHSCREEN_TAT200A) += synaptics_i2c_rmi_luisa.o tst200_download_luisa.o | |
| obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o | |
| obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o | |
| obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o | |
| @@ -47,3 +57,10 @@ | |
| obj-$(CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE) += zylonite-wm97xx.o | |
| obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o | |
| obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o | |
| +obj-$(CONFIG_TOUCHSCREEN_TSC2017) += tsc2017.o | |
| +obj-$(CONFIG_TOUCHSCREEN_EPML) += epml_touch.o | |
| +obj-$(CONFIG_TOUCHSCREEN_PCAP7200) += pcap7200_ts.o | |
| +obj-$(CONFIG_TOUCHSCREEN_F760) += silabs_f760_totoro.o bl_master.o | |
| +obj-$(CONFIG_TOUCHSCREEN_TMA140) += synaptics_i2c_rmi_tma140_totoro.o tma140_download_totoro.o | |
| +obj-$(CONFIG_TOUCHSCREEN_MMS128_TASSCOOPER) += melfas_ts_mms128_tasscooper.o | |
| +obj-$(CONFIG_TOUCHSCREEN_MMS128_TASSCOOPER) += mcs8000_download_rev04.o mms100_ISC_download.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: MCS8000_bin.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: MCS8000_bin_rev04.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: MCS8000_bin_rev04_TassVE.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: mcs8000_download.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: mcs8000_download.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: mcs8000_download_porting.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: mcs8000_download_rev04.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: melfas_ts.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: melfas-ts.idc | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: melfas_ts_mms128_tasscooper.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: melfas_ts_rev04.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: mms100_ISC_download.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: qt602240_ts.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: silabs_f760.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: silabs_f760_totoro.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_BL006_SMAC005_APP005.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_BL006_TYE004_APP005.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP004.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP006.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP010.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP013.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP015.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP017.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP018.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP019.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC005_BL006_APP020.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP011.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP012.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP013.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP014.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP015.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP017.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP018.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP019.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC007_BL006_APP020.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_SMAC7_BL6_APP10.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360T_SMAC020_BL006_APP015.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360T_TYE008_BL006_APP012.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360T_TYE008_BL006_APP013.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360T_TYE008_BL006_APP014.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_TYE004_BL006_APP004.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_TYE010_BL006_A015.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_TYE010_BL006_APP011.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_TYE010_BL006_APP020.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5360_TYE010_BL006_APP021.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5630_BL006_SMAC05_APP016.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SILABS_S5630_BL006_SMAC07_APP016.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SMAC_APP02.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: SMAC_APP3.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: synaptics_i2c_rmi.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: synaptics_i2c_rmi_luisa.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: synaptics_i2c_rmi_tma140_totoro.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: synaptics_i2c_rmi_tma340_cooperve.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: synaptics_i2c_rmi_tma340_tassve.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: tma140_download_totoro.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: tma140_download_totoro.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: TMA140_FIRMWARE_TOTORO | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/input/touchscreen/tsc2007.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen/tsc2007.c | |
| --- /path/to/linux-2.6.35.7/drivers/input/touchscreen/tsc2007.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen/tsc2007.c 2018-07-12 10:13:39.000000000 +0700 | |
| @@ -20,15 +20,33 @@ | |
| * published by the Free Software Foundation. | |
| */ | |
| +/******************************************************************************* | |
| +* Copyright 2010 Broadcom Corporation. All rights reserved. | |
| +* | |
| +* @file drivers/input/touchscreen/tsc2007.c | |
| +* | |
| +* 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.gnu.org/copyleft/gpl.html (the "GPL"). | |
| +* | |
| +* Notwithstanding the above, under no circumstances may you combine this | |
| +* software in any way with any other Broadcom software provided under a license | |
| +* other than the GPL, without Broadcom's express prior written consent. | |
| +*******************************************************************************/ | |
| + | |
| #include <linux/module.h> | |
| #include <linux/slab.h> | |
| #include <linux/input.h> | |
| #include <linux/interrupt.h> | |
| #include <linux/i2c.h> | |
| #include <linux/i2c/tsc2007.h> | |
| +#include <linux/earlysuspend.h> | |
| + | |
| +#include <linux/time.h> | |
| -#define TS_POLL_DELAY 1 /* ms delay between samples */ | |
| -#define TS_POLL_PERIOD 1 /* ms delay between samples */ | |
| +#define TS_POLL_DELAY 1 /* ms delay between samples */ | |
| +#define TS_POLL_PERIOD 20 /* ms delay between samples */ | |
| #define TSC2007_MEASURE_TEMP0 (0x0 << 4) | |
| #define TSC2007_MEASURE_AUX (0x2 << 4) | |
| @@ -61,28 +79,45 @@ | |
| #define PWRDOWN (TSC2007_12BIT | TSC2007_POWER_OFF_IRQ_EN) | |
| struct ts_event { | |
| - u16 x; | |
| - u16 y; | |
| - u16 z1, z2; | |
| + u16 x; | |
| + u16 y; | |
| + u16 z1, z2; | |
| }; | |
| struct tsc2007 { | |
| - struct input_dev *input; | |
| - char phys[32]; | |
| - struct delayed_work work; | |
| - | |
| - struct i2c_client *client; | |
| + struct tsc2007_platform_data *pdata; | |
| + struct input_dev *input; | |
| + char phys[32]; | |
| + struct delayed_work work; | |
| + | |
| + struct i2c_client *client; | |
| + struct early_suspend early_suspend; | |
| - u16 model; | |
| - u16 x_plate_ohms; | |
| + u16 model; | |
| + u16 x_plate_ohms; | |
| - bool pendown; | |
| - int irq; | |
| + bool pendown; | |
| + int irq; | |
| - int (*get_pendown_state)(void); | |
| - void (*clear_penirq)(void); | |
| + int (*get_pendown_state) (void); | |
| + void (*clear_penirq) (void); | |
| }; | |
| +#ifdef CONFIG_HAS_EARLYSUSPEND | |
| +static void tsc2007_early_suspend(struct early_suspend *h); | |
| +static void tsc2007_late_resume(struct early_suspend *h); | |
| +#endif | |
| + | |
| +/* #undef BCM_TS_EVENT_REGULATION */ | |
| +#define BCM_TS_EVENT_REGULATION | |
| + | |
| +#ifdef BCM_TS_EVENT_REGULATION | |
| +/* regulate event report rate */ | |
| +#define TS_EVENT_RATE 12 /* maximum number of touch screen event per second */ | |
| +#define TS_EVENT_REGULATE_WINDOW (HZ / TS_EVENT_RATE) /* minimum jiffies between two reported touch screen events */ | |
| +static uint32_t ts_last_time; | |
| +#endif /* BCM_TS_EVENT_REGULATION */ | |
| + | |
| static inline int tsc2007_xfer(struct tsc2007 *tsc, u8 cmd) | |
| { | |
| s32 data; | |
| @@ -107,13 +142,13 @@ | |
| static void tsc2007_read_values(struct tsc2007 *tsc, struct ts_event *tc) | |
| { | |
| - /* y- still on; turn on only y+ (and ADC) */ | |
| + /* y- still on; turn on only y + (and ADC) */ | |
| tc->y = tsc2007_xfer(tsc, READ_Y); | |
| - /* turn y- off, x+ on, then leave in lowpower */ | |
| + /* turn y- off, x + on, then leave in lowpower */ | |
| tc->x = tsc2007_xfer(tsc, READ_X); | |
| - /* turn y+ off, x- on; we'll use formula #1 */ | |
| + /* turn y + off, x- on; we'll use formula #1 */ | |
| tc->z1 = tsc2007_xfer(tsc, READ_Z1); | |
| tc->z2 = tsc2007_xfer(tsc, READ_Z2); | |
| @@ -152,13 +187,20 @@ | |
| input_sync(input); | |
| } | |
| +#define to_delayed_work(_work) container_of(_work, struct delayed_work, work) | |
| + | |
| +#define REPORT_X (ts->pdata->get_x_value(ts->pdata, tc.x, MAX_12BIT)) | |
| +#define REPORT_Y (ts->pdata->get_y_value(ts->pdata, tc.y, MAX_12BIT)) | |
| + | |
| static void tsc2007_work(struct work_struct *work) | |
| { | |
| struct tsc2007 *ts = | |
| - container_of(to_delayed_work(work), struct tsc2007, work); | |
| + container_of(to_delayed_work(work), struct tsc2007, work); | |
| struct ts_event tc; | |
| u32 rt; | |
| - | |
| +#ifdef BCM_TS_EVENT_REGULATION | |
| + uint32_t ts_this_time; | |
| +#endif | |
| /* | |
| * NOTE: We can't rely on the pressure to determine the pen down | |
| * state, even though this controller has a pressure sensor. | |
| @@ -196,6 +238,7 @@ | |
| } | |
| if (rt) { | |
| +/* static int ts_counter = 0; */ | |
| struct input_dev *input = ts->input; | |
| if (!ts->pendown) { | |
| @@ -204,16 +247,37 @@ | |
| input_report_key(input, BTN_TOUCH, 1); | |
| ts->pendown = true; | |
| } | |
| - | |
| - input_report_abs(input, ABS_X, tc.x); | |
| - input_report_abs(input, ABS_Y, tc.y); | |
| +#ifdef BCM_TS_EVENT_REGULATION | |
| + ts_this_time = jiffies; | |
| + if (ts_last_time == 0) | |
| + ts_last_time = ts_this_time - TS_EVENT_REGULATE_WINDOW; | |
| + | |
| + if (ts_this_time - ts_last_time >= TS_EVENT_REGULATE_WINDOW) { | |
| + ts_last_time = ts_this_time; | |
| + | |
| + input_report_abs(input, ABS_X, REPORT_X); | |
| + input_report_abs(input, ABS_Y, REPORT_Y); | |
| + input_report_abs(input, ABS_PRESSURE, rt); | |
| + input_sync(input); | |
| + | |
| + dev_dbg(&ts->client->dev, | |
| + "point(%4d,%4d), pressure (%4u)\n", REPORT_X, | |
| + REPORT_Y, rt); | |
| + | |
| + /* pr_info("ts#=%d ts_this_time=%u\n", | |
| + ts_counter++, ts_this_time); */ | |
| + pr_info("TS point(%4d,%4d), pressure (%4u)\n", | |
| + REPORT_X, REPORT_Y, rt); | |
| + } | |
| +#else /* BCM_TS_EVENT_REGULATION */ | |
| + input_report_abs(input, ABS_X, REPORT_X); | |
| + input_report_abs(input, ABS_Y, REPORT_Y); | |
| input_report_abs(input, ABS_PRESSURE, rt); | |
| - | |
| input_sync(input); | |
| dev_dbg(&ts->client->dev, "point(%4d,%4d), pressure (%4u)\n", | |
| - tc.x, tc.y, rt); | |
| - | |
| + REPORT_X, REPORT_Y, rt); | |
| +#endif | |
| } else if (!ts->get_pendown_state && ts->pendown) { | |
| /* | |
| * We don't have callback to check pendown state, so we | |
| @@ -224,7 +288,7 @@ | |
| ts->pendown = false; | |
| } | |
| - out: | |
| + out: | |
| if (ts->pendown) | |
| schedule_delayed_work(&ts->work, | |
| msecs_to_jiffies(TS_POLL_PERIOD)); | |
| @@ -261,6 +325,42 @@ | |
| } | |
| } | |
| +static int tsc2007_suspend(struct i2c_client *client, pm_message_t mesg) | |
| +{ | |
| + struct tsc2007 *ts; | |
| + | |
| + ts = i2c_get_clientdata(client); | |
| + cancel_work_sync(&ts->work.work); | |
| + disable_irq(ts->irq); | |
| + return 0; | |
| + | |
| +} | |
| + | |
| +static int tsc2007_resume(struct i2c_client *client) | |
| +{ | |
| + struct tsc2007 *ts; | |
| + | |
| + ts = i2c_get_clientdata(client); | |
| + enable_irq(ts->irq); | |
| + return 0; | |
| +} | |
| + | |
| +#ifdef CONFIG_HAS_EARLYSUSPEND | |
| +static void tsc2007_early_suspend(struct early_suspend *h) | |
| +{ | |
| + struct tsc2007 *ts; | |
| + ts = container_of(h, struct tsc2007, early_suspend); | |
| + tsc2007_suspend(ts->client, PMSG_SUSPEND); | |
| +} | |
| + | |
| +static void tsc2007_late_resume(struct early_suspend *h) | |
| +{ | |
| + struct tsc2007 *ts; | |
| + ts = container_of(h, struct tsc2007, early_suspend); | |
| + tsc2007_resume(ts->client); | |
| +} | |
| +#endif | |
| + | |
| static int __devinit tsc2007_probe(struct i2c_client *client, | |
| const struct i2c_device_id *id) | |
| { | |
| @@ -269,6 +369,7 @@ | |
| struct input_dev *input_dev; | |
| int err; | |
| + pr_info("tsc2007_probe\n"); | |
| if (!pdata) { | |
| dev_err(&client->dev, "platform data is required!\n"); | |
| return -EINVAL; | |
| @@ -285,15 +386,16 @@ | |
| goto err_free_mem; | |
| } | |
| + ts->pdata = pdata; | |
| ts->client = client; | |
| ts->irq = client->irq; | |
| ts->input = input_dev; | |
| INIT_DELAYED_WORK(&ts->work, tsc2007_work); | |
| - ts->model = pdata->model; | |
| - ts->x_plate_ohms = pdata->x_plate_ohms; | |
| + ts->model = pdata->model; | |
| + ts->x_plate_ohms = pdata->x_plate_ohms; | |
| ts->get_pendown_state = pdata->get_pendown_state; | |
| - ts->clear_penirq = pdata->clear_penirq; | |
| + ts->clear_penirq = pdata->clear_penirq; | |
| snprintf(ts->phys, sizeof(ts->phys), | |
| "%s/input0", dev_name(&client->dev)); | |
| @@ -313,7 +415,7 @@ | |
| pdata->init_platform_hw(); | |
| err = request_irq(ts->irq, tsc2007_irq, 0, | |
| - client->dev.driver->name, ts); | |
| + client->dev.driver->name, ts); | |
| if (err < 0) { | |
| dev_err(&client->dev, "irq %d busy?\n", ts->irq); | |
| goto err_free_mem; | |
| @@ -330,13 +432,20 @@ | |
| i2c_set_clientdata(client, ts); | |
| +#ifdef CONFIG_HAS_EARLYSUSPEND | |
| + ts->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1; | |
| + ts->early_suspend.suspend = tsc2007_early_suspend; | |
| + ts->early_suspend.resume = tsc2007_late_resume; | |
| + register_early_suspend(&ts->early_suspend); | |
| +#endif | |
| + | |
| return 0; | |
| - err_free_irq: | |
| + err_free_irq: | |
| tsc2007_free_irq(ts); | |
| if (pdata->exit_platform_hw) | |
| pdata->exit_platform_hw(); | |
| - err_free_mem: | |
| + err_free_mem: | |
| input_free_device(input_dev); | |
| kfree(ts); | |
| return err; | |
| @@ -344,7 +453,7 @@ | |
| static int __devexit tsc2007_remove(struct i2c_client *client) | |
| { | |
| - struct tsc2007 *ts = i2c_get_clientdata(client); | |
| + struct tsc2007 *ts = i2c_get_clientdata(client); | |
| struct tsc2007_platform_data *pdata = client->dev.platform_data; | |
| tsc2007_free_irq(ts); | |
| @@ -359,20 +468,24 @@ | |
| } | |
| static const struct i2c_device_id tsc2007_idtable[] = { | |
| - { "tsc2007", 0 }, | |
| - { } | |
| + {"tsc2007", 0}, | |
| + {} | |
| }; | |
| MODULE_DEVICE_TABLE(i2c, tsc2007_idtable); | |
| static struct i2c_driver tsc2007_driver = { | |
| .driver = { | |
| - .owner = THIS_MODULE, | |
| - .name = "tsc2007" | |
| - }, | |
| - .id_table = tsc2007_idtable, | |
| - .probe = tsc2007_probe, | |
| - .remove = __devexit_p(tsc2007_remove), | |
| + .owner = THIS_MODULE, | |
| + .name = "tsc2007"}, | |
| + .id_table = tsc2007_idtable, | |
| + .probe = tsc2007_probe, | |
| + .remove = __devexit_p(tsc2007_remove), | |
| +#ifndef CONFIG_HAS_EARLYSUSPEND | |
| + .suspend = tsc2007_suspend, | |
| + .resume = tsc2007_resume, | |
| +#endif | |
| + | |
| }; | |
| static int __init tsc2007_init(void) | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: tst200_download_luisa.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: TST200_FIRMWARE_LUISA | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: TYE_APP02.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/input/touchscreen: TYE_APP3.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/Kconfig 2018-07-12 10:13:33.000000000 +0700 | |
| @@ -60,6 +60,8 @@ | |
| source "drivers/hwmon/Kconfig" | |
| +source "drivers/haptic/Kconfig" | |
| + | |
| source "drivers/thermal/Kconfig" | |
| source "drivers/watchdog/Kconfig" | |
| @@ -88,6 +90,8 @@ | |
| source "drivers/leds/Kconfig" | |
| +source "drivers/switch/Kconfig" | |
| + | |
| source "drivers/accessibility/Kconfig" | |
| source "drivers/infiniband/Kconfig" | |
| @@ -111,4 +115,6 @@ | |
| source "drivers/staging/Kconfig" | |
| source "drivers/platform/Kconfig" | |
| + | |
| +source "../modules/Kconfig" | |
| endmenu | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/leds/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/leds/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/leds/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/leds/Kconfig 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -254,6 +254,14 @@ | |
| help | |
| This option enables support for regulator driven LEDs. | |
| +config LEDS_BCM59035 | |
| + tristate "LED support for Broadcom BCM59035 PMU" | |
| + depends on LEDS_CLASS && HAVE_PWM | |
| + help | |
| + This option enables support for control of LEDs connected to | |
| + BCM59035 PMU. The LED pattern and pattern-repetition period | |
| + is set through sysfs. | |
| + | |
| config LEDS_BD2802 | |
| tristate "LED driver for BD2802 RGB LED" | |
| depends on I2C | |
| @@ -364,6 +372,12 @@ | |
| This allows LEDs to be initialised in the ON state. | |
| If unsure, say Y. | |
| +config LEDS_TRIGGER_SLEEP | |
| + tristate "LED Sleep Mode Trigger" | |
| + depends on LEDS_TRIGGERS && HAS_EARLYSUSPEND | |
| + help | |
| + This turns LEDs on when the screen is off but the cpu still running. | |
| + | |
| comment "iptables trigger is under Netfilter config (LED target)" | |
| depends on LEDS_TRIGGERS | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/leds: ledtrig-sleep.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/leds/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/leds/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/leds/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/leds/Makefile 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -48,3 +48,5 @@ | |
| obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.o | |
| obj-$(CONFIG_LEDS_TRIGGER_GPIO) += ledtrig-gpio.o | |
| obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o | |
| +obj-$(CONFIG_LEDS_TRIGGER_SLEEP) += ledtrig-sleep.o | |
| +obj-$(CONFIG_LEDS_BCM59035) += leds-bcm59035.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/Makefile 2018-07-12 10:13:33.000000000 +0700 | |
| @@ -68,7 +68,7 @@ | |
| obj-$(CONFIG_USB) += usb/ | |
| obj-$(CONFIG_USB_MUSB_HDRC) += usb/musb/ | |
| obj-$(CONFIG_PCI) += usb/ | |
| -obj-$(CONFIG_USB_GADGET) += usb/gadget/ | |
| +obj-$(CONFIG_USB_GADGET) += usb/gadget_brcm/ | |
| obj-$(CONFIG_SERIO) += input/serio/ | |
| obj-$(CONFIG_GAMEPORT) += input/gameport/ | |
| obj-$(CONFIG_INPUT) += input/ | |
| @@ -79,6 +79,7 @@ | |
| obj-$(CONFIG_W1) += w1/ | |
| obj-$(CONFIG_POWER_SUPPLY) += power/ | |
| obj-$(CONFIG_HWMON) += hwmon/ | |
| +obj-$(CONFIG_HAPTIC) += haptic/ | |
| obj-$(CONFIG_THERMAL) += thermal/ | |
| obj-$(CONFIG_WATCHDOG) += watchdog/ | |
| obj-$(CONFIG_PHONE) += telephony/ | |
| @@ -95,6 +96,7 @@ | |
| obj-$(CONFIG_MMC) += mmc/ | |
| obj-$(CONFIG_MEMSTICK) += memstick/ | |
| obj-$(CONFIG_NEW_LEDS) += leds/ | |
| +obj-$(CONFIG_SWITCH) += switch/ | |
| obj-$(CONFIG_INFINIBAND) += infiniband/ | |
| obj-$(CONFIG_SGI_SN) += sn/ | |
| obj-y += firmware/ | |
| Only in /path/to/linux-2.6.35.7/drivers/md: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/media/IR/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/media/IR/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/media/IR/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/media/IR/Kconfig 2018-07-12 10:13:37.000000000 +0700 | |
| @@ -1,5 +1,5 @@ | |
| config IR_CORE | |
| - tristate | |
| + tristate "Core IR support" | |
| depends on INPUT | |
| default INPUT | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mfd/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mfd/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/mfd/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mfd/Kconfig 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -51,6 +51,22 @@ | |
| This driver supports the ASIC3 multifunction chip found on many | |
| PDAs (mainly iPAQ and HTC based ones) | |
| +config MFD_BCM59035 | |
| + tristate "Support for Broadcom BCM59035 PMU chip" | |
| + select MFD_CORE | |
| + depends on I2C | |
| + help | |
| + If you say yes here you will get support for Broadcom BCM59035 PMU chip. | |
| + This includes voltage regulators, RTC, DVS,GPIO,battery charging etc | |
| + | |
| +config MFD_BCM59038 | |
| + tristate "Support for Broadcom BCM59038 PMU chip" | |
| + select MFD_CORE | |
| + depends on I2C && ARCH_BCM215XX | |
| + help | |
| + If you say yes here you will get support for Broadcom BCM59038 PMU chip. | |
| + This includes voltage regulators, RTC, DVS,GPIO,battery charging etc | |
| + | |
| config MFD_SH_MOBILE_SDHI | |
| bool "Support for SuperH Mobile SDHI" | |
| depends on SUPERH || ARCH_SHMOBILE | |
| @@ -64,6 +80,20 @@ | |
| tristate | |
| select MFD_CORE | |
| +config MFD_MAX8986 | |
| + tristate "Support for Maxim MAX8986 PMU chip" | |
| + depends on I2C && ARCH_BCM215XX | |
| + select MFD_CORE | |
| + ---help--- | |
| + If you say yes here you will get support for Maxim Max8986 PMU chip. | |
| + This includes voltage regulators, RTC, DVS,GPIO,battery charging etc | |
| + | |
| +config MAX8986_WORKAROUND | |
| + bool "Support for i2c algo workaround" | |
| + depends on MFD_MAX8986 | |
| + ---help--- | |
| + If you say yes here i2c algo used will change as required by Max8986 chip. | |
| + | |
| config MFD_DM355EVM_MSP | |
| bool "DaVinci DM355 EVM microcontroller" | |
| depends on I2C && MACH_DAVINCI_DM355_EVM | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mfd/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mfd/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/mfd/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mfd/Makefile 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -64,6 +64,8 @@ | |
| obj-$(CONFIG_ABX500_CORE) += abx500-core.o | |
| obj-$(CONFIG_AB3100_CORE) += ab3100-core.o | |
| obj-$(CONFIG_AB3100_OTP) += ab3100-otp.o | |
| +obj-$(CONFIG_MFD_BCM59035) += bcm59035-core.o | |
| +obj-$(CONFIG_MFD_BCM59038) += bcm59038-core.o | |
| obj-$(CONFIG_AB3550_CORE) += ab3550-core.o | |
| obj-$(CONFIG_AB8500_CORE) += ab8500-core.o ab8500-spi.o | |
| obj-$(CONFIG_MFD_TIMBERDALE) += timberdale.o | |
| @@ -71,3 +73,4 @@ | |
| obj-$(CONFIG_LPC_SCH) += lpc_sch.o | |
| obj-$(CONFIG_MFD_RDC321X) += rdc321x-southbridge.o | |
| obj-$(CONFIG_MFD_JANZ_CMODIO) += janz-cmodio.o | |
| +obj-$(CONFIG_MFD_MAX8986) += max8986-core.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mfd: max8986-core.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: akm8975.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: apanic.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: bcm_reset_utils.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: bma222.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: bma222_driver.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: ckblock_reader.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: cp_crash.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: gp2a_prox.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: iface_stat.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/misc/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/misc/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc/Kconfig 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -53,6 +53,10 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called ad525x_dpot-spi. | |
| +config ANDROID_PMEM | |
| + bool "Android pmem allocator" | |
| + default y | |
| + | |
| config ATMEL_PWM | |
| tristate "Atmel AT32/AT91 PWM support" | |
| depends on AVR32 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9 | |
| @@ -199,6 +203,13 @@ | |
| driver (SCSI/ATA) which supports enclosures | |
| or a SCSI enclosure device (SES) to use these services. | |
| +config KERNEL_DEBUGGER_CORE | |
| + bool "Kernel Debugger Core" | |
| + default n | |
| + ---help--- | |
| + Generic kernel debugging command processor used by low level | |
| + (interrupt context) platform-specific debuggers. | |
| + | |
| config SGI_XP | |
| tristate "Support communication between SGI SSIs" | |
| depends on NET | |
| @@ -304,6 +315,14 @@ | |
| This driver can also be built as a module. If so, the module | |
| will be called tsl2550. | |
| +config SENSORS_AK8975 | |
| + tristate "AK8975 compass support" | |
| + default n | |
| + depends on I2C | |
| + help | |
| + If you say yes here you get support for Asahi Kasei's | |
| + orientation sensor AK8975. | |
| + | |
| config EP93XX_PWM | |
| tristate "EP93xx PWM support" | |
| depends on ARCH_EP93XX | |
| @@ -337,6 +356,14 @@ | |
| This driver can also be built as a module. If so, the module | |
| will be calles ti_dac7512. | |
| +config UID_STAT | |
| + bool "UID based statistics tracking exported to /proc/uid_stat" | |
| + default n | |
| + | |
| +config IFACE_STAT | |
| + bool "Persistent interface statistics tracking exported to /proc/iface_stat" | |
| + default n | |
| + | |
| config VMWARE_BALLOON | |
| tristate "VMware Balloon Driver" | |
| depends on X86 | |
| @@ -353,6 +380,170 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called vmware_balloon. | |
| +config WL127X_RFKILL | |
| + tristate "Bluetooth power control driver for TI wl127x" | |
| + depends on RFKILL | |
| + default n | |
| + ---help--- | |
| + Creates an rfkill entry in sysfs for power control of Bluetooth | |
| + TI wl127x chips. | |
| + | |
| +config APANIC | |
| + bool "Android kernel panic diagnostics driver" | |
| + default n | |
| + ---help--- | |
| + Driver which handles kernel panics and attempts to write | |
| + critical debugging data to flash. | |
| + | |
| +config APANIC_PLABEL | |
| + string "Android panic dump flash partition label" | |
| + depends on APANIC | |
| + default "kpanic" | |
| + ---help--- | |
| + If your platform uses a different flash partition label for storing | |
| + crashdumps, enter it here. | |
| + | |
| +config MISC_FRESET | |
| + bool "Factory Reset support" | |
| + default y | |
| + ---help--- | |
| + Support for Factory Reset | |
| + | |
| +config BRCM_CKBLOCK_READER | |
| + bool "Broadcom SIM Lock Data Block Reader" | |
| + depends on MTD | |
| + help | |
| + This option enables CK Block Reader driver. | |
| + CK Block Reader exports the API that is used | |
| + by KRIL to read the CK data block | |
| + | |
| +config BRCM_CKBLOCK_NAME | |
| + string "Name of the MTD Partition in which CK Block is stored" | |
| + depends on BRCM_CKBLOCK_READER | |
| + default "ckdatablock" | |
| + ---help--- | |
| + If the platform uses a differnt partition name for storing the | |
| + CK Data block, enter the name here. | |
| + | |
| +config SENSORS_TOTORO | |
| + tristate "Sensor support For Totoro(GT-S5360) Project" | |
| + depends on I2C | |
| + default n | |
| + help | |
| + If you say yes here you get support for Totoro(GT-S5360)'s sensors. | |
| + | |
| +config SENSORS_LUISA | |
| + tristate "Sensor support For Luisa(GT-B5510) Project" | |
| + depends on I2C | |
| + default n | |
| + help | |
| + If you say yes here you get support for Luisa(GT-B5510)'s sensors. | |
| + | |
| +config SENSORS_TASSVE | |
| + tristate "Sensor support For TassVE(GT-S5570i) Project" | |
| + depends on I2C | |
| + default n | |
| + help | |
| + If you say yes here you get support for TassVE(GT-S5570i)'s sensors. | |
| + | |
| +config SENSORS_COOPERVE | |
| + tristate "Sensor support For CooperVE(GT-S5830i) Project" | |
| + depends on I2C | |
| + default n | |
| + help | |
| + If you say yes here you get support for CooperVE(GT-S5830i)'s sensors. | |
| + | |
| +config SENSORS_BMA222 | |
| + tristate "BMA acceleration sensor support" | |
| + depends on I2C | |
| + default n | |
| + help | |
| + If you say yes here you get support for Bosch Sensortec's | |
| + acceleration sensors BMA. | |
| + | |
| +config SENSORS_GP2A | |
| + tristate "GP2A sensor support" | |
| + depends on I2C | |
| + default n | |
| + help | |
| + If you say yes here you get support for Sharp's sensor GP2A. | |
| + | |
| +config SENSORS_TAOS | |
| + tristate "TAOS sensor support" | |
| + depends on I2C | |
| + default n | |
| + help | |
| + If you say yes here you get support for sensor TAOS. | |
| + | |
| +config SENSORS_MMC328X | |
| + tristate "MEMSIC Magnetic Sensor MMC328X Driver Support" | |
| + depends on I2C | |
| + default n | |
| + help | |
| + If you say yes here you get support for the MEMSIC magnateic sensor | |
| + | |
| +config INPUT_YAS_MAGNETOMETER | |
| + tristate "YAS Geomagnetic Sensor" | |
| + depends on I2C | |
| + | |
| +config INPUT_YAS_MAGNETOMETER_POSITION | |
| + int "YAS Geomagnetic Sensor Mounting Position on Board" | |
| + depends on INPUT_YAS_MAGNETOMETER | |
| + default "0" | |
| + help | |
| + Chip mounting position (pin 1). | |
| + 0: top, upper-left | |
| + 1: top, upper-right | |
| + 2: top, lower-right | |
| + 3: top, lower-left | |
| + 4: bottom, upper-left | |
| + 5: bottom, upper-right | |
| + 6: bottom, lower-right | |
| + 7: bottom, lower-left | |
| + | |
| +config INPUT_YAS_ACCELEROMETER | |
| + tristate "YAS Acceleration Sensor" | |
| + depends on I2C | |
| + | |
| +config INPUT_YAS_ACCELEROMETER_POSITION | |
| + int "YAS Acceleration Sensor Mounting Position on Board" | |
| + depends on INPUT_YAS_ACCELEROMETER | |
| + default "0" | |
| + help | |
| + Chip mounting position (pin 1). | |
| + 0: top, upper-left | |
| + 1: top, upper-right | |
| + 2: top, lower-right | |
| + 3: top, lower-left | |
| + 4: bottom, upper-left | |
| + 5: bottom, upper-right | |
| + 6: bottom, lower-right | |
| + 7: bottom, lower-left | |
| + | |
| +config INPUT_YAS_ORIENTATION | |
| + tristate "YAS Orientation Sensor" | |
| + depends on I2C | |
| + | |
| +config MAX8986_AUDIO | |
| + tristate "MAX8986 audio driver" | |
| + depends on MFD_MAX8986 | |
| + ---help--- | |
| + Y to get the support of MAX8986 audio APIs | |
| + | |
| +config MAX8986_MUIC | |
| + tristate "MAX8986 MUIC driver" | |
| + depends on MFD_MAX8986 | |
| + ---help--- | |
| + Y to enable Max8986 PMU MUIC driver | |
| + | |
| +config BCM59035_PWM | |
| + bool "Broadcom BCM59035 PWM support" | |
| + depends on MFD_BCM59035 | |
| + select HAVE_PWM | |
| + help | |
| + This option enables device driver support for the PWM channels | |
| + on Broadcom BCM59035 PMU chip. | |
| + | |
| source "drivers/misc/c2port/Kconfig" | |
| source "drivers/misc/eeprom/Kconfig" | |
| source "drivers/misc/cb710/Kconfig" | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: kernel_debugger.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/misc/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/misc/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc/Makefile 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -1,6 +1,7 @@ | |
| # | |
| # Makefile for misc devices that really don't fit anywhere else. | |
| # | |
| +EXTRA_CFLAGS += -I ../modules/drivers/char/brcm/fuse_log/ | |
| obj-$(CONFIG_IBM_ASM) += ibmasm/ | |
| obj-$(CONFIG_AD525X_DPOT) += ad525x_dpot.o | |
| @@ -14,8 +15,10 @@ | |
| obj-$(CONFIG_TIFM_CORE) += tifm_core.o | |
| obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o | |
| obj-$(CONFIG_PHANTOM) += phantom.o | |
| +obj-$(CONFIG_ANDROID_PMEM) += pmem.o | |
| obj-$(CONFIG_SGI_IOC4) += ioc4.o | |
| obj-$(CONFIG_ENCLOSURE_SERVICES) += enclosure.o | |
| +obj-$(CONFIG_KERNEL_DEBUGGER_CORE) += kernel_debugger.o | |
| obj-$(CONFIG_KGDB_TESTS) += kgdbts.o | |
| obj-$(CONFIG_SGI_XP) += sgi-xp/ | |
| obj-$(CONFIG_SGI_GRU) += sgi-gru/ | |
| @@ -26,8 +29,27 @@ | |
| obj-$(CONFIG_EP93XX_PWM) += ep93xx_pwm.o | |
| obj-$(CONFIG_DS1682) += ds1682.o | |
| obj-$(CONFIG_TI_DAC7512) += ti_dac7512.o | |
| +obj-$(CONFIG_UID_STAT) += uid_stat.o | |
| +obj-$(CONFIG_IFACE_STAT) += iface_stat.o | |
| obj-$(CONFIG_C2PORT) += c2port/ | |
| obj-$(CONFIG_IWMC3200TOP) += iwmc3200top/ | |
| obj-y += eeprom/ | |
| obj-y += cb710/ | |
| obj-$(CONFIG_VMWARE_BALLOON) += vmware_balloon.o | |
| +obj-$(CONFIG_WL127X_RFKILL) += wl127x-rfkill.o | |
| +obj-$(CONFIG_APANIC) += apanic.o | |
| +obj-y += bcm_reset_utils.o | |
| +obj-$(CONFIG_BRCM_CKBLOCK_READER) += ckblock_reader.o | |
| +obj-$(CONFIG_BRCM_CP_CRASH_DUMP) += cp_crash.o | |
| +obj-$(CONFIG_SENSORS_AK8975) += akm8975.o | |
| +obj-$(CONFIG_SENSORS_BMA222) += bma222_driver.o bma222.o | |
| +obj-$(CONFIG_SENSORS_GP2A) += gp2a_prox.o | |
| +obj-$(CONFIG_SENSORS_TAOS) += taos.o | |
| +obj-$(CONFIG_SENSORS_MMC328X) += mmc328x.o mecs.o | |
| +obj-$(CONFIG_INPUT_YAS_MAGNETOMETER) += yas_mag_kernel_driver.o | |
| +obj-$(CONFIG_INPUT_YAS_ACCELEROMETER) += yas_acc_kernel_driver.o | |
| +obj-$(CONFIG_INPUT_YAS_ORIENTATION) += yas_ori_kernel_driver.o | |
| +obj-$(CONFIG_MAX8986_AUDIO) += max8986-audio.o | |
| +obj-$(CONFIG_BCM59035_PWM) += bcm59035_pwm.o | |
| +obj-$(CONFIG_MAX8986_MUIC) += max8986-muic.o | |
| + | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: max8986-audio.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: max8986-muic.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: mecs.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: mmc328x.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: pmem.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: taos.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: uid_stat.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: wl127x-rfkill.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_acc_driver-bma222.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_acc_driver.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_acc_kernel_driver.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_cfg.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_general_kernel_driver.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_mag_driver.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_mag_driver-yas529.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_mag_driver-yas530.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_mag_kernel_driver.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/misc: yas_ori_kernel_driver.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/card/block.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/card/block.c | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/card/block.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/card/block.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -86,11 +86,7 @@ | |
| mutex_lock(&open_lock); | |
| md->usage--; | |
| if (md->usage == 0) { | |
| - int devmaj = MAJOR(disk_devt(md->disk)); | |
| - int devidx = MINOR(disk_devt(md->disk)) >> MMC_SHIFT; | |
| - | |
| - if (!devmaj) | |
| - devidx = md->disk->first_minor >> MMC_SHIFT; | |
| + int devidx = md->disk->first_minor >> MMC_SHIFT; | |
| blk_cleanup_queue(md->queue.queue); | |
| @@ -242,6 +238,33 @@ | |
| return cmd.resp[0]; | |
| } | |
| +static int | |
| +mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card) | |
| +{ | |
| + struct mmc_command cmd; | |
| + int err; | |
| + | |
| + /* Block-addressed cards ignore MMC_SET_BLOCKLEN. */ | |
| + if (mmc_card_blockaddr(card)) | |
| + return 0; | |
| + | |
| + mmc_claim_host(card->host); | |
| + cmd.opcode = MMC_SET_BLOCKLEN; | |
| + cmd.arg = 512; | |
| + cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC; | |
| + err = mmc_wait_for_cmd(card->host, &cmd, 5); | |
| + mmc_release_host(card->host); | |
| + | |
| + if (err) { | |
| + printk(KERN_ERR "%s: unable to set block size to %d: %d\n", | |
| + md->disk->disk_name, cmd.arg, err); | |
| + return -EINVAL; | |
| + } | |
| + | |
| + return 0; | |
| +} | |
| + | |
| + | |
| static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |
| { | |
| struct mmc_blk_data *md = mq->data; | |
| @@ -249,6 +272,13 @@ | |
| struct mmc_blk_request brq; | |
| int ret = 1, disable_multi = 0; | |
| +#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME | |
| + if (mmc_bus_needs_resume(card->host)) { | |
| + mmc_resume_bus(card->host); | |
| + mmc_blk_set_blksize(md, card); | |
| + } | |
| +#endif | |
| + | |
| mmc_claim_host(card->host); | |
| do { | |
| @@ -352,6 +382,8 @@ | |
| continue; | |
| } | |
| status = get_card_status(card, req); | |
| + } else if (disable_multi == 1) { | |
| + disable_multi = 0; | |
| } | |
| if (brq.cmd.error) { | |
| @@ -522,6 +554,7 @@ | |
| md->disk->private_data = md; | |
| md->disk->queue = md->queue.queue; | |
| md->disk->driverfs_dev = &card->dev; | |
| + md->disk->flags = GENHD_FL_EXT_DEVT; | |
| /* | |
| * As discussed on lkml, GENHD_FL_REMOVABLE should: | |
| @@ -563,32 +596,6 @@ | |
| return ERR_PTR(ret); | |
| } | |
| -static int | |
| -mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card) | |
| -{ | |
| - struct mmc_command cmd; | |
| - int err; | |
| - | |
| - /* Block-addressed cards ignore MMC_SET_BLOCKLEN. */ | |
| - if (mmc_card_blockaddr(card)) | |
| - return 0; | |
| - | |
| - mmc_claim_host(card->host); | |
| - cmd.opcode = MMC_SET_BLOCKLEN; | |
| - cmd.arg = 512; | |
| - cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC; | |
| - err = mmc_wait_for_cmd(card->host, &cmd, 5); | |
| - mmc_release_host(card->host); | |
| - | |
| - if (err) { | |
| - printk(KERN_ERR "%s: unable to set block size to %d: %d\n", | |
| - md->disk->disk_name, cmd.arg, err); | |
| - return -EINVAL; | |
| - } | |
| - | |
| - return 0; | |
| -} | |
| - | |
| static int mmc_blk_probe(struct mmc_card *card) | |
| { | |
| struct mmc_blk_data *md; | |
| @@ -617,6 +624,9 @@ | |
| cap_str, md->read_only ? "(ro)" : ""); | |
| mmc_set_drvdata(card, md); | |
| +#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME | |
| + mmc_set_bus_resume_policy(card->host, 1); | |
| +#endif | |
| add_disk(md->disk); | |
| return 0; | |
| @@ -641,6 +651,9 @@ | |
| mmc_blk_put(md); | |
| } | |
| mmc_set_drvdata(card, NULL); | |
| +#ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME | |
| + mmc_set_bus_resume_policy(card->host, 0); | |
| +#endif | |
| } | |
| #ifdef CONFIG_PM | |
| @@ -659,7 +672,9 @@ | |
| struct mmc_blk_data *md = mmc_get_drvdata(card); | |
| if (md) { | |
| +#ifndef CONFIG_MMC_BLOCK_DEFERRED_RESUME | |
| mmc_blk_set_blksize(md, card); | |
| +#endif | |
| mmc_queue_resume(&md->queue); | |
| } | |
| return 0; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/card/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/card/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/card/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/card/Kconfig 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -32,6 +32,15 @@ | |
| If unsure, say Y here. | |
| +config MMC_BLOCK_DEFERRED_RESUME | |
| + bool "Deferr MMC layer resume until I/O is requested" | |
| + depends on MMC_BLOCK | |
| + default n | |
| + help | |
| + Say Y here to enable deferred MMC resume until I/O | |
| + is requested. This will reduce overall resume latency and | |
| + save power when theres an SD card inserted but not being used. | |
| + | |
| config SDIO_UART | |
| tristate "SDIO UART/GPS class support" | |
| help | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/core/core.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/core.c | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/core/core.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/core.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -22,6 +22,7 @@ | |
| #include <linux/scatterlist.h> | |
| #include <linux/log2.h> | |
| #include <linux/regulator/consumer.h> | |
| +#include <linux/wakelock.h> | |
| #include <linux/mmc/card.h> | |
| #include <linux/mmc/host.h> | |
| @@ -38,6 +39,7 @@ | |
| #include "sdio_ops.h" | |
| static struct workqueue_struct *workqueue; | |
| +static struct wake_lock mmc_delayed_work_wake_lock; | |
| /* | |
| * Enabling software CRCs on the data blocks can be a significant (30%) | |
| @@ -69,6 +71,7 @@ | |
| static int mmc_schedule_delayed_work(struct delayed_work *work, | |
| unsigned long delay) | |
| { | |
| + wake_lock(&mmc_delayed_work_wake_lock); | |
| return queue_delayed_work(workqueue, work, delay); | |
| } | |
| @@ -545,9 +548,12 @@ | |
| /* If the host is claimed then we do not want to disable it anymore */ | |
| if (!mmc_try_claim_host(host)) | |
| - return; | |
| + goto out; | |
| mmc_host_do_disable(host, 1); | |
| mmc_do_release_host(host); | |
| + | |
| +out: | |
| + wake_unlock(&mmc_delayed_work_wake_lock); | |
| } | |
| /** | |
| @@ -907,12 +913,7 @@ | |
| */ | |
| mmc_delay(10); | |
| - if (host->f_min > 400000) { | |
| - pr_warning("%s: Minimum clock frequency too high for " | |
| - "identification mode\n", mmc_hostname(host)); | |
| - host->ios.clock = host->f_min; | |
| - } else | |
| - host->ios.clock = 400000; | |
| + host->ios.clock = host->f_min; | |
| host->ios.power_mode = MMC_POWER_ON; | |
| mmc_set_ios(host); | |
| @@ -924,6 +925,14 @@ | |
| mmc_delay(10); | |
| } | |
| +void mmc_power_up_brcm(struct mmc_host *host) | |
| +{ | |
| + pr_info("%s\n",__func__); | |
| + mmc_power_up(host); | |
| +} | |
| + | |
| +EXPORT_SYMBOL(mmc_power_up_brcm); | |
| + | |
| static void mmc_power_off(struct mmc_host *host) | |
| { | |
| host->ios.clock = 0; | |
| @@ -938,6 +947,15 @@ | |
| mmc_set_ios(host); | |
| } | |
| +void mmc_power_off_brcm(struct mmc_host *host) | |
| +{ | |
| + pr_info("%s\n",__func__); | |
| + mmc_power_off(host); | |
| +} | |
| + | |
| +EXPORT_SYMBOL(mmc_power_off_brcm); | |
| + | |
| + | |
| /* | |
| * Cleanup when the last reference to the bus operator is dropped. | |
| */ | |
| @@ -977,6 +995,36 @@ | |
| spin_unlock_irqrestore(&host->lock, flags); | |
| } | |
| +int mmc_resume_bus(struct mmc_host *host) | |
| +{ | |
| + unsigned long flags; | |
| + | |
| + if (!mmc_bus_needs_resume(host)) | |
| + return -EINVAL; | |
| + | |
| + printk("%s: Starting deferred resume\n", mmc_hostname(host)); | |
| + spin_lock_irqsave(&host->lock, flags); | |
| + host->bus_resume_flags &= ~MMC_BUSRESUME_NEEDS_RESUME; | |
| + host->rescan_disable = 0; | |
| + spin_unlock_irqrestore(&host->lock, flags); | |
| + | |
| + mmc_bus_get(host); | |
| + if (host->bus_ops && !host->bus_dead) { | |
| + mmc_power_up(host); | |
| + BUG_ON(!host->bus_ops->resume); | |
| + host->bus_ops->resume(host); | |
| + } | |
| + | |
| + if (host->bus_ops->detect && !host->bus_dead) | |
| + host->bus_ops->detect(host); | |
| + | |
| + mmc_bus_put(host); | |
| + printk("%s: Deferred resume completed\n", mmc_hostname(host)); | |
| + return 0; | |
| +} | |
| + | |
| +EXPORT_SYMBOL(mmc_resume_bus); | |
| + | |
| /* | |
| * Assign a mmc bus handler to a host. Only one bus handler may control a | |
| * host at any given time. | |
| @@ -1056,9 +1104,11 @@ | |
| struct mmc_host *host = | |
| container_of(work, struct mmc_host, detect.work); | |
| u32 ocr; | |
| - int err; | |
| + int err=0; | |
| unsigned long flags; | |
| + int extend_wakelock = 0; | |
| + printk("%s: %s start\n", mmc_hostname(host), __func__); | |
| spin_lock_irqsave(&host->lock, flags); | |
| if (host->rescan_disable) { | |
| @@ -1075,6 +1125,12 @@ | |
| if ((host->bus_ops != NULL) && host->bus_ops->detect && !host->bus_dead) | |
| host->bus_ops->detect(host); | |
| + /* If the card was removed the bus will be marked | |
| + * as dead - extend the wakelock so userspace | |
| + * can respond */ | |
| + if (host->bus_dead) | |
| + extend_wakelock = 1; | |
| + | |
| mmc_bus_put(host); | |
| @@ -1112,6 +1168,7 @@ | |
| if (!err) { | |
| if (mmc_attach_sdio(host, ocr)) | |
| mmc_power_off(host); | |
| + extend_wakelock = 1; | |
| goto out; | |
| } | |
| @@ -1122,6 +1179,7 @@ | |
| if (!err) { | |
| if (mmc_attach_sd(host, ocr)) | |
| mmc_power_off(host); | |
| + extend_wakelock = 1; | |
| goto out; | |
| } | |
| @@ -1132,6 +1190,7 @@ | |
| if (!err) { | |
| if (mmc_attach_mmc(host, ocr)) | |
| mmc_power_off(host); | |
| + extend_wakelock = 1; | |
| goto out; | |
| } | |
| @@ -1139,8 +1198,17 @@ | |
| mmc_power_off(host); | |
| out: | |
| + printk("%s: %s rescann is out\n", mmc_hostname(host), __func__); | |
| + if (extend_wakelock) | |
| + wake_lock_timeout(&mmc_delayed_work_wake_lock, HZ / 2); | |
| + else | |
| + wake_unlock(&mmc_delayed_work_wake_lock); | |
| + | |
| if (host->caps & MMC_CAP_NEEDS_POLL) | |
| + { | |
| + printk("%s : schedule host->detect(mmc_sd_detect)\n",__func__); | |
| mmc_schedule_delayed_work(&host->detect, HZ); | |
| + } | |
| } | |
| void mmc_start_host(struct mmc_host *host) | |
| @@ -1268,6 +1336,9 @@ | |
| { | |
| int err = 0; | |
| + if (mmc_bus_needs_resume(host)) | |
| + return 0; | |
| + | |
| if (host->caps & MMC_CAP_DISABLE) | |
| cancel_delayed_work(&host->disable); | |
| cancel_delayed_work(&host->detect); | |
| @@ -1297,6 +1368,12 @@ | |
| int err = 0; | |
| mmc_bus_get(host); | |
| + if (mmc_bus_manual_resume(host)) { | |
| + host->bus_resume_flags |= MMC_BUSRESUME_NEEDS_RESUME; | |
| + mmc_bus_put(host); | |
| + return 0; | |
| + } | |
| + | |
| if (host->bus_ops && !host->bus_dead) { | |
| if (!(host->pm_flags & MMC_PM_KEEP_POWER)) { | |
| mmc_power_up(host); | |
| @@ -1334,6 +1411,10 @@ | |
| case PM_SUSPEND_PREPARE: | |
| spin_lock_irqsave(&host->lock, flags); | |
| + if (mmc_bus_needs_resume(host)) { | |
| + spin_unlock_irqrestore(&host->lock, flags); | |
| + break; | |
| + } | |
| host->rescan_disable = 1; | |
| spin_unlock_irqrestore(&host->lock, flags); | |
| cancel_delayed_work_sync(&host->detect); | |
| @@ -1355,8 +1436,13 @@ | |
| case PM_POST_HIBERNATION: | |
| spin_lock_irqsave(&host->lock, flags); | |
| + if (mmc_bus_manual_resume(host)) { | |
| + spin_unlock_irqrestore(&host->lock, flags); | |
| + break; | |
| + } | |
| host->rescan_disable = 0; | |
| spin_unlock_irqrestore(&host->lock, flags); | |
| + if (!host->card || host->card->type != MMC_TYPE_SDIO) | |
| mmc_detect_change(host, 0); | |
| } | |
| @@ -1365,10 +1451,28 @@ | |
| } | |
| #endif | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| +void mmc_set_embedded_sdio_data(struct mmc_host *host, | |
| + struct sdio_cis *cis, | |
| + struct sdio_cccr *cccr, | |
| + struct sdio_embedded_func *funcs, | |
| + int num_funcs) | |
| +{ | |
| + host->embedded_sdio_data.cis = cis; | |
| + host->embedded_sdio_data.cccr = cccr; | |
| + host->embedded_sdio_data.funcs = funcs; | |
| + host->embedded_sdio_data.num_funcs = num_funcs; | |
| +} | |
| + | |
| +EXPORT_SYMBOL(mmc_set_embedded_sdio_data); | |
| +#endif | |
| + | |
| static int __init mmc_init(void) | |
| { | |
| int ret; | |
| + wake_lock_init(&mmc_delayed_work_wake_lock, WAKE_LOCK_SUSPEND, "mmc_delayed_work"); | |
| + | |
| workqueue = create_singlethread_workqueue("kmmcd"); | |
| if (!workqueue) | |
| return -ENOMEM; | |
| @@ -1403,6 +1507,7 @@ | |
| mmc_unregister_host_class(); | |
| mmc_unregister_bus(); | |
| destroy_workqueue(workqueue); | |
| + wake_lock_destroy(&mmc_delayed_work_wake_lock); | |
| } | |
| subsys_initcall(mmc_init); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/core/host.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/host.c | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/core/host.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/host.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -137,7 +137,8 @@ | |
| #endif | |
| mmc_start_host(host); | |
| - register_pm_notifier(&host->pm_notify); | |
| + if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY)) | |
| + register_pm_notifier(&host->pm_notify); | |
| return 0; | |
| } | |
| @@ -154,7 +155,9 @@ | |
| */ | |
| void mmc_remove_host(struct mmc_host *host) | |
| { | |
| - unregister_pm_notifier(&host->pm_notify); | |
| + if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY)) | |
| + unregister_pm_notifier(&host->pm_notify); | |
| + | |
| mmc_stop_host(host); | |
| #ifdef CONFIG_DEBUG_FS | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/core/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/core/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/Kconfig 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -16,3 +16,20 @@ | |
| This option sets a default which can be overridden by the | |
| module parameter "removable=0" or "removable=1". | |
| + | |
| +config MMC_EMBEDDED_SDIO | |
| + boolean "MMC embedded SDIO device support (EXPERIMENTAL)" | |
| + depends on EXPERIMENTAL | |
| + help | |
| + If you say Y here, support will be added for embedded SDIO | |
| + devices which do not contain the necessary enumeration | |
| + support in hardware to be properly detected. | |
| + | |
| +config MMC_PARANOID_SD_INIT | |
| + bool "Enable paranoid SD card initialization (EXPERIMENTAL)" | |
| + depends on EXPERIMENTAL | |
| + help | |
| + If you say Y here, the MMC layer will be extra paranoid | |
| + about re-trying SD init requests. This can be a useful | |
| + work-around for buggy controllers and hardware. Enable | |
| + if you are experiencing issues with SD detection. | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/core/mmc.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/mmc.c | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/core/mmc.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/mmc.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -114,17 +114,18 @@ | |
| static int mmc_decode_csd(struct mmc_card *card) | |
| { | |
| struct mmc_csd *csd = &card->csd; | |
| - unsigned int e, m, csd_struct; | |
| + unsigned int e, m; | |
| u32 *resp = card->raw_csd; | |
| /* | |
| * We only understand CSD structure v1.1 and v1.2. | |
| * v1.2 has extra information in bits 15, 11 and 10. | |
| + * We also support eMMC v4.4 & v4.41. | |
| */ | |
| - csd_struct = UNSTUFF_BITS(resp, 126, 2); | |
| - if (csd_struct != 1 && csd_struct != 2) { | |
| + csd->structure = UNSTUFF_BITS(resp, 126, 2); | |
| + if (csd->structure == 0) { | |
| printk(KERN_ERR "%s: unrecognised CSD structure version %d\n", | |
| - mmc_hostname(card->host), csd_struct); | |
| + mmc_hostname(card->host), csd->structure); | |
| return -EINVAL; | |
| } | |
| @@ -207,11 +208,22 @@ | |
| goto out; | |
| } | |
| + /* Version is coded in the CSD_STRUCTURE byte in the EXT_CSD register */ | |
| + if (card->csd.structure == 3) { | |
| + int ext_csd_struct = ext_csd[EXT_CSD_STRUCTURE]; | |
| + if (ext_csd_struct > 2) { | |
| + printk(KERN_ERR "%s: unrecognised EXT_CSD structure " | |
| + "version %d\n", mmc_hostname(card->host), | |
| + ext_csd_struct); | |
| + err = -EINVAL; | |
| + goto out; | |
| + } | |
| + } | |
| + | |
| card->ext_csd.rev = ext_csd[EXT_CSD_REV]; | |
| if (card->ext_csd.rev > 5) { | |
| - printk(KERN_ERR "%s: unrecognised EXT_CSD structure " | |
| - "version %d\n", mmc_hostname(card->host), | |
| - card->ext_csd.rev); | |
| + printk(KERN_ERR "%s: unrecognised EXT_CSD revision %d\n", | |
| + mmc_hostname(card->host), card->ext_csd.rev); | |
| err = -EINVAL; | |
| goto out; | |
| } | |
| @@ -222,8 +234,13 @@ | |
| ext_csd[EXT_CSD_SEC_CNT + 1] << 8 | | |
| ext_csd[EXT_CSD_SEC_CNT + 2] << 16 | | |
| ext_csd[EXT_CSD_SEC_CNT + 3] << 24; | |
| - if (card->ext_csd.sectors) | |
| + if (card->ext_csd.sectors) { | |
| + unsigned boot_sectors; | |
| + /* size is in 256K chunks, i.e. 512 sectors each */ | |
| + boot_sectors = ext_csd[EXT_CSD_BOOT_SIZE_MULTI] * 512; | |
| + card->ext_csd.sectors -= boot_sectors; | |
| mmc_card_set_blockaddr(card); | |
| + } | |
| } | |
| switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) { | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/core/sd.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/sd.c | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/core/sd.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/sd.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -17,6 +17,10 @@ | |
| #include <linux/mmc/card.h> | |
| #include <linux/mmc/mmc.h> | |
| #include <linux/mmc/sd.h> | |
| +#include <linux/mmc/core.h> | |
| +#include <mach/sdio.h> | |
| +#include "../host/bcmsdhc.h" | |
| + | |
| #include "core.h" | |
| #include "bus.h" | |
| @@ -337,7 +341,9 @@ | |
| int err; | |
| u32 cid[4]; | |
| unsigned int max_dtr; | |
| - | |
| +#ifdef CONFIG_MMC_PARANOID_SD_INIT | |
| + int retries; | |
| +#endif | |
| BUG_ON(!host); | |
| WARN_ON(!host->claimed); | |
| @@ -347,7 +353,11 @@ | |
| * state. We wait 1ms to give cards time to | |
| * respond. | |
| */ | |
| - mmc_go_idle(host); | |
| + printk("%s : Card go to idle state\n",__func__); | |
| + err = mmc_go_idle(host); | |
| + | |
| + if(err) | |
| + printk("%s:fail to send CMD0 to go idle\n",__func__); | |
| /* | |
| * If SD_SEND_IF_COND indicates an SD 2.0 | |
| @@ -359,10 +369,13 @@ | |
| if (!err) | |
| ocr |= 1 << 30; | |
| + printk("%s : send ACMD41\n",__func__); | |
| err = mmc_send_app_op_cond(host, ocr, NULL); | |
| if (err) | |
| + { | |
| + printk("%s : fail to send ACMD41\n",__func__); | |
| goto err; | |
| - | |
| + } | |
| /* | |
| * Fetch CID from card. | |
| */ | |
| @@ -371,11 +384,15 @@ | |
| else | |
| err = mmc_all_send_cid(host, cid); | |
| if (err) | |
| + { | |
| + printk("%s : fail to send CMD2\n",__func__); | |
| goto err; | |
| + } | |
| if (oldcard) { | |
| if (memcmp(cid, oldcard->raw_cid, sizeof(cid)) != 0) { | |
| err = -ENOENT; | |
| + printk("%s : fail to memcpy\n",__func__); | |
| goto err; | |
| } | |
| @@ -440,11 +457,29 @@ | |
| err = mmc_decode_scr(card); | |
| if (err < 0) | |
| goto free_card; | |
| - | |
| /* | |
| * Fetch switch information from card. | |
| */ | |
| +#ifdef CONFIG_MMC_PARANOID_SD_INIT | |
| + for (retries = 1; retries <= 3; retries++) { | |
| + err = mmc_read_switch(card); | |
| + if (!err) { | |
| + if (retries > 1) { | |
| + printk(KERN_WARNING | |
| + "%s: recovered\n", | |
| + mmc_hostname(host)); | |
| + } | |
| + break; | |
| + } else { | |
| + printk(KERN_WARNING | |
| + "%s: read switch failed (attempt %d)\n", | |
| + mmc_hostname(host), retries); | |
| + } | |
| + } | |
| +#else | |
| err = mmc_read_switch(card); | |
| +#endif | |
| + | |
| if (err) | |
| goto free_card; | |
| } | |
| @@ -539,18 +574,36 @@ | |
| */ | |
| static void mmc_sd_detect(struct mmc_host *host) | |
| { | |
| - int err; | |
| + int err = 0; | |
| +#ifdef CONFIG_MMC_PARANOID_SD_INIT | |
| + int retries = 5; | |
| +#endif | |
| BUG_ON(!host); | |
| BUG_ON(!host->card); | |
| - | |
| + | |
| mmc_claim_host(host); | |
| /* | |
| * Just check if our card has been removed. | |
| */ | |
| +#ifdef CONFIG_MMC_PARANOID_SD_INIT | |
| + while(retries) { | |
| + err = mmc_send_status(host->card, NULL); | |
| + if (err) { | |
| + retries--; | |
| + udelay(5); | |
| + continue; | |
| + } | |
| + break; | |
| + } | |
| + if (!retries) { | |
| + printk(KERN_ERR "%s(%s): Unable to re-detect card (%d)\n", | |
| + __func__, mmc_hostname(host), err); | |
| + } | |
| +#else | |
| err = mmc_send_status(host->card, NULL); | |
| - | |
| +#endif | |
| mmc_release_host(host); | |
| if (err) { | |
| @@ -588,12 +641,40 @@ | |
| static int mmc_sd_resume(struct mmc_host *host) | |
| { | |
| int err; | |
| + struct bcmsdhc_host *bcm_host; | |
| +#ifdef CONFIG_MMC_PARANOID_SD_INIT | |
| + int retries; | |
| +#endif | |
| BUG_ON(!host); | |
| BUG_ON(!host->card); | |
| + bcm_host = mmc_priv(host); | |
| + | |
| mmc_claim_host(host); | |
| +#ifdef CONFIG_MMC_PARANOID_SD_INIT | |
| + retries = 5; | |
| + while (retries) { | |
| + err = mmc_sd_init_card(host, host->ocr, host->card); | |
| + | |
| + if (err) { | |
| + printk(KERN_ERR "%s: Re-init card rc = %d (retries = %d)\n", | |
| + mmc_hostname(host), err, retries); | |
| + mdelay(5); | |
| + retries--; | |
| + if(bcm_host->bcm_plat->flags&SDHC_DEVTYPE_SD){ | |
| + //force to power-off/on | |
| + mmc_power_off_brcm(host); | |
| + mdelay(1); | |
| + mmc_power_up_brcm(host); | |
| + } | |
| + continue; | |
| + } | |
| + break; | |
| + } | |
| +#else | |
| err = mmc_sd_init_card(host, host->ocr, host->card); | |
| +#endif | |
| mmc_release_host(host); | |
| return err; | |
| @@ -640,6 +721,9 @@ | |
| int mmc_attach_sd(struct mmc_host *host, u32 ocr) | |
| { | |
| int err; | |
| +#ifdef CONFIG_MMC_PARANOID_SD_INIT | |
| + int retries; | |
| +#endif | |
| BUG_ON(!host); | |
| WARN_ON(!host->claimed); | |
| @@ -688,9 +772,27 @@ | |
| /* | |
| * Detect and init the card. | |
| */ | |
| +#ifdef CONFIG_MMC_PARANOID_SD_INIT | |
| + retries = 5; | |
| + while (retries) { | |
| + err = mmc_sd_init_card(host, host->ocr, NULL); | |
| + if (err) { | |
| + retries--; | |
| + continue; | |
| + } | |
| + break; | |
| + } | |
| + | |
| + if (!retries) { | |
| + printk(KERN_ERR "%s: mmc_sd_init_card() failure (err = %d)\n", | |
| + mmc_hostname(host), err); | |
| + goto err; | |
| + } | |
| +#else | |
| err = mmc_sd_init_card(host, host->ocr, NULL); | |
| if (err) | |
| goto err; | |
| +#endif | |
| mmc_release_host(host); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/core/sdio_bus.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/sdio_bus.c | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/core/sdio_bus.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/sdio_bus.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -21,6 +21,10 @@ | |
| #include "sdio_cis.h" | |
| #include "sdio_bus.h" | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| +#include <linux/mmc/host.h> | |
| +#endif | |
| + | |
| /* show configuration fields */ | |
| #define sdio_config_attr(field, format_string) \ | |
| static ssize_t \ | |
| @@ -200,7 +204,14 @@ | |
| { | |
| struct sdio_func *func = dev_to_sdio_func(dev); | |
| - sdio_free_func_cis(func); | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + /* | |
| + * If this device is embedded then we never allocated | |
| + * cis tables for this func | |
| + */ | |
| + if (!func->card->host->embedded_sdio_data.funcs) | |
| +#endif | |
| + sdio_free_func_cis(func); | |
| if (func->info) | |
| kfree(func->info); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/core/sdio.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/sdio.c | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/core/sdio.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/sdio.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -24,6 +24,10 @@ | |
| #include "sdio_ops.h" | |
| #include "sdio_cis.h" | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| +#include <linux/mmc/sdio_ids.h> | |
| +#endif | |
| + | |
| static int sdio_read_fbr(struct sdio_func *func) | |
| { | |
| int ret; | |
| @@ -321,19 +325,35 @@ | |
| goto remove; | |
| } | |
| - /* | |
| - * Read the common registers. | |
| - */ | |
| - err = sdio_read_cccr(card); | |
| - if (err) | |
| - goto remove; | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + if (host->embedded_sdio_data.cccr) | |
| + memcpy(&card->cccr, host->embedded_sdio_data.cccr, sizeof(struct sdio_cccr)); | |
| + else { | |
| +#endif | |
| + /* | |
| + * Read the common registers. | |
| + */ | |
| + err = sdio_read_cccr(card); | |
| + if (err) | |
| + goto remove; | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + } | |
| +#endif | |
| - /* | |
| - * Read the common CIS tuples. | |
| - */ | |
| - err = sdio_read_common_cis(card); | |
| - if (err) | |
| - goto remove; | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + if (host->embedded_sdio_data.cis) | |
| + memcpy(&card->cis, host->embedded_sdio_data.cis, sizeof(struct sdio_cis)); | |
| + else { | |
| +#endif | |
| + /* | |
| + * Read the common CIS tuples. | |
| + */ | |
| + err = sdio_read_common_cis(card); | |
| + if (err) | |
| + goto remove; | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + } | |
| +#endif | |
| if (oldcard) { | |
| int same = (card->cis.vendor == oldcard->cis.vendor && | |
| @@ -573,6 +593,11 @@ | |
| funcs = (ocr & 0x70000000) >> 28; | |
| card->sdio_funcs = 0; | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + if (host->embedded_sdio_data.funcs) | |
| + card->sdio_funcs = funcs = host->embedded_sdio_data.num_funcs; | |
| +#endif | |
| + | |
| /* | |
| * If needed, disconnect card detection pull-up resistor. | |
| */ | |
| @@ -584,9 +609,27 @@ | |
| * Initialize (but don't add) all present functions. | |
| */ | |
| for (i = 0; i < funcs; i++, card->sdio_funcs++) { | |
| - err = sdio_init_func(host->card, i + 1); | |
| - if (err) | |
| - goto remove; | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + if (host->embedded_sdio_data.funcs) { | |
| + struct sdio_func *tmp; | |
| + | |
| + tmp = sdio_alloc_func(host->card); | |
| + if (IS_ERR(tmp)) | |
| + goto remove; | |
| + tmp->num = (i + 1); | |
| + card->sdio_func[i] = tmp; | |
| + tmp->class = host->embedded_sdio_data.funcs[i].f_class; | |
| + tmp->max_blksize = host->embedded_sdio_data.funcs[i].f_maxblksize; | |
| + tmp->vendor = card->cis.vendor; | |
| + tmp->device = card->cis.device; | |
| + } else { | |
| +#endif | |
| + err = sdio_init_func(host->card, i + 1); | |
| + if (err) | |
| + goto remove; | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + } | |
| +#endif | |
| } | |
| mmc_release_host(host); | |
| @@ -628,3 +671,82 @@ | |
| return err; | |
| } | |
| +int sdio_reset_comm(struct mmc_card *card) | |
| +{ | |
| + struct mmc_host *host = card->host; | |
| + u32 ocr; | |
| + int err; | |
| + | |
| + printk("%s():\n", __func__); | |
| + mmc_claim_host(host); | |
| + | |
| + mmc_go_idle(host); | |
| + | |
| + mmc_set_clock(host, host->f_min); | |
| + | |
| + err = mmc_send_io_op_cond(host, 0, &ocr); | |
| + if (err) | |
| + goto err; | |
| + | |
| + host->ocr = mmc_select_voltage(host, ocr); | |
| + if (!host->ocr) { | |
| + err = -EINVAL; | |
| + goto err; | |
| + } | |
| + | |
| + err = mmc_send_io_op_cond(host, host->ocr, &ocr); | |
| + if (err) | |
| + goto err; | |
| + | |
| + if (mmc_host_is_spi(host)) { | |
| + err = mmc_spi_set_crc(host, use_spi_crc); | |
| + if (err) | |
| + goto err; | |
| + } | |
| + | |
| + if (!mmc_host_is_spi(host)) { | |
| + err = mmc_send_relative_addr(host, &card->rca); | |
| + if (err) | |
| + goto err; | |
| + mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL); | |
| + } | |
| + if (!mmc_host_is_spi(host)) { | |
| + err = mmc_select_card(card); | |
| + if (err) | |
| + goto err; | |
| + } | |
| + | |
| + /* | |
| + * Switch to high-speed (if supported). | |
| + */ | |
| + err = sdio_enable_hs(card); | |
| + if (err) | |
| + goto err; | |
| + | |
| + /* | |
| + * Change to the card's maximum speed. | |
| + */ | |
| + if (mmc_card_highspeed(card)) { | |
| + /* | |
| + * The SDIO specification doesn't mention how | |
| + * the CIS transfer speed register relates to | |
| + * high-speed, but it seems that 50 MHz is | |
| + * mandatory. | |
| + */ | |
| + mmc_set_clock(host, 50000000); | |
| + } else { | |
| + mmc_set_clock(host, card->cis.max_dtr); | |
| + } | |
| + | |
| + err = sdio_enable_wide(card); | |
| + if (err) | |
| + goto err; | |
| + mmc_release_host(host); | |
| + return 0; | |
| +err: | |
| + printk("%s: Error resetting SDIO communications (%d)\n", | |
| + mmc_hostname(host), err); | |
| + mmc_release_host(host); | |
| + return err; | |
| +} | |
| +EXPORT_SYMBOL(sdio_reset_comm); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/core/sdio_io.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/sdio_io.c | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/core/sdio_io.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/core/sdio_io.c 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -383,6 +383,39 @@ | |
| EXPORT_SYMBOL_GPL(sdio_readb); | |
| /** | |
| + * sdio_readb_ext - read a single byte from a SDIO function | |
| + * @func: SDIO function to access | |
| + * @addr: address to read | |
| + * @err_ret: optional status value from transfer | |
| + * @in: value to add to argument | |
| + * | |
| + * Reads a single byte from the address space of a given SDIO | |
| + * function. If there is a problem reading the address, 0xff | |
| + * is returned and @err_ret will contain the error code. | |
| + */ | |
| +unsigned char sdio_readb_ext(struct sdio_func *func, unsigned int addr, | |
| + int *err_ret, unsigned in) | |
| +{ | |
| + int ret; | |
| + unsigned char val; | |
| + | |
| + BUG_ON(!func); | |
| + | |
| + if (err_ret) | |
| + *err_ret = 0; | |
| + | |
| + ret = mmc_io_rw_direct(func->card, 0, func->num, addr, (u8)in, &val); | |
| + if (ret) { | |
| + if (err_ret) | |
| + *err_ret = ret; | |
| + return 0xFF; | |
| + } | |
| + | |
| + return val; | |
| +} | |
| +EXPORT_SYMBOL_GPL(sdio_readb_ext); | |
| + | |
| +/** | |
| * sdio_writeb - write a single byte to a SDIO function | |
| * @func: SDIO function to access | |
| * @b: byte to write | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/host: bcmsdhc.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/host: bcmsdhc.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/host/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/host/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/host/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/host/Kconfig 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -68,6 +68,27 @@ | |
| If unsure, say N. | |
| +config MMC_BCM | |
| + tristate "Arasan SDHC support" | |
| + depends on (ARCH_BCM116X || ARCH_BCM215XX) | |
| + help | |
| + This selects the Arasan Multimedia card Interface. | |
| + If you have an broadcom board with a Multimedia Card slot, | |
| + say Y or M here. | |
| + | |
| + If unsure, say N. | |
| + | |
| +config MMC_ARASAN_HOST_FIX | |
| + bool "Workaround for Arasan's SDHCI Host" | |
| + depends on MMC | |
| + default n | |
| + help | |
| + This is an option to apply the software workaround for some of the | |
| + hardware issues with Arasan's SDHCI host. | |
| + | |
| + If unsure, say N. | |
| + | |
| + | |
| config MMC_RICOH_MMC | |
| bool "Ricoh MMC Controller Disabler (EXPERIMENTAL)" | |
| depends on MMC_SDHCI_PCI | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mmc/host/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/host/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/mmc/host/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mmc/host/Makefile 2018-07-12 10:13:42.000000000 +0700 | |
| @@ -45,3 +45,4 @@ | |
| ifeq ($(CONFIG_CB710_DEBUG),y) | |
| CFLAGS-cb710-mmc += -DDEBUG | |
| endif | |
| +obj-$(CONFIG_MMC_BCM) += bcmsdhc.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mtd/nand/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/mtd/nand/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand/Kconfig 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -1,3 +1,10 @@ | |
| +config MTD_NAND_IDS | |
| + tristate "Include chip ids for known NAND devices." | |
| + depends on MTD | |
| + help | |
| + Useful for NAND drivers that do not use the NAND subsystem but | |
| + still like to take advantage of the known chip information. | |
| + | |
| config MTD_NAND_ECC | |
| tristate | |
| @@ -122,9 +129,6 @@ | |
| or in DMA interrupt mode. | |
| Say y for DMA mode or MPU mode will be used | |
| -config MTD_NAND_IDS | |
| - tristate | |
| - | |
| config MTD_NAND_RICOH | |
| tristate "Ricoh xD card reader" | |
| default n | |
| @@ -234,6 +238,42 @@ | |
| when the is NAND chip selected or released, but will save | |
| approximately 5mA of power when there is nothing happening. | |
| +config MTD_NAND_BRCM_UMI | |
| + tristate "NAND Flash support for BCM116X Boards" | |
| + depends on (ARCH_BCM116X || ARCH_BCM215XX) | |
| + help | |
| + This enables the NAND flash controller on the BCM UMI block. | |
| + | |
| + No board specfic support is done by this driver, each board | |
| + must advertise a platform_device for the driver to attach. | |
| + | |
| +config MTD_NAND_BRCM_NVSRAM | |
| + tristate "NVSRAM Controller (ARM PrimeCell PL353) NAND Flash driver for BCM21553 Boards" | |
| + depends on ARCH_BCM215XX | |
| + help | |
| + This enables the NVSRAM Controller (ARM PrimeCell PL353) for NAND flash. | |
| + | |
| + No board specfic support is done by this driver, each board | |
| + must advertise a platform_device for the driver to attach. | |
| + | |
| +config MTD_USE_HW_NAND_CONTROLLER_ECC | |
| + bool "Use the NVSRAM NAND controller 1-bit ECC" | |
| + depends on MTD_NAND_BRCM_NVSRAM | |
| + default y | |
| + help | |
| + This selects the H/W NVSRAM NAND controller based 1-bit ECC. | |
| + | |
| + Select this for NAND flash chips that don't support on-die ECC. | |
| + | |
| +config MTD_USE_NAND_FLASH_ON_DIE_ECC | |
| + bool "Use the On-die 4-bit ECC provided by Micron NAND chips" | |
| + depends on MTD_NAND_BRCM_NVSRAM | |
| + default n | |
| + help | |
| + This selects the Micron NAND on-die 4-bit ECC. | |
| + | |
| + Select this for Micron NAND flash chips. | |
| + | |
| config MTD_NAND_BCM_UMI | |
| tristate "NAND Flash support for BCM Reference Boards" | |
| depends on ARCH_BCMRING && MTD_NAND | |
| @@ -526,4 +566,11 @@ | |
| This enables the driver for the NAND Flash on evaluation board based | |
| on w90p910 / NUC9xx. | |
| +config BRCM_TOSHIBA_NAND_OTP | |
| + bool "OTP support for Toshiba NAND" | |
| + depends on MTD_NAND | |
| + help | |
| + Enables read/write support to Toshiba OTP through standard MTD | |
| + interface. | |
| + | |
| endif # MTD_NAND | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mtd/nand/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/mtd/nand/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand/Makefile 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -44,6 +44,8 @@ | |
| obj-$(CONFIG_MTD_NAND_NUC900) += nuc900_nand.o | |
| obj-$(CONFIG_MTD_NAND_NOMADIK) += nomadik_nand.o | |
| obj-$(CONFIG_MTD_NAND_BCM_UMI) += bcm_umi_nand.o nand_bcm_umi.o | |
| +obj-$(CONFIG_MTD_NAND_BRCM_UMI) += nand_brcm_umi.o nand_correct_data512.o nand_calculate_ecc512.o | |
| +obj-$(CONFIG_MTD_NAND_BRCM_NVSRAM) += nand_burst_read.o nand_brcm_nvsram.o nand_correct_data512.o nand_calculate_ecc512.o | |
| obj-$(CONFIG_MTD_NAND_MPC5121_NFC) += mpc5121_nfc.o | |
| obj-$(CONFIG_MTD_NAND_RICOH) += r852.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mtd/nand/nand_base.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand/nand_base.c | |
| --- /path/to/linux-2.6.35.7/drivers/mtd/nand/nand_base.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand/nand_base.c 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -3021,6 +3021,247 @@ | |
| return 0; | |
| } | |
| +static void nand_panic_wait(struct mtd_info *mtd) | |
| +{ | |
| + struct nand_chip *chip = mtd->priv; | |
| + int i; | |
| + | |
| + if (chip->state != FL_READY) | |
| + for (i = 0; i < 40; i++) { | |
| + if (chip->dev_ready(mtd)) | |
| + break; | |
| + mdelay(10); | |
| + } | |
| + chip->state = FL_READY; | |
| +} | |
| + | |
| +static int nand_panic_write(struct mtd_info *mtd, loff_t to, size_t len, | |
| + size_t *retlen, const u_char *buf) | |
| +{ | |
| + struct nand_chip *chip = mtd->priv; | |
| + int ret; | |
| + | |
| + /* Do not allow reads past end of device */ | |
| + if ((to + len) > mtd->size) | |
| + return -EINVAL; | |
| + if (!len) | |
| + return 0; | |
| + | |
| + nand_panic_wait(mtd); | |
| + | |
| + chip->ops.len = len; | |
| + chip->ops.datbuf = (uint8_t *)buf; | |
| + chip->ops.oobbuf = NULL; | |
| + | |
| + ret = nand_do_write_ops(mtd, to, &chip->ops); | |
| + | |
| + *retlen = chip->ops.retlen; | |
| + return ret; | |
| +} | |
| + | |
| +#ifdef CONFIG_BRCM_TOSHIBA_NAND_OTP | |
| + | |
| +/* Interal OTP operation */ | |
| +typedef int (*otp_op_t)(struct mtd_info *mtd, loff_t form, size_t len, | |
| + size_t *retlen, u_char *buf); | |
| + | |
| +/** | |
| + * do_otp_read - [DEFAULT] Read OTP block area | |
| + * @param mtd MTD device structure | |
| + * @param from The offset to read | |
| + * @param len number of bytes to read | |
| + * @param retlen pointer to variable to store the number of readbytes | |
| + * @param buf the databuffer to put/get data | |
| + * | |
| + * Read OTP block area. | |
| + */ | |
| +static int do_otp_read(struct mtd_info *mtd, loff_t from, size_t len, | |
| + size_t *retlen, u_char *buf) | |
| +{ | |
| + struct nand_chip *chip = mtd->priv; | |
| + int ret = -ENOTSUPP; | |
| + | |
| + struct mtd_oob_ops ops = { | |
| + .mode = MTD_OOB_RAW, | |
| + .len = len, | |
| + .ooblen = 0, | |
| + .datbuf = buf, | |
| + .oobbuf = NULL, | |
| + .retlen = 0, | |
| + }; | |
| + | |
| + /* Enter OTP access mode */ | |
| + chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); | |
| + chip->cmdfunc(mtd, 0x5A, -1, -1); | |
| + chip->cmdfunc(mtd, 0xB5, -1, -1); | |
| + | |
| + ret = nand_do_read_ops(mtd, from, &ops); | |
| + *retlen = ops.retlen; | |
| + | |
| + /* Exit OTP access mode */ | |
| + chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); | |
| + return ret; | |
| +} | |
| + | |
| +/** | |
| + * do_otp_write - [DEFAULT] Write OTP block area | |
| + * @param mtd MTD device structure | |
| + * @param to The offset to write | |
| + * @param len number of bytes to write | |
| + * @param retlen pointer to variable to store the number of write bytes | |
| + * @param buf the databuffer to put/get data | |
| + * | |
| + * Write OTP block area. | |
| + */ | |
| +static int do_otp_write(struct mtd_info *mtd, loff_t to, size_t len, | |
| + size_t *retlen, u_char *buf) | |
| +{ | |
| + struct nand_chip *chip = mtd->priv; | |
| + unsigned char *pbuf = buf; | |
| + int ret; | |
| + struct mtd_oob_ops ops = { | |
| + .mode = MTD_OOB_RAW, | |
| + .ooboffs = 0, | |
| + .len = len, | |
| + .ooblen = 0, | |
| + .datbuf = pbuf, | |
| + .oobbuf = NULL, | |
| + .retlen = 0, | |
| + }; | |
| + | |
| + /* Enter OTP access mode */ | |
| + chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); | |
| + | |
| + chip->cmdfunc(mtd, 0x5A, -1, -1); | |
| + chip->cmdfunc(mtd, 0xB5, -1, -1); | |
| + | |
| + ret = nand_do_write_ops(mtd, to, &ops); | |
| + *retlen = ops.retlen; | |
| + | |
| + /* Exit OTP access mode */ | |
| + chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); | |
| + return ret; | |
| +} | |
| + | |
| +/** | |
| + * nand_otp_walk - [DEFAULT] Handle OTP operation | |
| + * @param mtd MTD device structure | |
| + * @param from The offset to read/write | |
| + * @param len number of bytes to read/write | |
| + * @param retlen pointer to variable to store the number of read bytes | |
| + * @param buf the databuffer to put/get data | |
| + * @param action do given action | |
| + * | |
| + * Handle OTP operation. | |
| + */ | |
| +static int nand_otp_walk(struct mtd_info *mtd, loff_t from, size_t len, | |
| + size_t *retlen, u_char *buf, otp_op_t action) | |
| +{ | |
| + struct nand_chip *chip = mtd->priv; | |
| + int otp_pages; | |
| + int ret = 0; | |
| + | |
| + *retlen = 0; | |
| + | |
| + /* One block is reserved for OTP on Toshiba NAND */ | |
| + otp_pages = mtd->erasesize >> chip->page_shift; | |
| + | |
| + /* Check OTP boundary */ | |
| + if (((mtd->writesize * otp_pages) - (from + len)) < 0) | |
| + return -EINVAL; | |
| + | |
| + nand_get_device(chip, mtd, FL_OTPING); | |
| + while (len > 0 && otp_pages > 0) { | |
| + if (!action) { /* OTP Info functions */ | |
| + struct otp_info *otpinfo; | |
| + | |
| + len -= sizeof(struct otp_info); | |
| + if (len <= 0) { | |
| + ret = -ENOSPC; | |
| + break; | |
| + } | |
| + | |
| + otpinfo = (struct otp_info *) buf; | |
| + otpinfo->start = from; | |
| + otpinfo->length = mtd->writesize; | |
| + otpinfo->locked = 0; | |
| + | |
| + from += mtd->writesize; | |
| + buf += sizeof(struct otp_info); | |
| + *retlen += sizeof(struct otp_info); | |
| + } else { | |
| + size_t tmp_retlen; | |
| + int size = len; | |
| + | |
| + ret = action(mtd, from, len, &tmp_retlen, buf); | |
| + | |
| + buf += size; | |
| + len -= size; | |
| + *retlen += size; | |
| + | |
| + if (ret) | |
| + break; | |
| + } | |
| + otp_pages--; | |
| + } | |
| + | |
| + nand_release_device(mtd); | |
| + | |
| + return ret; | |
| +} | |
| + | |
| +/** | |
| + * nand_get_user_prot_info - [MTD Interface] Read user OTP info | |
| + * @param mtd MTD device structure | |
| + * @param buf the databuffer to put/get data | |
| + * @param len number of bytes to read | |
| + * | |
| + * Read user OTP info. | |
| + */ | |
| +static int nand_get_user_prot_info(struct mtd_info *mtd, | |
| + struct otp_info *buf, size_t len) | |
| +{ | |
| + size_t retlen; | |
| + int ret; | |
| + | |
| + ret = nand_otp_walk(mtd, 0, len, &retlen, (u_char *) buf, NULL); | |
| + | |
| + return ret ? : retlen; | |
| +} | |
| + | |
| +/** | |
| + * nand_read_user_prot_reg - [MTD Interface] Read user OTP area | |
| + * @param mtd MTD device structure | |
| + * @param from The offset to read | |
| + * @param len number of bytes to read | |
| + * @param retlen pointer to variable to store the number of read bytes | |
| + * @param buf the databuffer to put/get data | |
| + * | |
| + * Read user OTP area. | |
| + */ | |
| +static int nand_read_user_prot_reg(struct mtd_info *mtd, loff_t from, | |
| + size_t len, size_t *retlen, u_char *buf) | |
| +{ | |
| + return nand_otp_walk(mtd, from, len, retlen, buf, do_otp_read); | |
| +} | |
| + | |
| +/** | |
| + * nand_write_user_prot_reg - [MTD Interface] Write user OTP area | |
| + * @param mtd MTD device structure | |
| + * @param from The offset to write | |
| + * @param len number of bytes to write | |
| + * @param retlen pointer to variable to store the number of write bytes | |
| + * @param buf the databuffer to put/get data | |
| + * | |
| + * Write user OTP area. | |
| + */ | |
| +static int nand_write_user_prot_reg(struct mtd_info *mtd, loff_t from, | |
| + size_t len, size_t *retlen, u_char *buf) | |
| +{ | |
| + return nand_otp_walk(mtd, from, len, retlen, buf, do_otp_write); | |
| +} | |
| +#endif /* CONFIG_BRCM_TOSHIBA_NAND_OTP */ | |
| + | |
| /** | |
| * nand_scan_tail - [NAND Interface] Scan for the NAND device | |
| @@ -3230,6 +3471,7 @@ | |
| mtd->panic_write = panic_nand_write; | |
| mtd->read_oob = nand_read_oob; | |
| mtd->write_oob = nand_write_oob; | |
| + mtd->panic_write = nand_panic_write; | |
| mtd->sync = nand_sync; | |
| mtd->lock = NULL; | |
| mtd->unlock = NULL; | |
| @@ -3241,6 +3483,21 @@ | |
| /* propagate ecc.layout to mtd_info */ | |
| mtd->ecclayout = chip->ecc.layout; | |
| +#ifdef CONFIG_BRCM_TOSHIBA_NAND_OTP | |
| + /* | |
| + * When the OTPSELECT is passed to the mtdchar.c in ioctl | |
| + * there is a check - if read_fact_prot_reg is not populated | |
| + * a failure is returned. In TOSHIBA Flash there is no factory | |
| + * and user mode differentiation. Hence we are populating the | |
| + * read_fact_prot_reg function pointer with the same function | |
| + * as User mode. | |
| + */ | |
| + mtd->read_fact_prot_reg = nand_get_user_prot_info; | |
| + mtd->get_user_prot_info = nand_get_user_prot_info; | |
| + mtd->read_user_prot_reg = nand_read_user_prot_reg; | |
| + mtd->write_user_prot_reg = nand_write_user_prot_reg; | |
| +#endif /* CONFIG_BRCM_TOSHIBA_NAND_OTP */ | |
| + | |
| /* Check, if we should skip the bad block table scan */ | |
| if (chip->options & NAND_SKIP_BBTSCAN) | |
| return 0; | |
| Only in /path/to/linux-2.6.35.7/drivers/mtd/nand: nand_bcm_umi.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand: nand_brcm_nvsram.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand: nand_brcm_umi.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand: nand_burst_read.S | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand: nand_calculate_ecc512.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/nand: nand_correct_data512.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/onenand: bcm_xboard.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mtd/onenand/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/onenand/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/mtd/onenand/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/onenand/Kconfig 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -23,6 +23,13 @@ | |
| help | |
| Support for OneNAND flash via platform device driver. | |
| +config MTD_ONENAND_BCM_XBOARD | |
| + tristate "XBOARD specific OneNAND device driver" | |
| + depends on ARCH_BCM116X || ARCH_BCM215XX | |
| + default n | |
| + help | |
| + Support for XBOARD specific OneNAND device driver. | |
| + | |
| config MTD_ONENAND_OMAP2 | |
| tristate "OneNAND on OMAP2/OMAP3 support" | |
| depends on MTD_ONENAND && (ARCH_OMAP2 || ARCH_OMAP3) | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mtd/onenand/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/onenand/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/mtd/onenand/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/onenand/Makefile 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -8,6 +8,7 @@ | |
| # Board specific. | |
| obj-$(CONFIG_MTD_ONENAND_GENERIC) += generic.o | |
| obj-$(CONFIG_MTD_ONENAND_OMAP2) += omap2.o | |
| +obj-$(CONFIG_MTD_ONENAND_BCM_XBOARD) += bcm_xboard.o | |
| obj-$(CONFIG_MTD_ONENAND_SAMSUNG) += samsung.o | |
| # Simulator | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/mtd/onenand/onenand_base.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/onenand/onenand_base.c | |
| --- /path/to/linux-2.6.35.7/drivers/mtd/onenand/onenand_base.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/mtd/onenand/onenand_base.c 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -1350,7 +1350,7 @@ | |
| stats = mtd->ecc_stats; | |
| - readcmd = ONENAND_IS_MLC(this) ? ONENAND_CMD_READ : ONENAND_CMD_READOOB; | |
| + readcmd = (ONENAND_IS_MLC(this) || ONENAND_IS_4KB_PAGE(this)) ? ONENAND_CMD_READ : ONENAND_CMD_READOOB; | |
| while (read < len) { | |
| cond_resched(); | |
| @@ -1555,7 +1555,7 @@ | |
| column = from & (mtd->oobsize - 1); | |
| - readcmd = ONENAND_IS_MLC(this) ? ONENAND_CMD_READ : ONENAND_CMD_READOOB; | |
| + readcmd = (ONENAND_IS_MLC(this) || ONENAND_IS_4KB_PAGE(this))? ONENAND_CMD_READ : ONENAND_CMD_READOOB; | |
| while (read < len) { | |
| cond_resched(); | |
| @@ -1609,7 +1609,7 @@ | |
| u_char *oob_buf = this->oob_buf; | |
| int status, i, readcmd; | |
| - readcmd = ONENAND_IS_MLC(this) ? ONENAND_CMD_READ : ONENAND_CMD_READOOB; | |
| + readcmd = (ONENAND_IS_MLC(this) || ONENAND_IS_4KB_PAGE(this))? ONENAND_CMD_READ : ONENAND_CMD_READOOB; | |
| this->command(mtd, readcmd, to, mtd->oobsize); | |
| onenand_update_bufferram(mtd, to, 0); | |
| @@ -2064,7 +2064,7 @@ | |
| oobbuf = this->oob_buf; | |
| - oobcmd = ONENAND_IS_MLC(this) ? ONENAND_CMD_PROG : ONENAND_CMD_PROGOOB; | |
| + oobcmd = ONENAND_IS_MLC(this) || ONENAND_IS_4KB_PAGE(this) ? ONENAND_CMD_PROG : ONENAND_CMD_PROGOOB; | |
| /* Loop until all data write */ | |
| while (written < len) { | |
| @@ -3019,9 +3019,9 @@ | |
| .ooblen = 0, | |
| .datbuf = buf, | |
| .oobbuf = NULL, | |
| + .retlen = 0, | |
| }; | |
| int ret; | |
| - | |
| /* Enter OTP access mode */ | |
| this->command(mtd, ONENAND_CMD_OTP_ACCESS, 0, 0); | |
| this->wait(mtd, FL_OTPING); | |
| @@ -3029,11 +3029,11 @@ | |
| ret = ONENAND_IS_MLC(this) || ONENAND_IS_4KB_PAGE(this) ? | |
| onenand_mlc_read_ops_nolock(mtd, from, &ops) : | |
| onenand_read_ops_nolock(mtd, from, &ops); | |
| + *retlen = ops.retlen; | |
| /* Exit OTP access mode */ | |
| this->command(mtd, ONENAND_CMD_RESET, 0, 0); | |
| this->wait(mtd, FL_RESETING); | |
| - | |
| return ret; | |
| } | |
| @@ -3054,7 +3054,6 @@ | |
| unsigned char *pbuf = buf; | |
| int ret; | |
| struct mtd_oob_ops ops; | |
| - | |
| /* Force buffer page aligned */ | |
| if (len < mtd->writesize) { | |
| memcpy(this->page_buf, buf, len); | |
| @@ -3077,7 +3076,6 @@ | |
| /* Exit OTP access mode */ | |
| this->command(mtd, ONENAND_CMD_RESET, 0, 0); | |
| this->wait(mtd, FL_RESETING); | |
| - | |
| return ret; | |
| } | |
| @@ -3176,7 +3174,6 @@ | |
| while (len > 0 && otp_pages > 0) { | |
| if (!action) { /* OTP Info functions */ | |
| struct otp_info *otpinfo; | |
| - | |
| len -= sizeof(struct otp_info); | |
| if (len <= 0) { | |
| ret = -ENOSPC; | |
| @@ -3362,18 +3359,19 @@ | |
| static void onenand_check_features(struct mtd_info *mtd) | |
| { | |
| struct onenand_chip *this = mtd->priv; | |
| - unsigned int density, process; | |
| + unsigned int density, process, numbufs; | |
| /* Lock scheme depends on density and process */ | |
| density = onenand_get_density(this->device_id); | |
| process = this->version_id >> ONENAND_VERSION_PROCESS_SHIFT; | |
| + numbufs = this->read_word(this->base + ONENAND_REG_NUM_BUFFERS) >> 8; | |
| /* Lock scheme */ | |
| switch (density) { | |
| case ONENAND_DEVICE_DENSITY_4Gb: | |
| if (ONENAND_IS_DDP(this)) | |
| this->options |= ONENAND_HAS_2PLANE; | |
| - else | |
| + else if (numbufs == 1) | |
| this->options |= ONENAND_HAS_4KB_PAGE; | |
| case ONENAND_DEVICE_DENSITY_2Gb: | |
| @@ -3745,6 +3743,7 @@ | |
| /* Save system configuration 1 */ | |
| syscfg = this->read_word(this->base + ONENAND_REG_SYS_CFG1); | |
| +#if 0 | |
| /* Clear Sync. Burst Read mode to read BootRAM */ | |
| this->write_word((syscfg & ~ONENAND_SYS_CFG1_SYNC_READ & ~ONENAND_SYS_CFG1_SYNC_WRITE), this->base + ONENAND_REG_SYS_CFG1); | |
| @@ -3762,6 +3761,7 @@ | |
| /* Restore system configuration 1 */ | |
| this->write_word(syscfg, this->base + ONENAND_REG_SYS_CFG1); | |
| +#endif | |
| /* Workaround */ | |
| if (syscfg & ONENAND_SYS_CFG1_SYNC_WRITE) { | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net: brcm_netconsole.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/net/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/net/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/Kconfig 2018-07-12 10:13:30.000000000 +0700 | |
| @@ -3184,6 +3184,23 @@ | |
| used by ISPs and enterprises to tunnel PPP traffic over UDP | |
| tunnels. L2TP is replacing PPTP for VPN uses. | |
| +config PPPOLAC | |
| + tristate "PPP on L2TP Access Concentrator" | |
| + depends on PPP && INET | |
| + help | |
| + L2TP (RFC 2661) is a tunneling protocol widely used in virtual private | |
| + networks. This driver handles L2TP data packets between a UDP socket | |
| + and a PPP channel, but only permits one session per socket. Thus it is | |
| + fairly simple and suited for clients. | |
| + | |
| +config PPPOPNS | |
| + tristate "PPP on PPTP Network Server" | |
| + depends on PPP && INET | |
| + help | |
| + PPTP (RFC 2637) is a tunneling protocol widely used in virtual private | |
| + networks. This driver handles PPTP data packets between a RAW socket | |
| + and a PPP channel. It is fairly simple and easy to use. | |
| + | |
| config SLIP | |
| tristate "SLIP (serial line) support" | |
| ---help--- | |
| @@ -3285,8 +3302,25 @@ | |
| at runtime through a userspace interface exported using configfs. | |
| See <file:Documentation/networking/netconsole.txt> for details. | |
| +config BRCM_NETCONSOLE | |
| + tristate "Broadcom Network console logging support (EXPERIMENTAL)" | |
| + depends on EXPERIMENTAL | |
| + ---help--- | |
| + If you want to log kernel messages over the network, enable this. | |
| + See <file:Documentation/networking/netconsole.txt> for details. | |
| + | |
| +config BRCM_NETCONSOLE_DYNAMIC | |
| + bool "Broadcom Dynamic reconfiguration of logging targets (EXPERIMENTAL)" | |
| + depends on BRCM_NETCONSOLE && SYSFS && EXPERIMENTAL | |
| + select CONFIGFS_FS | |
| + help | |
| + This option enables the ability to dynamically reconfigure target | |
| + parameters (interface, IP addresses, port numbers, MAC addresses) | |
| + at runtime through a userspace interface exported using configfs. | |
| + See <file:Documentation/networking/netconsole.txt> for details. | |
| + | |
| config NETPOLL | |
| - def_bool NETCONSOLE | |
| + def_bool NETCONSOLE || BRCM_NETCONSOLE | |
| config NETPOLL_TRAP | |
| bool "Netpoll traffic trapping" | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/net/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/net/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/Makefile 2018-07-12 10:13:30.000000000 +0700 | |
| @@ -162,6 +162,8 @@ | |
| obj-$(CONFIG_PPP_MPPE) += ppp_mppe.o | |
| obj-$(CONFIG_PPPOE) += pppox.o pppoe.o | |
| obj-$(CONFIG_PPPOL2TP) += pppox.o | |
| +obj-$(CONFIG_PPPOLAC) += pppox.o pppolac.o | |
| +obj-$(CONFIG_PPPOPNS) += pppox.o pppopns.o | |
| obj-$(CONFIG_SLIP) += slip.o | |
| obj-$(CONFIG_SLHC) += slhc.o | |
| @@ -283,6 +285,7 @@ | |
| obj-$(CONFIG_ENP2611_MSF_NET) += ixp2000/ | |
| obj-$(CONFIG_NETCONSOLE) += netconsole.o | |
| +obj-$(CONFIG_BRCM_NETCONSOLE) += brcm_netconsole.o | |
| obj-$(CONFIG_FS_ENET) += fs_enet/ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net: pppolac.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net: pppopns.c | |
| Only in /path/to/linux-2.6.35.7/drivers/net: tg3.c | |
| Only in /path/to/linux-2.6.35.7/drivers/net/wan: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/wireless: 4330 | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/net/wireless/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/wireless/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/net/wireless/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/wireless/Kconfig 2018-07-12 10:13:29.000000000 +0700 | |
| @@ -281,5 +281,5 @@ | |
| source "drivers/net/wireless/rt2x00/Kconfig" | |
| source "drivers/net/wireless/wl12xx/Kconfig" | |
| source "drivers/net/wireless/zd1211rw/Kconfig" | |
| - | |
| +source "drivers/net/wireless/4330/Kconfig" | |
| endif # WLAN | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/net/wireless/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/wireless/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/net/wireless/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/net/wireless/Makefile 2018-07-12 10:13:29.000000000 +0700 | |
| @@ -52,3 +52,5 @@ | |
| obj-$(CONFIG_WL12XX) += wl12xx/ | |
| obj-$(CONFIG_IWM) += iwmc3200wifi/ | |
| + | |
| +obj-$(CONFIG_BCM_4330_DRIVER) += 4330/ | |
| Only in /path/to/linux-2.6.35.7/drivers/pci: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/power/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/power/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/power/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/power/Kconfig 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -130,16 +130,54 @@ | |
| in handheld and portable equipment. The MAX17040 is configured | |
| to operate with a single lithium cell | |
| +config BCM59035_POWER | |
| + tristate "BCM59035 Power" | |
| + depends on MFD_BCM59035 | |
| + help | |
| + Say Y to enable support for Broadcom BCM59035 PMU power supply driver | |
| + | |
| +config BCM59038_POWER | |
| + tristate "BCM59038 Power" | |
| + depends on MFD_BCM59038 | |
| + help | |
| + Say Y to enable support for Broadcom BCM59038 PMU power supply driver | |
| + | |
| +config MAX8986_POWER | |
| + tristate "MAX8986 Power" | |
| + depends on MFD_MAX8986 | |
| + help | |
| + Say Y to enable support for Maxim Max8986 PMU power supply | |
| + driver | |
| + | |
| config BATTERY_Z2 | |
| tristate "Z2 battery driver" | |
| depends on I2C && MACH_ZIPIT2 | |
| help | |
| Say Y to include support for the battery on the Zipit Z2. | |
| +config BATT_LVL_FROM_ADC | |
| + bool "Measure battery level directly using ADC" | |
| + depends on MAX8986_POWER | |
| + help | |
| + Say Y to enable support for reading battery level from ADC | |
| + | |
| + | |
| config CHARGER_PCF50633 | |
| tristate "NXP PCF50633 MBC" | |
| depends on MFD_PCF50633 | |
| help | |
| Say Y to include support for NXP PCF50633 Main Battery Charger. | |
| + | |
| +config TOUCHSCREEN_F760 | |
| + tristate "Siliconlab touchscreens" | |
| + depends on I2C | |
| + help | |
| + Say Y here if you have a F760 based touchscreen. | |
| + | |
| + If unsure, say N. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called tsc2017. | |
| + | |
| endif # POWER_SUPPLY | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/power/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/power/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/power/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/power/Makefile 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -34,3 +34,6 @@ | |
| obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o | |
| obj-$(CONFIG_BATTERY_Z2) += z2_battery.o | |
| obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o | |
| +obj-$(CONFIG_BCM59035_POWER) += bcm59035-power.o | |
| +obj-$(CONFIG_BCM59038_POWER) += bcm59038-power.o | |
| +obj-$(CONFIG_MAX8986_POWER) += max8986-power.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/power: max8986-power.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/power/power_supply_core.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/power/power_supply_core.c | |
| --- /path/to/linux-2.6.35.7/drivers/power/power_supply_core.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/power/power_supply_core.c 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -41,23 +41,40 @@ | |
| static void power_supply_changed_work(struct work_struct *work) | |
| { | |
| + unsigned long flags; | |
| struct power_supply *psy = container_of(work, struct power_supply, | |
| changed_work); | |
| dev_dbg(psy->dev, "%s\n", __func__); | |
| - class_for_each_device(power_supply_class, NULL, psy, | |
| - __power_supply_changed_work); | |
| + spin_lock_irqsave(&psy->changed_lock, flags); | |
| + if (psy->changed) { | |
| + psy->changed = false; | |
| + spin_unlock_irqrestore(&psy->changed_lock, flags); | |
| - power_supply_update_leds(psy); | |
| + class_for_each_device(power_supply_class, NULL, psy, | |
| + __power_supply_changed_work); | |
| - kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE); | |
| + power_supply_update_leds(psy); | |
| + | |
| + kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE); | |
| + spin_lock_irqsave(&psy->changed_lock, flags); | |
| + } | |
| + if (!psy->changed) | |
| + wake_unlock(&psy->work_wake_lock); | |
| + spin_unlock_irqrestore(&psy->changed_lock, flags); | |
| } | |
| void power_supply_changed(struct power_supply *psy) | |
| { | |
| + unsigned long flags; | |
| + | |
| dev_dbg(psy->dev, "%s\n", __func__); | |
| + spin_lock_irqsave(&psy->changed_lock, flags); | |
| + psy->changed = true; | |
| + wake_lock(&psy->work_wake_lock); | |
| + spin_unlock_irqrestore(&psy->changed_lock, flags); | |
| schedule_work(&psy->changed_work); | |
| } | |
| EXPORT_SYMBOL_GPL(power_supply_changed); | |
| @@ -180,6 +197,8 @@ | |
| goto device_add_failed; | |
| INIT_WORK(&psy->changed_work, power_supply_changed_work); | |
| + spin_lock_init(&psy->changed_lock); | |
| + wake_lock_init(&psy->work_wake_lock, WAKE_LOCK_SUSPEND, "power-supply"); | |
| rc = power_supply_create_triggers(psy); | |
| if (rc) | |
| @@ -190,6 +209,7 @@ | |
| goto success; | |
| create_triggers_failed: | |
| + wake_lock_destroy(&psy->work_wake_lock); | |
| device_unregister(psy->dev); | |
| kobject_set_name_failed: | |
| device_add_failed: | |
| @@ -203,6 +223,7 @@ | |
| { | |
| flush_scheduled_work(); | |
| power_supply_remove_triggers(psy); | |
| + wake_lock_destroy(&psy->work_wake_lock); | |
| device_unregister(psy->dev); | |
| } | |
| EXPORT_SYMBOL_GPL(power_supply_unregister); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/regulator/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/regulator/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/regulator/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/regulator/Kconfig 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -195,11 +195,29 @@ | |
| three step-down converters and two general-purpose LDO voltage regulators. | |
| It supports TI's software based Class-2 SmartReflex implementation. | |
| +config REGULATOR_BCM59035 | |
| + tristate "Broadcom BCM59035 PMU regulator driver" | |
| + depends on MFD_BCM59035 | |
| + help | |
| + Say y here to support Broadcom BCM59035 PMU regulator driver | |
| + | |
| +config REGULATOR_BCM59038 | |
| + tristate "Broadcom BCM59038 PMU regulator driver" | |
| + depends on MFD_BCM59038 | |
| + help | |
| + Say y here to support Broadcom BCM59038 PMU regulator driver | |
| + | |
| config REGULATOR_88PM8607 | |
| bool "Marvell 88PM8607 Power regulators" | |
| depends on MFD_88PM860X=y | |
| help | |
| This driver supports 88PM8607 voltage regulator chips. | |
| +config REGULATOR_MAX8986 | |
| + tristate "Maxim Max8986 PMU regulator driver" | |
| + depends on MFD_MAX8986 | |
| + help | |
| + Say y here to support Maxim MAX8986 PMU regulator driver | |
| + | |
| endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/regulator/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/regulator/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/regulator/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/regulator/Makefile 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -30,6 +30,9 @@ | |
| obj-$(CONFIG_REGULATOR_TPS65023) += tps65023-regulator.o | |
| obj-$(CONFIG_REGULATOR_TPS6507X) += tps6507x-regulator.o | |
| +obj-$(CONFIG_REGULATOR_BCM59035) += bcm59035-regulator.o | |
| +obj-$(CONFIG_REGULATOR_BCM59038) += bcm59038-regulator.o | |
| obj-$(CONFIG_REGULATOR_88PM8607) += 88pm8607.o | |
| +obj-$(CONFIG_REGULATOR_MAX8986) += max8986-regulator.o | |
| ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/regulator: max8986-regulator.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc: alarm.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc: alarm-dev.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/rtc/class.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc/class.c | |
| --- /path/to/linux-2.6.35.7/drivers/rtc/class.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc/class.c 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -41,25 +41,32 @@ | |
| */ | |
| static struct timespec delta; | |
| +static struct timespec delta_delta; | |
| static time_t oldtime; | |
| static int rtc_suspend(struct device *dev, pm_message_t mesg) | |
| { | |
| struct rtc_device *rtc = to_rtc_device(dev); | |
| struct rtc_time tm; | |
| - struct timespec ts = current_kernel_time(); | |
| + struct timespec ts; | |
| + struct timespec new_delta; | |
| if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) | |
| return 0; | |
| + getnstimeofday(&ts); | |
| rtc_read_time(rtc, &tm); | |
| rtc_tm_to_time(&tm, &oldtime); | |
| /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ | |
| - set_normalized_timespec(&delta, | |
| + set_normalized_timespec(&new_delta, | |
| ts.tv_sec - oldtime, | |
| ts.tv_nsec - (NSEC_PER_SEC >> 1)); | |
| + /* prevent 1/2 sec errors from accumulating */ | |
| + delta_delta = timespec_sub(new_delta, delta); | |
| + if (delta_delta.tv_sec < -2 || delta_delta.tv_sec >= 2) | |
| + delta = new_delta; | |
| return 0; | |
| } | |
| @@ -79,6 +86,8 @@ | |
| return 0; | |
| } | |
| rtc_tm_to_time(&tm, &newtime); | |
| + if (delta_delta.tv_sec < -1) | |
| + newtime++; | |
| if (newtime <= oldtime) { | |
| if (newtime < oldtime) | |
| pr_debug("%s: time travel!\n", dev_name(&rtc->dev)); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/rtc/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/rtc/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc/Kconfig 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -109,6 +109,24 @@ | |
| clock several times per second, please enable this option | |
| only if you know that you really need it. | |
| +config RTC_INTF_ALARM | |
| + bool "Android alarm driver" | |
| + depends on RTC_CLASS | |
| + default y | |
| + help | |
| + Provides non-wakeup and rtc backed wakeup alarms based on rtc or | |
| + elapsed realtime, and a non-wakeup alarm on the monotonic clock. | |
| + Also provides an interface to set the wall time which must be used | |
| + for elapsed realtime to work. | |
| + | |
| +config RTC_INTF_ALARM_DEV | |
| + bool "Android alarm device" | |
| + depends on RTC_INTF_ALARM | |
| + default y | |
| + help | |
| + Exports the alarm interface to user-space. | |
| + | |
| + | |
| config RTC_DRV_TEST | |
| tristate "Test driver/device" | |
| help | |
| @@ -128,6 +146,53 @@ | |
| if I2C | |
| +config RTC_DRV_BCM59035 | |
| + tristate "Broadcom BCM59035 PMU RTC" | |
| + depends on MFD_BCM59035 | |
| + select RTC_ANDROID_ALARM_WORKAROUND | |
| + help | |
| + If you say yes here you will get support for the RTC subsystem | |
| + of Broadcom BCM59035 PMU chip | |
| + | |
| + This driver can also be built as a module. If so, the module | |
| + will be called "rtc-bcm59035". | |
| + | |
| +config RTC_DRV_BCM59038 | |
| + tristate "Broadcom BCM59038 PMU RTC" | |
| + depends on MFD_BCM59038 | |
| + help | |
| + If you say yes here you will get support for the RTC subsystem | |
| + of Broadcom BCM59038 PMU chip | |
| + | |
| + This driver can also be built as a module. If so, the module | |
| + will be called "rtc-bcm59038". | |
| + | |
| +config RTC_DRV_MAX8986 | |
| + tristate "Maxim MAX8986 PMU RTC" | |
| + depends on MFD_MAX8986 | |
| + select RTC_ANDROID_ALARM_WORKAROUND | |
| + help | |
| + If you say yes here you will get support for the RTC subsystem | |
| + of Maxim MAX8986 PMU chip | |
| + | |
| + This driver can also be built as a module. If so, the module | |
| + will be called "rtc-max8986". | |
| + | |
| +config RTC_ANDROID_ALARM_WORKAROUND | |
| + bool "Fix for alarm handling in 'Android' environment" | |
| + help | |
| + This option selects temporary fix for alarm handling in 'Android' | |
| + environment. This option enables code to disable alarm in the | |
| + 'resume' handler of RTC driver. In the normal mode, | |
| + android handles all alarms in software without using the RTC chip. | |
| + Android sets the alarm in the rtc only in the suspend path (by | |
| + calling .set_alarm with struct rtc_wkalrm->enabled set to 1). | |
| + In the resume path, android tries to disable alarm by calling | |
| + .set_alarm with struct rtc_wkalrm->enabled' field set to 0. | |
| + But unfortunately, it memsets the rtc_wkalrm struct to 0, which | |
| + causes the rtc lib to flag error and control does not reach RTC | |
| + driver. Hence this workaround. | |
| + | |
| config RTC_DRV_DS1307 | |
| tristate "Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025" | |
| help | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/rtc/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/rtc/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc/Makefile 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -11,6 +11,8 @@ | |
| obj-$(CONFIG_RTC_CLASS) += rtc-core.o | |
| rtc-core-y := class.o interface.o | |
| +obj-$(CONFIG_RTC_INTF_ALARM) += alarm.o | |
| +obj-$(CONFIG_RTC_INTF_ALARM_DEV) += alarm-dev.o | |
| rtc-core-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o | |
| rtc-core-$(CONFIG_RTC_INTF_PROC) += rtc-proc.o | |
| rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o | |
| @@ -23,6 +25,9 @@ | |
| obj-$(CONFIG_RTC_DRV_AT91RM9200)+= rtc-at91rm9200.o | |
| obj-$(CONFIG_RTC_DRV_AT91SAM9) += rtc-at91sam9.o | |
| obj-$(CONFIG_RTC_DRV_AU1XXX) += rtc-au1xxx.o | |
| +obj-$(CONFIG_RTC_DRV_BCM59035) += rtc-bcm59035.o | |
| +obj-$(CONFIG_RTC_DRV_BCM59038) += rtc-bcm59038.o | |
| +obj-$(CONFIG_RTC_DRV_MAX8986) += rtc-max8986.o | |
| obj-$(CONFIG_RTC_DRV_BFIN) += rtc-bfin.o | |
| obj-$(CONFIG_RTC_DRV_BQ32K) += rtc-bq32k.o | |
| obj-$(CONFIG_RTC_DRV_BQ4802) += rtc-bq4802.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/rtc: rtc-max8986.c | |
| Only in /path/to/linux-2.6.35.7/drivers/scsi/aic7xxx: .gitignore | |
| Only in /path/to/linux-2.6.35.7/drivers/scsi: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/serial/8250.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial/8250.c | |
| --- /path/to/linux-2.6.35.7/drivers/serial/8250.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial/8250.c 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -18,6 +18,21 @@ | |
| * membase is an 'ioremapped' cookie. | |
| */ | |
| +/******************************************************************************* | |
| +* Copyright 2010 Broadcom Corporation. All rights reserved. | |
| +* | |
| +* @file drivers/serial/8250.c | |
| +* | |
| +* 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.gnu.org/copyleft/gpl.html (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(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | |
| #define SUPPORT_SYSRQ | |
| #endif | |
| @@ -39,6 +54,10 @@ | |
| #include <linux/nmi.h> | |
| #include <linux/mutex.h> | |
| #include <linux/slab.h> | |
| +#ifdef CONFIG_HAS_WAKELOCK | |
| +#include <linux/wakelock.h> | |
| +#endif | |
| +#include <linux/clk.h> | |
| #include <asm/io.h> | |
| #include <asm/irq.h> | |
| @@ -49,6 +68,26 @@ | |
| #include "suncore.h" | |
| #endif | |
| +#define CONFIG_BCM_BT_UART_IOCTL 1 | |
| + | |
| +#ifdef CONFIG_BCM_BT_UART_IOCTL | |
| +#include "brcm_bt_lpm.h" | |
| +#endif | |
| + | |
| +#ifdef CONFIG_KEYPAD_BACKLIGHT | |
| +extern void Keypad_Led_control_On(void); | |
| +#endif | |
| + | |
| +#if defined(CONFIG_ARCH_BCM116X) || defined(CONFIG_ARCH_BCM215XX) | |
| +/* | |
| + * ** There are a number of components of this driver which are chip specific | |
| + * ** and don't work with BRCM chipsets. This define allow use to compile out | |
| + * ** those changes. | |
| + * */ | |
| +#define MOD_8250_FOR_BRCM 1 | |
| +#define UART_USR 31 /* UART status register */ | |
| +#endif | |
| + | |
| /* | |
| * Configuration: | |
| * share_irqs - whether we pass IRQF_SHARED to request_irq(). This option | |
| @@ -71,13 +110,13 @@ | |
| * Debugging. | |
| */ | |
| #if 0 | |
| -#define DEBUG_AUTOCONF(fmt...) printk(fmt) | |
| +#define DEBUG_AUTOCONF(fmt...) pr_info(fmt) | |
| #else | |
| #define DEBUG_AUTOCONF(fmt...) do { } while (0) | |
| #endif | |
| #if 0 | |
| -#define DEBUG_INTR(fmt...) printk(fmt) | |
| +#define DEBUG_INTR(fmt...) pr_info(fmt) | |
| #else | |
| #define DEBUG_INTR(fmt...) do { } while (0) | |
| #endif | |
| @@ -134,6 +173,10 @@ | |
| struct uart_port port; | |
| struct timer_list timer; /* "no irq" timer */ | |
| struct list_head list; /* ports on this IRQ */ | |
| + struct clk *clk; | |
| +#ifdef CONFIG_HAS_WAKELOCK | |
| + struct wake_lock uart_wake_lock; | |
| +#endif | |
| unsigned short capabilities; /* port capabilities */ | |
| unsigned short bugs; /* port bugs */ | |
| unsigned int tx_loadsz; /* transmit fifo load size */ | |
| @@ -199,10 +242,10 @@ | |
| }, | |
| [PORT_16550A] = { | |
| .name = "16550A", | |
| - .fifo_size = 16, | |
| - .tx_loadsz = 16, | |
| - .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, | |
| - .flags = UART_CAP_FIFO, | |
| + .fifo_size = 256, | |
| + .tx_loadsz = 256, | |
| + .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_11, | |
| + .flags = UART_CAP_FIFO | UART_CAP_AFE, | |
| }, | |
| [PORT_CIRRUS] = { | |
| .name = "Cirrus", | |
| @@ -613,6 +656,86 @@ | |
| #define serial_dl_write(up, value) _serial_dl_write(up, value) | |
| #endif | |
| +#if defined(CONFIG_ARCH_BCM116X) || defined(CONFIG_ARCH_BCM215XX) | |
| + | |
| +#if defined(CONFIG_ARCH_BCM215XX) | |
| +static const int uart_syscfg_mask[] = {0x00000800, 0x00001000, 0x00400000}; | |
| +#endif | |
| + | |
| +/* | |
| + * Added the Broadcom specific functions here. Its moved down because it uses | |
| + * the serial_outp macro | |
| + */ | |
| +#if defined(CONFIG_ARCH_BCM2153) | |
| +#define UCR_PWR_DIS(up) ((up->port.line) ? (1 << 7) : (1 << 14)) | |
| +#define UCR_PWR_STATE(up) ((up->port.line) ? (1 << 8) : (1 << 15)) | |
| +static inline int serial_ucr_pdstate(struct uart_8250_port *up) | |
| +{ | |
| + return !((*(volatile u32 *)up->port.private_data) & UCR_PWR_STATE(up)); | |
| +} | |
| + | |
| +#elif defined(CONFIG_ARCH_BCM215XX) || defined(CONFIG_ARCH_BCM2157) | |
| +#define UCR_PWR_DIS(up) (1 << 6) | |
| +#define UCR_PWR_STATE(up) (1 << 4) | |
| +static inline int serial_ucr_pdstate(struct uart_8250_port *up) | |
| +{ | |
| + return (*(volatile u32 *)up->port.private_data) & UCR_PWR_STATE(up); | |
| +} | |
| + | |
| +#endif | |
| + | |
| +static inline void serial_ucr_pden(struct uart_8250_port *up, int enable) | |
| +{ | |
| + unsigned int ucr; | |
| + unsigned int mask; | |
| + | |
| + ucr = *(volatile u32 *)up->port.private_data; | |
| + | |
| +#if defined(CONFIG_ARCH_BCM215XX) | |
| + /* Decide on the mask value based on port number */ | |
| + mask = uart_syscfg_mask[up->port.line]; | |
| + | |
| + if (enable) { | |
| + /* | |
| + * For Athena (BCM215XX) chip powering down UART C is little tricky. | |
| + * We need to follow a specific sequence to forcefully power it down. | |
| + */ | |
| + if (up->port.line == 2) { | |
| + serial_outp(up, UART_LCR, 0x80); | |
| + serial_outp(up, UART_DLL, 0x80); | |
| + serial_outp(up, UART_LCR, 0x02); | |
| + serial_outp(up, UART_FCR, 0x07); | |
| + } | |
| + /* For Athena forcefully turn off the bit in IOCR3 register */ | |
| + writel(readl(io_p2v(BCM21553_SYSCFG_BASE) + 0x1c) | mask, | |
| + io_p2v(BCM21553_SYSCFG_BASE) + 0x1c); | |
| + | |
| + ucr |= UCR_PWR_DIS(up); | |
| + } else { | |
| + writel(readl(io_p2v(BCM21553_SYSCFG_BASE) + 0x1c) & (~mask), | |
| + io_p2v(BCM21553_SYSCFG_BASE) + 0x1c); | |
| + | |
| + ucr &= ~UCR_PWR_DIS(up); | |
| + } | |
| +#else /* For ARCH other than BCM215xx */ | |
| + if (enable) | |
| + ucr |= UCR_PWR_DIS(up); | |
| + else | |
| + ucr &= ~UCR_PWR_DIS(up); | |
| +#endif | |
| + /* Program the Power Down EN bit */ | |
| + *(volatile u32 *)up->port.private_data = ucr; | |
| +} | |
| +#else /* !defined(CONFIG_ARCH_BCM2153)*/ | |
| +static inline void serial_ucr_pden(struct uart_8250_port *up, int enable) | |
| +{ | |
| +} | |
| +static inline int serial_ucr_pdstate(struct uart_8250_port *up) | |
| +{ | |
| + return 1; | |
| +} | |
| +#endif | |
| + | |
| /* | |
| * For the 16C950 | |
| */ | |
| @@ -939,7 +1062,9 @@ | |
| static void autoconfig_16550a(struct uart_8250_port *up) | |
| { | |
| unsigned char status1, status2; | |
| +#if !defined(MOD_8250_FOR_BRCM) | |
| unsigned int iersave; | |
| +#endif | |
| up->port.type = PORT_16550A; | |
| up->capabilities |= UART_CAP_FIFO; | |
| @@ -973,6 +1098,16 @@ | |
| return; | |
| } | |
| +#if !defined(MOD_8250_FOR_BRCM) | |
| + /* | |
| + * On the EagleRay board which has the 2133-A0, the following test seems | |
| + * to leave the serial port in loopback mode, which causes all of our | |
| + * console output to fail. Since we don't have one of these devices | |
| + * using a #if 0 seemed like the quickest thing to do. | |
| + * | |
| + * Dave Hylands - June 14, 2005 | |
| + */ | |
| + | |
| /* | |
| * Check for a National Semiconductor SuperIO chip. | |
| * Attempt to switch to bank 2, read the value of the LOOP bit | |
| @@ -1016,6 +1151,7 @@ | |
| return; | |
| } | |
| } | |
| +#endif | |
| /* | |
| * No EFR. Try to detect a TI16750, which only sets bit 5 of | |
| @@ -1041,6 +1177,7 @@ | |
| return; | |
| } | |
| +#if !defined(MOD_8250_FOR_BRCM) | |
| /* | |
| * Try writing and reading the UART_IER_UUE bit (b6). | |
| * If it works, this is probably one of the Xscale platform's | |
| @@ -1075,6 +1212,15 @@ | |
| DEBUG_AUTOCONF("Couldn't force IER_UUE to 0 "); | |
| } | |
| serial_outp(up, UART_IER, iersave); | |
| + /* | |
| + * We distinguish between 16550A and U6 16550A by counting | |
| + * how many bytes are in the FIFO. | |
| + */ | |
| + if (up->port.type == PORT_16550A && size_fifo(up) == 64) { | |
| + up->port.type = PORT_U6_16550A; | |
| + up->capabilities |= UART_CAP_AFE; | |
| + } | |
| +#endif | |
| } | |
| /* | |
| @@ -1093,7 +1239,7 @@ | |
| if (!up->port.iobase && !up->port.mapbase && !up->port.membase) | |
| return; | |
| - DEBUG_AUTOCONF("ttyS%d: autoconf (0x%04lx, 0x%p): ", | |
| + DEBUG_AUTOCONF("ttyS%d: autoconf (0x%04x, 0x%p): ", | |
| serial_index(&up->port), up->port.iobase, up->port.membase); | |
| /* | |
| @@ -1220,17 +1366,23 @@ | |
| serial_outp(up, UART_LCR, save_lcr); | |
| +#if defined(MOD_8250_FOR_BRCM) | |
| + (void)serial_in(up, UART_RX); | |
| +#endif | |
| + | |
| if (up->capabilities != uart_config[up->port.type].flags) { | |
| - printk(KERN_WARNING | |
| + pr_warning( | |
| "ttyS%d: detected caps %08x should be %08x\n", | |
| serial_index(&up->port), up->capabilities, | |
| uart_config[up->port.type].flags); | |
| } | |
| - | |
| - up->port.fifosize = uart_config[up->port.type].fifo_size; | |
| + if (up->port.fifosize) { | |
| + up->tx_loadsz= up->port.fifosize; | |
| + } else { | |
| + up->port.fifosize = uart_config[up->port.type].fifo_size; | |
| + up->tx_loadsz = uart_config[up->port.type].tx_loadsz; | |
| + } | |
| up->capabilities = uart_config[up->port.type].flags; | |
| - up->tx_loadsz = uart_config[up->port.type].tx_loadsz; | |
| - | |
| if (up->port.type == PORT_UNKNOWN) | |
| goto out; | |
| @@ -1290,6 +1442,9 @@ | |
| (void)serial_inp(up, UART_RX); | |
| (void)serial_inp(up, UART_IIR); | |
| (void)serial_inp(up, UART_MSR); | |
| +#if defined(MOD_8250_FOR_BRCM) | |
| + (void)serial_inp(up, UART_USR); | |
| +#endif | |
| serial_outp(up, UART_TX, 0xFF); | |
| udelay(20); | |
| irq = probe_irq_off(irqs); | |
| @@ -1328,21 +1483,34 @@ | |
| static void transmit_chars(struct uart_8250_port *up); | |
| +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) | |
| + | |
| static void serial8250_start_tx(struct uart_port *port) | |
| { | |
| struct uart_8250_port *up = (struct uart_8250_port *)port; | |
| if (!(up->ier & UART_IER_THRI)) { | |
| + unsigned char lsr1; | |
| + lsr1 = serial_in(up, UART_LSR); | |
| up->ier |= UART_IER_THRI; | |
| serial_out(up, UART_IER, up->ier); | |
| + if (lsr1 & BOTH_EMPTY) { | |
| + unsigned long flags; | |
| + spin_lock_irqsave(&up->port.lock, flags); | |
| + transmit_chars(up); | |
| + spin_unlock_irqrestore(&up->port.lock, flags); | |
| + } | |
| + | |
| if (up->bugs & UART_BUG_TXEN) { | |
| - unsigned char lsr; | |
| + unsigned char lsr, iir; | |
| lsr = serial_in(up, UART_LSR); | |
| up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; | |
| + iir = serial_in(up, UART_IIR) & 0x0f; | |
| if ((up->port.type == PORT_RM9000) ? | |
| - (lsr & UART_LSR_THRE) : | |
| - (lsr & UART_LSR_TEMT)) | |
| + (lsr & UART_LSR_THRE && | |
| + (iir == UART_IIR_NO_INT || iir == UART_IIR_THRI)) : | |
| + (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT)) | |
| transmit_chars(up); | |
| } | |
| } | |
| @@ -1464,7 +1632,7 @@ | |
| up->port.x_char = 0; | |
| return; | |
| } | |
| - if (uart_tx_stopped(&up->port)) { | |
| + if (!(up->mcr& UART_MCR_AFE) && uart_tx_stopped(&up->port)) { | |
| serial8250_stop_tx(&up->port); | |
| return; | |
| } | |
| @@ -1505,7 +1673,7 @@ | |
| up->port.icount.dsr++; | |
| if (status & UART_MSR_DDCD) | |
| uart_handle_dcd_change(&up->port, status & UART_MSR_DCD); | |
| - if (status & UART_MSR_DCTS) | |
| + if ( !(up->mcr& UART_MCR_AFE) && (status & UART_MSR_DCTS)) | |
| uart_handle_cts_change(&up->port, status & UART_MSR_CTS); | |
| wake_up_interruptible(&up->port.state->port.delta_msr_wait); | |
| @@ -1528,8 +1696,12 @@ | |
| DEBUG_INTR("status = %x...", status); | |
| - if (status & (UART_LSR_DR | UART_LSR_BI)) | |
| + if (status & (UART_LSR_DR | UART_LSR_BI)) { | |
| +#ifdef CONFIG_HAS_WAKELOCK | |
| + wake_lock_timeout(&up->uart_wake_lock, msecs_to_jiffies(10000)); | |
| +#endif | |
| receive_chars(up, &status); | |
| + } | |
| check_modem_status(up); | |
| if (status & UART_LSR_THRE) | |
| transmit_chars(up); | |
| @@ -1567,8 +1739,15 @@ | |
| unsigned int iir; | |
| up = list_entry(l, struct uart_8250_port, list); | |
| - | |
| + serial_ucr_pden(up, 0); | |
| iir = serial_in(up, UART_IIR); | |
| +#if defined(MOD_8250_FOR_BRCM) | |
| + if ((iir & UART_IIR_BUSY) == UART_IIR_BUSY) { | |
| + /* clear the busy detect indication interrupt */ | |
| + (void)serial_inp(up, UART_USR); | |
| + handled = 1; | |
| + } else | |
| +#endif | |
| if (!(iir & UART_IIR_NO_INT)) { | |
| serial8250_handle_port(up); | |
| @@ -1595,7 +1774,7 @@ | |
| if (l == i->head && pass_counter++ > PASS_LIMIT) { | |
| /* If we hit this, we're dead. */ | |
| - printk(KERN_ERR "serial8250: too much work for " | |
| + pr_err("serial8250: too much work for " | |
| "irq%d\n", irq); | |
| break; | |
| } | |
| @@ -1761,6 +1940,8 @@ | |
| lsr = serial_in(up, UART_LSR); | |
| up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; | |
| spin_unlock_irqrestore(&up->port.lock, flags); | |
| + if (!uart_circ_empty(&up->port.state->xmit) && (uart_tx_stopped(&up->port))) | |
| + check_modem_status(up); | |
| if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) && | |
| (!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) && | |
| (lsr & UART_LSR_THRE)) { | |
| @@ -1808,7 +1989,7 @@ | |
| ret |= TIOCM_RNG; | |
| if (status & UART_MSR_DSR) | |
| ret |= TIOCM_DSR; | |
| - if (status & UART_MSR_CTS) | |
| + //if (status & UART_MSR_CTS) | |
| ret |= TIOCM_CTS; | |
| return ret; | |
| } | |
| @@ -1848,6 +2029,7 @@ | |
| spin_unlock_irqrestore(&up->port.lock, flags); | |
| } | |
| + | |
| /* | |
| * Wait for transmitter & holding register to empty | |
| */ | |
| @@ -1938,9 +2120,15 @@ | |
| { | |
| struct uart_8250_port *up = (struct uart_8250_port *)port; | |
| unsigned long flags; | |
| +#if defined(MOD_8250_FOR_BRCM) | |
| + unsigned char iir; | |
| +#else | |
| unsigned char lsr, iir; | |
| +#endif | |
| int retval; | |
| + clk_enable(up->clk); | |
| + serial_ucr_pden(up, 0); | |
| up->capabilities = uart_config[up->port.type].flags; | |
| up->mcr = 0; | |
| @@ -1981,6 +2169,9 @@ | |
| (void) serial_inp(up, UART_RX); | |
| (void) serial_inp(up, UART_IIR); | |
| (void) serial_inp(up, UART_MSR); | |
| +#if defined(MOD_8250_FOR_BRCM) | |
| + (void) serial_inp(up, UART_USR); | |
| +#endif | |
| /* | |
| * At this point, there's no way the LSR could still be 0xff; | |
| @@ -1989,7 +2180,7 @@ | |
| */ | |
| if (!(up->port.flags & UPF_BUGGY_UART) && | |
| (serial_inp(up, UART_LSR) == 0xff)) { | |
| - printk(KERN_INFO "ttyS%d: LSR safety check engaged!\n", | |
| + pr_info("ttyS%d: LSR safety check engaged!\n", | |
| serial_index(&up->port)); | |
| return -ENODEV; | |
| } | |
| @@ -2049,6 +2240,9 @@ | |
| serial_index(port)); | |
| } | |
| } | |
| +#if defined(MOD_8250_FOR_BRCM) | |
| + up->bugs |= UART_BUG_THRE; | |
| +#endif | |
| /* | |
| * The above check will only give an accurate result the first time | |
| @@ -2091,6 +2285,7 @@ | |
| if (is_real_interrupt(up->port.irq)) | |
| up->port.mctrl |= TIOCM_OUT2; | |
| +#if !defined(MOD_8250_FOR_BRCM) | |
| serial8250_set_mctrl(&up->port, up->port.mctrl); | |
| /* Serial over Lan (SoL) hack: | |
| @@ -2127,6 +2322,10 @@ | |
| } | |
| dont_test_tx_en: | |
| +#else | |
| + /* only kick OUT1 and OUT2. rely on termios to set flow control signals! */ | |
| + serial8250_set_mctrl(&up->port, up->port.mctrl & (TIOCM_OUT1|TIOCM_OUT2)); | |
| +#endif | |
| spin_unlock_irqrestore(&up->port.lock, flags); | |
| /* | |
| @@ -2138,6 +2337,9 @@ | |
| serial_inp(up, UART_RX); | |
| serial_inp(up, UART_IIR); | |
| serial_inp(up, UART_MSR); | |
| +#if defined(MOD_8250_FOR_BRCM) | |
| + serial_inp(up, UART_USR); | |
| +#endif | |
| up->lsr_saved_flags = 0; | |
| up->msr_saved_flags = 0; | |
| @@ -2159,7 +2361,18 @@ | |
| (void) inb_p(icp); | |
| } | |
| - return 0; | |
| +#if defined(MOD_8250_FOR_BRCM) | |
| +#ifdef CONFIG_BCM_BT_UART_IOCTL | |
| + /* TODO: move to platform init */ | |
| + if (0 != brcm_init_bt_wake(&brcm_bt_lpm_data)) { | |
| + pr_info("brcm_init_bt_wake() failed!"); | |
| + } | |
| +#else | |
| +#error "CONFIG_BCM_BT_UART_IOCTL NOT DEFINED!!!!" | |
| +#endif | |
| +#endif | |
| + | |
| + return 0; | |
| } | |
| static void serial8250_shutdown(struct uart_port *port) | |
| @@ -2201,12 +2414,17 @@ | |
| * Read data port to reset things, and then unlink from | |
| * the IRQ chain. | |
| */ | |
| - (void) serial_in(up, UART_RX); | |
| del_timer_sync(&up->timer); | |
| up->timer.function = serial8250_timeout; | |
| if (is_real_interrupt(up->port.irq)) | |
| serial_unlink_irq_chain(up); | |
| + serial_ucr_pden(up, 1); | |
| + do { | |
| + serial_in(up, UART_RX); | |
| + udelay(2); | |
| + } while ((serial_ucr_pdstate(up))); | |
| + clk_disable(up->clk); | |
| } | |
| static unsigned int serial8250_get_divisor(struct uart_port *port, unsigned int baud) | |
| @@ -2229,6 +2447,66 @@ | |
| return quot; | |
| } | |
| +/* | |
| + * Routine which returns the proper uart input clock for the | |
| + * required baud rate. | |
| + * | |
| + * Note that the baud_table needs to be kept in sync with the | |
| + * include/asm/termbits.h file. | |
| + * Baud 16 * Baud UART_CLK Divisor | |
| + * ---------------------------------------------------------- | |
| + * 4800 76800 3000000 39.0625 | |
| + * 9600 153600 6000000 39.0625 | |
| + * 19200 307200 12000000 39.0625 | |
| + * 38400 614400 59000000 96.02864583 | |
| + * 57600 921600 59000000 64.01909722 | |
| + * 115200 1843200 59000000 32.00954861 | |
| + * 230400 3686400 59000000 16.00477431 | |
| + * 460800 7372800 59000000 8.002387153 | |
| + * 500000 8000000 48000000 6 | |
| + * 576000 9216000 37000000 4.014756944 | |
| + * 921600 14745600 59000000 4.001193576 | |
| + * 1000000 16000000 48000000 3 | |
| + * 1152000 18432000 37000000 2.007378472 | |
| + * 1500000 24000000 48000000 2 | |
| + * 2000000 32000000 64000000 2 | |
| + * 2500000 40000000 40000000 1 | |
| + * 3000000 48000000 48000000 1 | |
| + * 3500000 56000000 56000000 1 | |
| + * 4000000 64000000 64000000 1 | |
| + * ---------------------------------------------------------- | |
| + * Baudrate below 4800 is ignored as they are not used practically. | |
| + */ | |
| +static const speed_t uartclk_table[] = { | |
| + 1560000, 1560000, 1560000, 1560000, 1560000, | |
| + 1560000, 1560000, 1560000, 1560000, 1560000, | |
| + 1560000, 1560000, 3000000, 6000000, 12000000, | |
| + 59000000, 59000000, 59000000, 59000000, 59000000, | |
| + 48000000, 37000000, 59000000, 48000000, 37000000, | |
| + 48000000, 64000000, 40000000, 48000000, 56000000, | |
| + 64000000 | |
| +}; | |
| + | |
| +static void | |
| +uart_fix_clock_rate(struct uart_port *port, struct ktermios *termios) | |
| +{ | |
| + struct uart_8250_port *up = (struct uart_8250_port *)port; | |
| + speed_t uart_clk; | |
| + speed_t cbaud = termios->c_cflag & CBAUD; | |
| + if (cbaud & CBAUDEX) { | |
| + cbaud &= ~CBAUDEX; | |
| + if (cbaud < 1 || cbaud + 15 > ARRAY_SIZE(uartclk_table)) | |
| + termios->c_cflag &= ~CBAUDEX; | |
| + else | |
| + cbaud += 15; | |
| + } | |
| + uart_clk = uartclk_table[cbaud]; | |
| + if (port->uartclk != uart_clk) { | |
| + clk_set_rate(up->clk, uart_clk); | |
| + port->uartclk = clk_get_rate(up->clk); | |
| + } | |
| +} | |
| + | |
| static void | |
| serial8250_set_termios(struct uart_port *port, struct ktermios *termios, | |
| struct ktermios *old) | |
| @@ -2268,6 +2546,7 @@ | |
| /* | |
| * Ask the core to calculate the divisor for us. | |
| */ | |
| + uart_fix_clock_rate(port, termios); | |
| baud = uart_get_baud_rate(port, termios, old, | |
| port->uartclk / 16 / 0xffff, | |
| port->uartclk / 16); | |
| @@ -2294,10 +2573,20 @@ | |
| * have sufficient FIFO entries for the latency of the remote | |
| * UART to respond. IOW, at least 32 bytes of FIFO. | |
| */ | |
| - if (up->capabilities & UART_CAP_AFE && up->port.fifosize >= 32) { | |
| + /* | |
| + For BRCM specific UARTC config | |
| + MobC00152557: GPS satellite tracking is impacted with ongoing Data FTP session | |
| + problem: Found byte drop happens in UARTC due to overrun error on LSR | |
| + while receiving from FIFO. | |
| + Fix : Enable flow control even though UARTC fifo size is 16. | |
| + */ | |
| + if (up->capabilities & UART_CAP_AFE && up->port.fifosize >= 16) { | |
| up->mcr &= ~UART_MCR_AFE; | |
| - if (termios->c_cflag & CRTSCTS) | |
| + | |
| + if (termios->c_cflag & CRTSCTS) { | |
| + up->port.flags &= ~ASYNC_CTS_FLOW ; | |
| up->mcr |= UART_MCR_AFE; | |
| + } | |
| } | |
| /* | |
| @@ -2430,6 +2719,11 @@ | |
| struct uart_8250_port *p = (struct uart_8250_port *)port; | |
| serial8250_set_sleep(p, state != 0); | |
| + if (state != 0) { | |
| + clk_disable(p->clk); | |
| + } else { | |
| + clk_enable(p->clk); | |
| + } | |
| if (p->pm) | |
| p->pm(port, state, oldstate); | |
| @@ -2651,6 +2945,9 @@ | |
| .request_port = serial8250_request_port, | |
| .config_port = serial8250_config_port, | |
| .verify_port = serial8250_verify_port, | |
| +#ifdef CONFIG_BCM_BT_UART_IOCTL | |
| + .ioctl = serial8250_ioctl, | |
| +#endif | |
| #ifdef CONFIG_CONSOLE_POLL | |
| .poll_get_char = serial8250_get_poll_char, | |
| .poll_put_char = serial8250_put_poll_char, | |
| @@ -2775,6 +3072,7 @@ | |
| } else | |
| spin_lock(&up->port.lock); | |
| + serial_ucr_pden(up, 0); | |
| /* | |
| * First save the IER then disable the interrupts | |
| */ | |
| @@ -2972,6 +3270,7 @@ | |
| { | |
| struct plat_serial8250_port *p = dev->dev.platform_data; | |
| struct uart_port port; | |
| + struct uart_8250_port *up; | |
| int ret, i, irqflag = 0; | |
| memset(&port, 0, sizeof(struct uart_port)); | |
| @@ -2994,6 +3293,8 @@ | |
| port.type = p->type; | |
| port.serial_in = p->serial_in; | |
| port.serial_out = p->serial_out; | |
| + if(p->fifosize) | |
| + port.fifosize = p->fifosize; | |
| port.dev = &dev->dev; | |
| port.irqflags |= irqflag; | |
| ret = serial8250_register_port(&port); | |
| @@ -3004,6 +3305,16 @@ | |
| p->irq, ret); | |
| } | |
| } | |
| + if (dev->id >= 0) { | |
| + up = &serial8250_ports[dev->id]; | |
| + clk_enable(up->clk); | |
| + serial_ucr_pden(up, 1); | |
| + do { | |
| + serial_in(up, UART_RX); | |
| + udelay(2); | |
| + } while ((serial_ucr_pdstate(up))); | |
| + clk_disable(up->clk); | |
| + } | |
| return 0; | |
| } | |
| @@ -3017,6 +3328,9 @@ | |
| for (i = 0; i < nr_uarts; i++) { | |
| struct uart_8250_port *up = &serial8250_ports[i]; | |
| +#ifdef CONFIG_HAS_WAKELOCK | |
| + wake_lock_destroy(&up->uart_wake_lock); | |
| +#endif | |
| if (up->port.dev == &dev->dev) | |
| serial8250_unregister_port(i); | |
| } | |
| @@ -3134,6 +3448,12 @@ | |
| if (uart) { | |
| uart_remove_one_port(&serial8250_reg, &uart->port); | |
| + uart->clk = clk_get(uart->port.dev, dev_name(port->dev)); | |
| + if (IS_ERR(uart->clk)) | |
| + return PTR_ERR(uart->clk); | |
| + clk_set_rate(uart->clk, port->uartclk); | |
| + clk_enable(uart->clk); | |
| + uart->port.uartclk = clk_get_rate(uart->clk); | |
| uart->port.iobase = port->iobase; | |
| uart->port.membase = port->membase; | |
| uart->port.irq = port->irq; | |
| @@ -3161,6 +3481,12 @@ | |
| ret = uart_add_one_port(&serial8250_reg, &uart->port); | |
| if (ret == 0) | |
| ret = uart->port.line; | |
| + | |
| +#ifdef CONFIG_HAS_WAKELOCK | |
| + wake_lock_init(&uart->uart_wake_lock, WAKE_LOCK_SUSPEND, | |
| + dev_name(port->dev)); | |
| +#endif | |
| + clk_disable(uart->clk); | |
| } | |
| mutex_unlock(&serial_mutex); | |
| @@ -3200,7 +3526,7 @@ | |
| if (nr_uarts > UART_NR) | |
| nr_uarts = UART_NR; | |
| - printk(KERN_INFO "Serial: 8250/16550 driver, " | |
| + pr_info("Serial: 8250/16550 driver, " | |
| "%d ports, IRQ sharing %sabled\n", nr_uarts, | |
| share_irqs ? "en" : "dis"); | |
| @@ -3240,6 +3566,9 @@ | |
| uart_unregister_driver(&serial8250_reg); | |
| #endif | |
| out: | |
| +#ifdef CONFIG_KEYPAD_BACKLIGHT | |
| + Keypad_Led_control_On(); | |
| +#endif | |
| return ret; | |
| } | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial: brcm_bt_lpm.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial: brcm_bt_lpm.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/serial/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/serial/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial/Kconfig 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -1575,4 +1575,10 @@ | |
| help | |
| Enable a Altera UART port to be the system console. | |
| +config KEYPAD_BACKLIGHT | |
| + tristate "Keypad Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + Say Y to enable keypad backlight driver. | |
| + | |
| endmenu | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/serial/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/serial/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial/Makefile 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -15,6 +15,8 @@ | |
| obj-$(CONFIG_SERIAL_SUNSAB) += sunsab.o | |
| obj-$(CONFIG_SERIAL_8250) += 8250.o | |
| +# temp work arround. make own module | |
| +obj-$(CONFIG_SERIAL_8250) += brcm_bt_lpm.o | |
| obj-$(CONFIG_SERIAL_8250_PNP) += 8250_pnp.o | |
| obj-$(CONFIG_SERIAL_8250_GSC) += 8250_gsc.o | |
| obj-$(CONFIG_SERIAL_8250_PCI) += 8250_pci.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/serial/serial_core.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial/serial_core.c | |
| --- /path/to/linux-2.6.35.7/drivers/serial/serial_core.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/serial/serial_core.c 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -94,6 +94,9 @@ | |
| struct uart_state *state = tty->driver_data; | |
| struct uart_port *port = state->uart_port; | |
| + if (port->ops->wake_peer) | |
| + port->ops->wake_peer(port); | |
| + | |
| if (!uart_circ_empty(&state->xmit) && state->xmit.buf && | |
| !tty->stopped && !tty->hw_stopped) | |
| port->ops->start_tx(port); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/spi/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/spi/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/spi/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/spi/Kconfig 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -151,6 +151,14 @@ | |
| This enables using the Freescale i.MX SPI controllers in master | |
| mode. | |
| +config SPI_BCM21XX | |
| + tristate "Broadcom 21XX SPI controller" | |
| + depends on ARCH_BCM116X || ARCH_BCM215XX | |
| + help | |
| + This enables using the Broadcom SPI controller in master | |
| + mode. | |
| + | |
| + | |
| config SPI_LM70_LLP | |
| tristate "Parallel port adapter for LM70 eval board (DEVELOPMENT)" | |
| depends on PARPORT && EXPERIMENTAL | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/spi/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/spi/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/spi/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/spi/Makefile 2018-07-12 10:13:44.000000000 +0700 | |
| @@ -6,6 +6,10 @@ | |
| EXTRA_CFLAGS += -DDEBUG | |
| endif | |
| +ifeq ($(CONFIG_ATHENA),y) | |
| +EXTRA_CFLAGS += -D_ATHENA_ | |
| +endif | |
| + | |
| # small core, mostly translating board-specific | |
| # config declarations into driver model code | |
| obj-$(CONFIG_SPI_MASTER) += spi.o | |
| @@ -46,6 +50,11 @@ | |
| obj-$(CONFIG_SPI_SH_SCI) += spi_sh_sci.o | |
| obj-$(CONFIG_SPI_SH_MSIOF) += spi_sh_msiof.o | |
| obj-$(CONFIG_SPI_STMP3XXX) += spi_stmp.o | |
| +ifdef CONFIG_OSDAL_SUPPORT | |
| +obj-$(CONFIG_SPI_BCM21XX) += spi_bcm21xx_osdal.o | |
| +else | |
| +obj-$(CONFIG_SPI_BCM21XX) += spi_bcm21xx.o | |
| +endif | |
| obj-$(CONFIG_SPI_NUC900) += spi_nuc900.o | |
| # special build for s3c24xx spi driver with fiq support | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/spi: spi_bcm21xx_osdal.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/staging: android | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/staging/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/staging/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/staging/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/staging/Kconfig 2018-07-12 10:13:34.000000000 +0700 | |
| @@ -81,6 +81,8 @@ | |
| source "drivers/staging/frontier/Kconfig" | |
| +source "drivers/staging/android/Kconfig" | |
| + | |
| source "drivers/staging/dream/Kconfig" | |
| source "drivers/staging/pohmelfs/Kconfig" | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/staging/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/staging/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/staging/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/staging/Makefile 2018-07-12 10:13:34.000000000 +0700 | |
| @@ -23,6 +23,7 @@ | |
| obj-$(CONFIG_RTL8192U) += rtl8192u/ | |
| obj-$(CONFIG_RTL8192E) += rtl8192e/ | |
| obj-$(CONFIG_TRANZPORT) += frontier/ | |
| +obj-$(CONFIG_ANDROID) += android/ | |
| obj-$(CONFIG_DREAM) += dream/ | |
| obj-$(CONFIG_POHMELFS) += pohmelfs/ | |
| obj-$(CONFIG_IDE_PHISON) += phison/ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers: switch | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget: android.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/composite.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/composite.c | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/composite.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/composite.c 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -71,6 +71,59 @@ | |
| /*-------------------------------------------------------------------------*/ | |
| +static ssize_t enable_show(struct device *dev, struct device_attribute *attr, | |
| + char *buf) | |
| +{ | |
| + struct usb_function *f = dev_get_drvdata(dev); | |
| + return sprintf(buf, "%d\n", !f->disabled); | |
| +} | |
| + | |
| +static ssize_t enable_store( | |
| + struct device *dev, struct device_attribute *attr, | |
| + const char *buf, size_t size) | |
| +{ | |
| + struct usb_function *f = dev_get_drvdata(dev); | |
| + struct usb_composite_driver *driver = f->config->cdev->driver; | |
| + int value; | |
| + | |
| + sscanf(buf, "%d", &value); | |
| + if (driver->enable_function) | |
| + driver->enable_function(f, value); | |
| + else | |
| + usb_function_set_enabled(f, value); | |
| + | |
| + return size; | |
| +} | |
| + | |
| +static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, enable_show, enable_store); | |
| + | |
| +void usb_function_set_enabled(struct usb_function *f, int enabled) | |
| +{ | |
| + f->disabled = !enabled; | |
| + kobject_uevent(&f->dev->kobj, KOBJ_CHANGE); | |
| +} | |
| + | |
| + | |
| +void usb_composite_force_reset(struct usb_composite_dev *cdev) | |
| +{ | |
| + unsigned long flags; | |
| + | |
| + spin_lock_irqsave(&cdev->lock, flags); | |
| + /* force reenumeration */ | |
| + if (cdev && cdev->gadget && | |
| + cdev->gadget->speed != USB_SPEED_UNKNOWN) { | |
| + /* avoid sending a disconnect switch event until after we disconnect */ | |
| + cdev->mute_switch = 1; | |
| + spin_unlock_irqrestore(&cdev->lock, flags); | |
| + | |
| + usb_gadget_disconnect(cdev->gadget); | |
| + msleep(10); | |
| + usb_gadget_connect(cdev->gadget); | |
| + } else { | |
| + spin_unlock_irqrestore(&cdev->lock, flags); | |
| + } | |
| +} | |
| + | |
| /** | |
| * usb_add_function() - add a function to a configuration | |
| * @config: the configuration | |
| @@ -88,15 +141,30 @@ | |
| int usb_add_function(struct usb_configuration *config, | |
| struct usb_function *function) | |
| { | |
| + struct usb_composite_dev *cdev = config->cdev; | |
| int value = -EINVAL; | |
| + int index; | |
| - DBG(config->cdev, "adding '%s'/%p to config '%s'/%p\n", | |
| + DBG(cdev, "adding '%s'/%p to config '%s'/%p\n", | |
| function->name, function, | |
| config->label, config); | |
| if (!function->set_alt || !function->disable) | |
| goto done; | |
| + index = atomic_inc_return(&cdev->driver->function_count); | |
| + function->dev = device_create(cdev->driver->class, NULL, | |
| + MKDEV(0, index), NULL, function->name); | |
| + if (IS_ERR(function->dev)) | |
| + return PTR_ERR(function->dev); | |
| + | |
| + value = device_create_file(function->dev, &dev_attr_enable); | |
| + if (value < 0) { | |
| + device_destroy(cdev->driver->class, MKDEV(0, index)); | |
| + return value; | |
| + } | |
| + dev_set_drvdata(function->dev, function); | |
| + | |
| function->config = config; | |
| list_add_tail(&function->list, &config->functions); | |
| @@ -122,7 +190,7 @@ | |
| done: | |
| if (value) | |
| - DBG(config->cdev, "adding '%s'/%p --> %d\n", | |
| + DBG(cdev, "adding '%s'/%p --> %d\n", | |
| function->name, function, value); | |
| return value; | |
| } | |
| @@ -232,17 +300,19 @@ | |
| enum usb_device_speed speed, void *buf, u8 type) | |
| { | |
| struct usb_config_descriptor *c = buf; | |
| + struct usb_interface_descriptor *intf; | |
| void *next = buf + USB_DT_CONFIG_SIZE; | |
| int len = USB_BUFSIZ - USB_DT_CONFIG_SIZE; | |
| struct usb_function *f; | |
| int status; | |
| + int interfaceCount = 0; | |
| + u8 *dest; | |
| /* write the config descriptor */ | |
| c = buf; | |
| c->bLength = USB_DT_CONFIG_SIZE; | |
| c->bDescriptorType = type; | |
| - /* wTotalLength is written later */ | |
| - c->bNumInterfaces = config->next_interface_id; | |
| + /* wTotalLength and bNumInterfaces are written later */ | |
| c->bConfigurationValue = config->bConfigurationValue; | |
| c->iConfiguration = config->iConfiguration; | |
| c->bmAttributes = USB_CONFIG_ATT_ONE | config->bmAttributes; | |
| @@ -261,23 +331,40 @@ | |
| /* add each function's descriptors */ | |
| list_for_each_entry(f, &config->functions, list) { | |
| struct usb_descriptor_header **descriptors; | |
| + struct usb_descriptor_header *descriptor; | |
| if (speed == USB_SPEED_HIGH) | |
| descriptors = f->hs_descriptors; | |
| else | |
| descriptors = f->descriptors; | |
| - if (!descriptors) | |
| + if (f->disabled || !descriptors || descriptors[0] == NULL) | |
| continue; | |
| status = usb_descriptor_fillbuf(next, len, | |
| (const struct usb_descriptor_header **) descriptors); | |
| if (status < 0) | |
| return status; | |
| + | |
| + /* set interface numbers dynamically */ | |
| + dest = next; | |
| + while ((descriptor = *descriptors++) != NULL) { | |
| + intf = (struct usb_interface_descriptor *)dest; | |
| + if (intf->bDescriptorType == USB_DT_INTERFACE) { | |
| + /* don't increment bInterfaceNumber for alternate settings */ | |
| + if (intf->bAlternateSetting == 0) | |
| + intf->bInterfaceNumber = interfaceCount++; | |
| + else | |
| + intf->bInterfaceNumber = interfaceCount - 1; | |
| + } | |
| + dest += intf->bLength; | |
| + } | |
| + | |
| len -= status; | |
| next += status; | |
| } | |
| len = next - buf; | |
| c->wTotalLength = cpu_to_le16(len); | |
| + c->bNumInterfaces = interfaceCount; | |
| return len; | |
| } | |
| @@ -424,6 +511,8 @@ | |
| if (!f) | |
| break; | |
| + if (f->disabled) | |
| + continue; | |
| /* | |
| * Record which endpoints are used by the function. This is used | |
| @@ -463,6 +552,8 @@ | |
| power = c->bMaxPower ? (2 * c->bMaxPower) : CONFIG_USB_GADGET_VBUS_DRAW; | |
| done: | |
| usb_gadget_vbus_draw(gadget, power); | |
| + | |
| + schedule_work(&cdev->switch_work); | |
| return result; | |
| } | |
| @@ -759,6 +850,21 @@ | |
| case USB_DT_STRING: | |
| value = get_string(cdev, req->buf, | |
| w_index, w_value & 0xff); | |
| + | |
| + /* Allow functions to handle USB_DT_STRING. | |
| + * This is required for MTP. | |
| + */ | |
| + if (value < 0) { | |
| + struct usb_configuration *cfg; | |
| + list_for_each_entry(cfg, &cdev->configs, list) { | |
| + if (cfg && cfg->setup) { | |
| + value = cfg->setup(cfg, ctrl); | |
| + if (value >= 0) | |
| + break; | |
| + } | |
| + } | |
| + } | |
| + | |
| if (value >= 0) | |
| value = min(w_length, (u16) value); | |
| break; | |
| @@ -784,11 +890,11 @@ | |
| case USB_REQ_GET_CONFIGURATION: | |
| if (ctrl->bRequestType != USB_DIR_IN) | |
| goto unknown; | |
| - if (cdev->config) | |
| + if (cdev->config) { | |
| *(u8 *)req->buf = cdev->config->bConfigurationValue; | |
| - else | |
| + value = min(w_length, (u16) 1); | |
| + } else | |
| *(u8 *)req->buf = 0; | |
| - value = min(w_length, (u16) 1); | |
| break; | |
| /* function drivers must handle get/set altsetting; if there's | |
| @@ -838,6 +944,9 @@ | |
| */ | |
| switch (ctrl->bRequestType & USB_RECIP_MASK) { | |
| case USB_RECIP_INTERFACE: | |
| + if (cdev->config == NULL) | |
| + return value; | |
| + | |
| f = cdev->config->interface[intf]; | |
| break; | |
| @@ -862,6 +971,25 @@ | |
| value = c->setup(c, ctrl); | |
| } | |
| + /* If the vendor request is not processed (value < 0), | |
| + * call all device registered configure setup callbacks | |
| + * to process it. | |
| + * This is used to handle the following cases: | |
| + * - vendor request is for the device and arrives before | |
| + * setconfiguration. | |
| + * - Some devices are required to handle vendor request before | |
| + * setconfiguration such as MTP, USBNET. | |
| + */ | |
| + | |
| + if (value < 0) { | |
| + struct usb_configuration *cfg; | |
| + | |
| + list_for_each_entry(cfg, &cdev->configs, list) { | |
| + if (cfg && cfg->setup) | |
| + value = cfg->setup(cfg, ctrl); | |
| + } | |
| + } | |
| + | |
| goto done; | |
| } | |
| @@ -893,6 +1021,11 @@ | |
| spin_lock_irqsave(&cdev->lock, flags); | |
| if (cdev->config) | |
| reset_config(cdev); | |
| + | |
| + if (cdev->mute_switch) | |
| + cdev->mute_switch = 0; | |
| + else | |
| + schedule_work(&cdev->switch_work); | |
| spin_unlock_irqrestore(&cdev->lock, flags); | |
| } | |
| @@ -954,6 +1087,8 @@ | |
| kfree(cdev->req->buf); | |
| usb_ep_free_request(gadget->ep0, cdev->req); | |
| } | |
| + | |
| + switch_dev_unregister(&cdev->sdev); | |
| kfree(cdev); | |
| set_gadget_data(gadget, NULL); | |
| device_remove_file(&gadget->dev, &dev_attr_suspended); | |
| @@ -982,6 +1117,19 @@ | |
| } | |
| } | |
| +static void | |
| +composite_switch_work(struct work_struct *data) | |
| +{ | |
| + struct usb_composite_dev *cdev = | |
| + container_of(data, struct usb_composite_dev, switch_work); | |
| + struct usb_configuration *config = cdev->config; | |
| + | |
| + if (config) | |
| + switch_set_state(&cdev->sdev, config->bConfigurationValue); | |
| + else | |
| + switch_set_state(&cdev->sdev, 0); | |
| +} | |
| + | |
| static int composite_bind(struct usb_gadget *gadget) | |
| { | |
| struct usb_composite_dev *cdev; | |
| @@ -1033,6 +1181,12 @@ | |
| if (status < 0) | |
| goto fail; | |
| + cdev->sdev.name = "usb_configuration"; | |
| + status = switch_dev_register(&cdev->sdev); | |
| + if (status < 0) | |
| + goto fail; | |
| + INIT_WORK(&cdev->switch_work, composite_switch_work); | |
| + | |
| cdev->desc = *composite->dev; | |
| cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket; | |
| @@ -1107,6 +1261,23 @@ | |
| cdev->suspended = 0; | |
| } | |
| +static int | |
| +composite_uevent(struct device *dev, struct kobj_uevent_env *env) | |
| +{ | |
| + struct usb_function *f = dev_get_drvdata(dev); | |
| + | |
| + if (!f) { | |
| + /* this happens when the device is first created */ | |
| + return 0; | |
| + } | |
| + | |
| + if (add_uevent_var(env, "FUNCTION=%s", f->name)) | |
| + return -ENOMEM; | |
| + if (add_uevent_var(env, "ENABLED=%d", !f->disabled)) | |
| + return -ENOMEM; | |
| + return 0; | |
| +} | |
| + | |
| /*-------------------------------------------------------------------------*/ | |
| static struct usb_gadget_driver composite_driver = { | |
| @@ -1152,6 +1323,11 @@ | |
| composite_driver.driver.name = driver->name; | |
| composite = driver; | |
| + driver->class = class_create(THIS_MODULE, "usb_composite"); | |
| + if (IS_ERR(driver->class)) | |
| + return PTR_ERR(driver->class); | |
| + driver->class->dev_uevent = composite_uevent; | |
| + | |
| return usb_gadget_register_driver(&composite_driver); | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/f_acm.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/f_acm.c | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/f_acm.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/f_acm.c 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -17,6 +17,7 @@ | |
| #include <linux/slab.h> | |
| #include <linux/kernel.h> | |
| #include <linux/device.h> | |
| +#include <linux/usb/android_composite.h> | |
| #include "u_serial.h" | |
| #include "gadget_chips.h" | |
| @@ -405,10 +406,10 @@ | |
| usb_ep_disable(acm->notify); | |
| } else { | |
| VDBG(cdev, "init acm ctrl interface %d\n", intf); | |
| - acm->notify_desc = ep_choose(cdev->gadget, | |
| - acm->hs.notify, | |
| - acm->fs.notify); | |
| } | |
| + acm->notify_desc = ep_choose(cdev->gadget, | |
| + acm->hs.notify, | |
| + acm->fs.notify); | |
| usb_ep_enable(acm->notify, acm->notify_desc); | |
| acm->notify->driver_data = acm; | |
| @@ -418,11 +419,11 @@ | |
| gserial_disconnect(&acm->port); | |
| } else { | |
| DBG(cdev, "activate acm ttyGS%d\n", acm->port_num); | |
| - acm->port.in_desc = ep_choose(cdev->gadget, | |
| - acm->hs.in, acm->fs.in); | |
| - acm->port.out_desc = ep_choose(cdev->gadget, | |
| - acm->hs.out, acm->fs.out); | |
| } | |
| + acm->port.in_desc = ep_choose(cdev->gadget, | |
| + acm->hs.in, acm->fs.in); | |
| + acm->port.out_desc = ep_choose(cdev->gadget, | |
| + acm->hs.out, acm->fs.out); | |
| gserial_connect(&acm->port, acm->port_num); | |
| } else | |
| @@ -782,3 +783,28 @@ | |
| kfree(acm); | |
| return status; | |
| } | |
| + | |
| +#ifdef CONFIG_USB_ANDROID_ACM | |
| + | |
| +int acm_function_bind_config(struct usb_configuration *c) | |
| +{ | |
| + int ret = acm_bind_config(c, 0); | |
| + if (ret == 0) | |
| + gserial_setup(c->cdev->gadget, 1); | |
| + return ret; | |
| +} | |
| + | |
| +static struct android_usb_function acm_function = { | |
| + .name = "acm", | |
| + .bind_config = acm_function_bind_config, | |
| +}; | |
| + | |
| +static int __init init(void) | |
| +{ | |
| + printk(KERN_INFO "f_acm init\n"); | |
| + android_register_function(&acm_function); | |
| + return 0; | |
| +} | |
| +module_init(init); | |
| + | |
| +#endif /* CONFIG_USB_ANDROID_ACM */ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget: f_adb.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/f_mass_storage.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/f_mass_storage.c | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/f_mass_storage.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/f_mass_storage.c 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -295,7 +295,12 @@ | |
| #include "gadget_chips.h" | |
| +#ifdef CONFIG_USB_ANDROID_MASS_STORAGE | |
| +#include <linux/usb/android_composite.h> | |
| +#include <linux/platform_device.h> | |
| +#define FUNCTION_NAME "usb_mass_storage" | |
| +#endif | |
| /*------------------------------------------------------------------------*/ | |
| @@ -408,6 +413,10 @@ | |
| u16 release; | |
| char can_stall; | |
| + | |
| +#ifdef CONFIG_USB_ANDROID_MASS_STORAGE | |
| + struct platform_device *pdev; | |
| +#endif | |
| }; | |
| @@ -2717,7 +2726,13 @@ | |
| curlun->ro = lcfg->cdrom || lcfg->ro; | |
| curlun->removable = lcfg->removable; | |
| curlun->dev.release = fsg_lun_release; | |
| + | |
| +#ifdef CONFIG_USB_ANDROID_MASS_STORAGE | |
| + /* use "usb_mass_storage" platform device as parent */ | |
| + curlun->dev.parent = &cfg->pdev->dev; | |
| +#else | |
| curlun->dev.parent = &gadget->dev; | |
| +#endif | |
| /* curlun->dev.driver = &fsg_driver.driver; XXX */ | |
| dev_set_drvdata(&curlun->dev, &common->filesem); | |
| dev_set_name(&curlun->dev, | |
| @@ -3001,7 +3016,11 @@ | |
| if (unlikely(!fsg)) | |
| return -ENOMEM; | |
| +#ifdef CONFIG_USB_ANDROID_MASS_STORAGE | |
| + fsg->function.name = FUNCTION_NAME; | |
| +#else | |
| fsg->function.name = FSG_DRIVER_DESC; | |
| +#endif | |
| fsg->function.strings = fsg_strings_array; | |
| fsg->function.bind = fsg_bind; | |
| fsg->function.unbind = fsg_unbind; | |
| @@ -3118,3 +3137,63 @@ | |
| return fsg_common_init(common, cdev, &cfg); | |
| } | |
| +#ifdef CONFIG_USB_ANDROID_MASS_STORAGE | |
| + | |
| +static struct fsg_config fsg_cfg; | |
| + | |
| +static int fsg_probe(struct platform_device *pdev) | |
| +{ | |
| + struct usb_mass_storage_platform_data *pdata = pdev->dev.platform_data; | |
| + int i, nluns; | |
| + | |
| + printk(KERN_INFO "fsg_probe pdev: %p, pdata: %p\n", pdev, pdata); | |
| + if (!pdata) | |
| + return -1; | |
| + | |
| + nluns = pdata->nluns; | |
| + if (nluns > FSG_MAX_LUNS) | |
| + nluns = FSG_MAX_LUNS; | |
| + fsg_cfg.nluns = nluns; | |
| + for (i = 0; i < nluns; i++) | |
| + fsg_cfg.luns[i].removable = 1; | |
| + | |
| + fsg_cfg.vendor_name = pdata->vendor; | |
| + fsg_cfg.product_name = pdata->product; | |
| + fsg_cfg.release = pdata->release; | |
| + fsg_cfg.can_stall = 0; | |
| + fsg_cfg.pdev = pdev; | |
| + | |
| + return 0; | |
| +} | |
| + | |
| +static struct platform_driver fsg_platform_driver = { | |
| + .driver = { .name = FUNCTION_NAME, }, | |
| + .probe = fsg_probe, | |
| +}; | |
| + | |
| +int mass_storage_bind_config(struct usb_configuration *c) | |
| +{ | |
| + struct fsg_common *common = fsg_common_init(NULL, c->cdev, &fsg_cfg); | |
| + if (IS_ERR(common)) | |
| + return -1; | |
| + return fsg_add(c->cdev, c, common); | |
| +} | |
| + | |
| +static struct android_usb_function mass_storage_function = { | |
| + .name = FUNCTION_NAME, | |
| + .bind_config = mass_storage_bind_config, | |
| +}; | |
| + | |
| +static int __init init(void) | |
| +{ | |
| + int rc; | |
| + printk(KERN_INFO "f_mass_storage init\n"); | |
| + rc = platform_driver_register(&fsg_platform_driver); | |
| + if (rc != 0) | |
| + return rc; | |
| + android_register_function(&mass_storage_function); | |
| + return 0; | |
| +}module_init(init); | |
| + | |
| +#endif /* CONFIG_USB_ANDROID_MASS_STORAGE */ | |
| + | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget: f_mtp.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/f_rndis.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/f_rndis.c | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/f_rndis.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/f_rndis.c 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -26,8 +26,9 @@ | |
| #include <linux/slab.h> | |
| #include <linux/kernel.h> | |
| -#include <linux/device.h> | |
| +#include <linux/platform_device.h> | |
| #include <linux/etherdevice.h> | |
| +#include <linux/usb/android_composite.h> | |
| #include <asm/atomic.h> | |
| @@ -129,9 +130,16 @@ | |
| /* .bInterfaceNumber = DYNAMIC */ | |
| /* status endpoint is optional; this could be patched later */ | |
| .bNumEndpoints = 1, | |
| +#ifdef CONFIG_USB_ANDROID_RNDIS_WCEIS | |
| + /* "Wireless" RNDIS; auto-detected by Windows */ | |
| + .bInterfaceClass = USB_CLASS_WIRELESS_CONTROLLER, | |
| + .bInterfaceSubClass = 1, | |
| + .bInterfaceProtocol = 3, | |
| +#else | |
| .bInterfaceClass = USB_CLASS_COMM, | |
| .bInterfaceSubClass = USB_CDC_SUBCLASS_ACM, | |
| .bInterfaceProtocol = USB_CDC_ACM_PROTO_VENDOR, | |
| +#endif | |
| /* .iInterface = DYNAMIC */ | |
| }; | |
| @@ -304,6 +312,10 @@ | |
| NULL, | |
| }; | |
| +#ifdef CONFIG_USB_ANDROID_RNDIS | |
| +static struct usb_ether_platform_data *rndis_pdata; | |
| +#endif | |
| + | |
| /*-------------------------------------------------------------------------*/ | |
| static struct sk_buff *rndis_add_header(struct gether *port, | |
| @@ -487,10 +499,10 @@ | |
| usb_ep_disable(rndis->notify); | |
| } else { | |
| VDBG(cdev, "init rndis ctrl %d\n", intf); | |
| - rndis->notify_desc = ep_choose(cdev->gadget, | |
| - rndis->hs.notify, | |
| - rndis->fs.notify); | |
| } | |
| + rndis->notify_desc = ep_choose(cdev->gadget, | |
| + rndis->hs.notify, | |
| + rndis->fs.notify); | |
| usb_ep_enable(rndis->notify, rndis->notify_desc); | |
| rndis->notify->driver_data = rndis; | |
| @@ -504,11 +516,11 @@ | |
| if (!rndis->port.in) { | |
| DBG(cdev, "init rndis\n"); | |
| - rndis->port.in = ep_choose(cdev->gadget, | |
| - rndis->hs.in, rndis->fs.in); | |
| - rndis->port.out = ep_choose(cdev->gadget, | |
| - rndis->hs.out, rndis->fs.out); | |
| } | |
| + rndis->port.in = ep_choose(cdev->gadget, | |
| + rndis->hs.in, rndis->fs.in); | |
| + rndis->port.out = ep_choose(cdev->gadget, | |
| + rndis->hs.out, rndis->fs.out); | |
| /* Avoid ZLPs; they can be troublesome. */ | |
| rndis->port.is_zlp_ok = false; | |
| @@ -707,11 +719,12 @@ | |
| rndis_set_param_medium(rndis->config, NDIS_MEDIUM_802_3, 0); | |
| rndis_set_host_mac(rndis->config, rndis->ethaddr); | |
| -#if 0 | |
| -// FIXME | |
| - if (rndis_set_param_vendor(rndis->config, vendorID, | |
| - manufacturer)) | |
| - goto fail0; | |
| +#ifdef CONFIG_USB_ANDROID_RNDIS | |
| + if (rndis_pdata) { | |
| + if (rndis_set_param_vendor(rndis->config, rndis_pdata->vendorID, | |
| + rndis_pdata->vendorDescr)) | |
| + goto fail; | |
| + } | |
| #endif | |
| /* NOTE: all that is done without knowing or caring about | |
| @@ -850,6 +863,11 @@ | |
| rndis->port.func.setup = rndis_setup; | |
| rndis->port.func.disable = rndis_disable; | |
| +#ifdef CONFIG_USB_ANDROID_RNDIS | |
| + /* start disabled */ | |
| + rndis->port.func.disabled = 1; | |
| +#endif | |
| + | |
| status = usb_add_function(c, &rndis->port.func); | |
| if (status) { | |
| kfree(rndis); | |
| @@ -858,3 +876,55 @@ | |
| } | |
| return status; | |
| } | |
| + | |
| +#ifdef CONFIG_USB_ANDROID_RNDIS | |
| +#include "rndis.c" | |
| + | |
| +static int rndis_probe(struct platform_device *pdev) | |
| +{ | |
| + rndis_pdata = pdev->dev.platform_data; | |
| + return 0; | |
| +} | |
| + | |
| +static struct platform_driver rndis_platform_driver = { | |
| + .driver = { .name = "rndis", }, | |
| + .probe = rndis_probe, | |
| +}; | |
| + | |
| +int rndis_function_bind_config(struct usb_configuration *c) | |
| +{ | |
| + int ret; | |
| + | |
| + if (!rndis_pdata) { | |
| + printk(KERN_ERR "rndis_pdata null in rndis_function_bind_config\n"); | |
| + return -1; | |
| + } | |
| +#if 0 // log delete | |
| + printk(KERN_INFO | |
| + "rndis_function_bind_config MAC: %02X:%02X:%02X:%02X:%02X:%02X\n", | |
| + rndis_pdata->ethaddr[0], rndis_pdata->ethaddr[1], | |
| + rndis_pdata->ethaddr[2], rndis_pdata->ethaddr[3], | |
| + rndis_pdata->ethaddr[4], rndis_pdata->ethaddr[5]); | |
| +#endif | |
| + | |
| + ret = gether_setup(c->cdev->gadget, rndis_pdata->ethaddr); | |
| + if (ret == 0) | |
| + ret = rndis_bind_config(c, rndis_pdata->ethaddr); | |
| + return ret; | |
| +} | |
| + | |
| +static struct android_usb_function rndis_function = { | |
| + .name = "rndis", | |
| + .bind_config = rndis_function_bind_config, | |
| +}; | |
| + | |
| +static int __init init(void) | |
| +{ | |
| + printk(KERN_INFO "f_rndis init\n"); | |
| + platform_driver_register(&rndis_platform_driver); | |
| + android_register_function(&rndis_function); | |
| + return 0; | |
| +} | |
| +module_init(init); | |
| + | |
| +#endif /* CONFIG_USB_ANDROID_RNDIS */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/Kconfig 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -836,6 +836,54 @@ | |
| For more information, see Documentation/usb/gadget_printer.txt | |
| which includes sample code for accessing the device file. | |
| +config USB_ANDROID | |
| + boolean "Android Gadget" | |
| + depends on SWITCH | |
| + help | |
| + The Android gadget driver supports multiple USB functions. | |
| + The functions can be configured via a board file and may be | |
| + enabled and disabled dynamically. | |
| + | |
| +config USB_ANDROID_ACM | |
| + boolean "Android gadget ACM serial function" | |
| + depends on USB_ANDROID | |
| + help | |
| + Provides ACM serial function for android gadget driver. | |
| + | |
| +config USB_ANDROID_ADB | |
| + boolean "Android gadget adb function" | |
| + depends on USB_ANDROID | |
| + help | |
| + Provides adb function for android gadget driver. | |
| + | |
| +config USB_ANDROID_MASS_STORAGE | |
| + boolean "Android gadget mass storage function" | |
| + depends on USB_ANDROID && SWITCH | |
| + help | |
| + Provides USB mass storage function for android gadget driver. | |
| + | |
| +config USB_ANDROID_MTP | |
| + boolean "Android MTP function" | |
| + depends on USB_ANDROID | |
| + help | |
| + Provides Media Transfer Protocol (MTP) support for android gadget driver. | |
| + | |
| +config USB_ANDROID_RNDIS | |
| + boolean "Android gadget RNDIS ethernet function" | |
| + depends on USB_ANDROID | |
| + help | |
| + Provides RNDIS ethernet function for android gadget driver. | |
| + | |
| +config USB_ANDROID_RNDIS_WCEIS | |
| + boolean "Use Windows Internet Sharing Class/SubClass/Protocol" | |
| + depends on USB_ANDROID_RNDIS | |
| + help | |
| + Causes the driver to look like a Windows-compatible Internet | |
| + Sharing device, so Windows auto-detects it. | |
| + | |
| + If you enable this option, the device is no longer CDC ethernet | |
| + compatible. | |
| + | |
| config USB_CDC_COMPOSITE | |
| tristate "CDC Composite Device (Ethernet and ACM)" | |
| depends on NET | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/Makefile 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -63,4 +63,10 @@ | |
| obj-$(CONFIG_USB_G_MULTI) += g_multi.o | |
| obj-$(CONFIG_USB_G_NOKIA) += g_nokia.o | |
| obj-$(CONFIG_USB_G_WEBCAM) += g_webcam.o | |
| +obj-$(CONFIG_USB_ANDROID) += android.o | |
| +obj-$(CONFIG_USB_ANDROID_ACM) += f_acm.o u_serial.o | |
| +obj-$(CONFIG_USB_ANDROID_ADB) += f_adb.o | |
| +obj-$(CONFIG_USB_ANDROID_MASS_STORAGE) += f_mass_storage.o | |
| +obj-$(CONFIG_USB_ANDROID_MTP) += f_mtp.o | |
| +obj-$(CONFIG_USB_ANDROID_RNDIS) += f_rndis.o u_ether.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/storage_common.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/storage_common.c | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/storage_common.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/storage_common.c 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -750,10 +750,16 @@ | |
| struct rw_semaphore *filesem = dev_get_drvdata(dev); | |
| int rc = 0; | |
| + | |
| +#ifndef CONFIG_USB_ANDROID_MASS_STORAGE | |
| + /* disabled in android because we need to allow closing the backing file | |
| + * if the media was removed | |
| + */ | |
| if (curlun->prevent_medium_removal && fsg_lun_is_open(curlun)) { | |
| LDBG(curlun, "eject attempt prevented\n"); | |
| return -EBUSY; /* "Door is locked" */ | |
| } | |
| +#endif | |
| /* Remove a trailing newline */ | |
| if (count > 0 && buf[count-1] == '\n') | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/u_ether.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/u_ether.c | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/u_ether.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/u_ether.c 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -820,9 +820,10 @@ | |
| dev_dbg(&g->dev, "register_netdev failed, %d\n", status); | |
| free_netdev(net); | |
| } else { | |
| +#if 0 // log delete | |
| INFO(dev, "MAC %pM\n", net->dev_addr); | |
| INFO(dev, "HOST MAC %pM\n", dev->host_mac); | |
| - | |
| +#endif | |
| the_dev = dev; | |
| } | |
| @@ -947,7 +948,6 @@ | |
| struct eth_dev *dev = link->ioport; | |
| struct usb_request *req; | |
| - WARN_ON(!dev); | |
| if (!dev) | |
| return; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/gadget/u_ether.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/u_ether.h | |
| --- /path/to/linux-2.6.35.7/drivers/usb/gadget/u_ether.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/gadget/u_ether.h 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -105,7 +105,7 @@ | |
| int ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); | |
| int eem_bind_config(struct usb_configuration *c); | |
| -#ifdef USB_ETH_RNDIS | |
| +#if defined(USB_ETH_RNDIS) || defined(CONFIG_USB_ANDROID_RNDIS) | |
| int rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]); | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb: gadget_brcm | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/usb/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/usb/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/usb/Kconfig 2018-07-12 10:13:41.000000000 +0700 | |
| @@ -157,7 +157,7 @@ | |
| source "drivers/usb/atm/Kconfig" | |
| -source "drivers/usb/gadget/Kconfig" | |
| +source "drivers/usb/gadget_brcm/Kconfig" | |
| source "drivers/usb/otg/Kconfig" | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight: aat1401_bl.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight: bcm_keypad_led.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/backlight/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/video/backlight/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight/Kconfig 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -27,6 +27,13 @@ | |
| if LCD_CLASS_DEVICE | |
| +config BACKLIGHT_LCDFB | |
| + tristate "Broadcom LCD FrameBuffer Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + default y | |
| + help | |
| + Support for the LCD backlight on the Broadcom reference phone. | |
| + | |
| config LCD_CORGI | |
| tristate "LCD Panel support for SHARP corgi/spitz model" | |
| depends on SPI_MASTER && PXA_SHARPSL | |
| @@ -229,6 +236,41 @@ | |
| If you have a LCD backlight connected to the WLED output of DA9030 | |
| or DA9034 WLED output, say Y here to enable this driver. | |
| +config BACKLIGHT_AAT1401 | |
| + tristate "Generic aat1401 wire based Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + If you have a LCD backlight adjustable by AAT1401 wire, say Y to enable | |
| + this driver. | |
| + | |
| +config BACKLIGHT_LUISA | |
| + tristate "Generic aat1401 wire based Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + If you have a LCD backlight adjustable by AAT1401 wire, say Y to enable | |
| + this driver. | |
| + | |
| +config BACKLIGHT_TOTORO | |
| + tristate "Generic aat1401 wire based Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + If you have a LCD backlight adjustable by AAT1401 wire, say Y to enable | |
| + this driver. | |
| + | |
| +config BACKLIGHT_TASSVE | |
| + tristate "Generic aat1401 wire based Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + If you have a LCD backlight adjustable by AAT1401 wire, say Y to enable | |
| + this driver. | |
| + | |
| +config BACKLIGHT_COOPERVE | |
| + tristate "Generic aat1401 wire based Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + If you have a LCD backlight adjustable by AAT1401 wire, say Y to enable | |
| + this driver. | |
| + | |
| config BACKLIGHT_MAX8925 | |
| tristate "Backlight driver for MAX8925" | |
| depends on MFD_MAX8925 | |
| @@ -236,6 +278,13 @@ | |
| If you have a LCD backlight connected to the WLED output of MAX8925 | |
| WLED output, say Y here to enable this driver. | |
| +config BACKLIGHT_S2C | |
| + tristate "Generic S2C wire based Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + If you have a LCD backlight adjustable by S2C wire, say Y to enable | |
| + this driver. | |
| + | |
| config BACKLIGHT_MBP_NVIDIA | |
| tristate "MacBook Pro Nvidia Backlight Driver" | |
| depends on X86 | |
| @@ -307,6 +356,25 @@ | |
| If you have a backlight driven by a NXP PCF50633 MFD, say Y here to | |
| enable its driver. | |
| +config BACKLIGHT_CAT3648 | |
| + tristate "Generic CAT3648 wire based Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + If you have a LCD backlight adjustable by CAT3648 wire, say Y to enable | |
| + this driver. | |
| + | |
| +config BACKLIGHT_BCM_PWM_KEYPAD | |
| + tristate "Broadcom PWM based Keypad Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE && HAVE_PWM && BCM_PWM_CORE | |
| + help | |
| + Say Y to enable Broadcom PWM based keypad backlight driver. | |
| + | |
| +config KEYPAD_BACKLIGHT | |
| + tristate "Keypad Backlight Driver" | |
| + depends on BACKLIGHT_CLASS_DEVICE | |
| + help | |
| + Say Y to enable keypad backlight driver. | |
| + | |
| endif # BACKLIGHT_CLASS_DEVICE | |
| endif # BACKLIGHT_LCD_SUPPORT | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/backlight/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/video/backlight/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight/Makefile 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -24,6 +24,8 @@ | |
| obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o | |
| obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o | |
| obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o | |
| +obj-$(CONFIG_BACKLIGHT_S2C) += s2c_bl.o | |
| +obj-$(CONFIG_BACKLIGHT_AAT1401) += aat1401_bl.o | |
| obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o | |
| obj-$(CONFIG_BACKLIGHT_MAX8925) += max8925_bl.o | |
| obj-$(CONFIG_BACKLIGHT_MBP_NVIDIA) += mbp_nvidia_bl.o | |
| @@ -32,7 +34,11 @@ | |
| obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o | |
| obj-$(CONFIG_BACKLIGHT_ADX) += adx_bl.o | |
| obj-$(CONFIG_BACKLIGHT_ADP5520) += adp5520_bl.o | |
| +obj-$(CONFIG_BACKLIGHT_CAT3648) += cat3648_bl.o | |
| +obj-$(CONFIG_BACKLIGHT_LCDFB) += lcdfb_backlight.o | |
| obj-$(CONFIG_BACKLIGHT_ADP8860) += adp8860_bl.o | |
| obj-$(CONFIG_BACKLIGHT_88PM860X) += 88pm860x_bl.o | |
| obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o | |
| +obj-$(CONFIG_BACKLIGHT_BCM_PWM_KEYPAD) += bcm_pwm_keypad_bl.o | |
| +obj-$(CONFIG_KEYPAD_BACKLIGHT) += bcm_keypad_led.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/backlight/pwm_bl.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight/pwm_bl.c | |
| --- /path/to/linux-2.6.35.7/drivers/video/backlight/pwm_bl.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight/pwm_bl.c 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -19,14 +19,22 @@ | |
| #include <linux/err.h> | |
| #include <linux/pwm.h> | |
| #include <linux/pwm_backlight.h> | |
| -#include <linux/slab.h> | |
| +#ifdef CONFIG_HAS_EARLYSUSPEND | |
| +#include <linux/earlysuspend.h> | |
| +#endif | |
| + | |
| +#include <plat/pwm/consumer.h> | |
| struct pwm_bl_data { | |
| - struct pwm_device *pwm; | |
| - struct device *dev; | |
| - unsigned int period; | |
| - int (*notify)(struct device *, | |
| - int brightness); | |
| + struct pwm_device *pwm; | |
| + struct device *dev; | |
| + unsigned int period; | |
| + int (*notify) (struct device *, int brightness); | |
| +#ifdef CONFIG_HAS_EARLYSUSPEND | |
| + struct backlight_device *bl; | |
| + struct early_suspend early_suspend_desc; | |
| + bool initialised; | |
| +#endif | |
| }; | |
| static int pwm_backlight_update_status(struct backlight_device *bl) | |
| @@ -34,6 +42,10 @@ | |
| struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); | |
| int brightness = bl->props.brightness; | |
| int max = bl->props.max_brightness; | |
| + unsigned long long place_holder; | |
| + | |
| + if(!pb->initialised) | |
| + return -ENODEV; | |
| if (bl->props.power != FB_BLANK_UNBLANK) | |
| brightness = 0; | |
| @@ -48,7 +60,13 @@ | |
| pwm_config(pb->pwm, 0, pb->period); | |
| pwm_disable(pb->pwm); | |
| } else { | |
| - pwm_config(pb->pwm, brightness * pb->period / max, pb->period); | |
| + /* Arithmetic operations of large numbers can go out of range | |
| + * Instead of just multiplying two huge numbers and dividing later, | |
| + * first reduce the number by dividing and then multiply. | |
| + * A temp var to prevent modifying pb->period*/ | |
| + place_holder = pb->period ; | |
| + do_div(place_holder,max); | |
| + pwm_config(pb->pwm, (place_holder * brightness), pb->period); | |
| pwm_enable(pb->pwm); | |
| } | |
| return 0; | |
| @@ -64,6 +82,51 @@ | |
| .get_brightness = pwm_backlight_get_brightness, | |
| }; | |
| +#ifdef CONFIG_HAS_EARLYSUSPEND | |
| +static void pwm_backlight_earlysuspend(struct early_suspend *desc) | |
| +{ | |
| + struct pwm_bl_data *pb = container_of(desc, struct pwm_bl_data, | |
| + early_suspend_desc); | |
| + pwm_config(pb->pwm, 0, pb->period); | |
| + pwm_disable(pb->pwm); | |
| + pb->initialised = false; | |
| +} | |
| + | |
| +static void pwm_backlight_earlyresume(struct early_suspend *desc) | |
| +{ | |
| + struct pwm_bl_data *pb = container_of(desc, struct pwm_bl_data, | |
| + early_suspend_desc); | |
| + pb->initialised = true; | |
| + backlight_update_status(pb->bl); | |
| +} | |
| +#else | |
| +#ifdef CONFIG_PM | |
| +static int pwm_backlight_suspend(struct platform_device *pdev, | |
| + pm_message_t state) | |
| +{ | |
| + struct backlight_device *bl = platform_get_drvdata(pdev); | |
| + struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); | |
| + | |
| + pwm_config(pb->pwm, 0, pb->period); | |
| + pwm_disable(pb->pwm); | |
| + pb->initialised = false; | |
| + return 0; | |
| +} | |
| + | |
| +static int pwm_backlight_resume(struct platform_device *pdev) | |
| +{ | |
| + struct backlight_device *bl = platform_get_drvdata(pdev); | |
| + | |
| + pb->initialised = true; | |
| + backlight_update_status(bl); | |
| + return 0; | |
| +} | |
| +#else | |
| +#define pwm_backlight_suspend NULL | |
| +#define pwm_backlight_resume NULL | |
| +#endif | |
| +#endif | |
| + | |
| static int pwm_backlight_probe(struct platform_device *pdev) | |
| { | |
| struct backlight_properties props; | |
| @@ -106,6 +169,7 @@ | |
| props.max_brightness = data->max_brightness; | |
| bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, pb, | |
| &pwm_backlight_ops, &props); | |
| + pb->initialised = true; | |
| if (IS_ERR(bl)) { | |
| dev_err(&pdev->dev, "failed to register backlight\n"); | |
| ret = PTR_ERR(bl); | |
| @@ -115,6 +179,14 @@ | |
| bl->props.brightness = data->dft_brightness; | |
| backlight_update_status(bl); | |
| +#ifdef CONFIG_HAS_EARLYSUSPEND | |
| + pb->early_suspend_desc.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN; | |
| + pb->early_suspend_desc.suspend = pwm_backlight_earlysuspend; | |
| + pb->early_suspend_desc.resume = pwm_backlight_earlyresume; | |
| + register_early_suspend(&pb->early_suspend_desc); | |
| + pb->bl = bl; | |
| +#endif | |
| + | |
| platform_set_drvdata(pdev, bl); | |
| return 0; | |
| @@ -138,54 +210,33 @@ | |
| pwm_config(pb->pwm, 0, pb->period); | |
| pwm_disable(pb->pwm); | |
| pwm_free(pb->pwm); | |
| +#ifdef CONFIG_HAS_EARLYSUSPEND | |
| + unregister_early_suspend(&pb->early_suspend_desc); | |
| +#endif | |
| kfree(pb); | |
| if (data->exit) | |
| data->exit(&pdev->dev); | |
| return 0; | |
| } | |
| -#ifdef CONFIG_PM | |
| -static int pwm_backlight_suspend(struct platform_device *pdev, | |
| - pm_message_t state) | |
| -{ | |
| - struct backlight_device *bl = platform_get_drvdata(pdev); | |
| - struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); | |
| - | |
| - if (pb->notify) | |
| - pb->notify(pb->dev, 0); | |
| - pwm_config(pb->pwm, 0, pb->period); | |
| - pwm_disable(pb->pwm); | |
| - return 0; | |
| -} | |
| - | |
| -static int pwm_backlight_resume(struct platform_device *pdev) | |
| -{ | |
| - struct backlight_device *bl = platform_get_drvdata(pdev); | |
| - | |
| - backlight_update_status(bl); | |
| - return 0; | |
| -} | |
| -#else | |
| -#define pwm_backlight_suspend NULL | |
| -#define pwm_backlight_resume NULL | |
| -#endif | |
| - | |
| static struct platform_driver pwm_backlight_driver = { | |
| - .driver = { | |
| - .name = "pwm-backlight", | |
| - .owner = THIS_MODULE, | |
| - }, | |
| - .probe = pwm_backlight_probe, | |
| - .remove = pwm_backlight_remove, | |
| - .suspend = pwm_backlight_suspend, | |
| - .resume = pwm_backlight_resume, | |
| + .driver = { | |
| + .name = "pwm-backlight", | |
| + .owner = THIS_MODULE, | |
| + }, | |
| + .probe = pwm_backlight_probe, | |
| + .remove = pwm_backlight_remove, | |
| +#ifndef CONFIG_HAS_EARLYSUSPEND | |
| + .suspend = pwm_backlight_suspend, | |
| + .resume = pwm_backlight_resume, | |
| +#endif | |
| }; | |
| static int __init pwm_backlight_init(void) | |
| { | |
| return platform_driver_register(&pwm_backlight_driver); | |
| } | |
| -module_init(pwm_backlight_init); | |
| +late_initcall(pwm_backlight_init); | |
| static void __exit pwm_backlight_exit(void) | |
| { | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/backlight: s2c_bl.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video: broadcom | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/fbmem.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/fbmem.c | |
| --- /path/to/linux-2.6.35.7/drivers/video/fbmem.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/fbmem.c 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -1323,14 +1323,14 @@ | |
| { | |
| int fbidx = iminor(file->f_path.dentry->d_inode); | |
| struct fb_info *info = registered_fb[fbidx]; | |
| - struct fb_ops *fb = info->fbops; | |
| - unsigned long off; | |
| + struct fb_ops *fb; | |
| + unsigned long mmio_pgoff; | |
| unsigned long start; | |
| u32 len; | |
| - if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) | |
| - return -EINVAL; | |
| - off = vma->vm_pgoff << PAGE_SHIFT; | |
| + if (!info) | |
| + return -ENODEV; | |
| + fb = info->fbops; | |
| if (!fb) | |
| return -ENODEV; | |
| mutex_lock(&info->mm_lock); | |
| @@ -1341,32 +1341,23 @@ | |
| return res; | |
| } | |
| - /* frame buffer memory */ | |
| + /* | |
| + * Ugh. This can be either the frame buffer mapping, or | |
| + * if pgoff points past it, the mmio mapping. | |
| + */ | |
| start = info->fix.smem_start; | |
| - len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len); | |
| - if (off >= len) { | |
| - /* memory mapped io */ | |
| - off -= len; | |
| - if (info->var.accel_flags) { | |
| - mutex_unlock(&info->mm_lock); | |
| - return -EINVAL; | |
| - } | |
| + len = info->fix.smem_len; | |
| + mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT; | |
| + if (vma->vm_pgoff >= mmio_pgoff) { | |
| + vma->vm_pgoff -= mmio_pgoff; | |
| start = info->fix.mmio_start; | |
| - len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.mmio_len); | |
| + len = info->fix.mmio_len; | |
| } | |
| mutex_unlock(&info->mm_lock); | |
| - start &= PAGE_MASK; | |
| - if ((vma->vm_end - vma->vm_start + off) > len) | |
| - return -EINVAL; | |
| - off += start; | |
| - vma->vm_pgoff = off >> PAGE_SHIFT; | |
| - /* This is an IO map - tell maydump to skip this VMA */ | |
| - vma->vm_flags |= VM_IO | VM_RESERVED; | |
| - fb_pgprotect(file, vma, off); | |
| - if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, | |
| - vma->vm_end - vma->vm_start, vma->vm_page_prot)) | |
| - return -EAGAIN; | |
| - return 0; | |
| + vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); | |
| + fb_pgprotect(file, vma, start); | |
| + | |
| + return vm_iomap_memory(vma, start, len); | |
| } | |
| static int | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/video/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/Kconfig 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -2071,6 +2071,14 @@ | |
| framebuffer. ML300 carries a 640*480 LCD display on the board, | |
| ML403 uses a standard DB15 VGA connector. | |
| +config FB_BCM | |
| + tristate "BCM platform framebuffer support" | |
| + depends on FB && (ARCH_BCM116X || ARCH_BCM215XX) | |
| + select FB_CFB_FILLRECT | |
| + select FB_CFB_COPYAREA | |
| + select FB_CFB_IMAGEBLIT | |
| + default y | |
| + | |
| config FB_COBALT | |
| tristate "Cobalt server LCD frame buffer support" | |
| depends on FB && MIPS_COBALT | |
| @@ -2243,4 +2251,8 @@ | |
| source "drivers/video/logo/Kconfig" | |
| endif | |
| +if FB_BCM | |
| + source "drivers/video/broadcom/Kconfig" | |
| +endif | |
| + | |
| endmenu | |
| Only in /path/to/linux-2.6.35.7/drivers/video/logo: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/logo/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/logo/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/video/logo/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/logo/Kconfig 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -37,6 +37,11 @@ | |
| depends on BLACKFIN | |
| default y | |
| +config LOGO_LINUX_BCM2157 | |
| + bool "Broadcom BCM2157 224-color Linux logo" | |
| + depends on LOGO | |
| + default n | |
| + | |
| config LOGO_DEC_CLUT224 | |
| bool "224-color Digital Equipment Corporation Linux logo" | |
| depends on MACH_DECSTATION || ALPHA | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/logo: logo_bcm2157_clut224.ppm | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/logo/logo.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/logo/logo.c | |
| --- /path/to/linux-2.6.35.7/drivers/video/logo/logo.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/logo/logo.c 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -46,7 +46,7 @@ | |
| logo = &logo_superh_mono; | |
| #endif | |
| } | |
| - | |
| + | |
| if (depth >= 4) { | |
| #ifdef CONFIG_LOGO_LINUX_VGA16 | |
| /* Generic Linux logo */ | |
| @@ -61,8 +61,12 @@ | |
| logo = &logo_superh_vga16; | |
| #endif | |
| } | |
| - | |
| + | |
| if (depth >= 8) { | |
| +#ifdef CONFIG_LOGO_LINUX_BCM2157 | |
| + /* Broadcom splash screen */ | |
| + logo = &logo_bcm2157_clut224; | |
| +#endif | |
| #ifdef CONFIG_LOGO_LINUX_CLUT224 | |
| /* Generic Linux logo */ | |
| logo = &logo_linux_clut224; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/logo/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/logo/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/video/logo/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/logo/Makefile 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -11,6 +11,7 @@ | |
| obj-$(CONFIG_LOGO_PARISC_CLUT224) += logo_parisc_clut224.o | |
| obj-$(CONFIG_LOGO_SGI_CLUT224) += logo_sgi_clut224.o | |
| obj-$(CONFIG_LOGO_SUN_CLUT224) += logo_sun_clut224.o | |
| +obj-$(CONFIG_LOGO_LINUX_BCM2157) += logo_bcm2157_clut224.o | |
| obj-$(CONFIG_LOGO_SUPERH_MONO) += logo_superh_mono.o | |
| obj-$(CONFIG_LOGO_SUPERH_VGA16) += logo_superh_vga16.o | |
| obj-$(CONFIG_LOGO_SUPERH_CLUT224) += logo_superh_clut224.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/video/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/video/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/video/Makefile 2018-07-12 10:13:38.000000000 +0700 | |
| @@ -130,6 +130,7 @@ | |
| obj-$(CONFIG_FB_CARMINE) += carminefb.o | |
| obj-$(CONFIG_FB_MB862XX) += mb862xx/ | |
| obj-$(CONFIG_FB_MSM) += msm/ | |
| +obj-$(CONFIG_FB_BCM) += broadcom/ | |
| obj-$(CONFIG_FB_NUC900) += nuc900fb.o | |
| # Platform or fallback drivers go here | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/w1/w1.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/w1/w1.c | |
| --- /path/to/linux-2.6.35.7/drivers/w1/w1.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/w1/w1.c 2018-07-12 10:13:43.000000000 +0700 | |
| @@ -517,10 +517,10 @@ | |
| static W1_MASTER_ATTR_RO(attempts, S_IRUGO); | |
| static W1_MASTER_ATTR_RO(timeout, S_IRUGO); | |
| static W1_MASTER_ATTR_RO(pointer, S_IRUGO); | |
| -static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUGO); | |
| -static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUGO); | |
| -static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUGO); | |
| -static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUGO); | |
| +static W1_MASTER_ATTR_RW(search, S_IRUGO | S_IWUSR | S_IWGRP); | |
| +static W1_MASTER_ATTR_RW(pullup, S_IRUGO | S_IWUSR | S_IWGRP); | |
| +static W1_MASTER_ATTR_RW(add, S_IRUGO | S_IWUSR | S_IWGRP); | |
| +static W1_MASTER_ATTR_RW(remove, S_IRUGO | S_IWUSR | S_IWGRP); | |
| static struct attribute *w1_master_default_attrs[] = { | |
| &w1_master_attribute_name.attr, | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/watchdog: bcm_watchdog.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/watchdog/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/watchdog/Kconfig | |
| --- /path/to/linux-2.6.35.7/drivers/watchdog/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/watchdog/Kconfig 2018-07-12 10:13:45.000000000 +0700 | |
| @@ -87,6 +87,16 @@ | |
| Watchdog timer embedded into AT91SAM9X and AT91CAP9 chips. This will | |
| reboot your system when the timeout is reached. | |
| +config BCM_WATCHDOG | |
| + tristate "BCM watchdog" | |
| + depends on (WATCHDOG) && (ARCH_BCM116X || ARCH_BCM215XX) | |
| + help | |
| + Watchdog timer embedded into BCM chips. This will | |
| + reboot your system when timeout is reached. | |
| + | |
| + To compile this driver as a module, choose M here: the | |
| + module will be called bcm_wdt. | |
| + | |
| config 21285_WATCHDOG | |
| tristate "DC21285 watchdog" | |
| depends on FOOTBRIDGE | |
| @@ -232,6 +242,15 @@ | |
| operating as an Root Complex and/or Central Resource, the PCI-X | |
| and/or PCIe busses will also be reset. THIS IS A VERY BIG HAMMER. | |
| +# BCM59038 Watchdog | |
| +# | |
| +config BCM59038_WATCHDOG | |
| + tristate "BCM59038 Watchdog" | |
| + depends on (WATCHDOG) && (MFD_BCM59038) && (!BCM_WATCHDOG) | |
| + help | |
| + Say Y here if to include support for the watchdog timer | |
| + in the BCM2157 soc. | |
| + | |
| config DAVINCI_WATCHDOG | |
| tristate "DaVinci watchdog" | |
| depends on ARCH_DAVINCI | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/drivers/watchdog/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/watchdog/Makefile | |
| --- /path/to/linux-2.6.35.7/drivers/watchdog/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/drivers/watchdog/Makefile 2018-07-12 10:13:45.000000000 +0700 | |
| @@ -27,6 +27,7 @@ | |
| # ARM Architecture | |
| obj-$(CONFIG_AT91RM9200_WATCHDOG) += at91rm9200_wdt.o | |
| obj-$(CONFIG_AT91SAM9X_WATCHDOG) += at91sam9_wdt.o | |
| +obj-$(CONFIG_BCM_WATCHDOG) += bcm_watchdog.o | |
| obj-$(CONFIG_OMAP_WATCHDOG) += omap_wdt.o | |
| obj-$(CONFIG_TWL4030_WATCHDOG) += twl4030_wdt.o | |
| obj-$(CONFIG_21285_WATCHDOG) += wdt285.o | |
| @@ -44,6 +45,7 @@ | |
| obj-$(CONFIG_ORION_WATCHDOG) += orion_wdt.o | |
| obj-$(CONFIG_COH901327_WATCHDOG) += coh901327_wdt.o | |
| obj-$(CONFIG_STMP3XXX_WATCHDOG) += stmp3xxx_wdt.o | |
| +obj-$(CONFIG_BCM59038_WATCHDOG) += bcm59038-watchdog.o | |
| obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o | |
| obj-$(CONFIG_ADX_WATCHDOG) += adx_wdt.o | |
| obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o | |
| Only in /path/to/linux-2.6.35.7/drivers/zorro: .gitignore | |
| Only in /path/to/linux-2.6.35.7/firmware: bnx2 | |
| Only in /path/to/linux-2.6.35.7/firmware/cis: .gitignore | |
| Only in /path/to/linux-2.6.35.7/firmware: .gitignore | |
| Only in /path/to/linux-2.6.35.7/firmware: tigon | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/eventpoll.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/eventpoll.c | |
| --- /path/to/linux-2.6.35.7/fs/eventpoll.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/eventpoll.c 2018-07-12 10:14:28.000000000 +0700 | |
| @@ -77,9 +77,6 @@ | |
| /* Maximum number of nesting allowed inside epoll sets */ | |
| #define EP_MAX_NESTS 4 | |
| -/* Maximum msec timeout value storeable in a long int */ | |
| -#define EP_MAX_MSTIMEO min(1000ULL * MAX_SCHEDULE_TIMEOUT / HZ, (LONG_MAX - 999ULL) / HZ) | |
| - | |
| #define EP_MAX_EVENTS (INT_MAX / sizeof(struct epoll_event)) | |
| #define EP_UNACTIVE_PTR ((void *) -1L) | |
| @@ -1116,18 +1113,22 @@ | |
| static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, | |
| int maxevents, long timeout) | |
| { | |
| - int res, eavail; | |
| + int res, eavail, timed_out = 0; | |
| unsigned long flags; | |
| - long jtimeout; | |
| + long slack; | |
| wait_queue_t wait; | |
| + struct timespec end_time; | |
| + ktime_t expires, *to = NULL; | |
| - /* | |
| - * Calculate the timeout by checking for the "infinite" value (-1) | |
| - * and the overflow condition. The passed timeout is in milliseconds, | |
| - * that why (t * HZ) / 1000. | |
| - */ | |
| - jtimeout = (timeout < 0 || timeout >= EP_MAX_MSTIMEO) ? | |
| - MAX_SCHEDULE_TIMEOUT : (timeout * HZ + 999) / 1000; | |
| + if (timeout > 0) { | |
| + ktime_get_ts(&end_time); | |
| + timespec_add_ns(&end_time, (u64)timeout * NSEC_PER_MSEC); | |
| + slack = select_estimate_accuracy(&end_time); | |
| + to = &expires; | |
| + *to = timespec_to_ktime(end_time); | |
| + } else if (timeout == 0) { | |
| + timed_out = 1; | |
| + } | |
| retry: | |
| spin_lock_irqsave(&ep->lock, flags); | |
| @@ -1149,7 +1150,7 @@ | |
| * to TASK_INTERRUPTIBLE before doing the checks. | |
| */ | |
| set_current_state(TASK_INTERRUPTIBLE); | |
| - if (!list_empty(&ep->rdllist) || !jtimeout) | |
| + if (!list_empty(&ep->rdllist) || timed_out) | |
| break; | |
| if (signal_pending(current)) { | |
| res = -EINTR; | |
| @@ -1157,7 +1158,9 @@ | |
| } | |
| spin_unlock_irqrestore(&ep->lock, flags); | |
| - jtimeout = schedule_timeout(jtimeout); | |
| + if (!schedule_hrtimeout_range(to, slack, HRTIMER_MODE_ABS)) | |
| + timed_out = 1; | |
| + | |
| spin_lock_irqsave(&ep->lock, flags); | |
| } | |
| __remove_wait_queue(&ep->wq, &wait); | |
| @@ -1175,7 +1178,7 @@ | |
| * more luck. | |
| */ | |
| if (!res && eavail && | |
| - !(res = ep_send_events(ep, events, maxevents)) && jtimeout) | |
| + !(res = ep_send_events(ep, events, maxevents)) && !timed_out) | |
| goto retry; | |
| return res; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/ext4/super.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/ext4/super.c | |
| --- /path/to/linux-2.6.35.7/fs/ext4/super.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/ext4/super.c 2018-07-12 10:14:34.000000000 +0700 | |
| @@ -2799,6 +2799,24 @@ | |
| get_random_bytes(&sbi->s_next_generation, sizeof(u32)); | |
| spin_lock_init(&sbi->s_next_gen_lock); | |
| + err = percpu_counter_init(&sbi->s_freeblocks_counter, | |
| + ext4_count_free_blocks(sb)); | |
| + if (!err) { | |
| + err = percpu_counter_init(&sbi->s_freeinodes_counter, | |
| + ext4_count_free_inodes(sb)); | |
| + } | |
| + if (!err) { | |
| + err = percpu_counter_init(&sbi->s_dirs_counter, | |
| + ext4_count_dirs(sb)); | |
| + } | |
| + if (!err) { | |
| + err = percpu_counter_init(&sbi->s_dirtyblocks_counter, 0); | |
| + } | |
| + if (err) { | |
| + ext4_msg(sb, KERN_ERR, "insufficient memory"); | |
| + goto failed_mount3; | |
| + } | |
| + | |
| sbi->s_stripe = ext4_get_stripe_size(sbi); | |
| sbi->s_max_writeback_mb_bump = 128; | |
| @@ -2897,21 +2915,19 @@ | |
| } | |
| set_task_ioprio(sbi->s_journal->j_task, journal_ioprio); | |
| + /* | |
| + * The journal may have updated the bg summary counts, so we | |
| + * need to update the global counters. | |
| + */ | |
| + percpu_counter_set(&sbi->s_freeblocks_counter, | |
| + ext4_count_free_blocks(sb)); | |
| + percpu_counter_set(&sbi->s_freeinodes_counter, | |
| + ext4_count_free_inodes(sb)); | |
| + percpu_counter_set(&sbi->s_dirs_counter, | |
| + ext4_count_dirs(sb)); | |
| + percpu_counter_set(&sbi->s_dirtyblocks_counter, 0); | |
| + | |
| no_journal: | |
| - err = percpu_counter_init(&sbi->s_freeblocks_counter, | |
| - ext4_count_free_blocks(sb)); | |
| - if (!err) | |
| - err = percpu_counter_init(&sbi->s_freeinodes_counter, | |
| - ext4_count_free_inodes(sb)); | |
| - if (!err) | |
| - err = percpu_counter_init(&sbi->s_dirs_counter, | |
| - ext4_count_dirs(sb)); | |
| - if (!err) | |
| - err = percpu_counter_init(&sbi->s_dirtyblocks_counter, 0); | |
| - if (err) { | |
| - ext4_msg(sb, KERN_ERR, "insufficient memory"); | |
| - goto failed_mount_wq; | |
| - } | |
| if (test_opt(sb, NOBH)) { | |
| if (!(test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_WRITEBACK_DATA)) { | |
| ext4_msg(sb, KERN_WARNING, "Ignoring nobh option - " | |
| @@ -3063,10 +3079,6 @@ | |
| jbd2_journal_destroy(sbi->s_journal); | |
| sbi->s_journal = NULL; | |
| } | |
| - percpu_counter_destroy(&sbi->s_freeblocks_counter); | |
| - percpu_counter_destroy(&sbi->s_freeinodes_counter); | |
| - percpu_counter_destroy(&sbi->s_dirs_counter); | |
| - percpu_counter_destroy(&sbi->s_dirtyblocks_counter); | |
| failed_mount3: | |
| if (sbi->s_flex_groups) { | |
| if (is_vmalloc_addr(sbi->s_flex_groups)) | |
| @@ -3074,6 +3086,10 @@ | |
| else | |
| kfree(sbi->s_flex_groups); | |
| } | |
| + percpu_counter_destroy(&sbi->s_freeblocks_counter); | |
| + percpu_counter_destroy(&sbi->s_freeinodes_counter); | |
| + percpu_counter_destroy(&sbi->s_dirs_counter); | |
| + percpu_counter_destroy(&sbi->s_dirtyblocks_counter); | |
| failed_mount2: | |
| for (i = 0; i < db_count; i++) | |
| brelse(sbi->s_group_desc[i]); | |
| @@ -3389,9 +3405,10 @@ | |
| ((part_stat_read(sb->s_bdev->bd_part, sectors[1]) - | |
| EXT4_SB(sb)->s_sectors_written_start) >> 1)); | |
| ext4_free_blocks_count_set(es, percpu_counter_sum_positive( | |
| - &EXT4_SB(sb)->s_freeblocks_counter)); | |
| - es->s_free_inodes_count = cpu_to_le32(percpu_counter_sum_positive( | |
| - &EXT4_SB(sb)->s_freeinodes_counter)); | |
| + &EXT4_SB(sb)->s_freeblocks_counter)); | |
| + es->s_free_inodes_count = | |
| + cpu_to_le32(percpu_counter_sum_positive( | |
| + &EXT4_SB(sb)->s_freeinodes_counter)); | |
| sb->s_dirt = 0; | |
| BUFFER_TRACE(sbh, "marking dirty"); | |
| mark_buffer_dirty(sbh); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/fat/dir.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/fat/dir.c | |
| --- /path/to/linux-2.6.35.7/fs/fat/dir.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/fat/dir.c 2018-07-12 10:14:34.000000000 +0700 | |
| @@ -753,6 +753,13 @@ | |
| return ret; | |
| } | |
| +static int fat_ioctl_volume_id(struct inode *dir) | |
| +{ | |
| + struct super_block *sb = dir->i_sb; | |
| + struct msdos_sb_info *sbi = MSDOS_SB(sb); | |
| + return sbi->vol_id; | |
| +} | |
| + | |
| static long fat_dir_ioctl(struct file *filp, unsigned int cmd, | |
| unsigned long arg) | |
| { | |
| @@ -769,6 +776,8 @@ | |
| short_only = 0; | |
| both = 1; | |
| break; | |
| + case VFAT_IOCTL_GET_VOLUME_ID: | |
| + return fat_ioctl_volume_id(inode); | |
| default: | |
| return fat_generic_ioctl(filp, cmd, arg); | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/fat/fat.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/fat/fat.h | |
| --- /path/to/linux-2.6.35.7/fs/fat/fat.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/fat/fat.h 2018-07-12 10:14:34.000000000 +0700 | |
| @@ -78,6 +78,7 @@ | |
| const void *dir_ops; /* Opaque; default directory operations */ | |
| int dir_per_block; /* dir entries per block */ | |
| int dir_per_block_bits; /* log2(dir_per_block) */ | |
| + unsigned long vol_id; /* volume ID */ | |
| int fatent_shift; | |
| struct fatent_operations *fatent_ops; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/fat/inode.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/fat/inode.c | |
| --- /path/to/linux-2.6.35.7/fs/fat/inode.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/fat/inode.c 2018-07-12 10:14:34.000000000 +0700 | |
| @@ -1249,6 +1249,7 @@ | |
| struct inode *root_inode = NULL, *fat_inode = NULL; | |
| struct buffer_head *bh; | |
| struct fat_boot_sector *b; | |
| + struct fat_boot_bsx *bsx; | |
| struct msdos_sb_info *sbi; | |
| u16 logical_sector_size; | |
| u32 total_sectors, total_clusters, fat_clusters, rootdir_sectors; | |
| @@ -1393,6 +1394,8 @@ | |
| goto out_fail; | |
| } | |
| + bsx = (struct fat_boot_bsx *)(bh->b_data + FAT32_BSX_OFFSET); | |
| + | |
| fsinfo = (struct fat_boot_fsinfo *)fsinfo_bh->b_data; | |
| if (!IS_FSINFO(fsinfo)) { | |
| printk(KERN_WARNING "FAT: Invalid FSINFO signature: " | |
| @@ -1408,8 +1411,14 @@ | |
| } | |
| brelse(fsinfo_bh); | |
| + } else { | |
| + bsx = (struct fat_boot_bsx *)(bh->b_data + FAT16_BSX_OFFSET); | |
| } | |
| + /* interpret volume ID as a little endian 32 bit integer */ | |
| + sbi->vol_id = (((u32)bsx->vol_id[0]) | ((u32)bsx->vol_id[1] << 8) | | |
| + ((u32)bsx->vol_id[2] << 16) | ((u32)bsx->vol_id[3] << 24)); | |
| + | |
| sbi->dir_per_block = sb->s_blocksize / sizeof(struct msdos_dir_entry); | |
| sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/fs-writeback.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/fs-writeback.c | |
| --- /path/to/linux-2.6.35.7/fs/fs-writeback.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/fs-writeback.c 2018-07-12 10:14:28.000000000 +0700 | |
| @@ -910,7 +910,7 @@ | |
| if ((inode->i_state & flags) == flags) | |
| return; | |
| - if (unlikely(block_dump)) | |
| + if (unlikely(block_dump > 1)) | |
| block_dump___mark_inode_dirty(inode); | |
| spin_lock(&inode_lock); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/Kconfig | |
| --- /path/to/linux-2.6.35.7/fs/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/Kconfig 2018-07-12 10:14:28.000000000 +0700 | |
| @@ -174,6 +174,10 @@ | |
| source "fs/befs/Kconfig" | |
| source "fs/bfs/Kconfig" | |
| source "fs/efs/Kconfig" | |
| + | |
| +# Patched by YAFFS | |
| +source "fs/yaffs2/Kconfig" | |
| + | |
| source "fs/jffs2/Kconfig" | |
| # UBIFS File system configuration | |
| source "fs/ubifs/Kconfig" | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/Makefile | |
| --- /path/to/linux-2.6.35.7/fs/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/Makefile 2018-07-12 10:14:28.000000000 +0700 | |
| @@ -126,3 +126,6 @@ | |
| obj-$(CONFIG_GFS2_FS) += gfs2/ | |
| obj-$(CONFIG_EXOFS_FS) += exofs/ | |
| obj-$(CONFIG_CEPH_FS) += ceph/ | |
| + | |
| +# Patched by YAFFS | |
| +obj-$(CONFIG_YAFFS_FS) += yaffs2/ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/partitions/check.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/partitions/check.c | |
| --- /path/to/linux-2.6.35.7/fs/partitions/check.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/partitions/check.c 2018-07-12 10:14:36.000000000 +0700 | |
| @@ -21,6 +21,7 @@ | |
| #include <linux/ctype.h> | |
| #include <linux/genhd.h> | |
| #include <linux/blktrace_api.h> | |
| +#include <linux/vmalloc.h> | |
| #include "check.h" | |
| @@ -162,8 +163,15 @@ | |
| int i, res, err; | |
| state = kzalloc(sizeof(struct parsed_partitions), GFP_KERNEL); | |
| - if (!state) | |
| - return NULL; | |
| + if (!state){ | |
| + state = (struct parsed_partitions *)vmalloc(sizeof(struct parsed_partitions)); | |
| + if (!state) | |
| + return NULL; | |
| + | |
| + memset(state, 0, sizeof(struct parsed_partitions)); | |
| + state->is_kzalloc = false; | |
| + } else | |
| + state->is_kzalloc = true; | |
| state->bdev = bdev; | |
| disk_name(hd, 0, state->name); | |
| @@ -196,7 +204,12 @@ | |
| printk(" unknown partition table\n"); | |
| else if (warn_no_part) | |
| printk(" unable to read partition table\n"); | |
| - kfree(state); | |
| + | |
| + if( state->is_kzalloc ) | |
| + kfree(state); | |
| + else | |
| + vfree(state); | |
| + | |
| return ERR_PTR(res); | |
| } | |
| @@ -272,6 +285,13 @@ | |
| return sprintf(buf, "%8u %8u\n", p->in_flight[0], p->in_flight[1]); | |
| } | |
| +ssize_t part_partition_name_show(struct device *dev, | |
| + struct device_attribute *attr, char *buf) | |
| +{ | |
| + struct hd_struct *p = dev_to_part(dev); | |
| + return sprintf(buf, "%s\n", p->partition_name); | |
| +} | |
| + | |
| #ifdef CONFIG_FAIL_MAKE_REQUEST | |
| ssize_t part_fail_show(struct device *dev, | |
| struct device_attribute *attr, char *buf) | |
| @@ -303,6 +323,8 @@ | |
| NULL); | |
| static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL); | |
| static DEVICE_ATTR(inflight, S_IRUGO, part_inflight_show, NULL); | |
| +static DEVICE_ATTR(partition_name, S_IRUGO, part_partition_name_show, NULL); | |
| + | |
| #ifdef CONFIG_FAIL_MAKE_REQUEST | |
| static struct device_attribute dev_attr_fail = | |
| __ATTR(make-it-fail, S_IRUGO|S_IWUSR, part_fail_show, part_fail_store); | |
| @@ -316,6 +338,7 @@ | |
| &dev_attr_discard_alignment.attr, | |
| &dev_attr_stat.attr, | |
| &dev_attr_inflight.attr, | |
| + &dev_attr_partition_name.attr, | |
| #ifdef CONFIG_FAIL_MAKE_REQUEST | |
| &dev_attr_fail.attr, | |
| #endif | |
| @@ -341,10 +364,19 @@ | |
| kfree(p); | |
| } | |
| +static int part_uevent(struct device *dev, struct kobj_uevent_env *env) | |
| +{ | |
| + struct hd_struct *part = dev_to_part(dev); | |
| + | |
| + add_uevent_var(env, "PARTN=%u", part->partno); | |
| + return 0; | |
| +} | |
| + | |
| struct device_type part_type = { | |
| .name = "partition", | |
| .groups = part_attr_groups, | |
| .release = part_release, | |
| + .uevent = part_uevent, | |
| }; | |
| static void delete_partition_rcu_cb(struct rcu_head *head) | |
| @@ -386,6 +418,11 @@ | |
| static DEVICE_ATTR(whole_disk, S_IRUSR | S_IRGRP | S_IROTH, | |
| whole_disk_show, NULL); | |
| +static void name_partition(struct hd_struct *p, const char *name) | |
| +{ | |
| + strlcpy(p->partition_name, name, GENHD_PART_NAME_SIZE); | |
| +} | |
| + | |
| struct hd_struct *add_partition(struct gendisk *disk, int partno, | |
| sector_t start, sector_t len, int flags) | |
| { | |
| @@ -565,7 +602,12 @@ | |
| int p, highest, res; | |
| rescan: | |
| if (state && !IS_ERR(state)) { | |
| - kfree(state); | |
| + | |
| + if( state->is_kzalloc ) | |
| + kfree(state); | |
| + else | |
| + vfree(state); | |
| + | |
| state = NULL; | |
| } | |
| @@ -669,12 +711,17 @@ | |
| disk->disk_name, p, -PTR_ERR(part)); | |
| continue; | |
| } | |
| + name_partition(part, state->parts[p].name); | |
| #ifdef CONFIG_BLK_DEV_MD | |
| if (state->parts[p].flags & ADDPART_FLAG_RAID) | |
| md_autodetect_dev(part_to_dev(part)->devt); | |
| #endif | |
| } | |
| - kfree(state); | |
| + | |
| + if( state->is_kzalloc) | |
| + kfree(state); | |
| + else | |
| + vfree(state); | |
| return 0; | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/partitions/check.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/partitions/check.h | |
| --- /path/to/linux-2.6.35.7/fs/partitions/check.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/partitions/check.h 2018-07-12 10:14:36.000000000 +0700 | |
| @@ -1,6 +1,8 @@ | |
| #include <linux/pagemap.h> | |
| #include <linux/blkdev.h> | |
| +#define PART_NAME_SIZE 128 | |
| + | |
| /* | |
| * add_gd_partition adds a partitions details to the devices partition | |
| * description. | |
| @@ -12,10 +14,12 @@ | |
| sector_t from; | |
| sector_t size; | |
| int flags; | |
| + char name[PART_NAME_SIZE]; | |
| } parts[DISK_MAX_PARTS]; | |
| int next; | |
| int limit; | |
| bool access_beyond_eod; | |
| + bool is_kzalloc; | |
| }; | |
| static inline void *read_part_sector(struct parsed_partitions *state, | |
| @@ -29,14 +33,28 @@ | |
| } | |
| static inline void | |
| -put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size) | |
| +put_named_partition(struct parsed_partitions *p, int n, sector_t from, | |
| + sector_t size, const char *name, size_t name_size) | |
| { | |
| if (n < p->limit) { | |
| p->parts[n].from = from; | |
| p->parts[n].size = size; | |
| printk(" %s%d", p->name, n); | |
| + if (name) { | |
| + if (name_size > PART_NAME_SIZE - 1) | |
| + name_size = PART_NAME_SIZE - 1; | |
| + memcpy(p->parts[n].name, name, name_size); | |
| + p->parts[n].name[name_size] = 0; | |
| + printk(" (%s)", p->parts[n].name); | |
| + } | |
| } | |
| } | |
| +static inline void | |
| +put_partition(struct parsed_partitions *p, int n, sector_t from, sector_t size) | |
| +{ | |
| + put_named_partition(p, n, from, size, NULL, 0); | |
| +} | |
| + | |
| extern int warn_no_part; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/partitions/efi.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/partitions/efi.c | |
| --- /path/to/linux-2.6.35.7/fs/partitions/efi.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/partitions/efi.c 2018-07-12 10:14:36.000000000 +0700 | |
| @@ -621,7 +621,11 @@ | |
| if (!is_pte_valid(&ptes[i], last_lba(state->bdev))) | |
| continue; | |
| - put_partition(state, i+1, start * ssz, size * ssz); | |
| + put_named_partition(state, i+1, start * ssz, size * ssz, | |
| + (const char *) ptes[i].partition_name, | |
| + strnlen((const char *) | |
| + ptes[i].partition_name, | |
| + sizeof(ptes[i].partition_name))); | |
| /* If this is a RAID volume, tell md */ | |
| if (!efi_guidcmp(ptes[i].partition_type_guid, | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/proc/base.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/proc/base.c | |
| --- /path/to/linux-2.6.35.7/fs/proc/base.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/proc/base.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -129,6 +129,12 @@ | |
| NULL, &proc_single_file_operations, \ | |
| { .proc_show = show } ) | |
| +/* ANDROID is for special files in /proc. */ | |
| +#define ANDROID(NAME, MODE, OTYPE) \ | |
| + NOD(NAME, (S_IFREG|(MODE)), \ | |
| + &proc_##OTYPE##_inode_operations, \ | |
| + &proc_##OTYPE##_operations, {}) | |
| + | |
| /* | |
| * Count the number of hardlinks for the pid_entry table, excluding the . | |
| * and .. links. | |
| @@ -230,7 +236,8 @@ | |
| mm = get_task_mm(task); | |
| if (mm && mm != current->mm && | |
| - !ptrace_may_access(task, PTRACE_MODE_READ)) { | |
| + !ptrace_may_access(task, PTRACE_MODE_READ) && | |
| + !capable(CAP_SYS_RESOURCE)) { | |
| mmput(mm); | |
| mm = NULL; | |
| } | |
| @@ -1047,6 +1054,33 @@ | |
| return count; | |
| } | |
| +static int oom_adjust_permission(struct inode *inode, int mask) | |
| +{ | |
| + uid_t uid; | |
| + struct task_struct *p = get_proc_task(inode); | |
| + if(p) { | |
| + uid = task_uid(p); | |
| + put_task_struct(p); | |
| + } | |
| + | |
| + /* | |
| + * System Server (uid == 1000) is granted access to oom_adj of all | |
| + * android applications (uid > 10000) as and services (uid >= 1000) | |
| + */ | |
| + if (p && (current_fsuid() == 1000) && (uid >= 1000)) { | |
| + if (inode->i_mode >> 6 & mask) { | |
| + return 0; | |
| + } | |
| + } | |
| + | |
| + /* Fall back to default. */ | |
| + return generic_permission(inode, mask, NULL); | |
| +} | |
| + | |
| +static const struct inode_operations proc_oom_adjust_inode_operations = { | |
| + .permission = oom_adjust_permission, | |
| +}; | |
| + | |
| static const struct file_operations proc_oom_adjust_operations = { | |
| .read = oom_adjust_read, | |
| .write = oom_adjust_write, | |
| @@ -2624,7 +2658,7 @@ | |
| REG("cgroup", S_IRUGO, proc_cgroup_operations), | |
| #endif | |
| INF("oom_score", S_IRUGO, proc_oom_score), | |
| - REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adjust_operations), | |
| + ANDROID("oom_adj",S_IRUGO|S_IWUSR, oom_adjust), | |
| #ifdef CONFIG_AUDITSYSCALL | |
| REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations), | |
| REG("sessionid", S_IRUGO, proc_sessionid_operations), | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/fs/select.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/select.c | |
| --- /path/to/linux-2.6.35.7/fs/select.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs/select.c 2018-07-12 10:14:27.000000000 +0700 | |
| @@ -67,7 +67,7 @@ | |
| return slack; | |
| } | |
| -static long estimate_accuracy(struct timespec *tv) | |
| +long select_estimate_accuracy(struct timespec *tv) | |
| { | |
| unsigned long ret; | |
| struct timespec now; | |
| @@ -417,7 +417,7 @@ | |
| } | |
| if (end_time && !timed_out) | |
| - slack = estimate_accuracy(end_time); | |
| + slack = select_estimate_accuracy(end_time); | |
| retval = 0; | |
| for (;;) { | |
| @@ -769,7 +769,7 @@ | |
| } | |
| if (end_time && !timed_out) | |
| - slack = estimate_accuracy(end_time); | |
| + slack = select_estimate_accuracy(end_time); | |
| for (;;) { | |
| struct poll_list *walk; | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/fs: yaffs2 | |
| Only in /path/to/linux-2.6.35.7/: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/asm-generic/emergency-restart.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/asm-generic/emergency-restart.h | |
| --- /path/to/linux-2.6.35.7/include/asm-generic/emergency-restart.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/asm-generic/emergency-restart.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -3,7 +3,11 @@ | |
| static inline void machine_emergency_restart(void) | |
| { | |
| +#if defined(CONFIG_SEC_DEBUG) | |
| + machine_restart("upload"); | |
| +#else | |
| machine_restart(NULL); | |
| +#endif | |
| } | |
| #endif /* _ASM_GENERIC_EMERGENCY_RESTART_H */ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include: cfg_global.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include: config | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include: generated | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: aat1401_bl.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: akm8973.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: akm8975.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/amba/mmci.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/amba/mmci.h | |
| --- /path/to/linux-2.6.35.7/include/linux/amba/mmci.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/amba/mmci.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -5,6 +5,15 @@ | |
| #define AMBA_MMCI_H | |
| #include <linux/mmc/host.h> | |
| +#include <linux/mmc/card.h> | |
| +#include <linux/mmc/sdio_func.h> | |
| + | |
| +struct embedded_sdio_data { | |
| + struct sdio_cis cis; | |
| + struct sdio_cccr cccr; | |
| + struct sdio_embedded_func *funcs; | |
| + int num_funcs; | |
| +}; | |
| /** | |
| * struct mmci_platform_data - platform configuration for the MMCI | |
| @@ -34,6 +43,9 @@ | |
| int gpio_wp; | |
| int gpio_cd; | |
| unsigned long capabilities; | |
| + unsigned int status_irq; | |
| + struct embedded_sdio_data *embedded_sdio; | |
| + int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id); | |
| }; | |
| #endif | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: android_aid.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: android_alarm.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: android_pmem.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: ashmem.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: bcm_keypad_led.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: bma150.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: bma222_driver.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: bma222.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: brcm_console.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: brcm_usbstate.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: broadcom | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: cat3648_bl.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/cgroup.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/cgroup.h | |
| --- /path/to/linux-2.6.35.7/include/linux/cgroup.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/cgroup.h 2018-07-12 10:14:14.000000000 +0700 | |
| @@ -84,12 +84,6 @@ | |
| CSS_REMOVED, /* This CSS is dead */ | |
| }; | |
| -/* Caller must verify that the css is not for root cgroup */ | |
| -static inline void __css_get(struct cgroup_subsys_state *css, int count) | |
| -{ | |
| - atomic_add(count, &css->refcnt); | |
| -} | |
| - | |
| /* | |
| * Call css_get() to hold a reference on the css; it can be used | |
| * for a reference obtained via: | |
| @@ -97,6 +91,7 @@ | |
| * - task->cgroups for a locked task | |
| */ | |
| +extern void __css_get(struct cgroup_subsys_state *css, int count); | |
| static inline void css_get(struct cgroup_subsys_state *css) | |
| { | |
| /* We don't need to reference count the root state */ | |
| @@ -143,10 +138,7 @@ | |
| enum { | |
| /* Control Group is dead */ | |
| CGRP_REMOVED, | |
| - /* | |
| - * Control Group has previously had a child cgroup or a task, | |
| - * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) | |
| - */ | |
| + /* Control Group has ever had a child cgroup or a task */ | |
| CGRP_RELEASABLE, | |
| /* Control Group requires release notifications to userspace */ | |
| CGRP_NOTIFY_ON_RELEASE, | |
| @@ -283,6 +275,7 @@ | |
| /* For RCU-protected deletion */ | |
| struct rcu_head rcu_head; | |
| + struct work_struct work; | |
| }; | |
| /* | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: cpuacct.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/cpufreq.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/cpufreq.h | |
| --- /path/to/linux-2.6.35.7/include/linux/cpufreq.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/cpufreq.h 2018-07-12 10:14:14.000000000 +0700 | |
| @@ -3,7 +3,7 @@ | |
| * | |
| * Copyright (C) 2001 Russell King | |
| * (C) 2002 - 2003 Dominik Brodowski <[email protected]> | |
| - * | |
| + * | |
| * 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. | |
| @@ -56,9 +56,9 @@ | |
| #define CPUFREQ_POLICY_POWERSAVE (1) | |
| #define CPUFREQ_POLICY_PERFORMANCE (2) | |
| -/* Frequency values here are CPU kHz so that hardware which doesn't run | |
| - * with some frequencies can complain without having to guess what per | |
| - * cent / per mille means. | |
| +/* Frequency values here are CPU kHz so that hardware which doesn't run | |
| + * with some frequencies can complain without having to guess what per | |
| + * cent / per mille means. | |
| * Maximum transition latency is in nanoseconds - if it's unknown, | |
| * CPUFREQ_ETERNAL shall be used. | |
| */ | |
| @@ -180,7 +180,7 @@ | |
| struct module *owner; | |
| }; | |
| -/* pass a target to the cpufreq driver | |
| +/* pass a target to the cpufreq driver | |
| */ | |
| extern int cpufreq_driver_target(struct cpufreq_policy *policy, | |
| unsigned int target_freq, | |
| @@ -242,7 +242,7 @@ | |
| /* flags */ | |
| -#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if | |
| +#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if | |
| * all ->init() calls failed */ | |
| #define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel | |
| * "constants" aren't affected by | |
| @@ -257,7 +257,7 @@ | |
| void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state); | |
| -static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) | |
| +static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) | |
| { | |
| if (policy->min < min) | |
| policy->min = min; | |
| @@ -369,6 +369,9 @@ | |
| #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE) | |
| extern struct cpufreq_governor cpufreq_gov_conservative; | |
| #define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative) | |
| +#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_BCM21553) | |
| +extern struct cpufreq_governor cpufreq_gov_bcm; | |
| +#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_bcm) | |
| #endif | |
| @@ -405,7 +408,7 @@ | |
| /* the following are really really optional */ | |
| extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; | |
| -void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | |
| +void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | |
| unsigned int cpu); | |
| void cpufreq_frequency_table_put_attr(unsigned int cpu); | |
| @@ -421,7 +424,7 @@ | |
| #ifdef CONFIG_CPU_FREQ_DEBUG | |
| -extern void cpufreq_debug_printk(unsigned int type, const char *prefix, | |
| +extern void cpufreq_debug_printk(unsigned int type, const char *prefix, | |
| const char *fmt, ...); | |
| #else | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: earlysuspend.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: epml_ts.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/genhd.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/genhd.h | |
| --- /path/to/linux-2.6.35.7/include/linux/genhd.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/genhd.h 2018-07-12 10:14:14.000000000 +0700 | |
| @@ -21,6 +21,8 @@ | |
| #define disk_to_dev(disk) (&(disk)->part0.__dev) | |
| #define part_to_dev(part) (&((part)->__dev)) | |
| +#define GENHD_PART_NAME_SIZE 128 | |
| + | |
| extern struct device_type part_type; | |
| extern struct kobject *block_depr; | |
| extern struct class block_class; | |
| @@ -106,6 +108,7 @@ | |
| struct disk_stats dkstats; | |
| #endif | |
| struct rcu_head rcu_head; | |
| + char partition_name[GENHD_PART_NAME_SIZE]; | |
| }; | |
| #define GENHD_FL_REMOVABLE 1 | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: gp2a_prox.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: gpio_event.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: haptic.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/i2c: qt602240_ts.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/i2c/tsc2007.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/i2c/tsc2007.h | |
| --- /path/to/linux-2.6.35.7/include/linux/i2c/tsc2007.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/i2c/tsc2007.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -1,17 +1,51 @@ | |
| +/******************************************************************************* | |
| +* Copyright 2010 Broadcom Corporation. All rights reserved. | |
| +* | |
| +* @file include/linux/i2c/tsc2007.h | |
| +* | |
| +* 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.gnu.org/copyleft/gpl.html (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 __LINUX_I2C_TSC2007_H | |
| #define __LINUX_I2C_TSC2007_H | |
| /* linux/i2c/tsc2007.h */ | |
| +#include <plat/bcm_i2c.h> | |
| + | |
| struct tsc2007_platform_data { | |
| - u16 model; /* 2007. */ | |
| - u16 x_plate_ohms; | |
| + struct i2c_slave_platform_data i2c_pdata; | |
| + u16 model; /* 2007. */ | |
| + u16 x_plate_ohms; | |
| +/* The X and Y values are added for Broadcom specific | |
| + * calculations. These values needs to updated in board-<name>.c, | |
| + * according to display screen size and touch screen valid contact point | |
| + * for the same. | |
| + */ | |
| + u16 validx_left; | |
| + u16 validy_up; | |
| + u16 validx_right; | |
| + u16 validy_down; | |
| + int (*get_pendown_state) (void); | |
| + void (*clear_penirq) (void); /* If needed, clear 2nd level | |
| + interrupt source */ | |
| + int (*init_platform_hw) (void); | |
| + void (*exit_platform_hw) (void); | |
| - int (*get_pendown_state)(void); | |
| - void (*clear_penirq)(void); /* If needed, clear 2nd level | |
| - interrupt source */ | |
| - int (*init_platform_hw)(void); | |
| - void (*exit_platform_hw)(void); | |
| +/* Returning the x, y values really depends on how the screen is mounted. | |
| + * The upper layers should not be bothered about it. Hence the board | |
| + * specific code should return x,y values which is knowlegable about | |
| + * the screen orientation. | |
| + */ | |
| + int (*get_x_value) (struct tsc2007_platform_data *, int, u32); | |
| + int (*get_y_value) (struct tsc2007_platform_data *, int, u32); | |
| }; | |
| #endif | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/i2c: tsc2017.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/i2c-id.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/i2c-id.h | |
| --- /path/to/linux-2.6.35.7/include/linux/i2c-id.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/i2c-id.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -20,6 +20,21 @@ | |
| Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
| /* ------------------------------------------------------------------------- */ | |
| +/******************************************************************************* | |
| +* Copyright 2010 Broadcom Corporation. All rights reserved. | |
| +* | |
| +* @file include/linux/i2c-id.h | |
| +* | |
| +* 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.gnu.org/copyleft/gpl.html (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 LINUX_I2C_ID_H | |
| #define LINUX_I2C_ID_H | |
| @@ -28,29 +43,141 @@ | |
| identify a legacy client. If you don't need them, just don't set them. */ | |
| /* | |
| + * ---- Driver types ----------------------------------------------------- | |
| + */ | |
| + | |
| +#define I2C_DRIVERID_MSP3400 1 | |
| +#define I2C_DRIVERID_TUNER 2 | |
| +#define I2C_DRIVERID_TEA6420 5 /* audio matrix switch */ | |
| +#define I2C_DRIVERID_TEA6415C 6 /* video matrix switch */ | |
| +#define I2C_DRIVERID_TDA9840 7 /* stereo sound processor */ | |
| +#define I2C_DRIVERID_SAA7111A 8 /* video input processor */ | |
| +#define I2C_DRIVERID_SAA7185B 13 /* video encoder */ | |
| +#define I2C_DRIVERID_SAA7110 22 /* video decoder */ | |
| +#define I2C_DRIVERID_SAA5249 24 /* SAA5249 and compatibles */ | |
| +#define I2C_DRIVERID_PCF8583 25 /* real time clock */ | |
| +#define I2C_DRIVERID_SAB3036 26 /* SAB3036 tuner */ | |
| +#define I2C_DRIVERID_TDA7432 27 /* Stereo sound processor */ | |
| +#define I2C_DRIVERID_TVMIXER 28 /* Mixer driver for tv cards */ | |
| +#define I2C_DRIVERID_TVAUDIO 29 /* Generic TV sound driver */ | |
| +#define I2C_DRIVERID_TDA9875 32 /* TV sound decoder chip */ | |
| +#define I2C_DRIVERID_BT819 40 /* video decoder */ | |
| +#define I2C_DRIVERID_BT856 41 /* video encoder */ | |
| +#define I2C_DRIVERID_VPX3220 42 /* video decoder + vbi/vtxt */ | |
| +#define I2C_DRIVERID_ADV7175 48 /* ADV 7175/7176 video encoder */ | |
| +#define I2C_DRIVERID_SAA7114 49 /* video decoder */ | |
| +#define I2C_DRIVERID_ADV7170 54 /* video encoder */ | |
| +#define I2C_DRIVERID_SAA7191 57 /* video decoder */ | |
| +#define I2C_DRIVERID_INDYCAM 58 /* SGI IndyCam */ | |
| +#define I2C_DRIVERID_OVCAMCHIP 61 /* OmniVision CMOS image sens. */ | |
| +#define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ | |
| +#define I2C_DRIVERID_SAA6752HS 67 /* MPEG2 encoder */ | |
| +#define I2C_DRIVERID_TVEEPROM 68 /* TV EEPROM */ | |
| +#define I2C_DRIVERID_WM8775 69 /* wm8775 audio processor */ | |
| +#define I2C_DRIVERID_CS53L32A 70 /* cs53l32a audio processor */ | |
| +#define I2C_DRIVERID_CX25840 71 /* cx2584x video encoder */ | |
| +#define I2C_DRIVERID_SAA7127 72 /* saa7124 video encoder */ | |
| +#define I2C_DRIVERID_SAA711X 73 /* saa711x video encoders */ | |
| +#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ | |
| +#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ | |
| +#define I2C_DRIVERID_TVP5150 76 /* TVP5150 video decoder */ | |
| +#define I2C_DRIVERID_WM8739 77 /* wm8739 audio processor */ | |
| +#define I2C_DRIVERID_UPD64083 78 /* upd64083 video processor */ | |
| +#define I2C_DRIVERID_UPD64031A 79 /* upd64031a video processor */ | |
| +#define I2C_DRIVERID_SAA717X 80 /* saa717x video encoder */ | |
| +#define I2C_DRIVERID_DS1672 81 /* Dallas/Maxim DS1672 RTC */ | |
| +#define I2C_DRIVERID_BT866 85 /* Conexant bt866 video encoder */ | |
| +#define I2C_DRIVERID_KS0127 86 /* Samsung ks0127 video decoder */ | |
| +#define I2C_DRIVERID_TLV320AIC23B 87 /* TI TLV320AIC23B audio codec */ | |
| +#define I2C_DRIVERID_WM8731 89 /* Wolfson WM8731 audio codec */ | |
| +#define I2C_DRIVERID_WM8750 90 /* Wolfson WM8750 audio codec */ | |
| +#define I2C_DRIVERID_WM8753 91 /* Wolfson WM8753 audio codec */ | |
| +#define I2C_DRIVERID_LM4857 92 /* LM4857 Audio Amplifier */ | |
| +#define I2C_DRIVERID_VP27SMPX 93 /* Panasonic VP27s tuner internal MPX */ | |
| +#define I2C_DRIVERID_CS4270 94 /* Cirrus Logic 4270 audio codec */ | |
| +#define I2C_DRIVERID_M52790 95 /* Mitsubishi M52790SP/FP AV switch */ | |
| +#define I2C_DRIVERID_CS5345 96 /* cs5345 audio processor */ | |
| + | |
| +#define I2C_DRIVERID_OV7670 1048 /* Omnivision 7670 camera */ | |
| + | |
| +/* | |
| * ---- Adapter types ---------------------------------------------------- | |
| */ | |
| /* --- Bit algorithm adapters */ | |
| +#define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ | |
| #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ | |
| +#define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ | |
| +#define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */ | |
| +#define I2C_HW_B_I810 0x01000a /* Intel I810 */ | |
| +#define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */ | |
| +#define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */ | |
| #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | |
| +#define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ | |
| +#define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ | |
| #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ | |
| +#define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */ | |
| #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ | |
| +#define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */ | |
| +#define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ | |
| +#define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ | |
| #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | |
| #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | |
| +#define I2C_HW_B_INTELFB 0x010021 /* intel framebuffer driver */ | |
| #define I2C_HW_B_CX23885 0x010022 /* conexant 23885 based tv cards (bus1) */ | |
| #define I2C_HW_B_AU0828 0x010023 /* auvitek au0828 usb bridge */ | |
| -#define I2C_HW_B_CX231XX 0x010024 /* Conexant CX231XX USB based cards */ | |
| -#define I2C_HW_B_HDPVR 0x010025 /* Hauppauge HD PVR */ | |
| + | |
| +#define I2C_HW_B_BCM1160 0x01002A /* BCM1160 chipset */ | |
| +#define I2C_BSC_ID0 0x0 /* BCM1161 chipset */ | |
| +#define I2C_BSC_ID1 0x1 /* BCM1161 chipset */ | |
| +#define I2C_BSC_ID2 0x2 | |
| + | |
| +/* --- PCF 8584 based algorithms */ | |
| +#define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */ | |
| + | |
| +/* --- PCA 9564 based algorithms */ | |
| +#define I2C_HW_A_ISA 0x1a0000 /* generic ISA Bus interface card */ | |
| + | |
| +/* --- PowerPC on-chip adapters */ | |
| +#define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ | |
| + | |
| +/* --- Broadcom SiByte adapters */ | |
| +#define I2C_HW_SIBYTE 0x150000 | |
| /* --- SGI adapters */ | |
| #define I2C_HW_SGI_VINO 0x160000 | |
| +/* --- XSCALE on-chip adapters */ | |
| +#define I2C_HW_IOP3XX 0x140000 | |
| + | |
| +/* --- Au1550 PSC adapters adapters */ | |
| +#define I2C_HW_AU1550_PSC 0x1b0000 | |
| + | |
| /* --- SMBus only adapters */ | |
| +#define I2C_HW_SMBUS_PIIX4 0x040000 | |
| +#define I2C_HW_SMBUS_ALI15X3 0x040001 | |
| +#define I2C_HW_SMBUS_VIA2 0x040002 | |
| +#define I2C_HW_SMBUS_I801 0x040004 | |
| +#define I2C_HW_SMBUS_AMD756 0x040005 | |
| +#define I2C_HW_SMBUS_SIS5595 0x040006 | |
| +#define I2C_HW_SMBUS_ALI1535 0x040007 | |
| +#define I2C_HW_SMBUS_SIS630 0x040008 | |
| +#define I2C_HW_SMBUS_SIS96X 0x040009 | |
| +#define I2C_HW_SMBUS_AMD8111 0x04000a | |
| +#define I2C_HW_SMBUS_SCX200 0x04000b | |
| +#define I2C_HW_SMBUS_NFORCE2 0x04000c | |
| #define I2C_HW_SMBUS_W9968CF 0x04000d | |
| #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ | |
| #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ | |
| #define I2C_HW_SMBUS_CAFE 0x040012 /* Marvell 88ALP01 "CAFE" cam */ | |
| +#define I2C_HW_SMBUS_ALI1563 0x040013 | |
| + | |
| +/* --- MCP107 adapter */ | |
| +#define I2C_HW_MPC107 0x0d0000 | |
| + | |
| +/* --- Embedded adapters */ | |
| +#define I2C_HW_MV64XXX 0x190000 | |
| +#define I2C_HW_BLACKFIN 0x190001 /* ADI Blackfin I2C TWI driver */ | |
| /* --- Miscellaneous adapters */ | |
| #define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: iface_stat.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: if_pppolac.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: if_pppopns.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/if_pppox.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/if_pppox.h | |
| --- /path/to/linux-2.6.35.7/include/linux/if_pppox.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/if_pppox.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -27,6 +27,8 @@ | |
| #include <linux/ppp_channel.h> | |
| #endif /* __KERNEL__ */ | |
| #include <linux/if_pppol2tp.h> | |
| +#include <linux/if_pppolac.h> | |
| +#include <linux/if_pppopns.h> | |
| /* For user-space programs to pick up these definitions | |
| * which they wouldn't get otherwise without defining __KERNEL__ | |
| @@ -51,7 +53,9 @@ | |
| */ | |
| #define PX_PROTO_OE 0 /* Currently just PPPoE */ | |
| #define PX_PROTO_OL2TP 1 /* Now L2TP also */ | |
| -#define PX_MAX_PROTO 2 | |
| +#define PX_PROTO_OLAC 2 | |
| +#define PX_PROTO_OPNS 3 | |
| +#define PX_MAX_PROTO 4 | |
| struct sockaddr_pppox { | |
| sa_family_t sa_family; /* address family, AF_PPPOX */ | |
| @@ -150,6 +154,22 @@ | |
| relayed to (PPPoE relaying) */ | |
| }; | |
| +struct pppolac_opt { | |
| + __u32 local; | |
| + __u32 remote; | |
| + __u16 sequence; | |
| + __u8 sequencing; | |
| + int (*backlog_rcv)(struct sock *sk_udp, struct sk_buff *skb); | |
| +}; | |
| + | |
| +struct pppopns_opt { | |
| + __u16 local; | |
| + __u16 remote; | |
| + __u32 sequence; | |
| + void (*data_ready)(struct sock *sk_raw, int length); | |
| + int (*backlog_rcv)(struct sock *sk_raw, struct sk_buff *skb); | |
| +}; | |
| + | |
| #include <net/sock.h> | |
| struct pppox_sock { | |
| @@ -159,6 +179,8 @@ | |
| struct pppox_sock *next; /* for hash table */ | |
| union { | |
| struct pppoe_opt pppoe; | |
| + struct pppolac_opt lac; | |
| + struct pppopns_opt pns; | |
| } proto; | |
| __be16 num; | |
| }; | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/input: cyttsp.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/input.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/input.h | |
| --- /path/to/linux-2.6.35.7/include/linux/input.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/input.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -378,7 +378,20 @@ | |
| #define KEY_WIMAX 246 | |
| #define KEY_RFKILL 247 /* Key that controls all radios */ | |
| -/* Code 255 is reserved for special needs of AT keyboard driver */ | |
| +/* | |
| +According to Android,OEM can define their own keys and changes | |
| +in framework/apps to get those keys in framework or send it to application. | |
| +so the application can take action on that. | |
| + | |
| +In case of single button headset as here, it would be phone app which | |
| +needs to get this key and takes action like accept or hang-up the call. | |
| +We define our own key for Headset button press for this puspose. | |
| +Its KEY_BCM_HEADSET_BUTTON which has same value as KEY_SEND as defined here | |
| +in input.h for Martini platform. | |
| +*/ | |
| +#define KEY_BCM_HEADSET_BUTTON KEY_SEND | |
| + | |
| +/* Range 248 - 255 is reserved for special needs of AT keyboard driver */ | |
| #define BTN_MISC 0x100 | |
| #define BTN_0 0x100 | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: kernel_debugger.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/kernel.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/kernel.h | |
| --- /path/to/linux-2.6.35.7/include/linux/kernel.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/kernel.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -124,6 +124,12 @@ | |
| #define minimum_console_loglevel (console_printk[2]) | |
| #define default_console_loglevel (console_printk[3]) | |
| +extern int brcm_console_brcm_printk[]; | |
| +#define brcm_console_loglevel (brcm_console_brcm_printk[0]) | |
| +#define default_brcm_message_loglevel (brcm_console_brcm_printk[1]) | |
| +#define minimum_brcm_console_loglevel (brcm_console_brcm_printk[2]) | |
| +#define default_brcm_console_loglevel (brcm_console_brcm_printk[3]) | |
| + | |
| struct completion; | |
| struct pt_regs; | |
| struct user; | |
| @@ -258,6 +264,15 @@ | |
| extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | |
| unsigned int interval_msec); | |
| +/* brcm printk */ | |
| +asmlinkage int brcm_vprintk(const char *fmt, va_list args) | |
| + __attribute__ ((format (printf, 1, 0))); | |
| +asmlinkage int brcm_printk(const char * fmt, ...) | |
| + __attribute__ ((format (printf, 1, 2))) __cold; | |
| + | |
| +extern int brcm_klogging(char *data, int length); | |
| +extern void brcm_current_netcon_status(unsigned char status); | |
| + | |
| extern int printk_delay_msec; | |
| /* | |
| @@ -284,6 +299,15 @@ | |
| static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | |
| unsigned int interval_msec) \ | |
| { return false; } | |
| +/* brcm printk */ | |
| +static inline int brcm_vprintk(const char *s, va_list args) | |
| + __attribute__ ((format (printf, 1, 0))); | |
| +static inline int brcm_vprintk(const char *s, va_list args) { return 0; } | |
| +static inline int brcm_printk(const char *s, ...) | |
| + __attribute__ ((format (printf, 1, 2))); | |
| +static inline int __cold brcm_printk(const char *s, ...) { return 0; } | |
| +static inline int brcm_klogging(char *data, int length){ return 0;} | |
| +static inline void brcm_current_netcon_status(unsigned char status) {}; | |
| /* No effect, but we still get type checking even in the !PRINTK case: */ | |
| #define printk_once(x...) printk(x) | |
| @@ -730,7 +754,7 @@ | |
| #ifndef __EXPORTED_HEADERS__ | |
| #ifndef __KERNEL__ | |
| -#warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders | |
| +#warning Attempt to use kernel headers from user space, see http:/* kernelnewbies.org/KernelHeaders */ | |
| #endif /* __KERNEL__ */ | |
| #endif /* __EXPORTED_HEADERS__ */ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: keychord.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: keyreset.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/linux_logo.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/linux_logo.h | |
| --- /path/to/linux-2.6.35.7/include/linux/linux_logo.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/linux_logo.h 2018-07-12 10:14:14.000000000 +0700 | |
| @@ -38,6 +38,7 @@ | |
| extern const struct linux_logo logo_blackfin_vga16; | |
| extern const struct linux_logo logo_blackfin_clut224; | |
| extern const struct linux_logo logo_dec_clut224; | |
| +extern const struct linux_logo logo_bcm2157_clut224; | |
| extern const struct linux_logo logo_mac_clut224; | |
| extern const struct linux_logo logo_parisc_clut224; | |
| extern const struct linux_logo logo_sgi_clut224; | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: mecs.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: melfas_ts.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mfd: bcm59035 | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mfd: bcm59038 | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mfd: max8986 | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/mmc/card.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/card.h | |
| --- /path/to/linux-2.6.35.7/include/linux/mmc/card.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/card.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -24,6 +24,7 @@ | |
| }; | |
| struct mmc_csd { | |
| + unsigned char structure; | |
| unsigned char mmca_vsn; | |
| unsigned short cmdclass; | |
| unsigned short tacc_clks; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/mmc/core.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/core.h | |
| --- /path/to/linux-2.6.35.7/include/linux/mmc/core.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/core.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -154,4 +154,7 @@ | |
| extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); | |
| +extern void mmc_power_up_brcm(struct mmc_host *host); | |
| +extern void mmc_power_off_brcm(struct mmc_host *host); | |
| + | |
| #endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/mmc/host.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/host.h | |
| --- /path/to/linux-2.6.35.7/include/linux/mmc/host.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/host.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -201,6 +201,10 @@ | |
| const struct mmc_bus_ops *bus_ops; /* current bus driver */ | |
| unsigned int bus_refs; /* reference counter */ | |
| + unsigned int bus_resume_flags; | |
| +#define MMC_BUSRESUME_MANUAL_RESUME (1 << 0) | |
| +#define MMC_BUSRESUME_NEEDS_RESUME (1 << 1) | |
| + | |
| unsigned int sdio_irqs; | |
| struct task_struct *sdio_irq_thread; | |
| atomic_t sdio_irq_thread_abort; | |
| @@ -213,6 +217,15 @@ | |
| struct dentry *debugfs_root; | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| + struct { | |
| + struct sdio_cis *cis; | |
| + struct sdio_cccr *cccr; | |
| + struct sdio_embedded_func *funcs; | |
| + int num_funcs; | |
| + } embedded_sdio_data; | |
| +#endif | |
| + | |
| unsigned long private[0] ____cacheline_aligned; | |
| }; | |
| @@ -221,6 +234,14 @@ | |
| extern void mmc_remove_host(struct mmc_host *); | |
| extern void mmc_free_host(struct mmc_host *); | |
| +#ifdef CONFIG_MMC_EMBEDDED_SDIO | |
| +extern void mmc_set_embedded_sdio_data(struct mmc_host *host, | |
| + struct sdio_cis *cis, | |
| + struct sdio_cccr *cccr, | |
| + struct sdio_embedded_func *funcs, | |
| + int num_funcs); | |
| +#endif | |
| + | |
| static inline void *mmc_priv(struct mmc_host *host) | |
| { | |
| return (void *)host->private; | |
| @@ -231,6 +252,18 @@ | |
| #define mmc_dev(x) ((x)->parent) | |
| #define mmc_classdev(x) (&(x)->class_dev) | |
| #define mmc_hostname(x) (dev_name(&(x)->class_dev)) | |
| +#define mmc_bus_needs_resume(host) ((host)->bus_resume_flags & MMC_BUSRESUME_NEEDS_RESUME) | |
| +#define mmc_bus_manual_resume(host) ((host)->bus_resume_flags & MMC_BUSRESUME_MANUAL_RESUME) | |
| + | |
| +static inline void mmc_set_bus_resume_policy(struct mmc_host *host, int manual) | |
| +{ | |
| + if (manual) | |
| + host->bus_resume_flags |= MMC_BUSRESUME_MANUAL_RESUME; | |
| + else | |
| + host->bus_resume_flags &= ~MMC_BUSRESUME_MANUAL_RESUME; | |
| +} | |
| + | |
| +extern int mmc_resume_bus(struct mmc_host *host); | |
| extern int mmc_suspend_host(struct mmc_host *); | |
| extern int mmc_resume_host(struct mmc_host *); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/mmc/mmc.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/mmc.h | |
| --- /path/to/linux-2.6.35.7/include/linux/mmc/mmc.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/mmc.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -254,10 +254,11 @@ | |
| #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | |
| #define EXT_CSD_HS_TIMING 185 /* R/W */ | |
| #define EXT_CSD_CARD_TYPE 196 /* RO */ | |
| +#define EXT_CSD_STRUCTURE 194 /* RO */ | |
| #define EXT_CSD_REV 192 /* RO */ | |
| #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | |
| #define EXT_CSD_S_A_TIMEOUT 217 | |
| - | |
| +#define EXT_CSD_BOOT_SIZE_MULTI 226 | |
| /* | |
| * EXT_CSD field definitions | |
| */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/mmc/pm.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/pm.h | |
| --- /path/to/linux-2.6.35.7/include/linux/mmc/pm.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/pm.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -26,5 +26,6 @@ | |
| #define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ | |
| #define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ | |
| +#define MMC_PM_IGNORE_PM_NOTIFY (1 << 2) /* ignore mmc pm notify */ | |
| #endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/mmc/sdio_func.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/sdio_func.h | |
| --- /path/to/linux-2.6.35.7/include/linux/mmc/sdio_func.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mmc/sdio_func.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -23,6 +23,14 @@ | |
| typedef void (sdio_irq_handler_t)(struct sdio_func *); | |
| /* | |
| + * Structure used to hold embedded SDIO device data from platform layer | |
| + */ | |
| +struct sdio_embedded_func { | |
| + uint8_t f_class; | |
| + uint32_t f_maxblksize; | |
| +}; | |
| + | |
| +/* | |
| * SDIO function CIS tuple (unknown to the core) | |
| */ | |
| struct sdio_func_tuple { | |
| @@ -130,6 +138,8 @@ | |
| extern unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz); | |
| extern u8 sdio_readb(struct sdio_func *func, unsigned int addr, int *err_ret); | |
| +extern u8 sdio_readb_ext(struct sdio_func *func, unsigned int addr, int *err_ret, | |
| + unsigned in); | |
| extern u16 sdio_readw(struct sdio_func *func, unsigned int addr, int *err_ret); | |
| extern u32 sdio_readl(struct sdio_func *func, unsigned int addr, int *err_ret); | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: mmc328x.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/mm.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mm.h | |
| --- /path/to/linux-2.6.35.7/include/linux/mm.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mm.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -736,6 +736,7 @@ | |
| int shmem_lock(struct file *file, int lock, struct user_struct *user); | |
| struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); | |
| +void shmem_set_file(struct vm_area_struct *vma, struct file *file); | |
| int shmem_zero_setup(struct vm_area_struct *); | |
| #ifndef CONFIG_MMU | |
| @@ -1371,6 +1372,8 @@ | |
| unsigned long pfn); | |
| int vm_insert_mixed(struct vm_area_struct *vma, unsigned long addr, | |
| unsigned long pfn); | |
| +int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len); | |
| + | |
| struct page *follow_page(struct vm_area_struct *, unsigned long address, | |
| unsigned int foll_flags); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/msdos_fs.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/msdos_fs.h | |
| --- /path/to/linux-2.6.35.7/include/linux/msdos_fs.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/msdos_fs.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -101,6 +101,7 @@ | |
| /* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */ | |
| #define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32) | |
| #define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32) | |
| +#define VFAT_IOCTL_GET_VOLUME_ID _IOR('r', 0x12, __u32) | |
| struct fat_boot_sector { | |
| __u8 ignored[3]; /* Boot strap short or near jump */ | |
| @@ -138,6 +139,17 @@ | |
| __le32 reserved2[4]; | |
| }; | |
| +struct fat_boot_bsx { | |
| + __u8 drive; /* drive number */ | |
| + __u8 reserved1; | |
| + __u8 signature; /* extended boot signature */ | |
| + __u8 vol_id[4]; /* volume ID */ | |
| + __u8 vol_label[11]; /* volume label */ | |
| + __u8 type[8]; /* file system type */ | |
| +}; | |
| +#define FAT16_BSX_OFFSET 36 /* offset of fat_boot_bsx in FAT12 and FAT16 */ | |
| +#define FAT32_BSX_OFFSET 64 /* offset of fat_boot_bsx in FAT32 */ | |
| + | |
| struct msdos_dir_entry { | |
| __u8 name[MSDOS_NAME];/* name and extension */ | |
| __u8 attr; /* attribute bits */ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/mtd: nand_ecc512.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: pcap7200.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/percpu_counter.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/percpu_counter.h | |
| --- /path/to/linux-2.6.35.7/include/linux/percpu_counter.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/percpu_counter.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -77,6 +77,11 @@ | |
| return 1; | |
| } | |
| +static inline int percpu_counter_initialized(struct percpu_counter *fbc) | |
| +{ | |
| + return (fbc->counters != NULL); | |
| +} | |
| + | |
| #else | |
| struct percpu_counter { | |
| @@ -132,6 +137,11 @@ | |
| return percpu_counter_read(fbc); | |
| } | |
| +static inline int percpu_counter_initialized(struct percpu_counter *fbc) | |
| +{ | |
| + return 1; | |
| +} | |
| + | |
| #endif /* CONFIG_SMP */ | |
| static inline void percpu_counter_inc(struct percpu_counter *fbc) | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/platform_device.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/platform_device.h | |
| --- /path/to/linux-2.6.35.7/include/linux/platform_device.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/platform_device.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -17,6 +17,7 @@ | |
| struct platform_device { | |
| const char * name; | |
| int id; | |
| + int voltage; | |
| struct device dev; | |
| u32 num_resources; | |
| struct resource * resource; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/poll.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/poll.h | |
| --- /path/to/linux-2.6.35.7/include/linux/poll.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/poll.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -73,6 +73,8 @@ | |
| extern void poll_freewait(struct poll_wqueues *pwq); | |
| extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state, | |
| ktime_t *expires, unsigned long slack); | |
| +extern long select_estimate_accuracy(struct timespec *tv); | |
| + | |
| static inline int poll_schedule(struct poll_wqueues *pwq, int state) | |
| { | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/power_supply.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/power_supply.h | |
| --- /path/to/linux-2.6.35.7/include/linux/power_supply.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/power_supply.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -14,6 +14,7 @@ | |
| #define __LINUX_POWER_SUPPLY_H__ | |
| #include <linux/device.h> | |
| +#include <linux/wakelock.h> | |
| #include <linux/workqueue.h> | |
| #include <linux/leds.h> | |
| @@ -159,6 +160,9 @@ | |
| /* private */ | |
| struct device *dev; | |
| struct work_struct changed_work; | |
| + spinlock_t changed_lock; | |
| + bool changed; | |
| + struct wake_lock work_wake_lock; | |
| #ifdef CONFIG_LEDS_TRIGGERS | |
| struct led_trigger *charging_full_trig; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/pwm.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/pwm.h | |
| --- /path/to/linux-2.6.35.7/include/linux/pwm.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/pwm.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -27,5 +27,10 @@ | |
| * pwm_disable - stop a PWM output toggling | |
| */ | |
| void pwm_disable(struct pwm_device *pwm); | |
| +/* | |
| + * pwm_setmode - configure channel to device specific mode. the mode | |
| + * parameter value is implementation specific. | |
| + */ | |
| +int pwm_setmode(struct pwm_device *dev, int mode); | |
| #endif /* __LINUX_PWM_H */ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: s2c_bl.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/sched.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/sched.h | |
| --- /path/to/linux-2.6.35.7/include/linux/sched.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/sched.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -1077,6 +1077,7 @@ | |
| #ifdef CONFIG_FAIR_GROUP_SCHED | |
| void (*moved_group) (struct task_struct *p, int on_rq); | |
| + void (*prep_move_group) (struct task_struct *p, int on_rq); | |
| #endif | |
| }; | |
| @@ -1682,6 +1683,9 @@ | |
| extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st); | |
| extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st); | |
| +extern int task_free_register(struct notifier_block *n); | |
| +extern int task_free_unregister(struct notifier_block *n); | |
| + | |
| /* | |
| * Per process flags | |
| */ | |
| @@ -2402,7 +2406,16 @@ | |
| extern void recalc_sigpending_and_wake(struct task_struct *t); | |
| extern void recalc_sigpending(void); | |
| -extern void signal_wake_up(struct task_struct *t, int resume_stopped); | |
| +extern void signal_wake_up_state(struct task_struct *t, unsigned int state); | |
| + | |
| +static inline void signal_wake_up(struct task_struct *t, bool resume) | |
| +{ | |
| + signal_wake_up_state(t, resume ? TASK_WAKEKILL : 0); | |
| +} | |
| +static inline void ptrace_signal_wake_up(struct task_struct *t, bool resume) | |
| +{ | |
| + signal_wake_up_state(t, resume ? __TASK_TRACED : 0); | |
| +} | |
| /* | |
| * Wrappers for p->thread_info->cpu access. No-op on UP. | |
| @@ -2556,5 +2569,186 @@ | |
| } | |
| #endif /* __KERNEL__ */ | |
| +//{{ Add GAForensicINFO - 1/2 | |
| +/* | |
| + * Add GAForensic information | |
| + */ | |
| +#pragma once | |
| + | |
| +#include <linux/fs.h> | |
| +#include <linux/mount.h> | |
| +#include <asm/pgtable.h> | |
| + | |
| +static struct GAForensicINFO{ | |
| +unsigned short ver; | |
| +unsigned int size; | |
| +unsigned short task_struct_struct_state; | |
| +unsigned short task_struct_struct_comm; | |
| +unsigned short task_struct_struct_tasks; | |
| +unsigned short task_struct_struct_pid; | |
| +unsigned short task_struct_struct_stack; | |
| +unsigned short task_struct_struct_mm; | |
| +unsigned short mm_struct_struct_start_data; | |
| +unsigned short mm_struct_struct_end_data; | |
| +unsigned short mm_struct_struct_start_brk; | |
| +unsigned short mm_struct_struct_brk; | |
| +unsigned short mm_struct_struct_start_stack; | |
| +unsigned short mm_struct_struct_arg_start; | |
| +unsigned short mm_struct_struct_arg_end; | |
| +unsigned short mm_struct_struct_pgd; | |
| +unsigned short mm_struct_struct_mmap; | |
| +unsigned short vm_area_struct_struct_vm_start; | |
| +unsigned short vm_area_struct_struct_vm_end; | |
| +unsigned short vm_area_struct_struct_vm_next; | |
| +unsigned short vm_area_struct_struct_vm_file; | |
| +unsigned short thread_info_struct_cpu_context; | |
| +unsigned short cpu_context_save_struct_sp; | |
| +unsigned short file_struct_f_path; | |
| +unsigned short path_struct_mnt; | |
| +unsigned short path_struct_dentry; | |
| +unsigned short dentry_struct_d_parent; | |
| +unsigned short dentry_struct_d_name; | |
| +unsigned short qstr_struct_name; | |
| +unsigned short vfsmount_struct_mnt_mountpoint; | |
| +unsigned short vfsmount_struct_mnt_root; | |
| +unsigned short vfsmount_struct_mnt_parent; | |
| +unsigned int pgdir_shift; | |
| +unsigned int ptrs_per_pte; | |
| +unsigned int phys_offset; | |
| +unsigned int page_offset; | |
| +unsigned int page_shift; | |
| +unsigned int page_size; | |
| +unsigned short task_struct_struct_thread_group; | |
| +unsigned short task_struct_struct_utime; | |
| +unsigned short task_struct_struct_stime; | |
| +unsigned short list_head_struct_next; | |
| +unsigned short list_head_struct_prev; | |
| +unsigned short rq_struct_curr; | |
| + | |
| +unsigned short thread_info_struct_cpu; | |
| + | |
| +unsigned short task_struct_struct_prio; | |
| +unsigned short task_struct_struct_static_prio; | |
| +unsigned short task_struct_struct_normal_prio; | |
| +unsigned short task_struct_struct_rt_priority; | |
| + | |
| +unsigned short task_struct_struct_se; | |
| + | |
| +unsigned short sched_entity_struct_exec_start; | |
| +unsigned short sched_entity_struct_sum_exec_runtime; | |
| +unsigned short sched_entity_struct_prev_sum_exec_runtime; | |
| + | |
| +unsigned short task_struct_struct_sched_info; | |
| + | |
| +unsigned short sched_info_struct_pcount; | |
| +unsigned short sched_info_struct_run_delay; | |
| +unsigned short sched_info_struct_last_arrival; | |
| +unsigned short sched_info_struct_last_queued; | |
| + | |
| +unsigned short task_struct_struct_blocked_on; | |
| + | |
| +unsigned short mutex_waiter_struct_list; | |
| +unsigned short mutex_waiter_struct_task; | |
| + | |
| +unsigned short sched_entity_struct_cfs_rq_struct; | |
| +unsigned short cfs_rq_struct_rq_struct; | |
| +unsigned short gaf_fp; | |
| +unsigned short GAFINFOCheckSum; | |
| +}GAFINFO= { | |
| +.ver=0x0300, // by dh3s.choi 2010 12 14 | |
| +.size=sizeof(GAFINFO), | |
| +.task_struct_struct_state=offsetof(struct task_struct,state), | |
| +.task_struct_struct_comm=offsetof(struct task_struct,comm), | |
| +.task_struct_struct_tasks=offsetof(struct task_struct,tasks), | |
| +.task_struct_struct_pid=offsetof(struct task_struct,pid), | |
| +.task_struct_struct_stack=offsetof(struct task_struct,stack), | |
| +.task_struct_struct_mm=offsetof(struct task_struct,mm), | |
| +.mm_struct_struct_start_data=offsetof(struct mm_struct,start_data), | |
| +.mm_struct_struct_end_data=offsetof(struct mm_struct,end_data), | |
| +.mm_struct_struct_start_brk=offsetof(struct mm_struct,start_brk), | |
| +.mm_struct_struct_brk=offsetof(struct mm_struct,brk), | |
| +.mm_struct_struct_start_stack=offsetof(struct mm_struct,start_stack), | |
| +.mm_struct_struct_arg_start=offsetof(struct mm_struct,arg_start), | |
| +.mm_struct_struct_arg_end=offsetof(struct mm_struct,arg_end), | |
| +.mm_struct_struct_pgd=offsetof(struct mm_struct,pgd), | |
| +.mm_struct_struct_mmap=offsetof(struct mm_struct,mmap), | |
| +.vm_area_struct_struct_vm_start=offsetof(struct vm_area_struct,vm_start), | |
| +.vm_area_struct_struct_vm_end=offsetof(struct vm_area_struct,vm_end), | |
| +.vm_area_struct_struct_vm_next=offsetof(struct vm_area_struct,vm_next), | |
| +.vm_area_struct_struct_vm_file=offsetof(struct vm_area_struct,vm_file), | |
| +.thread_info_struct_cpu_context=offsetof(struct thread_info,cpu_context), | |
| +.cpu_context_save_struct_sp=offsetof(struct cpu_context_save,sp), | |
| +.file_struct_f_path=offsetof(struct file,f_path), | |
| +.path_struct_mnt=offsetof(struct path,mnt), | |
| +.path_struct_dentry=offsetof(struct path,dentry), | |
| +.dentry_struct_d_parent=offsetof(struct dentry,d_parent), | |
| +.dentry_struct_d_name=offsetof(struct dentry,d_name), | |
| +.qstr_struct_name=offsetof(struct qstr,name), | |
| +.vfsmount_struct_mnt_mountpoint=offsetof(struct vfsmount,mnt_mountpoint), | |
| +.vfsmount_struct_mnt_root=offsetof(struct vfsmount,mnt_root), | |
| +.vfsmount_struct_mnt_parent=offsetof(struct vfsmount,mnt_parent), | |
| +.pgdir_shift=PGDIR_SHIFT, | |
| +.ptrs_per_pte=PTRS_PER_PTE, | |
| +.phys_offset=PHYS_OFFSET, | |
| +.page_offset=PAGE_OFFSET, | |
| +.page_shift=PAGE_SHIFT, | |
| +.page_size=PAGE_SIZE, | |
| +.task_struct_struct_thread_group =offsetof(struct task_struct, thread_group), | |
| +.task_struct_struct_utime= offsetof(struct task_struct, utime), | |
| +.task_struct_struct_stime= offsetof(struct task_struct, stime), | |
| +.list_head_struct_next=offsetof(struct list_head, next), | |
| +.list_head_struct_prev=offsetof(struct list_head, prev), | |
| + .rq_struct_curr=0, | |
| +.thread_info_struct_cpu=offsetof(struct thread_info,cpu), | |
| +.task_struct_struct_prio=offsetof(struct task_struct, prio), | |
| +.task_struct_struct_static_prio=offsetof(struct task_struct, static_prio), | |
| +.task_struct_struct_normal_prio=offsetof(struct task_struct, normal_prio), | |
| +.task_struct_struct_rt_priority=offsetof(struct task_struct, rt_priority), | |
| +.task_struct_struct_se=offsetof(struct task_struct, se), | |
| +.sched_entity_struct_exec_start=offsetof(struct sched_entity,exec_start), | |
| +.sched_entity_struct_sum_exec_runtime=offsetof(struct sched_entity,sum_exec_runtime), | |
| +.sched_entity_struct_prev_sum_exec_runtime=offsetof(struct sched_entity,prev_sum_exec_runtime), | |
| + | |
| +#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | |
| +.task_struct_struct_sched_info=offsetof(struct task_struct, sched_info), | |
| +.sched_info_struct_pcount=offsetof(struct sched_info,pcount), | |
| +.sched_info_struct_run_delay=offsetof(struct sched_info,run_delay), | |
| +.sched_info_struct_last_arrival=offsetof(struct sched_info,last_arrival), | |
| +.sched_info_struct_last_queued=offsetof(struct sched_info,last_queued), | |
| +#else | |
| +.task_struct_struct_sched_info=0x1223, | |
| +.sched_info_struct_pcount=0x1224, | |
| +.sched_info_struct_run_delay=0x1225, | |
| +.sched_info_struct_last_arrival=0x1226, | |
| +.sched_info_struct_last_queued=0x1227, | |
| +#endif | |
| + | |
| +#ifdef CONFIG_DEBUG_MUTEXES | |
| +.task_struct_struct_blocked_on=offsetof(struct task_struct,blocked_on), | |
| +.mutex_waiter_struct_list=offsetof(struct mutex_waiter,list), | |
| +.mutex_waiter_struct_task=offsetof(struct mutex_waiter,task), | |
| +#else | |
| +.task_struct_struct_blocked_on=0x1228, | |
| +.mutex_waiter_struct_list=0x1229, | |
| +.mutex_waiter_struct_task=0x122a, | |
| +#endif | |
| + | |
| +#ifdef CONFIG_FAIR_GROUP_SCHED | |
| +.sched_entity_struct_cfs_rq_struct=offsetof(struct sched_entity, cfs_rq), | |
| +#else | |
| +.sched_entity_struct_cfs_rq_struct=0x1223, | |
| +#endif | |
| + | |
| +.cfs_rq_struct_rq_struct=0, | |
| + | |
| +#ifdef CONFIG_FRAME_POINTER | |
| +.gaf_fp=1, | |
| +#else | |
| +.gaf_fp=0, | |
| +#endif | |
| + | |
| +.GAFINFOCheckSum=0 | |
| +}; | |
| +//}} Add GAForensicINFO - 1/2 | |
| #endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/serial_8250.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/serial_8250.h | |
| --- /path/to/linux-2.6.35.7/include/linux/serial_8250.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/serial_8250.h 2018-07-12 10:14:14.000000000 +0700 | |
| @@ -26,6 +26,7 @@ | |
| unsigned int uartclk; /* UART clock rate */ | |
| void *private_data; | |
| unsigned char regshift; /* register shift */ | |
| + unsigned int fifosize; | |
| unsigned char iotype; /* UPIO_* */ | |
| unsigned char hub6; | |
| upf_t flags; /* UPF_* flags */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/serial_core.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/serial_core.h | |
| --- /path/to/linux-2.6.35.7/include/linux/serial_core.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/serial_core.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -224,6 +224,7 @@ | |
| void (*pm)(struct uart_port *, unsigned int state, | |
| unsigned int oldstate); | |
| int (*set_wake)(struct uart_port *, unsigned int state); | |
| + void (*wake_peer)(struct uart_port *); | |
| /* | |
| * Return a string describing the type of the port | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/skbuff.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/skbuff.h | |
| --- /path/to/linux-2.6.35.7/include/linux/skbuff.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/skbuff.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -45,6 +45,8 @@ | |
| #define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0)) | |
| #define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2)) | |
| +#define SKB_NETPOLL_SIGNATURE 0x12345678 | |
| + | |
| /* A. Checksumming of received packets by device. | |
| * | |
| * NONE: device failed to checksum this packet. | |
| @@ -256,7 +258,7 @@ | |
| typedef unsigned char *sk_buff_data_t; | |
| #endif | |
| -/** | |
| +/** | |
| * struct sk_buff - socket buffer | |
| * @next: Next buffer in list | |
| * @prev: Previous buffer in list | |
| @@ -285,7 +287,7 @@ | |
| * @priority: Packet queueing priority | |
| * @users: User count - see {datagram,tcp}.c | |
| * @protocol: Packet protocol from driver | |
| - * @truesize: Buffer size | |
| + * @truesize: Buffer size | |
| * @head: Head of buffer | |
| * @data: Data head pointer | |
| * @tail: Tail pointer | |
| @@ -407,6 +409,7 @@ | |
| sk_buff_data_t transport_header; | |
| sk_buff_data_t network_header; | |
| sk_buff_data_t mac_header; | |
| + unsigned int netpoll_signature; | |
| /* These elements must be at the end, see alloc_skb() for details. */ | |
| sk_buff_data_t tail; | |
| sk_buff_data_t end; | |
| @@ -1645,7 +1648,7 @@ | |
| * is untouched. Otherwise it is extended. Returns zero on | |
| * success. The skb is freed on error. | |
| */ | |
| - | |
| + | |
| static inline int skb_padto(struct sk_buff *skb, unsigned int len) | |
| { | |
| unsigned int size = skb->len; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/sockios.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/sockios.h | |
| --- /path/to/linux-2.6.35.7/include/linux/sockios.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/sockios.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -65,6 +65,7 @@ | |
| #define SIOCDIFADDR 0x8936 /* delete PA address */ | |
| #define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */ | |
| #define SIOCGIFCOUNT 0x8938 /* get number of devices */ | |
| +#define SIOCKILLADDR 0x8939 /* kill sockets with this local addr */ | |
| #define SIOCGIFBR 0x8940 /* Bridging support */ | |
| #define SIOCSIFBR 0x8941 /* Set bridging options */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/stat.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/stat.h | |
| --- /path/to/linux-2.6.35.7/include/linux/stat.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/stat.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -52,6 +52,7 @@ | |
| #define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) | |
| #define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) | |
| #define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) | |
| +#define S_IWUG (S_IWUSR|S_IWGRP) | |
| #define UTIME_NOW ((1l << 30) - 1l) | |
| #define UTIME_OMIT ((1l << 30) - 2l) | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: switch.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: synaptics_i2c_rmi.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: taos.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: timed_gpio.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/tty.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/tty.h | |
| --- /path/to/linux-2.6.35.7/include/linux/tty.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/tty.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -289,7 +289,7 @@ | |
| void *driver_data; | |
| struct list_head tty_files; | |
| -#define N_TTY_BUF_SIZE 4096 | |
| +#define N_TTY_BUF_SIZE 4096*2 //4096 | |
| /* | |
| * The following is data for the N_TTY line discipline. For | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: uid_stat.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb: android_composite.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb: android.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/usb/composite.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb/composite.h | |
| --- /path/to/linux-2.6.35.7/include/linux/usb/composite.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb/composite.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -36,8 +36,18 @@ | |
| #include <linux/usb/ch9.h> | |
| #include <linux/usb/gadget.h> | |
| +#include <linux/switch.h> | |
| +/* | |
| + * USB function drivers should return USB_GADGET_DELAYED_STATUS if they | |
| + * wish to delay the data/status stages of the control transfer till they | |
| + * are ready. The control transfer will then be kept from completing till | |
| + * all the function drivers that requested for USB_GADGET_DELAYED_STAUS | |
| + * invoke usb_composite_setup_continue(). | |
| + */ | |
| +#define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ | |
| +struct usb_composite_dev; | |
| struct usb_configuration; | |
| /** | |
| @@ -101,6 +111,9 @@ | |
| struct usb_configuration *config; | |
| + /* disabled is zero if the function is enabled */ | |
| + int disabled; | |
| + | |
| /* REVISIT: bind() functions can be marked __init, which | |
| * makes trouble for section mismatch analysis. See if | |
| * we can't restructure things to avoid mismatching. | |
| @@ -128,6 +141,7 @@ | |
| /* internals */ | |
| struct list_head list; | |
| DECLARE_BITMAP(endpoints, 32); | |
| + struct device *dev; | |
| }; | |
| int usb_add_function(struct usb_configuration *, struct usb_function *); | |
| @@ -137,6 +151,13 @@ | |
| int usb_interface_id(struct usb_configuration *, struct usb_function *); | |
| +void usb_function_set_enabled(struct usb_function *, int); | |
| +void usb_composite_force_reset(struct usb_composite_dev *); | |
| + | |
| +void set_usb_interface(struct usb_function *function, unsigned id, bool is_on); | |
| +void set_current_usb_config(unsigned char is_android); | |
| +extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | |
| + | |
| /** | |
| * ep_choose - select descriptor endpoint at current device speed | |
| * @g: gadget, connected and running at some speed | |
| @@ -268,6 +289,9 @@ | |
| const struct usb_device_descriptor *dev; | |
| struct usb_gadget_strings **strings; | |
| + struct class *class; | |
| + atomic_t function_count; | |
| + | |
| /* REVISIT: bind() functions can be marked __init, which | |
| * makes trouble for section mismatch analysis. See if | |
| * we can't restructure things to avoid mismatching... | |
| @@ -279,6 +303,8 @@ | |
| /* global suspend hooks */ | |
| void (*suspend)(struct usb_composite_dev *); | |
| void (*resume)(struct usb_composite_dev *); | |
| + | |
| + void (*enable_function)(struct usb_function *f, int enable); | |
| }; | |
| extern int usb_composite_register(struct usb_composite_driver *); | |
| @@ -337,8 +363,22 @@ | |
| */ | |
| unsigned deactivations; | |
| - /* protects at least deactivation count */ | |
| + /* the composite driver won't complete the control transfer's | |
| + * data/status stages till delayed_status is zero. | |
| + */ | |
| + int delayed_status; | |
| + | |
| + /* protects deactivations and delayed_status counts*/ | |
| spinlock_t lock; | |
| + | |
| + /* switch indicating connected/disconnected state */ | |
| + struct switch_dev sw_connected; | |
| + /* switch indicating current configuration */ | |
| + struct switch_dev sw_config; | |
| + /* current connected state for sw_connected */ | |
| + bool connected; | |
| + | |
| + struct work_struct switch_work; | |
| }; | |
| extern int usb_string_id(struct usb_composite_dev *c); | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb: f_mtp.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/usb/gadget.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb/gadget.h | |
| --- /path/to/linux-2.6.35.7/include/linux/usb/gadget.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb/gadget.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -112,6 +112,18 @@ | |
| gfp_t gfp_flags); | |
| void (*free_request) (struct usb_ep *ep, struct usb_request *req); | |
| +#ifdef CONFIG_USB_GADGET_USE_LOWLEVEL_ALLOC_BUFFER | |
| + void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, | |
| + dma_addr_t *dma, int gfp_flags); | |
| + void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, | |
| + unsigned bytes); | |
| +#endif | |
| + | |
| +#ifdef CONFIG_USB_GADGET_USE_DMA_MAP | |
| + int (*queue_dma) (struct usb_ep *ep, struct usb_request *req, | |
| + gfp_t gfp_flags); | |
| +#endif | |
| + | |
| int (*queue) (struct usb_ep *ep, struct usb_request *req, | |
| gfp_t gfp_flags); | |
| int (*dequeue) (struct usb_ep *ep, struct usb_request *req); | |
| @@ -121,6 +133,7 @@ | |
| int (*fifo_status) (struct usb_ep *ep); | |
| void (*fifo_flush) (struct usb_ep *ep); | |
| + void (*setup_in_status_phase) (struct usb_ep *ep, struct usb_request *req); | |
| }; | |
| /** | |
| @@ -230,6 +243,51 @@ | |
| ep->ops->free_request(ep, req); | |
| } | |
| +#ifdef CONFIG_USB_GADGET_USE_LOWLEVEL_ALLOC_BUFFER | |
| + | |
| +/** | |
| + * usb_ep_alloc_buffer - allocate an I/O buffer | |
| + * @param ep the endpoint associated with the buffer | |
| + * @param len:length of the desired buffer | |
| + * @param dma:pointer to the buffer's DMA address; must be valid | |
| + * @param gfp_flags:GFP_* flags to use | |
| + * | |
| + * Returns a new buffer, or null if one could not be allocated. | |
| + * The buffer is suitably aligned for dma, if that endpoint uses DMA, | |
| + * and the caller won't have to care about dma-inconsistency | |
| + * or any hidden "bounce buffer" mechanism. No additional per-request | |
| + * DMA mapping will be required for such buffers. | |
| + * Free it later with usb_ep_free_buffer(). | |
| + * | |
| + * You don't need to use this call to allocate I/O buffers unless you | |
| + * want to make sure drivers don't incur costs for such "bounce buffer" | |
| + * copies or per-request DMA mappings. | |
| + */ | |
| +static inline void * | |
| +usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, | |
| + int gfp_flags) | |
| +{ | |
| + return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); | |
| +} | |
| + | |
| +/** | |
| + * usb_ep_free_buffer - frees an i/o buffer | |
| + * @param ep the endpoint associated with the buffer | |
| + * @param buf CPU view address of the buffer | |
| + * @param dma the buffer's DMA address | |
| + * @param len length of the buffer | |
| + * | |
| + * reverses the effect of usb_ep_alloc_buffer(). | |
| + * caller guarantees the buffer will no longer be accessed | |
| + */ | |
| +static inline void | |
| +usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len) | |
| +{ | |
| + ep->ops->free_buffer (ep, buf, dma, len); | |
| +} | |
| + | |
| +#endif | |
| + | |
| /** | |
| * usb_ep_queue - queues (submits) an I/O request to an endpoint. | |
| * @ep:the endpoint associated with the request | |
| @@ -293,6 +351,14 @@ | |
| return ep->ops->queue(ep, req, gfp_flags); | |
| } | |
| +#ifdef CONFIG_USB_GADGET_USE_DMA_MAP | |
| +static inline int | |
| +usb_ep_queue_dma (struct usb_ep *ep, struct usb_request *req, gfp_t gfp_flags) | |
| +{ | |
| + return ep->ops->queue_dma (ep, req, gfp_flags); | |
| +} | |
| +#endif | |
| + | |
| /** | |
| * usb_ep_dequeue - dequeues (cancels, unlinks) an I/O request from an endpoint | |
| * @ep:the endpoint associated with the request | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/usb_usual.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb_usual.h | |
| --- /path/to/linux-2.6.35.7/include/linux/usb_usual.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/usb_usual.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -113,11 +113,11 @@ | |
| /* | |
| */ | |
| -extern int usb_usual_ignore_device(struct usb_interface *intf); | |
| -extern struct usb_device_id usb_storage_usb_ids[]; | |
| #ifdef CONFIG_USB_LIBUSUAL | |
| +extern int usb_usual_ignore_device(struct usb_interface *intf); | |
| +extern struct usb_device_id usb_storage_usb_ids[]; | |
| extern void usb_usual_set_present(int type); | |
| extern void usb_usual_clear_present(int type); | |
| extern int usb_usual_check_type(const struct usb_device_id *, int type); | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: version.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/linux/videodev2.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/videodev2.h | |
| --- /path/to/linux-2.6.35.7/include/linux/videodev2.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux/videodev2.h 2018-07-12 10:14:15.000000000 +0700 | |
| @@ -631,6 +631,109 @@ | |
| struct v4l2_rect c; | |
| }; | |
| +//BYKIM_CAMACQ | |
| +//#ifdef CONFIG_MACH_GFORCE | |
| +/* | |
| + * F L A S H L I G H T M A N A G E M E N T | |
| + */ | |
| +enum v4l2_flash_mode { V4L2_FLASH_DISABLED = 0 ,V4L2_FLASH_FORCED ,V4L2_FLASH_AUTO ,V4L2_PRE_FLASH ,V4L2_FLASH_NOT_AVAIL, NB_FLASH_MODE }; | |
| +struct v4l2_flash | |
| +{ | |
| + enum v4l2_flash_mode flash_mode; | |
| +}; | |
| + | |
| +/* | |
| + * M U L T I C A M E R A S U P P O R T | |
| + */ | |
| +enum v4l2_camera_type { CAPTURE_CAM = 0 , VIDEOTEL_CAM }; | |
| +enum v4l2_camera_orientation { PORTRAIT_MODE = 0 , LANDSCAPE_MODE }; | |
| + | |
| +struct v4l2_camera_status | |
| +{ | |
| + __u8 nb_camera; | |
| + enum v4l2_camera_type running_camera; | |
| + //enum v4l2_camera_orientation camera_orientation; | |
| +}; | |
| + | |
| +/* QUERY CAM*/ | |
| +struct v4l2_camcap | |
| +{ | |
| + __u8 cam_index; | |
| + __u32 max_width; | |
| + __u32 max_height; | |
| + | |
| +}; | |
| + | |
| + | |
| +#define MAX_EFX_NAME_LENGTH 12 | |
| +#define MAX_EFX_NUMBER 15 | |
| + | |
| +struct v4l2_efx | |
| +{ | |
| + char efx_name[MAX_EFX_NAME_LENGTH]; | |
| +}; | |
| + | |
| +struct v4l2_query_efx | |
| +{ | |
| + __u32 index; | |
| + struct v4l2_efx efx; | |
| +}; | |
| + | |
| + | |
| +/* About various white balance preset available */ | |
| +#define MAX_WB_NAME_LENGTH 20 | |
| +#define MAX_WB_NUMBER 15 | |
| +struct v4l2_wb_mode | |
| +{ | |
| + char wb_mode_name[MAX_WB_NAME_LENGTH+1]; /*+ SAMSUNG chulspro 20091216 We added carrige return data */ | |
| +}; | |
| + | |
| +struct v4l2_query_wb_mode | |
| +{ | |
| + __u32 index; | |
| + struct v4l2_wb_mode wb_mode; | |
| +}; | |
| + | |
| + | |
| +enum v4l2_ctrl_sensitivity { | |
| + V4L2_CTRL_ISO_AUTO = 0, | |
| + V4L2_CTRL_ISO_50 = 1, | |
| + V4L2_CTRL_ISO_100 = 2, | |
| + V4L2_CTRL_ISO_200 = 3, | |
| + V4L2_CTRL_ISO_400 = 4, | |
| + V4L2_CTRL_ISO_800 = 5, | |
| + V4L2_CTRL_ISO_1600 = 6, | |
| + V4L2_CTRL_ISO_3200 = 7, | |
| + V4L2_CTRL_ISO_HJR = 8, | |
| +}; | |
| + | |
| +enum v4l2_ctrl_metering_exposure { | |
| + V4L2_CTRL_MET_EXP_MATRIX = 0, | |
| + V4L2_CTRL_MET_EXP_CENTERWEIGHTED = 1, | |
| + V4L2_CTRL_MET_EXP_SPOT = 2, | |
| +}; | |
| + | |
| +enum v4l2_ctrl_scene { | |
| + V4L2_CTRL_SCENE_AUTO = 0, | |
| + V4L2_CTRL_SCENE_NIGHT, | |
| + V4L2_CTRL_SCENE_LANDSCAPE, | |
| + V4L2_CTRL_SCENE_SUNSET , | |
| + V4L2_CTRL_SCENE_PORTRAIT, | |
| + V4L2_CTRL_SCENE_PARTY, | |
| + V4L2_CTRL_SCENE_SUNRISE, | |
| + V4L2_CTRL_SCENE_INDOOR, | |
| + V4L2_CTRL_SCENE_SPORTS, | |
| + V4L2_CTRL_SCENE_BEACH, | |
| + V4L2_CTRL_SCENE_SNOW, | |
| + V4L2_CTRL_SCENE_FALLCOLOR, | |
| + V4L2_CTRL_SCENE_FIREWORKS, | |
| + V4L2_CTRL_SCENE_CANDLELIGHT, | |
| + V4L2_CTRL_SCENE_AGAINSTLIGHT, | |
| + V4L2_CTRL_SCENE_TEXT, | |
| + V4L2_CTRL_SCENE_DUSKDAWN, | |
| +}; | |
| +//#endif /*MACH_GFORCE*/ | |
| + | |
| /* | |
| * A N A L O G V I D E O S T A N D A R D | |
| */ | |
| @@ -897,6 +1000,15 @@ | |
| #define V4L2_OUT_CAP_CUSTOM_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ | |
| #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ | |
| +//BYKIM_CAMACQ | |
| +// #ifdef CONFIG_MACH_GFORCE | |
| +#define V4L2_CID_MET_EXP (V4L2_CID_PRIVATE_BASE+0) /*sensor specific*/ | |
| +#define V4L2_CID_SENSITIVITY (V4L2_CID_PRIVATE_BASE+1) /*sensor specific*/ | |
| +#define V4L2_CID_SCENE (V4L2_CID_PRIVATE_BASE+2) /*sensor specific*/ | |
| +#define V4L2_CID_ATFCS_MODE (V4L2_CID_PRIVATE_BASE+3) /*sensor specific*/ | |
| +#define V4L2_CID_PRIVATE_CTRL_MODE (V4L2_CID_PRIVATE_BASE+4) /*sensor specific*/ | |
| +// #endif /*MACH_GFORCE*/ | |
| + | |
| /* | |
| * C O N T R O L S | |
| */ | |
| @@ -1016,6 +1128,10 @@ | |
| V4L2_CID_POWER_LINE_FREQUENCY_DISABLED = 0, | |
| V4L2_CID_POWER_LINE_FREQUENCY_50HZ = 1, | |
| V4L2_CID_POWER_LINE_FREQUENCY_60HZ = 2, | |
| +//BYKIM_CAMACQ | |
| +// #ifdef CONFIG_MACH_GFORCE | |
| + V4L2_CID_POWER_LINE_FREQUENCY_AUTO = 3, | |
| +// #endif /*MACH_GFORCE*/ | |
| }; | |
| #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE+25) | |
| #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE+26) | |
| @@ -1024,6 +1140,14 @@ | |
| #define V4L2_CID_CHROMA_AGC (V4L2_CID_BASE+29) | |
| #define V4L2_CID_COLOR_KILLER (V4L2_CID_BASE+30) | |
| #define V4L2_CID_COLORFX (V4L2_CID_BASE+31) | |
| +//BYKIM_CAMACQ | |
| +// #ifdef CONFIG_MACH_GFORCE | |
| +#define V4L2_CID_ROTATE (V4L2_CID_BASE+32) | |
| +#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+33) | |
| +#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+34) | |
| +#define V4L2_CID_EXP_COMPENSATION (V4L2_CID_BASE+35) | |
| +// #endif /*MACH_GFORCE*/ | |
| + | |
| enum v4l2_colorfx { | |
| V4L2_COLORFX_NONE = 0, | |
| V4L2_COLORFX_BW = 1, | |
| @@ -1036,6 +1160,17 @@ | |
| V4L2_COLORFX_SKIN_WHITEN = 8, | |
| V4L2_COLORFX_VIVID = 9, | |
| }; | |
| +//BYKIM_CAMACQ | |
| +#if 1 //CONFIG_MACH_GFORCE | |
| +#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+36) | |
| +#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+37) | |
| + | |
| +#define V4L2_CID_AF_FIRMWARE_DOWNLOAD (V4L2_CID_BASE+38) | |
| +/* last CID + 1 */ | |
| +#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) | |
| + | |
| +#else /*MACH_GFORCE*/ | |
| + | |
| #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) | |
| #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) | |
| @@ -1047,6 +1182,9 @@ | |
| /* last CID + 1 */ | |
| #define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) | |
| +#define V4L2_CID_AF_FIRMWARE_DOWNLOAD (V4L2_CID_BASE+38) | |
| +#endif /*MACH_GFORCE*/ | |
| + | |
| /* MPEG-class control IDs defined by V4L2 */ | |
| #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | |
| #define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) | |
| @@ -1326,6 +1464,53 @@ | |
| }; | |
| #define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) | |
| #define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) | |
| +//BYKIM_CAMACQ | |
| +// #ifdef CONFIG_MACH_GFORCE | |
| +enum v4l2_autofocus_ctrl { | |
| + V4L2_ATFCS_CTRL_OFF = 0, | |
| + V4L2_ATFCS_CTRL_SINGLE = 1, | |
| + V4L2_ATFCS_CTRL_CONTINOUS = 2, | |
| + V4L2_ATFCS_CTRL_INIT = 3, | |
| + V4L2_ATFSC_CTRL_MAX, | |
| + V4L2_ATFCS_CTRL_ENUM = 0x7FFFFFFF | |
| +}; | |
| + | |
| +enum v4l2_autofocus_state { | |
| + V4L2_ATFCS_STT_SEARCHING = V4L2_ATFSC_CTRL_MAX, | |
| + V4L2_ATFCS_STT_FOCUSED, | |
| + V4L2_ATFCS_STT_NOT_FOCUSED, | |
| + V4L2_ATFCS_STT_NOT_SUPPORT, | |
| + V4L2_ATFCS_STT_ENUM = 0x7FFFFFFF | |
| +}; | |
| + | |
| +enum v4l2_autofocus_mode { | |
| + V4L2_ATFCS_MODE_AUTO = 0, | |
| + V4L2_ATFCS_MODE_NORMAL = 1, | |
| + V4L2_ATFCS_MODE_MACRO = 2, | |
| + V4L2_ATFCS_MODE_INFINITY = 3, | |
| + V4L2_ATFCS_MODE_FIXED = 4, | |
| + V4L2_ATFCS_MODE_EDOF = 5, | |
| + | |
| + V4L2_ATFCS_MODE_RET_AUTO = 100, | |
| + V4L2_ATFCS_MODE_RET_MACRO = 101, | |
| + | |
| + V4L2_ATFCS_MODE_ENUM = 0x7FFFFFF | |
| +}; | |
| + | |
| +enum v4l2_flicker_mode { | |
| + V4L2_FLR_50HZ = 0, | |
| + V4L2_FLR_60HZ = 1, | |
| + V4L2_FLR_AUTO = 2, | |
| + V4L2_FLR_ENUM = 0x7FFFFFFF | |
| +}; | |
| + | |
| +enum v4l2_private_ctrl_mode { | |
| + V4L2_PRIVATE_CTRL_RETURN_PREVIEW = 0, | |
| + | |
| + | |
| + V4L2_PRIVATE_CTRL_ENUM = 0x7FFFFFFF | |
| +}; | |
| +// #endif /*MACH_GFORCE*/ | |
| /* | |
| * T U N I N G | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: wakelock.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: wifi_tiwlan.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: wl127x-rfkill.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/linux: wlan_plat.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net: activity_stats.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/net/bluetooth/hci_core.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/hci_core.h | |
| --- /path/to/linux-2.6.35.7/include/net/bluetooth/hci_core.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/hci_core.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -1,6 +1,6 @@ | |
| /* | |
| BlueZ - Bluetooth protocol stack for Linux | |
| - Copyright (C) 2000-2001 Qualcomm Incorporated | |
| + Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved. | |
| Written 2000,2001 by Maxim Krasnyansky <[email protected]> | |
| @@ -250,6 +250,7 @@ | |
| HCI_CONN_ENCRYPT_PEND, | |
| HCI_CONN_RSWITCH_PEND, | |
| HCI_CONN_MODE_CHANGE_PEND, | |
| + HCI_CONN_SCO_SETUP_PEND, | |
| }; | |
| static inline void hci_conn_hash_init(struct hci_dev *hdev) | |
| @@ -330,13 +331,17 @@ | |
| void hci_acl_disconn(struct hci_conn *conn, __u8 reason); | |
| void hci_add_sco(struct hci_conn *conn, __u16 handle); | |
| void hci_setup_sync(struct hci_conn *conn, __u16 handle); | |
| +void hci_sco_setup(struct hci_conn *conn, __u8 status); | |
| -struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); | |
| +struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, | |
| + __u16 pkt_type, bdaddr_t *dst); | |
| int hci_conn_del(struct hci_conn *conn); | |
| void hci_conn_hash_flush(struct hci_dev *hdev); | |
| void hci_conn_check_pending(struct hci_dev *hdev); | |
| -struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 sec_level, __u8 auth_type); | |
| +struct hci_conn *hci_connect(struct hci_dev *hdev, int type, | |
| + __u16 pkt_type, bdaddr_t *dst, | |
| + __u8 sec_level, __u8 auth_type); | |
| int hci_conn_check_link_mode(struct hci_conn *conn); | |
| int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); | |
| int hci_conn_change_link_key(struct hci_conn *conn); | |
| @@ -363,7 +368,7 @@ | |
| if (conn->state == BT_CONNECTED) { | |
| timeo = msecs_to_jiffies(conn->disc_timeout); | |
| if (!conn->out) | |
| - timeo *= 2; | |
| + timeo *= 20; | |
| } else | |
| timeo = msecs_to_jiffies(10); | |
| } else | |
| @@ -444,6 +449,7 @@ | |
| #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | |
| #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | |
| #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | |
| +#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) | |
| /* ----- HCI protocols ----- */ | |
| struct hci_proto { | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/net/bluetooth/hci.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/hci.h | |
| --- /path/to/linux-2.6.35.7/include/net/bluetooth/hci.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/hci.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -143,15 +143,20 @@ | |
| #define ESCO_2EV5 0x0100 | |
| #define ESCO_3EV5 0x0200 | |
| -#define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) | |
| -#define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) | |
| +#define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) | |
| +#define EDR_ESCO_MASK (ESCO_2EV3 | ESCO_3EV3 | ESCO_2EV5 | ESCO_3EV5) | |
| +#define ALL_ESCO_MASK (SCO_ESCO_MASK | ESCO_EV3 | ESCO_EV4 | ESCO_EV5 | \ | |
| + EDR_ESCO_MASK) | |
| /* ACL flags */ | |
| +#define ACL_START_NO_FLUSH 0x00 | |
| #define ACL_CONT 0x01 | |
| #define ACL_START 0x02 | |
| #define ACL_ACTIVE_BCAST 0x04 | |
| #define ACL_PICO_BCAST 0x08 | |
| +#define ACL_PB_MASK (ACL_CONT | ACL_START) | |
| + | |
| /* Baseband links */ | |
| #define SCO_LINK 0x00 | |
| #define ACL_LINK 0x01 | |
| @@ -190,6 +195,7 @@ | |
| #define LMP_EDR_ESCO_3M 0x40 | |
| #define LMP_EDR_3S_ESCO 0x80 | |
| +#define LMP_NO_FLUSH 0x01 | |
| #define LMP_SIMPLE_PAIR 0x08 | |
| /* Connection modes */ | |
| @@ -995,6 +1001,9 @@ | |
| __u8 out; | |
| __u16 state; | |
| __u32 link_mode; | |
| + __u32 mtu; | |
| + __u32 cnt; | |
| + __u32 pkts; | |
| }; | |
| struct hci_dev_req { | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/net/bluetooth/l2cap.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/l2cap.h | |
| --- /path/to/linux-2.6.35.7/include/net/bluetooth/l2cap.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/l2cap.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -73,6 +73,7 @@ | |
| #define L2CAP_LM_TRUSTED 0x0008 | |
| #define L2CAP_LM_RELIABLE 0x0010 | |
| #define L2CAP_LM_SECURE 0x0020 | |
| +#define L2CAP_LM_FLUSHABLE 0x0040 | |
| /* L2CAP command codes */ | |
| #define L2CAP_COMMAND_REJ 0x01 | |
| @@ -320,6 +321,7 @@ | |
| __u8 sec_level; | |
| __u8 role_switch; | |
| __u8 force_reliable; | |
| + __u8 flushable; | |
| __u8 conf_req[64]; | |
| __u8 conf_len; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/net/bluetooth/rfcomm.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/rfcomm.h | |
| --- /path/to/linux-2.6.35.7/include/net/bluetooth/rfcomm.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/rfcomm.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -29,7 +29,6 @@ | |
| #define RFCOMM_CONN_TIMEOUT (HZ * 30) | |
| #define RFCOMM_DISC_TIMEOUT (HZ * 20) | |
| #define RFCOMM_AUTH_TIMEOUT (HZ * 25) | |
| -#define RFCOMM_IDLE_TIMEOUT (HZ * 2) | |
| #define RFCOMM_DEFAULT_MTU 127 | |
| #define RFCOMM_DEFAULT_CREDITS 7 | |
| @@ -155,7 +154,6 @@ | |
| struct rfcomm_session { | |
| struct list_head list; | |
| struct socket *sock; | |
| - struct timer_list timer; | |
| unsigned long state; | |
| unsigned long flags; | |
| atomic_t refcnt; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/net/bluetooth/sco.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/sco.h | |
| --- /path/to/linux-2.6.35.7/include/net/bluetooth/sco.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/bluetooth/sco.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -37,6 +37,7 @@ | |
| struct sockaddr_sco { | |
| sa_family_t sco_family; | |
| bdaddr_t sco_bdaddr; | |
| + __u16 sco_pkt_type; | |
| }; | |
| /* SCO socket options */ | |
| @@ -72,7 +73,8 @@ | |
| struct sco_pinfo { | |
| struct bt_sock bt; | |
| - __u32 flags; | |
| + __u16 pkt_type; | |
| + | |
| struct sco_conn *conn; | |
| }; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/include/net/tcp.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/tcp.h | |
| --- /path/to/linux-2.6.35.7/include/net/tcp.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/include/net/tcp.h 2018-07-12 10:14:16.000000000 +0700 | |
| @@ -1457,6 +1457,8 @@ | |
| extern int tcp_gro_complete(struct sk_buff *skb); | |
| extern int tcp4_gro_complete(struct sk_buff *skb); | |
| +extern void tcp_v4_nuke_addr(__u32 saddr); | |
| + | |
| #ifdef CONFIG_PROC_FS | |
| extern int tcp4_proc_init(void); | |
| extern void tcp4_proc_exit(void); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/init/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/init/Kconfig | |
| --- /path/to/linux-2.6.35.7/init/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/init/Kconfig 2018-07-12 10:14:39.000000000 +0700 | |
| @@ -786,6 +786,12 @@ | |
| config ANON_INODES | |
| bool | |
| +config PANIC_TIMEOUT | |
| + int "Default panic timeout" | |
| + default 0 | |
| + help | |
| + Set default panic timeout. | |
| + | |
| menuconfig EMBEDDED | |
| bool "Configure standard kernel features (for small systems)" | |
| help | |
| @@ -958,6 +964,15 @@ | |
| option replaces shmem and tmpfs with the much simpler ramfs code, | |
| which may be appropriate on small systems without swap. | |
| +config ASHMEM | |
| + bool "Enable the Anonymous Shared Memory Subsystem" | |
| + default n | |
| + depends on SHMEM || TINY_SHMEM | |
| + help | |
| + The ashmem subsystem is a new shared memory allocator, similar to | |
| + POSIX SHM but with different behavior and sporting a simpler | |
| + file-based API. | |
| + | |
| config AIO | |
| bool "Enable AIO support" if EMBEDDED | |
| default y | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel: brcm_ulogging_printk.h | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel: brcm_ulogging_printkmtt.h | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/cgroup.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/cgroup.c | |
| --- /path/to/linux-2.6.35.7/kernel/cgroup.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/cgroup.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -58,6 +58,7 @@ | |
| #include <linux/vmalloc.h> /* TODO: replace with more sophisticated array */ | |
| #include <linux/eventfd.h> | |
| #include <linux/poll.h> | |
| +#include <linux/capability.h> | |
| #include <asm/atomic.h> | |
| @@ -263,6 +264,33 @@ | |
| static DECLARE_WORK(release_agent_work, cgroup_release_agent); | |
| static void check_for_release(struct cgroup *cgrp); | |
| +/* | |
| + * A queue for waiters to do rmdir() cgroup. A tasks will sleep when | |
| + * cgroup->count == 0 && list_empty(&cgroup->children) && subsys has some | |
| + * reference to css->refcnt. In general, this refcnt is expected to goes down | |
| + * to zero, soon. | |
| + * | |
| + * CGRP_WAIT_ON_RMDIR flag is set under cgroup's inode->i_mutex; | |
| + */ | |
| +DECLARE_WAIT_QUEUE_HEAD(cgroup_rmdir_waitq); | |
| + | |
| +static void cgroup_wakeup_rmdir_waiter(struct cgroup *cgrp) | |
| +{ | |
| + if (unlikely(test_and_clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags))) | |
| + wake_up_all(&cgroup_rmdir_waitq); | |
| +} | |
| + | |
| +void cgroup_exclude_rmdir(struct cgroup_subsys_state *css) | |
| +{ | |
| + css_get(css); | |
| +} | |
| + | |
| +void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css) | |
| +{ | |
| + cgroup_wakeup_rmdir_waiter(css->cgroup); | |
| + css_put(css); | |
| +} | |
| + | |
| /* Link structure for associating css_set objects with cgroups */ | |
| struct cg_cgroup_link { | |
| /* | |
| @@ -322,10 +350,35 @@ | |
| return &css_set_table[index]; | |
| } | |
| +static void free_css_set_work(struct work_struct *work) | |
| +{ | |
| + struct css_set *cg = container_of(work, struct css_set, work); | |
| + struct cg_cgroup_link *link; | |
| + struct cg_cgroup_link *saved_link; | |
| + | |
| + write_lock(&css_set_lock); | |
| + list_for_each_entry_safe(link, saved_link, &cg->cg_links, | |
| + cg_link_list) { | |
| + struct cgroup *cgrp = link->cgrp; | |
| + list_del(&link->cg_link_list); | |
| + list_del(&link->cgrp_link_list); | |
| + if (atomic_dec_and_test(&cgrp->count)) { | |
| + check_for_release(cgrp); | |
| + cgroup_wakeup_rmdir_waiter(cgrp); | |
| + } | |
| + kfree(link); | |
| + } | |
| + write_unlock(&css_set_lock); | |
| + | |
| + kfree(cg); | |
| +} | |
| + | |
| static void free_css_set_rcu(struct rcu_head *obj) | |
| { | |
| struct css_set *cg = container_of(obj, struct css_set, rcu_head); | |
| - kfree(cg); | |
| + | |
| + INIT_WORK(&cg->work, free_css_set_work); | |
| + schedule_work(&cg->work); | |
| } | |
| /* We don't maintain the lists running through each css_set to its | |
| @@ -334,10 +387,16 @@ | |
| * compiled into their kernel but not actually in use */ | |
| static int use_task_css_set_links __read_mostly; | |
| -static void __put_css_set(struct css_set *cg, int taskexit) | |
| +/* | |
| + * refcounted get/put for css_set objects | |
| + */ | |
| +static inline void get_css_set(struct css_set *cg) | |
| +{ | |
| + atomic_inc(&cg->refcount); | |
| +} | |
| + | |
| +static void put_css_set(struct css_set *cg) | |
| { | |
| - struct cg_cgroup_link *link; | |
| - struct cg_cgroup_link *saved_link; | |
| /* | |
| * Ensure that the refcount doesn't hit zero while any readers | |
| * can see it. Similar to atomic_dec_and_lock(), but for an | |
| @@ -351,48 +410,14 @@ | |
| return; | |
| } | |
| - /* This css_set is dead. unlink it and release cgroup refcounts */ | |
| hlist_del(&cg->hlist); | |
| css_set_count--; | |
| - list_for_each_entry_safe(link, saved_link, &cg->cg_links, | |
| - cg_link_list) { | |
| - struct cgroup *cgrp = link->cgrp; | |
| - list_del(&link->cg_link_list); | |
| - list_del(&link->cgrp_link_list); | |
| - if (atomic_dec_and_test(&cgrp->count) && | |
| - notify_on_release(cgrp)) { | |
| - if (taskexit) | |
| - set_bit(CGRP_RELEASABLE, &cgrp->flags); | |
| - check_for_release(cgrp); | |
| - } | |
| - | |
| - kfree(link); | |
| - } | |
| - | |
| write_unlock(&css_set_lock); | |
| call_rcu(&cg->rcu_head, free_css_set_rcu); | |
| } | |
| /* | |
| - * refcounted get/put for css_set objects | |
| - */ | |
| -static inline void get_css_set(struct css_set *cg) | |
| -{ | |
| - atomic_inc(&cg->refcount); | |
| -} | |
| - | |
| -static inline void put_css_set(struct css_set *cg) | |
| -{ | |
| - __put_css_set(cg, 0); | |
| -} | |
| - | |
| -static inline void put_css_set_taskexit(struct css_set *cg) | |
| -{ | |
| - __put_css_set(cg, 1); | |
| -} | |
| - | |
| -/* | |
| * compare_css_sets - helper function for find_existing_css_set(). | |
| * @cg: candidate css_set being tested | |
| * @old_cg: existing css_set for a task | |
| @@ -721,9 +746,9 @@ | |
| * cgroup_attach_task(), which overwrites one tasks cgroup pointer with | |
| * another. It does so using cgroup_mutex, however there are | |
| * several performance critical places that need to reference | |
| - * task->cgroup without the expense of grabbing a system global | |
| + * task->cgroups without the expense of grabbing a system global | |
| * mutex. Therefore except as noted below, when dereferencing or, as | |
| - * in cgroup_attach_task(), modifying a task'ss cgroup pointer we use | |
| + * in cgroup_attach_task(), modifying a task's cgroups pointer we use | |
| * task_lock(), which acts on a spinlock (task->alloc_lock) already in | |
| * the task_struct routinely used for such matters. | |
| * | |
| @@ -904,33 +929,6 @@ | |
| } | |
| /* | |
| - * A queue for waiters to do rmdir() cgroup. A tasks will sleep when | |
| - * cgroup->count == 0 && list_empty(&cgroup->children) && subsys has some | |
| - * reference to css->refcnt. In general, this refcnt is expected to goes down | |
| - * to zero, soon. | |
| - * | |
| - * CGRP_WAIT_ON_RMDIR flag is set under cgroup's inode->i_mutex; | |
| - */ | |
| -DECLARE_WAIT_QUEUE_HEAD(cgroup_rmdir_waitq); | |
| - | |
| -static void cgroup_wakeup_rmdir_waiter(struct cgroup *cgrp) | |
| -{ | |
| - if (unlikely(test_and_clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags))) | |
| - wake_up_all(&cgroup_rmdir_waitq); | |
| -} | |
| - | |
| -void cgroup_exclude_rmdir(struct cgroup_subsys_state *css) | |
| -{ | |
| - css_get(css); | |
| -} | |
| - | |
| -void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css) | |
| -{ | |
| - cgroup_wakeup_rmdir_waiter(css->cgroup); | |
| - css_put(css); | |
| -} | |
| - | |
| -/* | |
| * Call with cgroup_mutex held. Drops reference counts on modules, including | |
| * any duplicate ones that parse_cgroupfs_options took. If this function | |
| * returns an error, no reference counts are touched. | |
| @@ -1721,6 +1719,15 @@ | |
| failed_ss = ss; | |
| goto out; | |
| } | |
| + } else if (!capable(CAP_SYS_ADMIN)) { | |
| + const struct cred *cred = current_cred(), *tcred; | |
| + | |
| + /* No can_attach() - check perms generically */ | |
| + tcred = __task_cred(tsk); | |
| + if (cred->euid != tcred->uid && | |
| + cred->euid != tcred->suid) { | |
| + return -EACCES; | |
| + } | |
| } | |
| } | |
| @@ -1761,8 +1768,8 @@ | |
| if (ss->attach) | |
| ss->attach(ss, cgrp, oldcgrp, tsk, false); | |
| } | |
| - set_bit(CGRP_RELEASABLE, &oldcgrp->flags); | |
| - synchronize_rcu(); | |
| + set_bit(CGRP_RELEASABLE, &cgrp->flags); | |
| + /* put_css_set will not destroy cg until after an RCU grace period */ | |
| put_css_set(cg); | |
| /* | |
| @@ -1795,7 +1802,6 @@ | |
| static int attach_task_by_pid(struct cgroup *cgrp, u64 pid) | |
| { | |
| struct task_struct *tsk; | |
| - const struct cred *cred = current_cred(), *tcred; | |
| int ret; | |
| if (pid) { | |
| @@ -1805,14 +1811,6 @@ | |
| rcu_read_unlock(); | |
| return -ESRCH; | |
| } | |
| - | |
| - tcred = __task_cred(tsk); | |
| - if (cred->euid && | |
| - cred->euid != tcred->uid && | |
| - cred->euid != tcred->suid) { | |
| - rcu_read_unlock(); | |
| - return -EACCES; | |
| - } | |
| get_task_struct(tsk); | |
| rcu_read_unlock(); | |
| } else { | |
| @@ -3334,6 +3332,8 @@ | |
| if (err < 0) | |
| goto err_remove; | |
| + set_bit(CGRP_RELEASABLE, &parent->flags); | |
| + | |
| /* The cgroup directory was pre-locked for us */ | |
| BUG_ON(!mutex_is_locked(&cgrp->dentry->d_inode->i_mutex)); | |
| @@ -3465,6 +3465,21 @@ | |
| return !failed; | |
| } | |
| +/* checks if all of the css_sets attached to a cgroup have a refcount of 0. | |
| + * Must be called with css_set_lock held */ | |
| +static int cgroup_css_sets_empty(struct cgroup *cgrp) | |
| +{ | |
| + struct cg_cgroup_link *link; | |
| + | |
| + list_for_each_entry(link, &cgrp->css_sets, cgrp_link_list) { | |
| + struct css_set *cg = link->cg; | |
| + if (atomic_read(&cg->refcount) > 0) | |
| + return 0; | |
| + } | |
| + | |
| + return 1; | |
| +} | |
| + | |
| static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry) | |
| { | |
| struct cgroup *cgrp = dentry->d_fsdata; | |
| @@ -3477,7 +3492,7 @@ | |
| /* the vfs holds both inode->i_mutex already */ | |
| again: | |
| mutex_lock(&cgroup_mutex); | |
| - if (atomic_read(&cgrp->count) != 0) { | |
| + if (!cgroup_css_sets_empty(cgrp)) { | |
| mutex_unlock(&cgroup_mutex); | |
| return -EBUSY; | |
| } | |
| @@ -3510,7 +3525,7 @@ | |
| mutex_lock(&cgroup_mutex); | |
| parent = cgrp->parent; | |
| - if (atomic_read(&cgrp->count) || !list_empty(&cgrp->children)) { | |
| + if (!cgroup_css_sets_empty(cgrp) || !list_empty(&cgrp->children)) { | |
| clear_bit(CGRP_WAIT_ON_RMDIR, &cgrp->flags); | |
| mutex_unlock(&cgroup_mutex); | |
| return -EBUSY; | |
| @@ -3552,7 +3567,6 @@ | |
| cgroup_d_remove_dir(d); | |
| dput(d); | |
| - set_bit(CGRP_RELEASABLE, &parent->flags); | |
| check_for_release(parent); | |
| /* | |
| @@ -4128,7 +4142,7 @@ | |
| if (!list_empty(&tsk->cg_list)) { | |
| write_lock(&css_set_lock); | |
| if (!list_empty(&tsk->cg_list)) | |
| - list_del(&tsk->cg_list); | |
| + list_del_init(&tsk->cg_list); | |
| write_unlock(&css_set_lock); | |
| } | |
| @@ -4138,7 +4152,7 @@ | |
| tsk->cgroups = &init_css_set; | |
| task_unlock(tsk); | |
| if (cg) | |
| - put_css_set_taskexit(cg); | |
| + put_css_set(cg); | |
| } | |
| /** | |
| @@ -4308,6 +4322,14 @@ | |
| } | |
| /* Caller must verify that the css is not for root cgroup */ | |
| +void __css_get(struct cgroup_subsys_state *css, int count) | |
| +{ | |
| + atomic_add(count, &css->refcnt); | |
| + set_bit(CGRP_RELEASABLE, &css->cgroup->flags); | |
| +} | |
| +EXPORT_SYMBOL_GPL(__css_get); | |
| + | |
| +/* Caller must verify that the css is not for root cgroup */ | |
| void __css_put(struct cgroup_subsys_state *css, int count) | |
| { | |
| struct cgroup *cgrp = css->cgroup; | |
| @@ -4315,10 +4337,7 @@ | |
| rcu_read_lock(); | |
| val = atomic_sub_return(count, &css->refcnt); | |
| if (val == 1) { | |
| - if (notify_on_release(cgrp)) { | |
| - set_bit(CGRP_RELEASABLE, &cgrp->flags); | |
| - check_for_release(cgrp); | |
| - } | |
| + check_for_release(cgrp); | |
| cgroup_wakeup_rmdir_waiter(cgrp); | |
| } | |
| rcu_read_unlock(); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/cgroup_freezer.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/cgroup_freezer.c | |
| --- /path/to/linux-2.6.35.7/kernel/cgroup_freezer.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/cgroup_freezer.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -172,6 +172,14 @@ | |
| { | |
| struct freezer *freezer; | |
| + if ((current != task) && (!capable(CAP_SYS_ADMIN))) { | |
| + const struct cred *cred = current_cred(), *tcred; | |
| + | |
| + tcred = __task_cred(task); | |
| + if (cred->euid != tcred->uid && cred->euid != tcred->suid) | |
| + return -EPERM; | |
| + } | |
| + | |
| /* | |
| * Anything frozen can't move or be moved to/from. | |
| * | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/cpuset.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/cpuset.c | |
| --- /path/to/linux-2.6.35.7/kernel/cpuset.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/cpuset.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -1383,6 +1383,13 @@ | |
| int ret; | |
| struct cpuset *cs = cgroup_cs(cont); | |
| + if ((current != task) && (!capable(CAP_SYS_ADMIN))) { | |
| + const struct cred *cred = current_cred(), *tcred; | |
| + | |
| + if (cred->euid != tcred->uid && cred->euid != tcred->suid) | |
| + return -EPERM; | |
| + } | |
| + | |
| if (cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed)) | |
| return -ENOSPC; | |
| Only in /path/to/linux-2.6.35.7/kernel/debug/kdb: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/fork.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/fork.c | |
| --- /path/to/linux-2.6.35.7/kernel/fork.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/fork.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -147,6 +147,9 @@ | |
| /* SLAB cache for mm_struct structures (tsk->mm) */ | |
| static struct kmem_cache *mm_cachep; | |
| +/* Notifier list called when a task struct is freed */ | |
| +static ATOMIC_NOTIFIER_HEAD(task_free_notifier); | |
| + | |
| static void account_kernel_stack(struct thread_info *ti, int account) | |
| { | |
| struct zone *zone = page_zone(virt_to_page(ti)); | |
| @@ -177,6 +180,18 @@ | |
| free_signal_struct(sig); | |
| } | |
| +int task_free_register(struct notifier_block *n) | |
| +{ | |
| + return atomic_notifier_chain_register(&task_free_notifier, n); | |
| +} | |
| +EXPORT_SYMBOL(task_free_register); | |
| + | |
| +int task_free_unregister(struct notifier_block *n) | |
| +{ | |
| + return atomic_notifier_chain_unregister(&task_free_notifier, n); | |
| +} | |
| +EXPORT_SYMBOL(task_free_unregister); | |
| + | |
| void __put_task_struct(struct task_struct *tsk) | |
| { | |
| WARN_ON(!tsk->exit_state); | |
| @@ -187,6 +202,7 @@ | |
| delayacct_tsk_free(tsk); | |
| put_signal_struct(tsk->signal); | |
| + atomic_notifier_call_chain(&task_free_notifier, 0, tsk); | |
| if (!profile_handoff_task(tsk)) | |
| free_task(tsk); | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/futex.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/futex.c | |
| --- /path/to/linux-2.6.35.7/kernel/futex.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/futex.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -220,6 +220,7 @@ | |
| struct mm_struct *mm = current->mm; | |
| struct page *page; | |
| int err; | |
| + struct vm_area_struct *vma; | |
| /* | |
| * The futex address must be "naturally" aligned. | |
| @@ -242,6 +243,37 @@ | |
| key->private.mm = mm; | |
| key->private.address = address; | |
| get_futex_key_refs(key); | |
| + return 0; | |
| + } | |
| + | |
| + /* | |
| + * The futex is hashed differently depending on whether | |
| + * it's in a shared or private mapping. So check vma first. | |
| + */ | |
| + vma = find_extend_vma(mm, address); | |
| + if (unlikely(!vma)) | |
| + return -EFAULT; | |
| + | |
| + /* | |
| + * Permissions. | |
| + */ | |
| + if (unlikely((vma->vm_flags & (VM_IO|VM_READ)) != VM_READ)) | |
| + return (vma->vm_flags & VM_IO) ? -EPERM : -EACCES; | |
| + | |
| + /* | |
| + * Private mappings are handled in a simple way. | |
| + * | |
| + * NOTE: When userspace waits on a MAP_SHARED mapping, even if | |
| + * it's a read-only handle, it's expected that futexes attach to | |
| + * the object not the particular process. Therefore we use | |
| + * VM_MAYSHARE here, not VM_SHARED which is restricted to shared | |
| + * mappings of _writable_ handles. | |
| + */ | |
| + if (likely(!(vma->vm_flags & VM_MAYSHARE))) { | |
| + key->both.offset |= FUT_OFF_MMSHARED; /* reference taken on mm */ | |
| + key->private.mm = mm; | |
| + key->private.address = address; | |
| + get_futex_key_refs(key); | |
| return 0; | |
| } | |
| Only in /path/to/linux-2.6.35.7/kernel: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/panic.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/panic.c | |
| --- /path/to/linux-2.6.35.7/kernel/panic.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/panic.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -30,7 +30,10 @@ | |
| static int pause_on_oops_flag; | |
| static DEFINE_SPINLOCK(pause_on_oops_lock); | |
| -int panic_timeout; | |
| +#ifndef CONFIG_PANIC_TIMEOUT | |
| +#define CONFIG_PANIC_TIMEOUT 0 | |
| +#endif | |
| +int panic_timeout = CONFIG_PANIC_TIMEOUT; | |
| ATOMIC_NOTIFIER_HEAD(panic_notifier_list); | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power: consoleearlysuspend.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power: earlysuspend.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power: fbearlysuspend.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/power/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/Kconfig | |
| --- /path/to/linux-2.6.35.7/kernel/power/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/Kconfig 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -134,6 +134,73 @@ | |
| Turning OFF this setting is NOT recommended! If in doubt, say Y. | |
| +config HAS_WAKELOCK | |
| + bool | |
| + | |
| +config HAS_EARLYSUSPEND | |
| + bool | |
| + | |
| +config WAKELOCK | |
| + bool "Wake lock" | |
| + depends on PM && RTC_CLASS | |
| + default n | |
| + select HAS_WAKELOCK | |
| + ---help--- | |
| + Enable wakelocks. When user space request a sleep state the | |
| + sleep request will be delayed until no wake locks are held. | |
| + | |
| +config WAKELOCK_STAT | |
| + bool "Wake lock stats" | |
| + depends on WAKELOCK | |
| + default y | |
| + ---help--- | |
| + Report wake lock stats in /proc/wakelocks | |
| + | |
| +config USER_WAKELOCK | |
| + bool "Userspace wake locks" | |
| + depends on WAKELOCK | |
| + default y | |
| + ---help--- | |
| + User-space wake lock api. Write "lockname" or "lockname timeout" | |
| + to /sys/power/wake_lock lock and if needed create a wake lock. | |
| + Write "lockname" to /sys/power/wake_unlock to unlock a user wake | |
| + lock. | |
| + | |
| +config EARLYSUSPEND | |
| + bool "Early suspend" | |
| + depends on WAKELOCK | |
| + default y | |
| + select HAS_EARLYSUSPEND | |
| + ---help--- | |
| + Call early suspend handlers when the user requested sleep state | |
| + changes. | |
| + | |
| +choice | |
| + prompt "User-space screen access" | |
| + default FB_EARLYSUSPEND if !FRAMEBUFFER_CONSOLE | |
| + default CONSOLE_EARLYSUSPEND | |
| + depends on HAS_EARLYSUSPEND | |
| + | |
| + config NO_USER_SPACE_SCREEN_ACCESS_CONTROL | |
| + bool "None" | |
| + | |
| + config CONSOLE_EARLYSUSPEND | |
| + bool "Console switch on early-suspend" | |
| + depends on HAS_EARLYSUSPEND && VT | |
| + ---help--- | |
| + Register early suspend handler to perform a console switch to | |
| + when user-space should stop drawing to the screen and a switch | |
| + back when it should resume. | |
| + | |
| + config FB_EARLYSUSPEND | |
| + bool "Sysfs interface" | |
| + depends on HAS_EARLYSUSPEND | |
| + ---help--- | |
| + Register early suspend handler that notifies and waits for | |
| + user-space through sysfs when user-space should stop drawing | |
| + to the screen and notifies user-space when it should resume. | |
| +endchoice | |
| + | |
| config HIBERNATION | |
| bool "Hibernation (aka 'suspend to disk')" | |
| depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/power/main.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/main.c | |
| --- /path/to/linux-2.6.35.7/kernel/power/main.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/main.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -173,12 +173,17 @@ | |
| const char *buf, size_t n) | |
| { | |
| #ifdef CONFIG_SUSPEND | |
| +#ifdef CONFIG_EARLYSUSPEND | |
| + suspend_state_t state = PM_SUSPEND_ON; | |
| +#else | |
| suspend_state_t state = PM_SUSPEND_STANDBY; | |
| +#endif | |
| const char * const *s; | |
| #endif | |
| char *p; | |
| int len; | |
| int error = -EINVAL; | |
| + pr_info("%s\n",__func__); | |
| p = memchr(buf, '\n', n); | |
| len = p ? p - buf : n; | |
| @@ -195,8 +200,16 @@ | |
| break; | |
| } | |
| if (state < PM_SUSPEND_MAX && *s) | |
| +#ifdef CONFIG_EARLYSUSPEND | |
| + if (state == PM_SUSPEND_ON || valid_state(state)) { | |
| + error = 0; | |
| + pr_info("%s invoking request_suspend_state - state = %d\n",__func__,state); | |
| + request_suspend_state(state); | |
| + } | |
| +#else | |
| error = enter_state(state); | |
| #endif | |
| +#endif | |
| Exit: | |
| return error ? error : n; | |
| @@ -229,6 +242,11 @@ | |
| power_attr(pm_trace); | |
| #endif /* CONFIG_PM_TRACE */ | |
| +#ifdef CONFIG_USER_WAKELOCK | |
| +power_attr(wake_lock); | |
| +power_attr(wake_unlock); | |
| +#endif | |
| + | |
| static struct attribute * g[] = { | |
| &state_attr.attr, | |
| #ifdef CONFIG_PM_TRACE | |
| @@ -239,6 +257,10 @@ | |
| #ifdef CONFIG_PM_DEBUG | |
| &pm_test_attr.attr, | |
| #endif | |
| +#ifdef CONFIG_USER_WAKELOCK | |
| + &wake_lock_attr.attr, | |
| + &wake_unlock_attr.attr, | |
| +#endif | |
| #endif | |
| NULL, | |
| }; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/power/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/Makefile | |
| --- /path/to/linux-2.6.35.7/kernel/power/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/Makefile 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -11,5 +11,10 @@ | |
| obj-$(CONFIG_HIBERNATION) += hibernate.o snapshot.o swap.o user.o \ | |
| block_io.o | |
| obj-$(CONFIG_SUSPEND_NVS) += nvs.o | |
| +obj-$(CONFIG_WAKELOCK) += wakelock.o | |
| +obj-$(CONFIG_USER_WAKELOCK) += userwakelock.o | |
| +obj-$(CONFIG_EARLYSUSPEND) += earlysuspend.o | |
| +obj-$(CONFIG_CONSOLE_EARLYSUSPEND) += consoleearlysuspend.o | |
| +obj-$(CONFIG_FB_EARLYSUSPEND) += fbearlysuspend.o | |
| obj-$(CONFIG_MAGIC_SYSRQ) += poweroff.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/power/power.h /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/power.h | |
| --- /path/to/linux-2.6.35.7/kernel/power/power.h 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/power.h 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -233,3 +233,27 @@ | |
| { | |
| } | |
| #endif | |
| + | |
| +#ifdef CONFIG_WAKELOCK | |
| +/* kernel/power/wakelock.c */ | |
| +extern struct workqueue_struct *suspend_work_queue; | |
| +extern struct wake_lock main_wake_lock; | |
| +extern suspend_state_t requested_suspend_state; | |
| +#endif | |
| + | |
| +#ifdef CONFIG_USER_WAKELOCK | |
| +ssize_t wake_lock_show(struct kobject *kobj, struct kobj_attribute *attr, | |
| + char *buf); | |
| +ssize_t wake_lock_store(struct kobject *kobj, struct kobj_attribute *attr, | |
| + const char *buf, size_t n); | |
| +ssize_t wake_unlock_show(struct kobject *kobj, struct kobj_attribute *attr, | |
| + char *buf); | |
| +ssize_t wake_unlock_store(struct kobject *kobj, struct kobj_attribute *attr, | |
| + const char *buf, size_t n); | |
| +#endif | |
| + | |
| +#ifdef CONFIG_EARLYSUSPEND | |
| +/* kernel/power/earlysuspend.c */ | |
| +void request_suspend_state(suspend_state_t state); | |
| +suspend_state_t get_suspend_state(void); | |
| +#endif | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/power/process.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/process.c | |
| --- /path/to/linux-2.6.35.7/kernel/power/process.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/process.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -15,6 +15,7 @@ | |
| #include <linux/syscalls.h> | |
| #include <linux/freezer.h> | |
| #include <linux/delay.h> | |
| +#include <linux/wakelock.h> | |
| /* | |
| * Timeout for stopping processes | |
| @@ -38,6 +39,7 @@ | |
| struct timeval start, end; | |
| u64 elapsed_csecs64; | |
| unsigned int elapsed_csecs; | |
| + unsigned int wakeup = 0; | |
| do_gettimeofday(&start); | |
| @@ -63,6 +65,10 @@ | |
| todo++; | |
| } while_each_thread(g, p); | |
| read_unlock(&tasklist_lock); | |
| + if (todo && has_wake_lock(WAKE_LOCK_SUSPEND)) { | |
| + wakeup = 1; | |
| + break; | |
| + } | |
| if (!todo || time_after(jiffies, end_time)) | |
| break; | |
| @@ -84,14 +90,22 @@ | |
| * and caller must call thaw_processes() if something fails), | |
| * but it cleans up leftover PF_FREEZE requests. | |
| */ | |
| - printk("\n"); | |
| - printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds " | |
| - "(%d tasks refusing to freeze):\n", | |
| - elapsed_csecs / 100, elapsed_csecs % 100, todo); | |
| + if(wakeup) { | |
| + printk("\n"); | |
| + printk(KERN_ERR "Freezing of %s aborted\n", | |
| + sig_only ? "user space " : "tasks "); | |
| + } | |
| + else { | |
| + printk("\n"); | |
| + printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds " | |
| + "(%d tasks refusing to freeze):\n", | |
| + elapsed_csecs / 100, elapsed_csecs % 100, todo); | |
| + } | |
| read_lock(&tasklist_lock); | |
| do_each_thread(g, p) { | |
| task_lock(p); | |
| - if (freezing(p) && !freezer_should_skip(p)) | |
| + if (freezing(p) && !freezer_should_skip(p) && | |
| + elapsed_csecs > 100) | |
| sched_show_task(p); | |
| cancel_freezing(p); | |
| task_unlock(p); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/power/suspend.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/suspend.c | |
| --- /path/to/linux-2.6.35.7/kernel/power/suspend.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power/suspend.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -26,6 +26,9 @@ | |
| #include "power.h" | |
| const char *const pm_states[PM_SUSPEND_MAX] = { | |
| +#ifdef CONFIG_EARLYSUSPEND | |
| + [PM_SUSPEND_ON] = "on", | |
| +#endif | |
| [PM_SUSPEND_STANDBY] = "standby", | |
| [PM_SUSPEND_MEM] = "mem", | |
| }; | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power: userwakelock.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/power: wakelock.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/printk.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/printk.c | |
| --- /path/to/linux-2.6.35.7/kernel/printk.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/printk.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -55,6 +55,10 @@ | |
| #define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) | |
| +#ifdef CONFIG_DEBUG_LL | |
| +extern void printascii(char *); | |
| +#endif | |
| + | |
| /* printk's without a loglevel use this.. */ | |
| #define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */ | |
| @@ -164,6 +168,24 @@ | |
| VMCOREINFO_SYMBOL(logged_chars); | |
| } | |
| #endif | |
| +//{{ Mark for GetLog - 1/2 | |
| +struct struct_kernel_log_mark { | |
| +u32 special_mark_1; | |
| +u32 special_mark_2; | |
| +u32 special_mark_3; | |
| +u32 special_mark_4; | |
| +void *p__log_buf; | |
| +}; | |
| + | |
| +static struct struct_kernel_log_mark kernel_log_mark = { | |
| + .special_mark_1 = (('*' << 24) | ('^' << 16) | ('^' << 8) | ('*' << 0)), | |
| + .special_mark_2 = (('I' << 24) | ('n' << 16) | ('f' << 8) | ('o' << 0)), | |
| + .special_mark_3 = (('H' << 24) | ('e' << 16) | ('r' << 8) | ('e' << 0)), | |
| + .special_mark_4 = (('k' << 24) | ('l' << 16) | ('o' << 8) | ('g' << 0)), | |
| + .p__log_buf = __log_buf, | |
| +}; | |
| +//}} Mark for GetLog - 1/2 | |
| + | |
| static int __init log_buf_len_setup(char *str) | |
| { | |
| @@ -201,6 +223,11 @@ | |
| printk(KERN_NOTICE "log_buf_len: %d\n", log_buf_len); | |
| } | |
| out: | |
| + | |
| + //{{ Mark for GetLog - 2/2 | |
| + kernel_log_mark.p__log_buf = __log_buf; | |
| + //}} Mark for GetLog - 2/2 | |
| + | |
| return 1; | |
| } | |
| @@ -259,6 +286,68 @@ | |
| } | |
| #endif | |
| +/* | |
| + * Return the number of unread characters in the log buffer. | |
| + */ | |
| +static int log_buf_get_len(void) | |
| +{ | |
| + return logged_chars; | |
| +} | |
| + | |
| +/* | |
| + * Clears the ring-buffer | |
| + */ | |
| +void log_buf_clear(void) | |
| +{ | |
| + logged_chars = 0; | |
| +} | |
| + | |
| +/* | |
| + * Copy a range of characters from the log buffer. | |
| + */ | |
| +int log_buf_copy(char *dest, int idx, int len) | |
| +{ | |
| + int ret, max; | |
| + bool took_lock = false; | |
| + | |
| + if (!oops_in_progress) { | |
| + spin_lock_irq(&logbuf_lock); | |
| + took_lock = true; | |
| + } | |
| + | |
| + max = log_buf_get_len(); | |
| + if (idx < 0 || idx >= max) { | |
| + ret = -1; | |
| + } else { | |
| + if (len > max - idx) | |
| + len = max - idx; | |
| + ret = len; | |
| + idx += (log_end - max); | |
| + while (len-- > 0) | |
| + dest[len] = LOG_BUF(idx + len); | |
| + } | |
| + | |
| + if (took_lock) | |
| + spin_unlock_irq(&logbuf_lock); | |
| + | |
| + return ret; | |
| +} | |
| + | |
| +/* | |
| + * Commands to do_syslog: | |
| + * | |
| + * 0 -- Close the log. Currently a NOP. | |
| + * 1 -- Open the log. Currently a NOP. | |
| + * 2 -- Read from the log. | |
| + * 3 -- Read all messages remaining in the ring buffer. | |
| + * 4 -- Read and clear all messages remaining in the ring buffer | |
| + * 5 -- Clear ring buffer. | |
| + * 6 -- Disable printk's to console | |
| + * 7 -- Enable printk's to console | |
| + * 8 -- Set level of messages printed to console | |
| + * 9 -- Return number of unread characters in the log buffer | |
| + * 10 -- Return size of the log buffer | |
| + */ | |
| int do_syslog(int type, char __user *buf, int len, bool from_file) | |
| { | |
| unsigned i, j, limit, count; | |
| @@ -687,6 +776,11 @@ | |
| } | |
| } | |
| +#ifdef CONFIG_BRCM_UNIFIED_LOGGING | |
| +/* Unified logging */ | |
| +#include "brcm_ulogging_printk.h" | |
| +#endif | |
| + | |
| asmlinkage int vprintk(const char *fmt, va_list args) | |
| { | |
| int printed_len = 0; | |
| @@ -734,6 +828,9 @@ | |
| printed_len += vscnprintf(printk_buf + printed_len, | |
| sizeof(printk_buf) - printed_len, fmt, args); | |
| +#ifdef CONFIG_DEBUG_LL | |
| + printascii(printk_buf); | |
| +#endif | |
| p = printk_buf; | |
| @@ -758,6 +855,9 @@ | |
| } | |
| } | |
| +#ifdef CONFIG_BRCM_UNIFIED_LOGGING | |
| +#include "brcm_ulogging_printkmtt.h" | |
| +#endif | |
| /* | |
| * Copy the output into log_buf. If the caller didn't provide | |
| * appropriate log level tags, we insert them here | |
| @@ -771,7 +871,7 @@ | |
| printed_len += 3; | |
| new_text_line = 0; | |
| - if (printk_time) { | |
| + if(printk_time){ | |
| /* Follow the token with the time */ | |
| char tbuf[50], *tp; | |
| unsigned tlen; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/ptrace.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/ptrace.c | |
| --- /path/to/linux-2.6.35.7/kernel/ptrace.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/ptrace.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -56,7 +56,7 @@ | |
| child->signal->group_stop_count) | |
| __set_task_state(child, TASK_STOPPED); | |
| else | |
| - signal_wake_up(child, 1); | |
| + ptrace_signal_wake_up(child, true); | |
| } | |
| spin_unlock(&child->sighand->siglock); | |
| } | |
| @@ -79,6 +79,40 @@ | |
| ptrace_untrace(child); | |
| } | |
| +/* Ensure that nothing can wake it up, even SIGKILL */ | |
| +static bool ptrace_freeze_traced(struct task_struct *task, int kill) | |
| +{ | |
| + bool ret = true; | |
| + | |
| + spin_lock_irq(&task->sighand->siglock); | |
| + if (task_is_stopped(task) && !__fatal_signal_pending(task)) | |
| + task->state = __TASK_TRACED; | |
| + else if (!kill) { | |
| + if (task_is_traced(task) && !__fatal_signal_pending(task)) | |
| + task->state = __TASK_TRACED; | |
| + else | |
| + ret = false; | |
| + } | |
| + spin_unlock_irq(&task->sighand->siglock); | |
| + | |
| + return ret; | |
| +} | |
| + | |
| +static void ptrace_unfreeze_traced(struct task_struct *task) | |
| +{ | |
| + if (task->state != __TASK_TRACED) | |
| + return; | |
| + | |
| + WARN_ON(!task->ptrace || task->parent != current); | |
| + | |
| + spin_lock_irq(&task->sighand->siglock); | |
| + if (__fatal_signal_pending(task)) | |
| + wake_up_state(task, __TASK_TRACED); | |
| + else | |
| + task->state = TASK_TRACED; | |
| + spin_unlock_irq(&task->sighand->siglock); | |
| +} | |
| + | |
| /* | |
| * Check that we have indeed attached to the thing.. | |
| */ | |
| @@ -94,25 +128,29 @@ | |
| * be changed by us so it's not changing right after this. | |
| */ | |
| read_lock(&tasklist_lock); | |
| - if ((child->ptrace & PT_PTRACED) && child->parent == current) { | |
| - ret = 0; | |
| + if (child->ptrace && child->parent == current) { | |
| + WARN_ON(child->state == __TASK_TRACED); | |
| /* | |
| * child->sighand can't be NULL, release_task() | |
| * does ptrace_unlink() before __exit_signal(). | |
| */ | |
| - spin_lock_irq(&child->sighand->siglock); | |
| - if (task_is_stopped(child)) | |
| - child->state = TASK_TRACED; | |
| - else if (!task_is_traced(child) && !kill) | |
| - ret = -ESRCH; | |
| - spin_unlock_irq(&child->sighand->siglock); | |
| + if (ptrace_freeze_traced(child, kill)) | |
| + ret = 0; | |
| } | |
| read_unlock(&tasklist_lock); | |
| - if (!ret && !kill) | |
| - ret = wait_task_inactive(child, TASK_TRACED) ? 0 : -ESRCH; | |
| + if (!ret && !kill) { | |
| + if (!wait_task_inactive(child, __TASK_TRACED)) { | |
| + /* | |
| + * This can only happen if may_ptrace_stop() fails and | |
| + * ptrace_stop() changes ->state back to TASK_RUNNING, | |
| + * so we should not worry about leaking __TASK_TRACED. | |
| + */ | |
| + WARN_ON(child->state == __TASK_TRACED); | |
| + ret = -ESRCH; | |
| + } | |
| + } | |
| - /* All systems go.. */ | |
| return ret; | |
| } | |
| @@ -719,6 +757,8 @@ | |
| goto out_put_task_struct; | |
| ret = arch_ptrace(child, request, addr, data); | |
| + if (ret || request != PTRACE_DETACH) | |
| + ptrace_unfreeze_traced(child); | |
| out_put_task_struct: | |
| put_task_struct(child); | |
| @@ -855,8 +895,11 @@ | |
| } | |
| ret = ptrace_check_attach(child, request == PTRACE_KILL); | |
| - if (!ret) | |
| + if (!ret) { | |
| ret = compat_arch_ptrace(child, request, addr, data); | |
| + if (ret || request != PTRACE_DETACH) | |
| + ptrace_unfreeze_traced(child); | |
| + } | |
| out_put_task_struct: | |
| put_task_struct(child); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/sched.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/sched.c | |
| --- /path/to/linux-2.6.35.7/kernel/sched.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/sched.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -72,6 +72,7 @@ | |
| #include <linux/ctype.h> | |
| #include <linux/ftrace.h> | |
| #include <linux/slab.h> | |
| +#include <linux/cpuacct.h> | |
| #include <asm/tlb.h> | |
| #include <asm/irq_regs.h> | |
| @@ -5081,7 +5082,7 @@ | |
| unsigned state; | |
| state = p->state ? __ffs(p->state) + 1 : 0; | |
| - printk(KERN_INFO "%-13.13s %c", p->comm, | |
| + printk(KERN_INFO "%-15.15s %c", p->comm, | |
| state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?'); | |
| #if BITS_PER_LONG == 32 | |
| if (state == TASK_RUNNING) | |
| @@ -7497,6 +7498,31 @@ | |
| int i, j; | |
| unsigned long alloc_size = 0, ptr; | |
| + //{{ Add GAForensicINFO - 2/2 | |
| + /* | |
| + * Add GAForensic init for preventing symbol removal for optimization. | |
| + */ | |
| + | |
| + GAFINFO.rq_struct_curr = offsetof(struct rq, curr); | |
| + | |
| +#ifdef CONFIG_FAIR_GROUP_SCHED | |
| + GAFINFO.cfs_rq_struct_rq_struct=offsetof(struct cfs_rq, rq); | |
| +#else | |
| + GAFINFO.cfs_rq_struct_rq_struct=0x1224; | |
| +#endif | |
| + unsigned short *checksum = &(GAFINFO.GAFINFOCheckSum); | |
| + unsigned char *memory = &GAFINFO; | |
| + unsigned char address; | |
| + | |
| + for (*checksum=0,address = 0; address < (sizeof(GAFINFO)-sizeof(GAFINFO.GAFINFOCheckSum)); address++) | |
| + { | |
| + if ((*checksum) & 0x8000) | |
| + (*checksum) = (((*checksum) << 1) | 1 ) ^ memory[address]; | |
| + else | |
| + (*checksum) = ((*checksum) << 1) ^ memory[address]; | |
| + } | |
| + //}} Add GAForensicINFO - 2/2 | |
| + | |
| #ifdef CONFIG_FAIR_GROUP_SCHED | |
| alloc_size += 2 * nr_cpu_ids * sizeof(void **); | |
| #endif | |
| @@ -7680,13 +7706,24 @@ | |
| return (nested == PREEMPT_INATOMIC_BASE + preempt_offset); | |
| } | |
| +static int __might_sleep_init_called; | |
| +int __init __might_sleep_init(void) | |
| +{ | |
| + __might_sleep_init_called = 1; | |
| + return 0; | |
| +} | |
| +early_initcall(__might_sleep_init); | |
| + | |
| void __might_sleep(const char *file, int line, int preempt_offset) | |
| { | |
| #ifdef in_atomic | |
| static unsigned long prev_jiffy; /* ratelimiting */ | |
| if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) || | |
| - system_state != SYSTEM_RUNNING || oops_in_progress) | |
| + oops_in_progress) | |
| + return; | |
| + if (system_state != SYSTEM_RUNNING && | |
| + (!__might_sleep_init_called || system_state != SYSTEM_BOOTING)) | |
| return; | |
| if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) | |
| return; | |
| @@ -8086,6 +8123,11 @@ | |
| if (unlikely(running)) | |
| tsk->sched_class->put_prev_task(rq, tsk); | |
| +#ifdef CONFIG_FAIR_GROUP_SCHED | |
| + if (tsk->sched_class->prep_move_group) | |
| + tsk->sched_class->prep_move_group(tsk, on_rq); | |
| +#endif | |
| + | |
| set_task_rq(tsk, task_cpu(tsk)); | |
| #ifdef CONFIG_FAIR_GROUP_SCHED | |
| @@ -8503,6 +8545,15 @@ | |
| static int | |
| cpu_cgroup_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk) | |
| { | |
| + if ((current != tsk) && (!capable(CAP_SYS_NICE))) { | |
| + const struct cred *cred = current_cred(), *tcred; | |
| + | |
| + tcred = __task_cred(tsk); | |
| + | |
| + if (cred->euid != tcred->uid && cred->euid != tcred->suid) | |
| + return -EPERM; | |
| + } | |
| + | |
| #ifdef CONFIG_RT_GROUP_SCHED | |
| if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk)) | |
| return -EINVAL; | |
| @@ -8647,8 +8698,30 @@ | |
| u64 __percpu *cpuusage; | |
| struct percpu_counter cpustat[CPUACCT_STAT_NSTATS]; | |
| struct cpuacct *parent; | |
| + struct cpuacct_charge_calls *cpufreq_fn; | |
| + void *cpuacct_data; | |
| }; | |
| +static struct cpuacct *cpuacct_root; | |
| + | |
| +/* Default calls for cpufreq accounting */ | |
| +static struct cpuacct_charge_calls *cpuacct_cpufreq; | |
| +int cpuacct_register_cpufreq(struct cpuacct_charge_calls *fn) | |
| +{ | |
| + cpuacct_cpufreq = fn; | |
| + | |
| + /* | |
| + * Root node is created before platform can register callbacks, | |
| + * initalize here. | |
| + */ | |
| + if (cpuacct_root && fn) { | |
| + cpuacct_root->cpufreq_fn = fn; | |
| + if (fn->init) | |
| + fn->init(&cpuacct_root->cpuacct_data); | |
| + } | |
| + return 0; | |
| +} | |
| + | |
| struct cgroup_subsys cpuacct_subsys; | |
| /* return cpu accounting group corresponding to this container */ | |
| @@ -8683,8 +8756,16 @@ | |
| if (percpu_counter_init(&ca->cpustat[i], 0)) | |
| goto out_free_counters; | |
| + ca->cpufreq_fn = cpuacct_cpufreq; | |
| + | |
| + /* If available, have platform code initalize cpu frequency table */ | |
| + if (ca->cpufreq_fn && ca->cpufreq_fn->init) | |
| + ca->cpufreq_fn->init(&ca->cpuacct_data); | |
| + | |
| if (cgrp->parent) | |
| ca->parent = cgroup_ca(cgrp->parent); | |
| + else | |
| + cpuacct_root = ca; | |
| return &ca->css; | |
| @@ -8812,6 +8893,32 @@ | |
| return 0; | |
| } | |
| +static int cpuacct_cpufreq_show(struct cgroup *cgrp, struct cftype *cft, | |
| + struct cgroup_map_cb *cb) | |
| +{ | |
| + struct cpuacct *ca = cgroup_ca(cgrp); | |
| + if (ca->cpufreq_fn && ca->cpufreq_fn->cpufreq_show) | |
| + ca->cpufreq_fn->cpufreq_show(ca->cpuacct_data, cb); | |
| + | |
| + return 0; | |
| +} | |
| + | |
| +/* return total cpu power usage (milliWatt second) of a group */ | |
| +static u64 cpuacct_powerusage_read(struct cgroup *cgrp, struct cftype *cft) | |
| +{ | |
| + int i; | |
| + struct cpuacct *ca = cgroup_ca(cgrp); | |
| + u64 totalpower = 0; | |
| + | |
| + if (ca->cpufreq_fn && ca->cpufreq_fn->power_usage) | |
| + for_each_present_cpu(i) { | |
| + totalpower += ca->cpufreq_fn->power_usage( | |
| + ca->cpuacct_data); | |
| + } | |
| + | |
| + return totalpower; | |
| +} | |
| + | |
| static struct cftype files[] = { | |
| { | |
| .name = "usage", | |
| @@ -8826,6 +8933,14 @@ | |
| .name = "stat", | |
| .read_map = cpuacct_stats_show, | |
| }, | |
| + { | |
| + .name = "cpufreq", | |
| + .read_map = cpuacct_cpufreq_show, | |
| + }, | |
| + { | |
| + .name = "power", | |
| + .read_u64 = cpuacct_powerusage_read | |
| + }, | |
| }; | |
| static int cpuacct_populate(struct cgroup_subsys *ss, struct cgroup *cgrp) | |
| @@ -8855,6 +8970,10 @@ | |
| for (; ca; ca = ca->parent) { | |
| u64 *cpuusage = per_cpu_ptr(ca->cpuusage, cpu); | |
| *cpuusage += cputime; | |
| + | |
| + /* Call back into platform code to account for CPU speeds */ | |
| + if (ca->cpufreq_fn && ca->cpufreq_fn->charge) | |
| + ca->cpufreq_fn->charge(ca->cpuacct_data, cputime, cpu); | |
| } | |
| rcu_read_unlock(); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/sched_fair.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/sched_fair.c | |
| --- /path/to/linux-2.6.35.7/kernel/sched_fair.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/sched_fair.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -802,6 +802,8 @@ | |
| static void | |
| dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) | |
| { | |
| + u64 min_vruntime; | |
| + | |
| /* | |
| * Update run-time statistics of the 'current'. | |
| */ | |
| @@ -826,6 +828,8 @@ | |
| if (se != cfs_rq->curr) | |
| __dequeue_entity(cfs_rq, se); | |
| account_entity_dequeue(cfs_rq, se); | |
| + | |
| + min_vruntime = cfs_rq->min_vruntime; | |
| update_min_vruntime(cfs_rq); | |
| /* | |
| @@ -834,7 +838,7 @@ | |
| * movement in our normalized position. | |
| */ | |
| if (!(flags & DEQUEUE_SLEEP)) | |
| - se->vruntime -= cfs_rq->min_vruntime; | |
| + se->vruntime -= min_vruntime; | |
| } | |
| /* | |
| @@ -3618,10 +3622,21 @@ | |
| static void moved_group_fair(struct task_struct *p, int on_rq) | |
| { | |
| struct cfs_rq *cfs_rq = task_cfs_rq(p); | |
| + struct sched_entity *se = &p->se; | |
| update_curr(cfs_rq); | |
| if (!on_rq) | |
| - place_entity(cfs_rq, &p->se, 1); | |
| + se->vruntime += cfs_rq->min_vruntime; | |
| +} | |
| + | |
| +static void prep_move_group_fair(struct task_struct *p, int on_rq) | |
| +{ | |
| + struct cfs_rq *cfs_rq = task_cfs_rq(p); | |
| + struct sched_entity *se = &p->se; | |
| + | |
| + /* normalize the runtime of a sleeping task before moving it */ | |
| + if (!on_rq) | |
| + se->vruntime -= cfs_rq->min_vruntime; | |
| } | |
| #endif | |
| @@ -3674,6 +3689,7 @@ | |
| #ifdef CONFIG_FAIR_GROUP_SCHED | |
| .moved_group = moved_group_fair, | |
| + .prep_move_group = prep_move_group_fair, | |
| #endif | |
| }; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/signal.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/signal.c | |
| --- /path/to/linux-2.6.35.7/kernel/signal.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/signal.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -360,6 +360,9 @@ | |
| if (force_default || ka->sa.sa_handler != SIG_IGN) | |
| ka->sa.sa_handler = SIG_DFL; | |
| ka->sa.sa_flags = 0; | |
| +#ifdef SA_RESTORER | |
| + ka->sa.sa_restorer = NULL; | |
| +#endif | |
| sigemptyset(&ka->sa.sa_mask); | |
| ka++; | |
| } | |
| @@ -553,23 +556,17 @@ | |
| * No need to set need_resched since signal event passing | |
| * goes through ->blocked | |
| */ | |
| -void signal_wake_up(struct task_struct *t, int resume) | |
| +void signal_wake_up_state(struct task_struct *t, unsigned int state) | |
| { | |
| - unsigned int mask; | |
| - | |
| set_tsk_thread_flag(t, TIF_SIGPENDING); | |
| - | |
| /* | |
| - * For SIGKILL, we want to wake it up in the stopped/traced/killable | |
| + * TASK_WAKEKILL also means wake it up in the stopped/traced/killable | |
| * case. We don't check t->state here because there is a race with it | |
| * executing another processor and just now entering stopped state. | |
| * By using wake_up_state, we ensure the process will wake up and | |
| * handle its death signal. | |
| */ | |
| - mask = TASK_INTERRUPTIBLE; | |
| - if (resume) | |
| - mask |= TASK_WAKEKILL; | |
| - if (!wake_up_state(t, mask)) | |
| + if (!wake_up_state(t, state | TASK_INTERRUPTIBLE)) | |
| kick_process(t); | |
| } | |
| @@ -1587,6 +1584,10 @@ | |
| * If SIGKILL was already sent before the caller unlocked | |
| * ->siglock we must see ->core_state != NULL. Otherwise it | |
| * is safe to enter schedule(). | |
| + * | |
| + * This is almost outdated, a task with the pending SIGKILL can't | |
| + * block in TASK_TRACED. But PTRACE_EVENT_EXIT can be reported | |
| + * after SIGKILL was already dequeued. | |
| */ | |
| if (unlikely(current->mm->core_state) && | |
| unlikely(current->mm == current->parent->mm)) | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/sys.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/sys.c | |
| --- /path/to/linux-2.6.35.7/kernel/sys.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/sys.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -305,6 +305,7 @@ | |
| * Shutdown everything and perform a clean reboot. | |
| * This is not safe to call in interrupt context. | |
| */ | |
| +extern void sys_setting_info(unsigned int id, unsigned int value); | |
| void kernel_restart(char *cmd) | |
| { | |
| kernel_restart_prepare(cmd); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/sysctl.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/sysctl.c | |
| --- /path/to/linux-2.6.35.7/kernel/sysctl.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/sysctl.c 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -92,6 +92,7 @@ | |
| extern unsigned int core_pipe_limit; | |
| extern int pid_max; | |
| extern int min_free_kbytes; | |
| +extern int min_free_order_shift; | |
| extern int pid_max_min, pid_max_max; | |
| extern int sysctl_drop_caches; | |
| extern int percpu_pagelist_fraction; | |
| @@ -1155,6 +1156,13 @@ | |
| .extra1 = &zero, | |
| }, | |
| { | |
| + .procname = "min_free_order_shift", | |
| + .data = &min_free_order_shift, | |
| + .maxlen = sizeof(min_free_order_shift), | |
| + .mode = 0644, | |
| + .proc_handler = &proc_dointvec | |
| + }, | |
| + { | |
| .procname = "percpu_pagelist_fraction", | |
| .data = &percpu_pagelist_fraction, | |
| .maxlen = sizeof(percpu_pagelist_fraction), | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/kernel/timeconst.pl /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/timeconst.pl | |
| --- /path/to/linux-2.6.35.7/kernel/timeconst.pl 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/kernel/timeconst.pl 2018-07-12 10:14:37.000000000 +0700 | |
| @@ -270,7 +270,8 @@ | |
| my($name, $val) = @_; | |
| my $csuf; | |
| - if (defined($val)) { | |
| + #if (defined($val)) { | |
| + if ($val) { | |
| if ($name !~ /SHR/) { | |
| $val = "U64_C($val)"; | |
| } | |
| @@ -370,7 +371,8 @@ | |
| } | |
| @val = @{$canned_values{$hz}}; | |
| - if (!defined(@val)) { | |
| + #if (!defined(@val)) { | |
| + if (!@val) { | |
| @val = compute_values($hz); | |
| } | |
| output($hz, @val); | |
| Only in /path/to/linux-2.6.35.7/lib: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/lib/Kconfig.debug /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/lib/Kconfig.debug | |
| --- /path/to/linux-2.6.35.7/lib/Kconfig.debug 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/lib/Kconfig.debug 2018-07-12 10:14:39.000000000 +0700 | |
| @@ -587,8 +587,9 @@ | |
| mutexes and rwsems. | |
| config STACKTRACE | |
| - bool | |
| + bool "Stacktrace" | |
| depends on STACKTRACE_SUPPORT | |
| + default y | |
| config DEBUG_KOBJECT | |
| bool "kobject debugging" | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/Makefile | |
| --- /path/to/linux-2.6.35.7/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/Makefile 2018-07-12 10:14:17.000000000 +0700 | |
| @@ -4,6 +4,8 @@ | |
| EXTRAVERSION = .7 | |
| NAME = Yokohama | |
| +BRCM_MODULES := ../modules | |
| + | |
| # *DOCUMENTATION* | |
| # To see a list of typical targets execute "make help" | |
| # More info can be located in ./README | |
| @@ -188,8 +190,8 @@ | |
| # Default value for CROSS_COMPILE is not to prefix executables | |
| # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile | |
| export KBUILD_BUILDHOST := $(SUBARCH) | |
| -ARCH ?= $(SUBARCH) | |
| -CROSS_COMPILE ?= | |
| +ARCH ?=arm | |
| +CROSS_COMPILE ?=/opt/toolchains/arm-eabi-4.4.3/bin/arm-none-eabi- | |
| CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%) | |
| # Architecture as present in compile.h | |
| @@ -345,6 +347,7 @@ | |
| # Needed to be compatible with the O= option | |
| LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \ | |
| $(if $(KBUILD_SRC), -I$(srctree)/include) \ | |
| + -I$(BRCM_MODULES)/include \ | |
| -include include/generated/autoconf.h | |
| KBUILD_CPPFLAGS := -D__KERNEL__ | |
| @@ -479,6 +482,7 @@ | |
| # Objects we will link into vmlinux / subdirs we need to visit | |
| init-y := init/ | |
| drivers-y := drivers/ sound/ firmware/ | |
| +drivers-y += $(BRCM_MODULES)/ | |
| net-y := net/ | |
| libs-y := lib/ | |
| core-y := usr/ | |
| @@ -1119,7 +1123,7 @@ | |
| clean: archclean $(clean-dirs) | |
| $(call cmd,rmdirs) | |
| $(call cmd,rmfiles) | |
| - @find . $(RCS_FIND_IGNORE) \ | |
| + @find . $(BRCM_MODULES) $(RCS_FIND_IGNORE) \ | |
| \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ | |
| -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ | |
| -o -name '*.symtypes' -o -name 'modules.order' \ | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm: ashmem.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/mm/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm/Makefile | |
| --- /path/to/linux-2.6.35.7/mm/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm/Makefile 2018-07-12 10:14:39.000000000 +0700 | |
| @@ -24,6 +24,7 @@ | |
| obj-$(CONFIG_NUMA) += mempolicy.o | |
| obj-$(CONFIG_SPARSEMEM) += sparse.o | |
| obj-$(CONFIG_SPARSEMEM_VMEMMAP) += sparse-vmemmap.o | |
| +obj-$(CONFIG_ASHMEM) += ashmem.o | |
| obj-$(CONFIG_SLOB) += slob.o | |
| obj-$(CONFIG_COMPACTION) += compaction.o | |
| obj-$(CONFIG_MMU_NOTIFIER) += mmu_notifier.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/mm/memory.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm/memory.c | |
| --- /path/to/linux-2.6.35.7/mm/memory.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm/memory.c 2018-07-12 10:14:39.000000000 +0700 | |
| @@ -1923,6 +1923,53 @@ | |
| } | |
| EXPORT_SYMBOL(remap_pfn_range); | |
| +/** | |
| + * vm_iomap_memory - remap memory to userspace | |
| + * @vma: user vma to map to | |
| + * @start: start of area | |
| + * @len: size of area | |
| + * | |
| + * This is a simplified io_remap_pfn_range() for common driver use. The | |
| + * driver just needs to give us the physical memory range to be mapped, | |
| + * we'll figure out the rest from the vma information. | |
| + * | |
| + * NOTE! Some drivers might want to tweak vma->vm_page_prot first to get | |
| + * whatever write-combining details or similar. | |
| + */ | |
| +int vm_iomap_memory(struct vm_area_struct *vma, phys_addr_t start, unsigned long len) | |
| +{ | |
| + unsigned long vm_len, pfn, pages; | |
| + | |
| + /* Check that the physical memory area passed in looks valid */ | |
| + if (start + len < start) | |
| + return -EINVAL; | |
| + /* | |
| + * You *really* shouldn't map things that aren't page-aligned, | |
| + * but we've historically allowed it because IO memory might | |
| + * just have smaller alignment. | |
| + */ | |
| + len += start & ~PAGE_MASK; | |
| + pfn = start >> PAGE_SHIFT; | |
| + pages = (len + ~PAGE_MASK) >> PAGE_SHIFT; | |
| + if (pfn + pages < pfn) | |
| + return -EINVAL; | |
| + | |
| + /* We start the mapping 'vm_pgoff' pages into the area */ | |
| + if (vma->vm_pgoff > pages) | |
| + return -EINVAL; | |
| + pfn += vma->vm_pgoff; | |
| + pages -= vma->vm_pgoff; | |
| + | |
| + /* Can we fit all of the mapping? */ | |
| + vm_len = vma->vm_end - vma->vm_start; | |
| + if (vm_len >> PAGE_SHIFT > pages) | |
| + return -EINVAL; | |
| + | |
| + /* Ok, let it rip */ | |
| + return io_remap_pfn_range(vma, vma->vm_start, pfn, vm_len, vma->vm_page_prot); | |
| +} | |
| +EXPORT_SYMBOL(vm_iomap_memory); | |
| + | |
| static int apply_to_pte_range(struct mm_struct *mm, pmd_t *pmd, | |
| unsigned long addr, unsigned long end, | |
| pte_fn_t fn, void *data) | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/mm/page_alloc.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm/page_alloc.c | |
| --- /path/to/linux-2.6.35.7/mm/page_alloc.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm/page_alloc.c 2018-07-12 10:14:39.000000000 +0700 | |
| @@ -166,6 +166,7 @@ | |
| }; | |
| int min_free_kbytes = 1024; | |
| +int min_free_order_shift = 1; | |
| static unsigned long __meminitdata nr_kernel_pages; | |
| static unsigned long __meminitdata nr_all_pages; | |
| @@ -1477,7 +1478,7 @@ | |
| free_pages -= z->free_area[o].nr_free << o; | |
| /* Require fewer higher order pages to be free */ | |
| - min >>= 1; | |
| + min >>= min_free_order_shift; | |
| if (free_pages <= min) | |
| return 0; | |
| @@ -3148,6 +3149,20 @@ | |
| #define LONG_ALIGN(x) (((x)+(sizeof(long))-1)&~((sizeof(long))-1)) | |
| /* | |
| + * Check if a pageblock contains reserved pages | |
| + */ | |
| +static int pageblock_is_reserved(unsigned long start_pfn) | |
| +{ | |
| + unsigned long end_pfn = start_pfn + pageblock_nr_pages; | |
| + unsigned long pfn; | |
| + | |
| + for (pfn = start_pfn; pfn < end_pfn; pfn++) | |
| + if (PageReserved(pfn_to_page(pfn))) | |
| + return 1; | |
| + return 0; | |
| +} | |
| + | |
| +/* | |
| * Mark a number of pageblocks as MIGRATE_RESERVE. The number | |
| * of blocks reserved is based on min_wmark_pages(zone). The memory within | |
| * the reserve will tend to store contiguous free pages. Setting min_free_kbytes | |
| @@ -3186,7 +3201,7 @@ | |
| continue; | |
| /* Blocks with reserved pages will never free, skip them. */ | |
| - if (PageReserved(page)) | |
| + if (pageblock_is_reserved(pfn)) | |
| continue; | |
| block_migratetype = get_pageblock_migratetype(page); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/mm/shmem.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm/shmem.c | |
| --- /path/to/linux-2.6.35.7/mm/shmem.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/mm/shmem.c 2018-07-12 10:14:39.000000000 +0700 | |
| @@ -2739,6 +2739,14 @@ | |
| } | |
| EXPORT_SYMBOL_GPL(shmem_file_setup); | |
| +void shmem_set_file(struct vm_area_struct *vma, struct file *file) | |
| +{ | |
| + if (vma->vm_file) | |
| + fput(vma->vm_file); | |
| + vma->vm_file = file; | |
| + vma->vm_ops = &shmem_vm_ops; | |
| +} | |
| + | |
| /** | |
| * shmem_zero_setup - setup a shared anonymous mapping | |
| * @vma: the vma to be mmapped is prepared by do_mmap_pgoff | |
| @@ -2751,10 +2759,6 @@ | |
| file = shmem_file_setup("dev/zero", size, vma->vm_flags); | |
| if (IS_ERR(file)) | |
| return PTR_ERR(file); | |
| - | |
| - if (vma->vm_file) | |
| - fput(vma->vm_file); | |
| - vma->vm_file = file; | |
| - vma->vm_ops = &shmem_vm_ops; | |
| + shmem_set_file(vma, file); | |
| return 0; | |
| } | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/: Module.symvers | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net: activity_stats.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/bluetooth/af_bluetooth.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/af_bluetooth.c | |
| --- /path/to/linux-2.6.35.7/net/bluetooth/af_bluetooth.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/af_bluetooth.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -40,6 +40,15 @@ | |
| #include <net/bluetooth/bluetooth.h> | |
| +#ifdef CONFIG_ANDROID_PARANOID_NETWORK | |
| +#include <linux/android_aid.h> | |
| +#endif | |
| + | |
| +#ifndef CONFIG_BT_SOCK_DEBUG | |
| +#undef BT_DBG | |
| +#define BT_DBG(D...) | |
| +#endif | |
| + | |
| #define VERSION "2.15" | |
| /* Bluetooth sockets */ | |
| @@ -125,11 +134,40 @@ | |
| } | |
| EXPORT_SYMBOL(bt_sock_unregister); | |
| +#ifdef CONFIG_ANDROID_PARANOID_NETWORK | |
| +static inline int current_has_bt_admin(void) | |
| +{ | |
| + return (!current_euid() || in_egroup_p(AID_NET_BT_ADMIN)); | |
| +} | |
| + | |
| +static inline int current_has_bt(void) | |
| +{ | |
| + return (current_has_bt_admin() || in_egroup_p(AID_NET_BT)); | |
| +} | |
| +# else | |
| +static inline int current_has_bt_admin(void) | |
| +{ | |
| + return 1; | |
| +} | |
| + | |
| +static inline int current_has_bt(void) | |
| +{ | |
| + return 1; | |
| +} | |
| +#endif | |
| + | |
| static int bt_sock_create(struct net *net, struct socket *sock, int proto, | |
| int kern) | |
| { | |
| int err; | |
| + if (proto == BTPROTO_RFCOMM || proto == BTPROTO_SCO || | |
| + proto == BTPROTO_L2CAP) { | |
| + if (!current_has_bt()) | |
| + return -EPERM; | |
| + } else if (!current_has_bt_admin()) | |
| + return -EPERM; | |
| + | |
| if (net != &init_net) | |
| return -EAFNOSUPPORT; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/bluetooth/hci_conn.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/hci_conn.c | |
| --- /path/to/linux-2.6.35.7/net/bluetooth/hci_conn.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/hci_conn.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -1,6 +1,6 @@ | |
| /* | |
| BlueZ - Bluetooth protocol stack for Linux | |
| - Copyright (C) 2000-2001 Qualcomm Incorporated | |
| + Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved. | |
| Written 2000,2001 by Maxim Krasnyansky <[email protected]> | |
| @@ -155,6 +155,27 @@ | |
| hci_send_cmd(hdev, HCI_OP_SETUP_SYNC_CONN, sizeof(cp), &cp); | |
| } | |
| +/* Device _must_ be locked */ | |
| +void hci_sco_setup(struct hci_conn *conn, __u8 status) | |
| +{ | |
| + struct hci_conn *sco = conn->link; | |
| + | |
| + BT_DBG("%p", conn); | |
| + | |
| + if (!sco) | |
| + return; | |
| + | |
| + if (!status) { | |
| + if (lmp_esco_capable(conn->hdev)) | |
| + hci_setup_sync(sco, conn->handle); | |
| + else | |
| + hci_add_sco(sco, conn->handle); | |
| + } else { | |
| + hci_proto_connect_cfm(sco, status); | |
| + hci_conn_del(sco); | |
| + } | |
| +} | |
| + | |
| static void hci_conn_timeout(unsigned long arg) | |
| { | |
| struct hci_conn *conn = (void *) arg; | |
| @@ -196,7 +217,8 @@ | |
| hci_conn_enter_sniff_mode(conn); | |
| } | |
| -struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst) | |
| +struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, | |
| + __u16 pkt_type, bdaddr_t *dst) | |
| { | |
| struct hci_conn *conn; | |
| @@ -221,14 +243,22 @@ | |
| conn->pkt_type = hdev->pkt_type & ACL_PTYPE_MASK; | |
| break; | |
| case SCO_LINK: | |
| - if (lmp_esco_capable(hdev)) | |
| - conn->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) | | |
| - (hdev->esco_type & EDR_ESCO_MASK); | |
| - else | |
| - conn->pkt_type = hdev->pkt_type & SCO_PTYPE_MASK; | |
| - break; | |
| + if (!pkt_type) | |
| + pkt_type = SCO_ESCO_MASK; | |
| case ESCO_LINK: | |
| - conn->pkt_type = hdev->esco_type & ~EDR_ESCO_MASK; | |
| + if (!pkt_type) | |
| + pkt_type = ALL_ESCO_MASK; | |
| + if (lmp_esco_capable(hdev)) { | |
| + /* HCI Setup Synchronous Connection Command uses | |
| + reverse logic on the EDR_ESCO_MASK bits */ | |
| + conn->pkt_type = (pkt_type ^ EDR_ESCO_MASK) & | |
| + hdev->esco_type; | |
| + } else { | |
| + /* Legacy HCI Add Sco Connection Command uses a | |
| + shifted bitmask */ | |
| + conn->pkt_type = (pkt_type << 5) & hdev->pkt_type & | |
| + SCO_PTYPE_MASK; | |
| + } | |
| break; | |
| } | |
| @@ -340,7 +370,9 @@ | |
| /* Create SCO or ACL connection. | |
| * Device _must_ be locked */ | |
| -struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 sec_level, __u8 auth_type) | |
| +struct hci_conn *hci_connect(struct hci_dev *hdev, int type, | |
| + __u16 pkt_type, bdaddr_t *dst, | |
| + __u8 sec_level, __u8 auth_type) | |
| { | |
| struct hci_conn *acl; | |
| struct hci_conn *sco; | |
| @@ -348,7 +380,7 @@ | |
| BT_DBG("%s dst %s", hdev->name, batostr(dst)); | |
| if (!(acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst))) { | |
| - if (!(acl = hci_conn_add(hdev, ACL_LINK, dst))) | |
| + if (!(acl = hci_conn_add(hdev, ACL_LINK, 0, dst))) | |
| return NULL; | |
| } | |
| @@ -369,7 +401,7 @@ | |
| return acl; | |
| if (!(sco = hci_conn_hash_lookup_ba(hdev, type, dst))) { | |
| - if (!(sco = hci_conn_add(hdev, type, dst))) { | |
| + if (!(sco = hci_conn_add(hdev, type, pkt_type, dst))) { | |
| hci_conn_put(acl); | |
| return NULL; | |
| } | |
| @@ -385,10 +417,13 @@ | |
| acl->power_save = 1; | |
| hci_conn_enter_active_mode(acl); | |
| - if (lmp_esco_capable(hdev)) | |
| - hci_setup_sync(sco, acl->handle); | |
| - else | |
| - hci_add_sco(sco, acl->handle); | |
| + if (test_bit(HCI_CONN_MODE_CHANGE_PEND, &acl->pend)) { | |
| + /* defer SCO setup until mode change completed */ | |
| + set_bit(HCI_CONN_SCO_SETUP_PEND, &acl->pend); | |
| + return sco; | |
| + } | |
| + | |
| + hci_sco_setup(acl, 0x00); | |
| } | |
| return sco; | |
| @@ -505,7 +540,7 @@ | |
| if (test_bit(HCI_RAW, &hdev->flags)) | |
| return; | |
| - if (conn->mode != HCI_CM_SNIFF || !conn->power_save) | |
| + if (conn->mode != HCI_CM_SNIFF /* || !conn->power_save */) | |
| goto timer; | |
| if (!test_and_set_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend)) { | |
| @@ -644,6 +679,15 @@ | |
| (ci + n)->out = c->out; | |
| (ci + n)->state = c->state; | |
| (ci + n)->link_mode = c->link_mode; | |
| + if (c->type == SCO_LINK) { | |
| + (ci + n)->mtu = hdev->sco_mtu; | |
| + (ci + n)->cnt = hdev->sco_cnt; | |
| + (ci + n)->pkts = hdev->sco_pkts; | |
| + } else { | |
| + (ci + n)->mtu = hdev->acl_mtu; | |
| + (ci + n)->cnt = hdev->acl_cnt; | |
| + (ci + n)->pkts = hdev->acl_pkts; | |
| + } | |
| if (++n >= req.conn_num) | |
| break; | |
| } | |
| @@ -680,6 +724,15 @@ | |
| ci.out = conn->out; | |
| ci.state = conn->state; | |
| ci.link_mode = conn->link_mode; | |
| + if (req.type == SCO_LINK) { | |
| + ci.mtu = hdev->sco_mtu; | |
| + ci.cnt = hdev->sco_cnt; | |
| + ci.pkts = hdev->sco_pkts; | |
| + } else { | |
| + ci.mtu = hdev->acl_mtu; | |
| + ci.cnt = hdev->acl_cnt; | |
| + ci.pkts = hdev->acl_pkts; | |
| + } | |
| } | |
| hci_dev_unlock_bh(hdev); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/bluetooth/hci_core.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/hci_core.c | |
| --- /path/to/linux-2.6.35.7/net/bluetooth/hci_core.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/hci_core.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -1283,7 +1283,7 @@ | |
| skb->dev = (void *) hdev; | |
| bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT; | |
| - hci_add_acl_hdr(skb, conn->handle, flags | ACL_START); | |
| + hci_add_acl_hdr(skb, conn->handle, flags); | |
| if (!(list = skb_shinfo(skb)->frag_list)) { | |
| /* Non fragmented */ | |
| @@ -1300,12 +1300,14 @@ | |
| spin_lock_bh(&conn->data_q.lock); | |
| __skb_queue_tail(&conn->data_q, skb); | |
| + flags &= ~ACL_PB_MASK; | |
| + flags |= ACL_CONT; | |
| do { | |
| skb = list; list = list->next; | |
| skb->dev = (void *) hdev; | |
| bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT; | |
| - hci_add_acl_hdr(skb, conn->handle, flags | ACL_CONT); | |
| + hci_add_acl_hdr(skb, conn->handle, flags); | |
| BT_DBG("%s frag %p len %d", hdev->name, skb, skb->len); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/bluetooth/hci_event.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/hci_event.c | |
| --- /path/to/linux-2.6.35.7/net/bluetooth/hci_event.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/hci_event.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -1,6 +1,6 @@ | |
| /* | |
| BlueZ - Bluetooth protocol stack for Linux | |
| - Copyright (C) 2000-2001 Qualcomm Incorporated | |
| + Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved. | |
| Written 2000,2001 by Maxim Krasnyansky <[email protected]> | |
| @@ -579,7 +579,7 @@ | |
| } | |
| } else { | |
| if (!conn) { | |
| - conn = hci_conn_add(hdev, ACL_LINK, &cp->bdaddr); | |
| + conn = hci_conn_add(hdev, ACL_LINK, 0, &cp->bdaddr); | |
| if (conn) { | |
| conn->out = 1; | |
| conn->link_mode |= HCI_LM_MASTER; | |
| @@ -785,9 +785,13 @@ | |
| hci_dev_lock(hdev); | |
| conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); | |
| - if (conn) | |
| + if (conn) { | |
| clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend); | |
| + if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->pend)) | |
| + hci_sco_setup(conn, status); | |
| + } | |
| + | |
| hci_dev_unlock(hdev); | |
| } | |
| @@ -808,9 +812,13 @@ | |
| hci_dev_lock(hdev); | |
| conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); | |
| - if (conn) | |
| + if (conn) { | |
| clear_bit(HCI_CONN_MODE_CHANGE_PEND, &conn->pend); | |
| + if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->pend)) | |
| + hci_sco_setup(conn, status); | |
| + } | |
| + | |
| hci_dev_unlock(hdev); | |
| } | |
| @@ -915,20 +923,8 @@ | |
| } else | |
| conn->state = BT_CLOSED; | |
| - if (conn->type == ACL_LINK) { | |
| - struct hci_conn *sco = conn->link; | |
| - if (sco) { | |
| - if (!ev->status) { | |
| - if (lmp_esco_capable(hdev)) | |
| - hci_setup_sync(sco, conn->handle); | |
| - else | |
| - hci_add_sco(sco, conn->handle); | |
| - } else { | |
| - hci_proto_connect_cfm(sco, ev->status); | |
| - hci_conn_del(sco); | |
| - } | |
| - } | |
| - } | |
| + if (conn->type == ACL_LINK) | |
| + hci_sco_setup(conn, ev->status); | |
| if (ev->status) { | |
| hci_proto_connect_cfm(conn, ev->status); | |
| @@ -964,7 +960,9 @@ | |
| conn = hci_conn_hash_lookup_ba(hdev, ev->link_type, &ev->bdaddr); | |
| if (!conn) { | |
| - if (!(conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr))) { | |
| + /* pkt_type not yet used for incoming connections */ | |
| + if (!(conn = hci_conn_add(hdev, ev->link_type, 0, | |
| + &ev->bdaddr))) { | |
| BT_ERR("No memmory for new connection"); | |
| hci_dev_unlock(hdev); | |
| return; | |
| @@ -1481,6 +1479,9 @@ | |
| else | |
| conn->power_save = 0; | |
| } | |
| + | |
| + if (test_and_clear_bit(HCI_CONN_SCO_SETUP_PEND, &conn->pend)) | |
| + hci_sco_setup(conn, ev->status); | |
| } | |
| hci_dev_unlock(hdev); | |
| @@ -1700,6 +1701,7 @@ | |
| hci_conn_add_sysfs(conn); | |
| break; | |
| + case 0x10: /* Connection Accept Timeout */ | |
| case 0x11: /* Unsupported Feature or Parameter Value */ | |
| case 0x1c: /* SCO interval rejected */ | |
| case 0x1a: /* Unsupported Remote Feature */ | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/bluetooth/l2cap.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/l2cap.c | |
| --- /path/to/linux-2.6.35.7/net/bluetooth/l2cap.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/l2cap.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -337,13 +337,19 @@ | |
| static inline void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data) | |
| { | |
| struct sk_buff *skb = l2cap_build_cmd(conn, code, ident, len, data); | |
| + u8 flags; | |
| BT_DBG("code 0x%2.2x", code); | |
| if (!skb) | |
| return; | |
| - hci_send_acl(conn->hcon, skb, 0); | |
| + if (lmp_no_flush_capable(conn->hcon->hdev)) | |
| + flags = ACL_START_NO_FLUSH; | |
| + else | |
| + flags = ACL_START; | |
| + | |
| + hci_send_acl(conn->hcon, skb, flags); | |
| } | |
| static inline void l2cap_send_sframe(struct l2cap_pinfo *pi, u16 control) | |
| @@ -492,7 +498,8 @@ | |
| struct sock *parent = bt_sk(sk)->parent; | |
| rsp.result = cpu_to_le16(L2CAP_CR_PEND); | |
| rsp.status = cpu_to_le16(L2CAP_CS_AUTHOR_PEND); | |
| - parent->sk_data_ready(parent, 0); | |
| + if (parent) | |
| + parent->sk_data_ready(parent, 0); | |
| } else { | |
| sk->sk_state = BT_CONFIG; | |
| @@ -809,6 +816,7 @@ | |
| pi->sec_level = l2cap_pi(parent)->sec_level; | |
| pi->role_switch = l2cap_pi(parent)->role_switch; | |
| pi->force_reliable = l2cap_pi(parent)->force_reliable; | |
| + pi->flushable = l2cap_pi(parent)->flushable; | |
| } else { | |
| pi->imtu = L2CAP_DEFAULT_MTU; | |
| pi->omtu = 0; | |
| @@ -822,6 +830,7 @@ | |
| pi->sec_level = BT_SECURITY_LOW; | |
| pi->role_switch = 0; | |
| pi->force_reliable = 0; | |
| + pi->flushable = 0; | |
| } | |
| /* Default config options */ | |
| @@ -999,7 +1008,7 @@ | |
| } | |
| } | |
| - hcon = hci_connect(hdev, ACL_LINK, dst, | |
| + hcon = hci_connect(hdev, ACL_LINK, 0, dst, | |
| l2cap_pi(sk)->sec_level, auth_type); | |
| if (!hcon) | |
| goto done; | |
| @@ -1335,10 +1344,17 @@ | |
| static inline void l2cap_do_send(struct sock *sk, struct sk_buff *skb) | |
| { | |
| struct l2cap_pinfo *pi = l2cap_pi(sk); | |
| + struct hci_conn *hcon = pi->conn->hcon; | |
| + u16 flags; | |
| BT_DBG("sk %p, skb %p len %d", sk, skb, skb->len); | |
| - hci_send_acl(pi->conn->hcon, skb, 0); | |
| + if (lmp_no_flush_capable(hcon->hdev) && !l2cap_pi(sk)->flushable) | |
| + flags = ACL_START_NO_FLUSH; | |
| + else | |
| + flags = ACL_START; | |
| + | |
| + hci_send_acl(hcon, skb, flags); | |
| } | |
| static int l2cap_streaming_send(struct sock *sk) | |
| @@ -1907,6 +1923,7 @@ | |
| l2cap_pi(sk)->role_switch = (opt & L2CAP_LM_MASTER); | |
| l2cap_pi(sk)->force_reliable = (opt & L2CAP_LM_RELIABLE); | |
| + l2cap_pi(sk)->flushable = (opt & L2CAP_LM_FLUSHABLE); | |
| break; | |
| default: | |
| @@ -2037,6 +2054,9 @@ | |
| if (l2cap_pi(sk)->force_reliable) | |
| opt |= L2CAP_LM_RELIABLE; | |
| + if (l2cap_pi(sk)->flushable) | |
| + opt |= L2CAP_LM_FLUSHABLE; | |
| + | |
| if (put_user(opt, (u32 __user *) optval)) | |
| err = -EFAULT; | |
| break; | |
| @@ -4457,7 +4477,7 @@ | |
| BT_DBG("conn %p len %d flags 0x%x", conn, skb->len, flags); | |
| - if (flags & ACL_START) { | |
| + if (!(flags & ACL_CONT)) { | |
| struct l2cap_hdr *hdr; | |
| int len; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/bluetooth/rfcomm/core.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/rfcomm/core.c | |
| --- /path/to/linux-2.6.35.7/net/bluetooth/rfcomm/core.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/rfcomm/core.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -248,32 +248,6 @@ | |
| auth_type); | |
| } | |
| -static void rfcomm_session_timeout(unsigned long arg) | |
| -{ | |
| - struct rfcomm_session *s = (void *) arg; | |
| - | |
| - BT_DBG("session %p state %ld", s, s->state); | |
| - | |
| - set_bit(RFCOMM_TIMED_OUT, &s->flags); | |
| - rfcomm_schedule(RFCOMM_SCHED_TIMEO); | |
| -} | |
| - | |
| -static void rfcomm_session_set_timer(struct rfcomm_session *s, long timeout) | |
| -{ | |
| - BT_DBG("session %p state %ld timeout %ld", s, s->state, timeout); | |
| - | |
| - if (!mod_timer(&s->timer, jiffies + timeout)) | |
| - rfcomm_session_hold(s); | |
| -} | |
| - | |
| -static void rfcomm_session_clear_timer(struct rfcomm_session *s) | |
| -{ | |
| - BT_DBG("session %p state %ld", s, s->state); | |
| - | |
| - if (timer_pending(&s->timer) && del_timer(&s->timer)) | |
| - rfcomm_session_put(s); | |
| -} | |
| - | |
| /* ---- RFCOMM DLCs ---- */ | |
| static void rfcomm_dlc_timeout(unsigned long arg) | |
| { | |
| @@ -350,7 +324,6 @@ | |
| rfcomm_session_hold(s); | |
| - rfcomm_session_clear_timer(s); | |
| rfcomm_dlc_hold(d); | |
| list_add(&d->list, &s->dlcs); | |
| d->session = s; | |
| @@ -366,9 +339,6 @@ | |
| d->session = NULL; | |
| rfcomm_dlc_put(d); | |
| - if (list_empty(&s->dlcs)) | |
| - rfcomm_session_set_timer(s, RFCOMM_IDLE_TIMEOUT); | |
| - | |
| rfcomm_session_put(s); | |
| } | |
| @@ -462,7 +432,6 @@ | |
| switch (d->state) { | |
| case BT_CONNECT: | |
| - case BT_CONFIG: | |
| if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) { | |
| set_bit(RFCOMM_AUTH_REJECT, &d->flags); | |
| rfcomm_schedule(RFCOMM_SCHED_AUTH); | |
| @@ -482,7 +451,6 @@ | |
| break; | |
| case BT_OPEN: | |
| - case BT_CONNECT2: | |
| if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) { | |
| set_bit(RFCOMM_AUTH_REJECT, &d->flags); | |
| rfcomm_schedule(RFCOMM_SCHED_AUTH); | |
| @@ -601,8 +569,6 @@ | |
| BT_DBG("session %p sock %p", s, sock); | |
| - setup_timer(&s->timer, rfcomm_session_timeout, (unsigned long) s); | |
| - | |
| INIT_LIST_HEAD(&s->dlcs); | |
| s->state = state; | |
| s->sock = sock; | |
| @@ -634,7 +600,6 @@ | |
| if (state == BT_CONNECTED) | |
| rfcomm_send_disc(s, 0); | |
| - rfcomm_session_clear_timer(s); | |
| sock_release(s->sock); | |
| kfree(s); | |
| @@ -676,7 +641,6 @@ | |
| __rfcomm_dlc_close(d, err); | |
| } | |
| - rfcomm_session_clear_timer(s); | |
| rfcomm_session_put(s); | |
| } | |
| @@ -1238,8 +1202,6 @@ | |
| rfcomm_send_ua(d->session, d->dlci); | |
| - rfcomm_dlc_clear_timer(d); | |
| - | |
| rfcomm_dlc_lock(d); | |
| d->state = BT_CONNECTED; | |
| d->state_change(d, 0); | |
| @@ -1257,11 +1219,6 @@ | |
| if (d->defer_setup) { | |
| set_bit(RFCOMM_DEFER_SETUP, &d->flags); | |
| rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT); | |
| - | |
| - rfcomm_dlc_lock(d); | |
| - d->state = BT_CONNECT2; | |
| - d->state_change(d, 0); | |
| - rfcomm_dlc_unlock(d); | |
| } else | |
| rfcomm_dlc_accept(d); | |
| } else { | |
| @@ -1803,11 +1760,6 @@ | |
| if (d->defer_setup) { | |
| set_bit(RFCOMM_DEFER_SETUP, &d->flags); | |
| rfcomm_dlc_set_timer(d, RFCOMM_AUTH_TIMEOUT); | |
| - | |
| - rfcomm_dlc_lock(d); | |
| - d->state = BT_CONNECT2; | |
| - d->state_change(d, 0); | |
| - rfcomm_dlc_unlock(d); | |
| } else | |
| rfcomm_dlc_accept(d); | |
| } | |
| @@ -1923,13 +1875,6 @@ | |
| struct rfcomm_session *s; | |
| s = list_entry(p, struct rfcomm_session, list); | |
| - if (test_and_clear_bit(RFCOMM_TIMED_OUT, &s->flags)) { | |
| - s->state = BT_DISCONN; | |
| - rfcomm_send_disc(s, 0); | |
| - rfcomm_session_put(s); | |
| - continue; | |
| - } | |
| - | |
| if (s->state == BT_LISTEN) { | |
| rfcomm_accept_connection(s); | |
| continue; | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/bluetooth/sco.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/sco.c | |
| --- /path/to/linux-2.6.35.7/net/bluetooth/sco.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/bluetooth/sco.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -178,6 +178,7 @@ | |
| { | |
| bdaddr_t *src = &bt_sk(sk)->src; | |
| bdaddr_t *dst = &bt_sk(sk)->dst; | |
| + __u16 pkt_type = sco_pi(sk)->pkt_type; | |
| struct sco_conn *conn; | |
| struct hci_conn *hcon; | |
| struct hci_dev *hdev; | |
| @@ -194,10 +195,13 @@ | |
| if (lmp_esco_capable(hdev) && !disable_esco) | |
| type = ESCO_LINK; | |
| - else | |
| + else { | |
| type = SCO_LINK; | |
| + pkt_type &= SCO_ESCO_MASK; | |
| + } | |
| - hcon = hci_connect(hdev, type, dst, BT_SECURITY_LOW, HCI_AT_NO_BONDING); | |
| + hcon = hci_connect(hdev, type, pkt_type, dst, | |
| + BT_SECURITY_LOW, HCI_AT_NO_BONDING); | |
| if (!hcon) | |
| goto done; | |
| @@ -450,18 +454,22 @@ | |
| return 0; | |
| } | |
| -static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len) | |
| +static int sco_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) | |
| { | |
| - struct sockaddr_sco *sa = (struct sockaddr_sco *) addr; | |
| + struct sockaddr_sco sa; | |
| struct sock *sk = sock->sk; | |
| - bdaddr_t *src = &sa->sco_bdaddr; | |
| - int err = 0; | |
| + bdaddr_t *src = &sa.sco_bdaddr; | |
| + int len, err = 0; | |
| - BT_DBG("sk %p %s", sk, batostr(&sa->sco_bdaddr)); | |
| + BT_DBG("sk %p %s", sk, batostr(&sa.sco_bdaddr)); | |
| if (!addr || addr->sa_family != AF_BLUETOOTH) | |
| return -EINVAL; | |
| + memset(&sa, 0, sizeof(sa)); | |
| + len = min_t(unsigned int, sizeof(sa), alen); | |
| + memcpy(&sa, addr, len); | |
| + | |
| lock_sock(sk); | |
| if (sk->sk_state != BT_OPEN) { | |
| @@ -475,7 +483,8 @@ | |
| err = -EADDRINUSE; | |
| } else { | |
| /* Save source address */ | |
| - bacpy(&bt_sk(sk)->src, &sa->sco_bdaddr); | |
| + bacpy(&bt_sk(sk)->src, &sa.sco_bdaddr); | |
| + sco_pi(sk)->pkt_type = sa.sco_pkt_type; | |
| sk->sk_state = BT_BOUND; | |
| } | |
| @@ -488,27 +497,34 @@ | |
| static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags) | |
| { | |
| - struct sockaddr_sco *sa = (struct sockaddr_sco *) addr; | |
| struct sock *sk = sock->sk; | |
| - int err = 0; | |
| - | |
| + struct sockaddr_sco sa; | |
| + int len, err = 0; | |
| BT_DBG("sk %p", sk); | |
| - if (alen < sizeof(struct sockaddr_sco) || | |
| - addr->sa_family != AF_BLUETOOTH) | |
| + if (!addr || addr->sa_family != AF_BLUETOOTH) | |
| return -EINVAL; | |
| - if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) | |
| - return -EBADFD; | |
| - | |
| - if (sk->sk_type != SOCK_SEQPACKET) | |
| - return -EINVAL; | |
| + memset(&sa, 0, sizeof(sa)); | |
| + len = min_t(unsigned int, sizeof(sa), alen); | |
| + memcpy(&sa, addr, len); | |
| lock_sock(sk); | |
| + if (sk->sk_type != SOCK_SEQPACKET) { | |
| + err = -EINVAL; | |
| + goto done; | |
| + } | |
| + | |
| + if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) { | |
| + err = -EBADFD; | |
| + goto done; | |
| + } | |
| + | |
| /* Set destination address and psm */ | |
| - bacpy(&bt_sk(sk)->dst, &sa->sco_bdaddr); | |
| + bacpy(&bt_sk(sk)->dst, &sa.sco_bdaddr); | |
| + sco_pi(sk)->pkt_type = sa.sco_pkt_type; | |
| if ((err = sco_connect(sk))) | |
| goto done; | |
| @@ -614,6 +630,7 @@ | |
| bacpy(&sa->sco_bdaddr, &bt_sk(sk)->dst); | |
| else | |
| bacpy(&sa->sco_bdaddr, &bt_sk(sk)->src); | |
| + sa->sco_pkt_type = sco_pi(sk)->pkt_type; | |
| return 0; | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/core/dev.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/core/dev.c | |
| --- /path/to/linux-2.6.35.7/net/core/dev.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/core/dev.c 2018-07-12 10:14:20.000000000 +0700 | |
| @@ -131,6 +131,7 @@ | |
| #include <linux/random.h> | |
| #include <trace/events/napi.h> | |
| #include <linux/pci.h> | |
| +#include <linux/iface_stat.h> | |
| #include "net-sysfs.h" | |
| @@ -4803,6 +4804,9 @@ | |
| synchronize_net(); | |
| list_for_each_entry(dev, head, unreg_list) { | |
| + /* Store stats for this device in persistent iface_stat */ | |
| + iface_stat_update(dev); | |
| + | |
| /* Shutdown queueing discipline. */ | |
| dev_shutdown(dev); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/core/netpoll.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/core/netpoll.c | |
| --- /path/to/linux-2.6.35.7/net/core/netpoll.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/core/netpoll.c 2018-07-12 10:14:20.000000000 +0700 | |
| @@ -9,6 +9,18 @@ | |
| * Copyright (C) 2002 Red Hat, Inc. | |
| */ | |
| +/******************************************************************************************* | |
| +Copyright 2010 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.gnu.org/copyleft/gpl.html (the "GPL"). | |
| + | |
| +Notwithstanding the above, under no circumstances may you combine this software in any way | |
| +with any other Broadcom software provided under a license other than the GPL, without | |
| +Broadcom's express prior written consent. | |
| +*******************************************************************************************/ | |
| + | |
| #include <linux/moduleparam.h> | |
| #include <linux/netdevice.h> | |
| #include <linux/etherdevice.h> | |
| @@ -27,14 +39,20 @@ | |
| #include <net/udp.h> | |
| #include <asm/unaligned.h> | |
| #include <trace/events/napi.h> | |
| +#ifdef CONFIG_USB_ETH_RNDIS | |
| +#include "../../drivers/usb/gadget/rndis.h" | |
| +#endif | |
| /* | |
| * We maintain a small pool of fully-sized skbs, to make sure the | |
| * message gets out even in extreme OOM situations. | |
| */ | |
| - | |
| +#ifdef CONFIG_USB_ETH_RNDIS | |
| +#define MAX_UDP_CHUNK 1400 | |
| +#else | |
| #define MAX_UDP_CHUNK 1460 | |
| -#define MAX_SKBS 32 | |
| +#endif | |
| +#define MAX_SKBS 128 | |
| #define MAX_QUEUE_DEPTH (MAX_SKBS / 2) | |
| static struct sk_buff_head skb_pool; | |
| @@ -45,9 +63,16 @@ | |
| #define NETPOLL_RX_ENABLED 1 | |
| #define NETPOLL_RX_DROP 2 | |
| +#ifdef CONFIG_USB_ETH_RNDIS | |
| +#define MAX_SKB_SIZE \ | |
| + (MAX_UDP_CHUNK + sizeof(struct udphdr) + \ | |
| + sizeof(struct iphdr) + sizeof(struct ethhdr) + \ | |
| + sizeof (struct rndis_packet_msg_type)) | |
| +#else | |
| #define MAX_SKB_SIZE \ | |
| (MAX_UDP_CHUNK + sizeof(struct udphdr) + \ | |
| sizeof(struct iphdr) + sizeof(struct ethhdr)) | |
| +#endif | |
| static void zap_completion_queue(void); | |
| static void arp_reply(struct sk_buff *skb); | |
| @@ -67,7 +92,7 @@ | |
| const struct net_device_ops *ops = dev->netdev_ops; | |
| struct netdev_queue *txq; | |
| - if (!netif_device_present(dev) || !netif_running(dev)) { | |
| + if (!netif_device_present(dev) || !netif_running(dev) || !netif_carrier_ok(dev)) { | |
| __kfree_skb(skb); | |
| continue; | |
| } | |
| @@ -82,8 +107,8 @@ | |
| skb_queue_head(&npinfo->txq, skb); | |
| __netif_tx_unlock(txq); | |
| local_irq_restore(flags); | |
| - | |
| - schedule_delayed_work(&npinfo->tx_work, HZ/10); | |
| + /* Max 3 Mb/s */ | |
| + schedule_delayed_work(&npinfo->tx_work, 0); | |
| return; | |
| } | |
| __netif_tx_unlock(txq); | |
| @@ -205,17 +230,75 @@ | |
| netpoll_poll_dev(np->dev); | |
| } | |
| -static void refill_skbs(void) | |
| +/** | |
| + * static void __refill_skbs(struct sk_buff *skb) - put the skb buf back to queue to reuse | |
| + * | |
| + */ | |
| +static void __refill_skbs(struct sk_buff *skb) | |
| +{ | |
| + unsigned long flags; | |
| + | |
| + spin_lock_irqsave(&skb_pool.lock, flags); | |
| + | |
| + if (skb) | |
| + __skb_queue_tail(&skb_pool, skb); | |
| + else printk("Can not refill the skb buffer....\n"); | |
| + /* printk("@%d",skb_pool.qlen); */ | |
| + spin_unlock_irqrestore(&skb_pool.lock, flags); | |
| +} | |
| + | |
| +/** | |
| + * unsigned char netpoll_free_skbs(struct sk_buff *skb) - Obtain the available buffer | |
| + * | |
| + * @return the number bytes of free memory buffer | |
| + */ | |
| + | |
| +int netpoll_free_memory(void) | |
| +{ | |
| + unsigned char free_skbs; | |
| + unsigned long flags; | |
| + | |
| + spin_lock_irqsave(&skb_pool.lock, flags); | |
| + free_skbs = skb_queue_len(&skb_pool); | |
| + spin_unlock_irqrestore(&skb_pool.lock, flags); | |
| + return free_skbs<<10; | |
| +} | |
| + | |
| +/** | |
| + * void netpoll_recycle_skbs(struct sk_buff *skb) - recycle the skb buf for the logging to avoid to run out of memory | |
| + * | |
| + */ | |
| + | |
| +void netpoll_recycle_skbs(struct sk_buff *skb) | |
| +{ | |
| + __refill_skbs(skb); | |
| +} | |
| + | |
| +/** | |
| + * unsigned short netpoll_skb_size(void) - the whole skb size which includes the memory buffer for the logging data. | |
| + * | |
| + */ | |
| +unsigned short netpoll_skb_size(void) | |
| +{ | |
| + return MAX_SKB_SIZE; | |
| +} | |
| + | |
| +/** | |
| + * static void reserve_skbs_list(void) - reserve the skb buf list with allocated memory buffer for the logging data at beginning. | |
| + * | |
| + */ | |
| +static void reserve_skbs_list(void) | |
| { | |
| struct sk_buff *skb; | |
| unsigned long flags; | |
| + printk("reserve_skbs_list \n"); | |
| + | |
| spin_lock_irqsave(&skb_pool.lock, flags); | |
| while (skb_pool.qlen < MAX_SKBS) { | |
| skb = alloc_skb(MAX_SKB_SIZE, GFP_ATOMIC); | |
| if (!skb) | |
| break; | |
| - | |
| __skb_queue_tail(&skb_pool, skb); | |
| } | |
| spin_unlock_irqrestore(&skb_pool.lock, flags); | |
| @@ -226,7 +309,7 @@ | |
| unsigned long flags; | |
| struct softnet_data *sd = &get_cpu_var(softnet_data); | |
| - if (sd->completion_queue) { | |
| + if (sd->completion_queue) { | |
| struct sk_buff *clist; | |
| local_irq_save(flags); | |
| @@ -251,22 +334,20 @@ | |
| static struct sk_buff *find_skb(struct netpoll *np, int len, int reserve) | |
| { | |
| - int count = 0; | |
| + int count = 0, qlen; | |
| struct sk_buff *skb; | |
| zap_completion_queue(); | |
| - refill_skbs(); | |
| repeat: | |
| - skb = alloc_skb(len, GFP_ATOMIC); | |
| - if (!skb) | |
| - skb = skb_dequeue(&skb_pool); | |
| - | |
| + skb = skb_dequeue(&skb_pool); | |
| + /* printk("!%d",skb_pool.qlen); */ | |
| if (!skb) { | |
| if (++count < 10) { | |
| netpoll_poll(np); | |
| goto repeat; | |
| } | |
| + //printk("find_skb: out of memory..................\n"); | |
| return NULL; | |
| } | |
| @@ -294,7 +375,7 @@ | |
| const struct net_device_ops *ops = dev->netdev_ops; | |
| struct netpoll_info *npinfo = np->dev->npinfo; | |
| - if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) { | |
| + if (!npinfo || !netif_running(dev) || !netif_device_present(dev) || !netif_carrier_ok(dev)) { | |
| __kfree_skb(skb); | |
| return; | |
| } | |
| @@ -306,10 +387,11 @@ | |
| txq = netdev_get_tx_queue(dev, skb_get_queue_mapping(skb)); | |
| - local_irq_save(flags); | |
| /* try until next clock tick */ | |
| for (tries = jiffies_to_usecs(1)/USEC_PER_POLL; | |
| tries > 0; --tries) { | |
| + | |
| + local_irq_save(flags); | |
| if (__netif_tx_trylock(txq)) { | |
| if (!netif_tx_queue_stopped(txq)) { | |
| dev->priv_flags |= IFF_IN_NETPOLL; | |
| @@ -320,22 +402,24 @@ | |
| } | |
| __netif_tx_unlock(txq); | |
| - if (status == NETDEV_TX_OK) | |
| + if (status == NETDEV_TX_OK){ | |
| + local_irq_restore(flags); | |
| break; | |
| + } | |
| } | |
| /* tickle device maybe there is some cleanup */ | |
| netpoll_poll(np); | |
| + local_irq_restore(flags); | |
| + | |
| udelay(USEC_PER_POLL); | |
| } | |
| WARN_ONCE(!irqs_disabled(), | |
| "netpoll_send_skb(): %s enabled interrupts in poll (%pF)\n", | |
| dev->name, ops->ndo_start_xmit); | |
| - | |
| - local_irq_restore(flags); | |
| } | |
| if (status != NETDEV_TX_OK) { | |
| @@ -351,10 +435,22 @@ | |
| struct udphdr *udph; | |
| struct iphdr *iph; | |
| struct ethhdr *eth; | |
| + static unsigned short iph_id = 0x1234; | |
| + struct net_device *dev = np->dev; | |
| + struct netpoll_info *npinfo = np->dev->npinfo; | |
| + struct rndis_packet_msg_type *rndis_header; | |
| + if (!npinfo || !netif_running(dev) || !netif_device_present(dev) || !netif_carrier_ok(dev)) | |
| + return; | |
| + | |
| + iph_id++; | |
| udp_len = len + sizeof(*udph); | |
| ip_len = eth_len = udp_len + sizeof(*iph); | |
| - total_len = eth_len + ETH_HLEN + NET_IP_ALIGN; | |
| + total_len = eth_len + ETH_HLEN /*+ NET_IP_ALIGN*/ | |
| +#ifdef CONFIG_USB_ETH_RNDIS | |
| + + sizeof (struct rndis_packet_msg_type) /* reserved for the RNDIS header */ | |
| +#endif | |
| + ; | |
| skb = find_skb(np, total_len, total_len - len); | |
| if (!skb) | |
| @@ -362,7 +458,7 @@ | |
| skb_copy_to_linear_data(skb, msg, len); | |
| skb->len += len; | |
| - | |
| + | |
| skb_push(skb, sizeof(*udph)); | |
| skb_reset_transport_header(skb); | |
| udph = udp_hdr(skb); | |
| @@ -399,7 +495,16 @@ | |
| skb->protocol = eth->h_proto = htons(ETH_P_IP); | |
| memcpy(eth->h_source, np->dev->dev_addr, ETH_ALEN); | |
| memcpy(eth->h_dest, np->remote_mac, ETH_ALEN); | |
| - | |
| + /* Add RNDIS header here so we do not need to deal with on the ethernet driver */ | |
| +#ifdef CONFIG_USB_ETH_RNDIS | |
| + rndis_header = (void *) skb_push (skb, sizeof *rndis_header); | |
| + memset (rndis_header, 0, sizeof *rndis_header); | |
| + rndis_header->MessageType = __constant_cpu_to_le32(REMOTE_NDIS_PACKET_MSG); | |
| + rndis_header->MessageLength = cpu_to_le32(skb->len); | |
| + rndis_header->DataOffset = __constant_cpu_to_le32 (36); | |
| + rndis_header->DataLength = cpu_to_le32(skb->len - sizeof *rndis_header); | |
| +#endif | |
| + skb->netpoll_signature = SKB_NETPOLL_SIGNATURE; | |
| skb->dev = np->dev; | |
| netpoll_send_skb(np, skb); | |
| @@ -772,6 +877,7 @@ | |
| goto release; | |
| } | |
| +#if 0 /* for Android CTS test */ | |
| if (!netif_running(ndev)) { | |
| unsigned long atmost, atleast; | |
| @@ -812,6 +918,7 @@ | |
| msleep(4000); | |
| } | |
| } | |
| +#endif | |
| if (!np->local_ip) { | |
| rcu_read_lock(); | |
| @@ -838,7 +945,7 @@ | |
| } | |
| /* fill up the skb queue */ | |
| - refill_skbs(); | |
| + reserve_skbs_list(); | |
| /* last thing to do is link it to the net device structure */ | |
| ndev->npinfo = npinfo; | |
| @@ -930,5 +1037,6 @@ | |
| EXPORT_SYMBOL(netpoll_setup); | |
| EXPORT_SYMBOL(netpoll_cleanup); | |
| EXPORT_SYMBOL(netpoll_send_udp); | |
| +EXPORT_SYMBOL(netpoll_free_memory); | |
| EXPORT_SYMBOL(netpoll_poll_dev); | |
| EXPORT_SYMBOL(netpoll_poll); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/core/skbuff.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/core/skbuff.c | |
| --- /path/to/linux-2.6.35.7/net/core/skbuff.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/core/skbuff.c 2018-07-12 10:14:20.000000000 +0700 | |
| @@ -73,6 +73,9 @@ | |
| static struct kmem_cache *skbuff_head_cache __read_mostly; | |
| static struct kmem_cache *skbuff_fclone_cache __read_mostly; | |
| +extern unsigned short netpoll_skb_size(void); | |
| +extern void netpoll_recycle_skbs(struct sk_buff *skb); | |
| + | |
| static void sock_pipe_buf_release(struct pipe_inode_info *pipe, | |
| struct pipe_buffer *buf) | |
| { | |
| @@ -415,6 +418,34 @@ | |
| } | |
| /** | |
| + * recycle_skbs_process - Process the skb which will be recycled. | |
| + * @skb: buffer | |
| + * @skb_size: minimum buffer size | |
| + * | |
| + */ | |
| +static void recycle_skbs_process(struct sk_buff *skb, int skb_size) | |
| +{ | |
| + struct skb_shared_info *shinfo; | |
| + | |
| + skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); | |
| + | |
| + skb_release_head_state(skb); | |
| + shinfo = skb_shinfo(skb); | |
| + atomic_set(&shinfo->dataref, 1); | |
| + shinfo->nr_frags = 0; | |
| + shinfo->gso_size = 0; | |
| + shinfo->gso_segs = 0; | |
| + shinfo->gso_type = 0; | |
| + shinfo->ip6_frag_id = 0; | |
| + shinfo->frag_list = NULL; | |
| + | |
| + memset(skb, 0, offsetof(struct sk_buff, tail)); | |
| + skb->data = skb->head + NET_SKB_PAD; | |
| + skb_reset_tail_pointer(skb); | |
| + | |
| +} | |
| + | |
| +/** | |
| * __kfree_skb - private function | |
| * @skb: buffer | |
| * | |
| @@ -425,8 +456,17 @@ | |
| void __kfree_skb(struct sk_buff *skb) | |
| { | |
| - skb_release_all(skb); | |
| - kfree_skbmem(skb); | |
| + /* If the skb is with netpoll signature, we will recyle the skb buf to avoid to run out of memory.*/ | |
| + if (skb->netpoll_signature == 0x12345678) | |
| + { | |
| + //printk("*"); | |
| + recycle_skbs_process(skb, netpoll_skb_size()); | |
| + netpoll_recycle_skbs(skb); | |
| + | |
| + } else { | |
| + skb_release_all(skb); | |
| + kfree_skbmem(skb); | |
| + } | |
| } | |
| EXPORT_SYMBOL(__kfree_skb); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/ipv4/af_inet.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/af_inet.c | |
| --- /path/to/linux-2.6.35.7/net/ipv4/af_inet.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/af_inet.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -117,6 +117,19 @@ | |
| #include <linux/mroute.h> | |
| #endif | |
| +#ifdef CONFIG_ANDROID_PARANOID_NETWORK | |
| +#include <linux/android_aid.h> | |
| + | |
| +static inline int current_has_network(void) | |
| +{ | |
| + return in_egroup_p(AID_INET) || capable(CAP_NET_RAW); | |
| +} | |
| +#else | |
| +static inline int current_has_network(void) | |
| +{ | |
| + return 1; | |
| +} | |
| +#endif | |
| /* The inetsw table contains everything that inet_create needs to | |
| * build a new socket. | |
| @@ -259,6 +272,7 @@ | |
| return ipprot->netns_ok; | |
| } | |
| + | |
| /* | |
| * Create an inet socket. | |
| */ | |
| @@ -275,6 +289,9 @@ | |
| int try_loading_module = 0; | |
| int err; | |
| + if (!current_has_network()) | |
| + return -EACCES; | |
| + | |
| if (unlikely(!inet_ehash_secret)) | |
| if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) | |
| build_ehash_secret(); | |
| @@ -864,6 +881,7 @@ | |
| case SIOCSIFPFLAGS: | |
| case SIOCGIFPFLAGS: | |
| case SIOCSIFFLAGS: | |
| + case SIOCKILLADDR: | |
| err = devinet_ioctl(net, cmd, (void __user *)arg); | |
| break; | |
| default: | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/ipv4/devinet.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/devinet.c | |
| --- /path/to/linux-2.6.35.7/net/ipv4/devinet.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/devinet.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -55,9 +55,11 @@ | |
| #include <linux/sysctl.h> | |
| #endif | |
| #include <linux/kmod.h> | |
| +#include <linux/iface_stat.h> | |
| #include <net/arp.h> | |
| #include <net/ip.h> | |
| +#include <net/tcp.h> | |
| #include <net/route.h> | |
| #include <net/ip_fib.h> | |
| #include <net/rtnetlink.h> | |
| @@ -374,6 +376,9 @@ | |
| rtmsg_ifa(RTM_NEWADDR, ifa, nlh, pid); | |
| blocking_notifier_call_chain(&inetaddr_chain, NETDEV_UP, ifa); | |
| + /* Start persistent interface stat monitoring. Ignores if loopback. */ | |
| + create_iface_stat(in_dev); | |
| + | |
| return 0; | |
| } | |
| @@ -635,6 +640,7 @@ | |
| case SIOCSIFBRDADDR: /* Set the broadcast address */ | |
| case SIOCSIFDSTADDR: /* Set the destination address */ | |
| case SIOCSIFNETMASK: /* Set the netmask for the interface */ | |
| + case SIOCKILLADDR: /* Nuke all sockets on this address */ | |
| ret = -EACCES; | |
| if (!capable(CAP_NET_ADMIN)) | |
| goto out; | |
| @@ -686,7 +692,8 @@ | |
| } | |
| ret = -EADDRNOTAVAIL; | |
| - if (!ifa && cmd != SIOCSIFADDR && cmd != SIOCSIFFLAGS) | |
| + if (!ifa && cmd != SIOCSIFADDR && cmd != SIOCSIFFLAGS | |
| + && cmd != SIOCKILLADDR) | |
| goto done; | |
| switch (cmd) { | |
| @@ -811,6 +818,10 @@ | |
| inet_insert_ifa(ifa); | |
| } | |
| break; | |
| + case SIOCKILLADDR: /* Nuke all connections on this address */ | |
| + ret = 0; | |
| + tcp_v4_nuke_addr(sin->sin_addr.s_addr); | |
| + break; | |
| } | |
| done: | |
| rtnl_unlock(); | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/ipv4/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/Makefile | |
| --- /path/to/linux-2.6.35.7/net/ipv4/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/Makefile 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -14,6 +14,7 @@ | |
| inet_fragment.o | |
| obj-$(CONFIG_SYSCTL) += sysctl_net_ipv4.o | |
| +obj-$(CONFIG_SYSFS) += sysfs_net_ipv4.o | |
| obj-$(CONFIG_IP_FIB_HASH) += fib_hash.o | |
| obj-$(CONFIG_IP_FIB_TRIE) += fib_trie.o | |
| obj-$(CONFIG_PROC_FS) += proc.o | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4: sysfs_net_ipv4.c | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/ipv4/tcp.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/tcp.c | |
| --- /path/to/linux-2.6.35.7/net/ipv4/tcp.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/tcp.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -266,6 +266,7 @@ | |
| #include <linux/crypto.h> | |
| #include <linux/time.h> | |
| #include <linux/slab.h> | |
| +#include <linux/uid_stat.h> | |
| #include <net/icmp.h> | |
| #include <net/tcp.h> | |
| @@ -1102,6 +1103,9 @@ | |
| tcp_push(sk, flags, mss_now, tp->nonagle); | |
| TCP_CHECK_TIMER(sk); | |
| release_sock(sk); | |
| + | |
| + if (copied > 0) | |
| + uid_stat_tcp_snd(current_uid(), copied); | |
| return copied; | |
| do_fault: | |
| @@ -1378,8 +1382,11 @@ | |
| tcp_rcv_space_adjust(sk); | |
| /* Clean up data we have read: This will do ACK frames. */ | |
| - if (copied > 0) | |
| + if (copied > 0) { | |
| tcp_cleanup_rbuf(sk, copied); | |
| + uid_stat_tcp_rcv(current_uid(), copied); | |
| + } | |
| + | |
| return copied; | |
| } | |
| @@ -1765,6 +1772,9 @@ | |
| TCP_CHECK_TIMER(sk); | |
| release_sock(sk); | |
| + | |
| + if (copied > 0) | |
| + uid_stat_tcp_rcv(current_uid(), copied); | |
| return copied; | |
| out: | |
| @@ -1774,6 +1784,8 @@ | |
| recv_urg: | |
| err = tcp_recv_urg(sk, msg, len, flags); | |
| + if (err > 0) | |
| + uid_stat_tcp_rcv(current_uid(), err); | |
| goto out; | |
| } | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/ipv4/tcp_ipv4.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/tcp_ipv4.c | |
| --- /path/to/linux-2.6.35.7/net/ipv4/tcp_ipv4.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/tcp_ipv4.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -1963,6 +1963,49 @@ | |
| EXPORT_SYMBOL(tcp_v4_destroy_sock); | |
| +/* | |
| + * tcp_v4_nuke_addr - destroy all sockets on the given local address | |
| + */ | |
| +void tcp_v4_nuke_addr(__u32 saddr) | |
| +{ | |
| + unsigned int bucket; | |
| + | |
| + for (bucket = 0; bucket < tcp_hashinfo.ehash_mask; bucket++) { | |
| + struct hlist_nulls_node *node; | |
| + struct sock *sk; | |
| + spinlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, bucket); | |
| + | |
| +restart: | |
| + spin_lock_bh(lock); | |
| + sk_nulls_for_each(sk, node, &tcp_hashinfo.ehash[bucket].chain) { | |
| + struct inet_sock *inet = inet_sk(sk); | |
| + | |
| + if (inet->inet_rcv_saddr != saddr) | |
| + continue; | |
| + if (sysctl_ip_dynaddr && sk->sk_state == TCP_SYN_SENT) | |
| + continue; | |
| + if (sock_flag(sk, SOCK_DEAD)) | |
| + continue; | |
| + | |
| + sock_hold(sk); | |
| + spin_unlock_bh(lock); | |
| + | |
| + local_bh_disable(); | |
| + bh_lock_sock(sk); | |
| + sk->sk_err = ETIMEDOUT; | |
| + sk->sk_error_report(sk); | |
| + | |
| + tcp_done(sk); | |
| + bh_unlock_sock(sk); | |
| + local_bh_enable(); | |
| + sock_put(sk); | |
| + | |
| + goto restart; | |
| + } | |
| + spin_unlock_bh(lock); | |
| + } | |
| +} | |
| + | |
| #ifdef CONFIG_PROC_FS | |
| /* Proc filesystem TCP sock list dumping. */ | |
| @@ -2585,4 +2628,3 @@ | |
| EXPORT_SYMBOL(tcp_proc_unregister); | |
| #endif | |
| EXPORT_SYMBOL(sysctl_tcp_low_latency); | |
| - | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/ipv4/udp.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/udp.c | |
| --- /path/to/linux-2.6.35.7/net/ipv4/udp.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv4/udp.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -100,6 +100,7 @@ | |
| #include <linux/skbuff.h> | |
| #include <linux/proc_fs.h> | |
| #include <linux/seq_file.h> | |
| +#include <linux/uid_stat.h> | |
| #include <net/net_namespace.h> | |
| #include <net/icmp.h> | |
| #include <net/route.h> | |
| @@ -962,8 +963,10 @@ | |
| ip_rt_put(rt); | |
| if (free) | |
| kfree(ipc.opt); | |
| - if (!err) | |
| + if (!err) { | |
| + uid_stat_udp_snd(current_uid(), len); | |
| return len; | |
| + } | |
| /* | |
| * ENOBUFS = no kernel mem, SOCK_NOSPACE = no sndbuf space. Reporting | |
| * ENOBUFS might not be good (it's not tunable per se), but otherwise | |
| @@ -1196,6 +1199,8 @@ | |
| out_free: | |
| skb_free_datagram_locked(sk, skb); | |
| out: | |
| + if (err > 0) | |
| + uid_stat_udp_rcv(current_uid(), err); | |
| return err; | |
| csum_copy_err: | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/ipv6/af_inet6.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv6/af_inet6.c | |
| --- /path/to/linux-2.6.35.7/net/ipv6/af_inet6.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv6/af_inet6.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -63,6 +63,20 @@ | |
| #include <asm/system.h> | |
| #include <linux/mroute6.h> | |
| +#ifdef CONFIG_ANDROID_PARANOID_NETWORK | |
| +#include <linux/android_aid.h> | |
| + | |
| +static inline int current_has_network(void) | |
| +{ | |
| + return in_egroup_p(AID_INET) || capable(CAP_NET_RAW); | |
| +} | |
| +#else | |
| +static inline int current_has_network(void) | |
| +{ | |
| + return 1; | |
| +} | |
| +#endif | |
| + | |
| MODULE_AUTHOR("Cast of dozens"); | |
| MODULE_DESCRIPTION("IPv6 protocol stack for Linux"); | |
| MODULE_LICENSE("GPL"); | |
| @@ -109,6 +123,9 @@ | |
| int try_loading_module = 0; | |
| int err; | |
| + if (!current_has_network()) | |
| + return -EACCES; | |
| + | |
| if (sock->type != SOCK_RAW && | |
| sock->type != SOCK_DGRAM && | |
| !inet_ehash_secret) | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/ipv6/route.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv6/route.c | |
| --- /path/to/linux-2.6.35.7/net/ipv6/route.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/ipv6/route.c 2018-07-12 10:14:18.000000000 +0700 | |
| @@ -189,7 +189,13 @@ | |
| /* allocate dst with ip6_dst_ops */ | |
| static inline struct rt6_info *ip6_dst_alloc(struct dst_ops *ops) | |
| { | |
| - return (struct rt6_info *)dst_alloc(ops); | |
| + struct rt6_info *rt = dst_alloc(ops); | |
| + | |
| + if (rt != NULL) | |
| + memset(&rt->rt6i_table, 0, | |
| + sizeof(*rt) - sizeof(struct dst_entry)); | |
| + | |
| + return rt; | |
| } | |
| static void ip6_dst_destroy(struct dst_entry *dst) | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/Kconfig | |
| --- /path/to/linux-2.6.35.7/net/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/Kconfig 2018-07-12 10:14:17.000000000 +0700 | |
| @@ -79,6 +79,20 @@ | |
| endif # if INET | |
| +config ANDROID_PARANOID_NETWORK | |
| + bool "Only allow certain groups to create sockets" | |
| + default y | |
| + help | |
| + none | |
| + | |
| +config NET_ACTIVITY_STATS | |
| + bool "Network activity statistics tracking" | |
| + default y | |
| + help | |
| + Network activity statistics are useful for tracking wireless | |
| + modem activity on 2G, 3G, 4G wireless networks. Counts number of | |
| + transmissions and groups them in specified time buckets. | |
| + | |
| config NETWORK_SECMARK | |
| bool "Security Marking" | |
| help | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/l2tp/l2tp_eth.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/l2tp/l2tp_eth.c | |
| --- /path/to/linux-2.6.35.7/net/l2tp/l2tp_eth.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/l2tp/l2tp_eth.c 2018-07-12 10:14:21.000000000 +0700 | |
| @@ -284,7 +284,7 @@ | |
| return 0; | |
| } | |
| -static __net_initdata struct pernet_operations l2tp_eth_net_ops = { | |
| +static struct pernet_operations l2tp_eth_net_ops = { | |
| .init = l2tp_eth_init_net, | |
| .id = &l2tp_eth_net_id, | |
| .size = sizeof(struct l2tp_eth_net), | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/Makefile /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/Makefile | |
| --- /path/to/linux-2.6.35.7/net/Makefile 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/Makefile 2018-07-12 10:14:17.000000000 +0700 | |
| @@ -67,3 +67,4 @@ | |
| obj-$(CONFIG_SYSCTL) += sysctl_net.o | |
| endif | |
| obj-$(CONFIG_WIMAX) += wimax/ | |
| +obj-$(CONFIG_NET_ACTIVITY_STATS) += activity_stats.o | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/rfkill/core.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/rfkill/core.c | |
| --- /path/to/linux-2.6.35.7/net/rfkill/core.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/rfkill/core.c 2018-07-12 10:14:23.000000000 +0700 | |
| @@ -783,6 +783,7 @@ | |
| } | |
| EXPORT_SYMBOL(rfkill_pause_polling); | |
| +#ifdef CONFIG_RFKILL_PM | |
| void rfkill_resume_polling(struct rfkill *rfkill) | |
| { | |
| BUG_ON(!rfkill); | |
| @@ -817,14 +818,17 @@ | |
| return 0; | |
| } | |
| +#endif | |
| static struct class rfkill_class = { | |
| .name = "rfkill", | |
| .dev_release = rfkill_release, | |
| .dev_attrs = rfkill_dev_attrs, | |
| .dev_uevent = rfkill_dev_uevent, | |
| +#ifdef CONFIG_RFKILL_PM | |
| .suspend = rfkill_suspend, | |
| .resume = rfkill_resume, | |
| +#endif | |
| }; | |
| bool rfkill_blocked(struct rfkill *rfkill) | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/rfkill/Kconfig /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/rfkill/Kconfig | |
| --- /path/to/linux-2.6.35.7/net/rfkill/Kconfig 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/rfkill/Kconfig 2018-07-12 10:14:23.000000000 +0700 | |
| @@ -10,6 +10,11 @@ | |
| To compile this driver as a module, choose M here: the | |
| module will be called rfkill. | |
| +config RFKILL_PM | |
| + bool "Power off on suspend" | |
| + depends on RFKILL && PM | |
| + default y | |
| + | |
| # LED trigger support | |
| config RFKILL_LEDS | |
| bool | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/net/socket.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/socket.c | |
| --- /path/to/linux-2.6.35.7/net/socket.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/net/socket.c 2018-07-12 10:14:17.000000000 +0700 | |
| @@ -570,7 +570,8 @@ | |
| if (err) | |
| return err; | |
| - return sock->ops->sendmsg(iocb, sock, msg, size); | |
| + err = sock->ops->sendmsg(iocb, sock, msg, size); | |
| + return err; | |
| } | |
| int sock_sendmsg(struct socket *sock, struct msghdr *msg, size_t size) | |
| @@ -685,6 +686,7 @@ | |
| static inline int __sock_recvmsg_nosec(struct kiocb *iocb, struct socket *sock, | |
| struct msghdr *msg, size_t size, int flags) | |
| { | |
| + int err; | |
| struct sock_iocb *si = kiocb_to_siocb(iocb); | |
| sock_update_classid(sock->sk); | |
| @@ -695,7 +697,8 @@ | |
| si->size = size; | |
| si->flags = flags; | |
| - return sock->ops->recvmsg(iocb, sock, msg, size, flags); | |
| + err = sock->ops->recvmsg(iocb, sock, msg, size, flags); | |
| + return err; | |
| } | |
| static inline int __sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |
| Only in /path/to/linux-2.6.35.7/net/wireless: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/basic: docproc | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/basic: fixdep | |
| Only in /path/to/linux-2.6.35.7/scripts/basic: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/basic: hash | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts: conmakehash | |
| Only in /path/to/linux-2.6.35.7/scripts/dtc: .gitignore | |
| Only in /path/to/linux-2.6.35.7/scripts/genksyms: .gitignore | |
| Only in /path/to/linux-2.6.35.7/scripts: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts: kallsyms | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/kconfig: conf | |
| Only in /path/to/linux-2.6.35.7/scripts/kconfig: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/kconfig: lex.zconf.c | |
| Only in /path/to/linux-2.6.35.7/scripts/kconfig/lxdialog: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/kconfig: zconf.hash.c | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/kconfig: zconf.tab.c | |
| Only in /path/to/linux-2.6.35.7/scripts/kconfig: zconf.tab.c_shipped | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/mod: elfconfig.h | |
| Only in /path/to/linux-2.6.35.7/scripts/mod: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/mod: mk_elfconfig | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/scripts/mod: modpost | |
| Only in /path/to/linux-2.6.35.7/scripts/selinux/genheaders: .gitignore | |
| Only in /path/to/linux-2.6.35.7/scripts/selinux/mdp: .gitignore | |
| diff -ur '-x*.o' '-x*.o.cmd)' /path/to/linux-2.6.35.7/security/commoncap.c /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/security/commoncap.c | |
| --- /path/to/linux-2.6.35.7/security/commoncap.c 2010-09-29 08:09:08.000000000 +0700 | |
| +++ /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/security/commoncap.c 2018-07-12 10:14:38.000000000 +0700 | |
| @@ -29,6 +29,10 @@ | |
| #include <linux/securebits.h> | |
| #include <linux/syslog.h> | |
| +#ifdef CONFIG_ANDROID_PARANOID_NETWORK | |
| +#include <linux/android_aid.h> | |
| +#endif | |
| + | |
| /* | |
| * If a non-root user executes a setuid-root binary in | |
| * !secure(SECURE_NOROOT) mode, then we raise capabilities. | |
| @@ -83,6 +87,12 @@ | |
| int cap_capable(struct task_struct *tsk, const struct cred *cred, int cap, | |
| int audit) | |
| { | |
| +#ifdef CONFIG_ANDROID_PARANOID_NETWORK | |
| + if (cap == CAP_NET_RAW && in_egroup_p(AID_NET_RAW)) | |
| + return 0; | |
| + if (cap == CAP_NET_ADMIN && in_egroup_p(AID_NET_ADMIN)) | |
| + return 0; | |
| +#endif | |
| return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM; | |
| } | |
| Only in /path/to/linux-2.6.35.7/security/selinux: .gitignore | |
| Only in /path/to/linux-2.6.35.7/sound/oss: .gitignore | |
| Only in /path/to/linux-2.6.35.7/tools/perf: .gitignore | |
| Only in /path/to/linux-2.6.35.7/usr: .gitignore | |
| Only in /path/to/GT-S5360_GB_Opensource_Update4-kernel/common/: .version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment