GIT 9fc22f8b5572981bc3bfafa3e3fabfa1fa57883c git+ssh://master.kernel.org/home/rmk/linux-2.6-arm.git#devel commit 9fc22f8b5572981bc3bfafa3e3fabfa1fa57883c Author: Matej Kenda Date: Mon Mar 5 13:06:40 2007 +0100 [ARM] 4246/1: i2c-pxa: add adapter class to platform specific data Reposted patch for kernel 2.6.21-rc2. The driver i2c-pxa doesn't set the class member in i2c_adapter, which is used to register the I2C adapter. The hwmon (sensors) drivers (e.g. adm1021) that are connected to a i2c-pxa adapter don't attach because they expect that the adapter supports class I2C_CLASS_HWMON. This patch adds functionality to allow platforms to set the class and pass it as platform_data to the i2c-pxa driver. Sample usage in platform code: static struct i2c_pxa_platform_data my_i2c_platform_data = { .class = I2C_CLASS_HWMON }; static void __init my_platform_init(void) { (void) platform_add_devices(devices, ARRAY_SIZE(devices)); pxa_set_i2c_info(&my_i2c_platform_data); } Signed-off-by: Matej Kenda Signed-off-by: Russell King commit fa84cd3404165acd68e1642beb77ee41ca9a013e Author: Russell King Date: Sun Mar 4 20:44:59 2007 +0000 [ARM] getuser.S and putuser.S don't need thread_info.h nor asm-offsets.h Signed-off-by: Russell King commit 02fdcd822178c42158cefea86a4befc15f387e91 Author: Russell King Date: Sun Mar 4 09:50:28 2007 +0000 [ARM] ptrace: clean up single stepping support Signed-off-by: Russell King commit 79b23bdb289122c9f0fecb465569cfafe90b23fe Author: Russell King Date: Sat Mar 3 19:45:25 2007 +0000 [ARM] Remove needless linux/ptrace.h includes Lots of places in arch/arm were needlessly including linux/ptrace.h, resumably because we used to pass a struct pt_regs to interrupt handlers. Now that we don't, all these ptrace.h includes are redundant. Signed-off-by: Russell King commit 2916c95d98f03afba16458ab9cd00ebee4d71e8e Author: Philipp Zabel Date: Mon Feb 26 01:44:57 2007 +0100 [ARM] 4236/2: basic {enable,disable}_irq_wake() support for PXA pxa_set_gpio_wake handles GPIOs > 1, so IRQ_TO_GPIO has to be used instead of just substracting IRQ_GPIO0 from the irq number. commit be145ac20b49eea3197e6c03d97bf4c9eff20dc8 Author: Russell King Date: Sat Mar 3 11:51:31 2007 +0000 [ARM] EBSA110: Add readsw/readsl/writesw/writesl Signed-off-by: Russell King commit b6d75b19ef7fb2fff843e0f668f293e6cb27d6da Author: Russell King Date: Fri Mar 2 15:01:36 2007 +0000 [ARM] Add ability to dump exception stacks to kernel backtraces Signed-off-by: Russell King commit 2848e647402719d4a8d03141361caed60f2668da Author: Andrew Victor Date: Mon Mar 26 11:02:48 2007 +0100 [ARM] 4289/1: AT91: SAM9260 NAND flash timing Fix the NAND flash timings on the AT91SAM9260. The current timings lead to the detection of a number of bad blocks. These timings are now set the same as on the AT91SAM9263. Patch from Nicolas Ferre. Signed-off-by: Andrew Victor Signed-off-by: Russell King Signed-off-by: Andrew Morton --- arch/arm/common/sa1111.c | 1 arch/arm/common/via82c505.c | 1 arch/arm/kernel/irq.c | 3 arch/arm/kernel/process.c | 1 arch/arm/kernel/ptrace.c | 15 -- arch/arm/kernel/ptrace.h | 39 +++++ arch/arm/kernel/signal.c | 22 --- arch/arm/kernel/traps.c | 19 ++ arch/arm/kernel/vmlinux.lds.S | 3 arch/arm/lib/backtrace.S | 165 ++++++++++++------------- arch/arm/lib/getuser.S | 2 arch/arm/lib/putuser.S | 2 arch/arm/mach-ebsa110/io.c | 40 ++++++ arch/arm/mach-footbridge/dc21285.c | 1 arch/arm/mach-integrator/pci.c | 1 arch/arm/mach-integrator/pci_v3.c | 1 arch/arm/mach-lh7a40x/irq-lh7a400.c | 1 arch/arm/mach-lh7a40x/irq-lh7a404.c | 1 arch/arm/mach-lh7a40x/irq-lpd7a40x.c | 1 arch/arm/mach-omap1/irq.c | 1 arch/arm/mach-pxa/irq.c | 73 ++++++++++- arch/arm/mach-s3c2410/bast-irq.c | 1 arch/arm/mach-s3c2410/irq.c | 1 arch/arm/mach-s3c2412/irq.c | 1 arch/arm/mach-s3c2440/irq.c | 1 arch/arm/mach-s3c2443/irq.c | 1 arch/arm/mach-sa1100/irq.c | 1 arch/arm/mach-sa1100/neponset.c | 1 arch/arm/mach-shark/irq.c | 1 arch/arm/mach-versatile/pci.c | 1 arch/arm/mm/alignment.c | 1 arch/arm/mm/fault.c | 5 arch/arm/mm/init.c | 1 arch/arm/plat-omap/gpio.c | 1 arch/arm/plat-s3c24xx/irq.c | 1 arch/arm/plat-s3c24xx/s3c244x-irq.c | 1 drivers/i2c/busses/i2c-pxa.c | 6 include/asm-arm/arch-ebsa110/io.h | 8 + include/asm-arm/arch-pxa/i2c.h | 1 include/asm-arm/system.h | 2 40 files changed, 276 insertions(+), 153 deletions(-) diff -puN arch/arm/common/sa1111.c~git-arm arch/arm/common/sa1111.c --- a/arch/arm/common/sa1111.c~git-arm +++ a/arch/arm/common/sa1111.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff -puN arch/arm/common/via82c505.c~git-arm arch/arm/common/via82c505.c --- a/arch/arm/common/via82c505.c~git-arm +++ a/arch/arm/common/via82c505.c @@ -1,6 +1,5 @@ #include #include -#include #include #include #include diff -puN arch/arm/kernel/irq.c~git-arm arch/arm/kernel/irq.c --- a/arch/arm/kernel/irq.c~git-arm +++ a/arch/arm/kernel/irq.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -109,7 +108,7 @@ static struct irq_desc bad_irq_desc = { * come via this function. Instead, they should provide their * own 'handler' */ -asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) +asmlinkage void __exception asm_do_IRQ(unsigned int irq, struct pt_regs *regs) { struct pt_regs *old_regs = set_irq_regs(regs); struct irq_desc *desc = irq_desc + irq; diff -puN arch/arm/kernel/process.c~git-arm arch/arm/kernel/process.c --- a/arch/arm/kernel/process.c~git-arm +++ a/arch/arm/kernel/process.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff -puN arch/arm/kernel/ptrace.c~git-arm arch/arm/kernel/ptrace.c --- a/arch/arm/kernel/ptrace.c~git-arm +++ a/arch/arm/kernel/ptrace.c @@ -457,13 +457,10 @@ void ptrace_cancel_bpt(struct task_struc /* * Called by kernel/ptrace.c when detaching.. - * - * Make sure the single step bit is not set. */ void ptrace_disable(struct task_struct *child) { - child->ptrace &= ~PT_SINGLESTEP; - ptrace_cancel_bpt(child); + single_step_disable(child); } /* @@ -712,9 +709,7 @@ long arch_ptrace(struct task_struct *chi else clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); child->exit_code = data; - /* make sure single-step breakpoint is gone. */ - child->ptrace &= ~PT_SINGLESTEP; - ptrace_cancel_bpt(child); + single_step_disable(child); wake_up_process(child); ret = 0; break; @@ -725,9 +720,7 @@ long arch_ptrace(struct task_struct *chi * exit. */ case PTRACE_KILL: - /* make sure single-step breakpoint is gone. */ - child->ptrace &= ~PT_SINGLESTEP; - ptrace_cancel_bpt(child); + single_step_disable(child); if (child->exit_state != EXIT_ZOMBIE) { child->exit_code = SIGKILL; wake_up_process(child); @@ -742,7 +735,7 @@ long arch_ptrace(struct task_struct *chi ret = -EIO; if (!valid_signal(data)) break; - child->ptrace |= PT_SINGLESTEP; + single_step_enable(child); clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); child->exit_code = data; /* give it a chance to run. */ diff -puN arch/arm/kernel/ptrace.h~git-arm arch/arm/kernel/ptrace.h --- a/arch/arm/kernel/ptrace.h~git-arm +++ a/arch/arm/kernel/ptrace.h @@ -7,6 +7,45 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include + extern void ptrace_cancel_bpt(struct task_struct *); extern void ptrace_set_bpt(struct task_struct *); extern void ptrace_break(struct task_struct *, struct pt_regs *); + +/* + * make sure single-step breakpoint is gone. + */ +static inline void single_step_disable(struct task_struct *task) +{ + task->ptrace &= ~PT_SINGLESTEP; + ptrace_cancel_bpt(task); +} + +static inline void single_step_enable(struct task_struct *task) +{ + task->ptrace |= PT_SINGLESTEP; +} + +/* + * Send SIGTRAP if we're single-stepping + */ +static inline void single_step_trap(struct task_struct *task) +{ + if (task->ptrace & PT_SINGLESTEP) { + ptrace_cancel_bpt(task); + send_sig(SIGTRAP, task, 1); + } +} + +static inline void single_step_clear(struct task_struct *task) +{ + if (task->ptrace & PT_SINGLESTEP) + ptrace_cancel_bpt(task); +} + +static inline void single_step_set(struct task_struct *task) +{ + if (task->ptrace & PT_SINGLESTEP) + ptrace_set_bpt(task); +} diff -puN arch/arm/kernel/signal.c~git-arm arch/arm/kernel/signal.c --- a/arch/arm/kernel/signal.c~git-arm +++ a/arch/arm/kernel/signal.c @@ -9,7 +9,6 @@ */ #include #include -#include #include #include @@ -285,11 +284,7 @@ asmlinkage int sys_sigreturn(struct pt_r if (restore_sigframe(regs, frame)) goto badframe; - /* Send SIGTRAP if we're single-stepping */ - if (current->ptrace & PT_SINGLESTEP) { - ptrace_cancel_bpt(current); - send_sig(SIGTRAP, current, 1); - } + single_step_trap(current); return regs->ARM_r0; @@ -324,11 +319,7 @@ asmlinkage int sys_rt_sigreturn(struct p if (do_sigaltstack(&frame->sig.uc.uc_stack, NULL, regs->ARM_sp) == -EFAULT) goto badframe; - /* Send SIGTRAP if we're single-stepping */ - if (current->ptrace & PT_SINGLESTEP) { - ptrace_cancel_bpt(current); - send_sig(SIGTRAP, current, 1); - } + single_step_trap(current); return regs->ARM_r0; @@ -644,14 +635,12 @@ static int do_signal(sigset_t *oldset, s if (try_to_freeze()) goto no_signal; - if (current->ptrace & PT_SINGLESTEP) - ptrace_cancel_bpt(current); + single_step_clear(current); signr = get_signal_to_deliver(&info, &ka, regs, NULL); if (signr > 0) { handle_signal(signr, &ka, &info, oldset, regs, syscall); - if (current->ptrace & PT_SINGLESTEP) - ptrace_set_bpt(current); + single_step_set(current); return 1; } @@ -705,8 +694,7 @@ static int do_signal(sigset_t *oldset, s restart_syscall(regs); } } - if (current->ptrace & PT_SINGLESTEP) - ptrace_set_bpt(current); + single_step_set(current); return 0; } diff -puN arch/arm/kernel/traps.c~git-arm arch/arm/kernel/traps.c --- a/arch/arm/kernel/traps.c~git-arm +++ a/arch/arm/kernel/traps.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -45,7 +44,18 @@ static int __init user_debug_setup(char __setup("user_debug=", user_debug_setup); #endif -void dump_backtrace_entry(unsigned long where, unsigned long from) +static void dump_mem(const char *str, unsigned long bottom, unsigned long top); + +static inline int in_exception_text(unsigned long ptr) +{ + extern char __exception_text_start[]; + extern char __exception_text_end[]; + + return ptr >= (unsigned long)&__exception_text_start && + ptr < (unsigned long)&__exception_text_end; +} + +void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame) { #ifdef CONFIG_KALLSYMS printk("[<%08lx>] ", where); @@ -55,6 +65,9 @@ void dump_backtrace_entry(unsigned long #else printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from); #endif + + if (in_exception_text(where)) + dump_mem("Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs)); } /* @@ -266,7 +279,7 @@ void unregister_undef_hook(struct undef_ spin_unlock_irqrestore(&undef_lock, flags); } -asmlinkage void do_undefinstr(struct pt_regs *regs) +asmlinkage void __exception do_undefinstr(struct pt_regs *regs) { unsigned int correction = thumb_mode(regs) ? 2 : 4; unsigned int instr; diff -puN arch/arm/kernel/vmlinux.lds.S~git-arm arch/arm/kernel/vmlinux.lds.S --- a/arch/arm/kernel/vmlinux.lds.S~git-arm +++ a/arch/arm/kernel/vmlinux.lds.S @@ -83,6 +83,9 @@ SECTIONS .text : { /* Real text segment */ _text = .; /* Text and read-only data */ + __exception_text_start = .; + *(.exception.text) + __exception_text_end = .; *(.text) SCHED_TEXT LOCK_TEXT diff -puN arch/arm/lib/backtrace.S~git-arm arch/arm/lib/backtrace.S --- a/arch/arm/lib/backtrace.S~git-arm +++ a/arch/arm/lib/backtrace.S @@ -17,8 +17,8 @@ @ fp is 0 or stack frame #define frame r4 -#define next r5 -#define save r6 +#define sv_fp r5 +#define sv_pc r6 #define mask r7 #define offset r8 @@ -31,108 +31,106 @@ ENTRY(c_backtrace) #if !defined(CONFIG_FRAME_POINTER) || !defined(CONFIG_PRINTK) mov pc, lr #else - stmfd sp!, {r4 - r8, lr} @ Save an extra register so we have a location... - tst r1, #0x10 @ 26 or 32-bit? - moveq mask, #0xfc000003 - movne mask, #0 - tst mask, r0 - movne r0, #0 - movs frame, r0 -1: moveq r0, #-2 - ldmeqfd sp!, {r4 - r8, pc} - -2: stmfd sp!, {pc} @ calculate offset of PC in STMIA instruction - ldr r0, [sp], #4 - adr r1, 2b - 4 + movs frame, r0 @ if frame pointer is zero + beq no_frame @ we have no stack frames + + tst r1, #0x10 @ 26 or 32-bit mode? + moveq mask, #0xfc000003 @ mask for 26-bit + movne mask, #0 @ mask for 32-bit + +1: stmfd sp!, {pc} @ calculate offset of PC stored + ldr r0, [sp], #4 @ by stmfd for this CPU + adr r1, 1b sub offset, r0, r1 -3: tst frame, mask @ Check for address exceptions... - bne 1b +/* + * Stack frame layout: + * optionally saved caller registers (r4 - r10) + * saved fp + * saved sp + * saved lr + * frame => saved pc + * optionally saved arguments (r0 - r3) + * saved sp => + * + * Functions start with the following code sequence: + * mov ip, sp + * stmfd sp!, {r0 - r3} (optional) + * corrected pc => stmfd sp!, {..., fp, ip, lr, pc} + */ +for_each_frame: tst frame, mask @ Check for address exceptions + bne no_frame -1001: ldr next, [frame, #-12] @ get fp -1002: ldr r2, [frame, #-4] @ get lr -1003: ldr r3, [frame, #0] @ get pc - sub save, r3, offset @ Correct PC for prefetching - bic save, save, mask -1004: ldr r1, [save, #0] @ get instruction at function - mov r1, r1, lsr #10 - ldr r3, .Ldsi+4 - teq r1, r3 - subeq save, save, #4 - mov r0, save - bic r1, r2, mask +1001: ldr sv_pc, [frame, #0] @ get saved pc +1002: ldr sv_fp, [frame, #-12] @ get saved fp + + sub sv_pc, sv_pc, offset @ Correct PC for prefetching + bic sv_pc, sv_pc, mask @ mask PC/LR for the mode + +1003: ldr r2, [sv_pc, #-4] @ if stmfd sp!, {args} exists, + ldr r3, .Ldsi+4 @ adjust saved 'pc' back one + teq r3, r2, lsr #10 @ instruction + subne r0, sv_pc, #4 @ allow for mov + subeq r0, sv_pc, #8 @ allow for mov + stmia + + ldr r1, [frame, #-4] @ get saved lr + mov r2, frame + bic r1, r1, mask @ mask PC/LR for the mode bl dump_backtrace_entry - ldr r0, [frame, #-8] @ get sp - sub r0, r0, #4 -1005: ldr r1, [save, #4] @ get instruction at function+4 - mov r3, r1, lsr #10 - ldr r2, .Ldsi+4 - teq r3, r2 @ Check for stmia sp!, {args} - addeq save, save, #4 @ next instruction - bleq .Ldumpstm - - sub r0, frame, #16 -1006: ldr r1, [save, #4] @ Get 'stmia sp!, {rlist, fp, ip, lr, pc}' instruction - mov r3, r1, lsr #10 - ldr r2, .Ldsi - teq r3, r2 - bleq .Ldumpstm - - /* - * A zero next framepointer means we're done. - */ - teq next, #0 - ldmeqfd sp!, {r4 - r8, pc} - - /* - * The next framepointer must be above the - * current framepointer. - */ - cmp next, frame - mov frame, next - bhi 3b - b 1007f + ldr r1, [sv_pc, #-4] @ if stmfd sp!, {args} exists, + ldr r3, .Ldsi+4 + teq r3, r1, lsr #10 + ldreq r0, [frame, #-8] @ get sp + subeq r0, r0, #4 @ point at the last arg + bleq .Ldumpstm @ dump saved registers + +1004: ldr r1, [sv_pc, #0] @ if stmfd sp!, {..., fp, ip, lr, pc} + ldr r3, .Ldsi @ instruction exists, + teq r3, r1, lsr #10 + subeq r0, frame, #16 + bleq .Ldumpstm @ dump saved registers + + teq sv_fp, #0 @ zero saved fp means + beq no_frame @ no further frames + + cmp sv_fp, frame @ next frame must be + mov frame, sv_fp @ above the current frame + bhi for_each_frame -/* - * Fixup for LDMDB. Note that this must not be in the fixup section. - */ -1007: ldr r0, =.Lbad +1006: adr r0, .Lbad mov r1, frame bl printk - ldmfd sp!, {r4 - r8, pc} - .ltorg +no_frame: ldmfd sp!, {r4 - r8, pc} .section __ex_table,"a" .align 3 - .long 1001b, 1007b - .long 1002b, 1007b - .long 1003b, 1007b - .long 1004b, 1007b - .long 1005b, 1007b - .long 1006b, 1007b + .long 1001b, 1006b + .long 1002b, 1006b + .long 1003b, 1006b + .long 1004b, 1006b .previous #define instr r4 #define reg r5 #define stack r6 -.Ldumpstm: stmfd sp!, {instr, reg, stack, r7, r8, lr} +.Ldumpstm: stmfd sp!, {instr, reg, stack, r7, lr} mov stack, r0 mov instr, r1 - mov reg, #9 + mov reg, #10 mov r7, #0 1: mov r3, #1 tst instr, r3, lsl reg beq 2f add r7, r7, #1 - teq r7, #4 - moveq r7, #0 - moveq r3, #'\n' - movne r3, #' ' - ldr r2, [stack], #-4 - mov r1, reg + teq r7, #6 + moveq r7, #1 + moveq r1, #'\n' + movne r1, #' ' + ldr r3, [stack], #-4 + mov r2, reg adr r0, .Lfp bl printk 2: subs reg, reg, #1 @@ -140,14 +138,13 @@ ENTRY(c_backtrace) teq r7, #0 adrne r0, .Lcr blne printk - mov r0, stack - ldmfd sp!, {instr, reg, stack, r7, r8, pc} + ldmfd sp!, {instr, reg, stack, r7, pc} -.Lfp: .asciz " r%d = %08X%c" +.Lfp: .asciz "%cr%d:%08x" .Lcr: .asciz "\n" .Lbad: .asciz "Backtrace aborted due to bad frame pointer <%p>\n" .align -.Ldsi: .word 0x00e92dd8 >> 2 - .word 0x00e92d00 >> 2 +.Ldsi: .word 0xe92dd800 >> 10 @ stmfd sp!, {... fp, ip, lr, pc} + .word 0xe92d0000 >> 10 @ stmfd sp!, {} #endif diff -puN arch/arm/lib/getuser.S~git-arm arch/arm/lib/getuser.S --- a/arch/arm/lib/getuser.S~git-arm +++ a/arch/arm/lib/getuser.S @@ -26,8 +26,6 @@ * Note that ADDR_LIMIT is either 0 or 0xc0000000. * Note also that it is intended that __get_user_bad is not global. */ -#include -#include #include .global __get_user_1 diff -puN arch/arm/lib/putuser.S~git-arm arch/arm/lib/putuser.S --- a/arch/arm/lib/putuser.S~git-arm +++ a/arch/arm/lib/putuser.S @@ -26,8 +26,6 @@ * Note that ADDR_LIMIT is either 0 or 0xc0000000 * Note also that it is intended that __put_user_bad is not global. */ -#include -#include #include .global __put_user_1 diff -puN arch/arm/mach-at91/at91sam9260_devices.c~git-arm arch/arm/mach-at91/at91sam9260_devices.c diff -puN arch/arm/mach-ebsa110/io.c~git-arm arch/arm/mach-ebsa110/io.c --- a/arch/arm/mach-ebsa110/io.c~git-arm +++ a/arch/arm/mach-ebsa110/io.c @@ -102,6 +102,26 @@ EXPORT_SYMBOL(__readb); EXPORT_SYMBOL(__readw); EXPORT_SYMBOL(__readl); +void readsw(void __iomem *addr, void *data, int len) +{ + void __iomem *a = __isamem_convert_addr(addr); + + BUG_ON((unsigned long)addr & 1); + + __raw_readsw(a, data, len); +} +EXPORT_SYMBOL(readsw); + +void readsl(void __iomem *addr, void *data, int len) +{ + void __iomem *a = __isamem_convert_addr(addr); + + BUG_ON((unsigned long)addr & 3); + + __raw_readsl(a, data, len); +} +EXPORT_SYMBOL(readsl); + void __writeb(u8 val, void __iomem *addr) { void __iomem *a = __isamem_convert_addr(addr); @@ -137,6 +157,26 @@ EXPORT_SYMBOL(__writeb); EXPORT_SYMBOL(__writew); EXPORT_SYMBOL(__writel); +void writesw(void __iomem *addr, void *data, int len) +{ + void __iomem *a = __isamem_convert_addr(addr); + + BUG_ON((unsigned long)addr & 1); + + __raw_writesw(a, data, len); +} +EXPORT_SYMBOL(writesw); + +void writesl(void __iomem *addr, void *data, int len) +{ + void __iomem *a = __isamem_convert_addr(addr); + + BUG_ON((unsigned long)addr & 3); + + __raw_writesl(a, data, len); +} +EXPORT_SYMBOL(writesl); + #define SUPERIO_PORT(p) \ (((p) >> 3) == (0x3f8 >> 3) || \ ((p) >> 3) == (0x2f8 >> 3) || \ diff -puN arch/arm/mach-footbridge/dc21285.c~git-arm arch/arm/mach-footbridge/dc21285.c --- a/arch/arm/mach-footbridge/dc21285.c~git-arm +++ a/arch/arm/mach-footbridge/dc21285.c @@ -10,7 +10,6 @@ */ #include #include -#include #include #include #include diff -puN arch/arm/mach-integrator/pci.c~git-arm arch/arm/mach-integrator/pci.c --- a/arch/arm/mach-integrator/pci.c~git-arm +++ a/arch/arm/mach-integrator/pci.c @@ -23,7 +23,6 @@ */ #include #include -#include #include #include diff -puN arch/arm/mach-integrator/pci_v3.c~git-arm arch/arm/mach-integrator/pci_v3.c --- a/arch/arm/mach-integrator/pci_v3.c~git-arm +++ a/arch/arm/mach-integrator/pci_v3.c @@ -22,7 +22,6 @@ */ #include #include -#include #include #include #include diff -puN arch/arm/mach-lh7a40x/irq-lh7a400.c~git-arm arch/arm/mach-lh7a40x/irq-lh7a400.c --- a/arch/arm/mach-lh7a40x/irq-lh7a400.c~git-arm +++ a/arch/arm/mach-lh7a40x/irq-lh7a400.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-lh7a40x/irq-lh7a404.c~git-arm arch/arm/mach-lh7a40x/irq-lh7a404.c --- a/arch/arm/mach-lh7a40x/irq-lh7a404.c~git-arm +++ a/arch/arm/mach-lh7a40x/irq-lh7a404.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-lh7a40x/irq-lpd7a40x.c~git-arm arch/arm/mach-lh7a40x/irq-lpd7a40x.c --- a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c~git-arm +++ a/arch/arm/mach-lh7a40x/irq-lpd7a40x.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-omap1/irq.c~git-arm arch/arm/mach-omap1/irq.c --- a/arch/arm/mach-omap1/irq.c~git-arm +++ a/arch/arm/mach-omap1/irq.c @@ -40,7 +40,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-pxa/irq.c~git-arm arch/arm/mach-pxa/irq.c --- a/arch/arm/mach-pxa/irq.c~git-arm +++ a/arch/arm/mach-pxa/irq.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -39,11 +38,33 @@ static void pxa_unmask_low_irq(unsigned ICMR |= (1 << (irq + PXA_IRQ_SKIP)); } +static int pxa_set_wake(unsigned int irq, unsigned int on) +{ + u32 mask; + + switch (irq) { + case IRQ_RTCAlrm: + mask = PWER_RTC; + break; +#ifdef CONFIG_PXA27x + /* REVISIT can handle USBH1, USBH2, USB, MSL, USIM, ... */ +#endif + default: + return -EINVAL; + } + if (on) + PWER |= mask; + else + PWER &= ~mask; + return 0; +} + static struct irq_chip pxa_internal_chip_low = { .name = "SC", .ack = pxa_mask_low_irq, .mask = pxa_mask_low_irq, .unmask = pxa_unmask_low_irq, + .set_wake = pxa_set_wake, }; #if PXA_INTERNAL_IRQS > 32 @@ -71,6 +92,26 @@ static struct irq_chip pxa_internal_chip #endif +/* Note that if an input/irq line ever gets changed to an output during + * suspend, the relevant PWER, PRER, and PFER bits should be cleared. + */ +#ifdef CONFIG_PXA27x + +/* PXA27x: Various gpios can issue wakeup events. This logic only + * handles the simple cases, not the WEMUX2 and WEMUX3 options + */ +#define PXA27x_GPIO_NOWAKE_MASK \ + ((1 << 8) | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 2)) +#define WAKEMASK(gpio) \ + (((gpio) <= 15) \ + ? ((1 << (gpio)) & ~PXA27x_GPIO_NOWAKE_MASK) \ + : ((gpio == 35) ? (1 << 24) : 0)) +#else + +/* pxa 210, 250, 255, 26x: gpios 0..15 can issue wakeups */ +#define WAKEMASK(gpio) (((gpio) <= 15) ? (1 << (gpio)) : 0) +#endif + /* * PXA GPIO edge detection for IRQs: * IRQs are generated on Falling-Edge, Rising-Edge, or both. @@ -84,9 +125,11 @@ static long GPIO_IRQ_mask[4]; static int pxa_gpio_irq_type(unsigned int irq, unsigned int type) { int gpio, idx; + u32 mask; gpio = IRQ_TO_GPIO(irq); idx = gpio >> 5; + mask = WAKEMASK(gpio); if (type == IRQT_PROBE) { /* Don't mess with enabled GPIOs using preconfigured edges or @@ -106,14 +149,20 @@ static int pxa_gpio_irq_type(unsigned in if (type & __IRQT_RISEDGE) { /* printk("rising "); */ __set_bit (gpio, GPIO_IRQ_rising_edge); - } else + PRER |= mask; + } else { __clear_bit (gpio, GPIO_IRQ_rising_edge); + PRER &= ~mask; + } if (type & __IRQT_FALEDGE) { /* printk("falling "); */ __set_bit (gpio, GPIO_IRQ_falling_edge); - } else + PFER |= mask; + } else { __clear_bit (gpio, GPIO_IRQ_falling_edge); + PFER &= ~mask; + } /* printk("edges\n"); */ @@ -131,12 +180,29 @@ static void pxa_ack_low_gpio(unsigned in GEDR0 = (1 << (irq - IRQ_GPIO0)); } +static int pxa_set_gpio_wake(unsigned int irq, unsigned int on) +{ + int gpio = IRQ_TO_GPIO(irq); + u32 mask = WAKEMASK(gpio); + + if (!mask) + return -EINVAL; + + if (on) + PWER |= mask; + else + PWER &= ~mask; + return 0; +} + + static struct irq_chip pxa_low_gpio_chip = { .name = "GPIO-l", .ack = pxa_ack_low_gpio, .mask = pxa_mask_low_irq, .unmask = pxa_unmask_low_irq, .set_type = pxa_gpio_irq_type, + .set_wake = pxa_set_gpio_wake, }; /* @@ -245,6 +311,7 @@ static struct irq_chip pxa_muxed_gpio_ch .mask = pxa_mask_muxed_gpio, .unmask = pxa_unmask_muxed_gpio, .set_type = pxa_gpio_irq_type, + .set_wake = pxa_set_gpio_wake, }; diff -puN arch/arm/mach-s3c2410/bast-irq.c~git-arm arch/arm/mach-s3c2410/bast-irq.c --- a/arch/arm/mach-s3c2410/bast-irq.c~git-arm +++ a/arch/arm/mach-s3c2410/bast-irq.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-s3c2410/irq.c~git-arm arch/arm/mach-s3c2410/irq.c --- a/arch/arm/mach-s3c2410/irq.c~git-arm +++ a/arch/arm/mach-s3c2410/irq.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-s3c2412/irq.c~git-arm arch/arm/mach-s3c2412/irq.c --- a/arch/arm/mach-s3c2412/irq.c~git-arm +++ a/arch/arm/mach-s3c2412/irq.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-s3c2440/irq.c~git-arm arch/arm/mach-s3c2440/irq.c --- a/arch/arm/mach-s3c2440/irq.c~git-arm +++ a/arch/arm/mach-s3c2440/irq.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-s3c2443/irq.c~git-arm arch/arm/mach-s3c2443/irq.c --- a/arch/arm/mach-s3c2443/irq.c~git-arm +++ a/arch/arm/mach-s3c2443/irq.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-sa1100/irq.c~git-arm arch/arm/mach-sa1100/irq.c --- a/arch/arm/mach-sa1100/irq.c~git-arm +++ a/arch/arm/mach-sa1100/irq.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mach-sa1100/neponset.c~git-arm arch/arm/mach-sa1100/neponset.c --- a/arch/arm/mach-sa1100/neponset.c~git-arm +++ a/arch/arm/mach-sa1100/neponset.c @@ -4,7 +4,6 @@ */ #include #include -#include #include #include #include diff -puN arch/arm/mach-shark/irq.c~git-arm arch/arm/mach-shark/irq.c --- a/arch/arm/mach-shark/irq.c~git-arm +++ a/arch/arm/mach-shark/irq.c @@ -10,7 +10,6 @@ #include #include -#include #include #include diff -puN arch/arm/mach-versatile/pci.c~git-arm arch/arm/mach-versatile/pci.c --- a/arch/arm/mach-versatile/pci.c~git-arm +++ a/arch/arm/mach-versatile/pci.c @@ -16,7 +16,6 @@ */ #include #include -#include #include #include #include diff -puN arch/arm/mm/alignment.c~git-arm arch/arm/mm/alignment.c --- a/arch/arm/mm/alignment.c~git-arm +++ a/arch/arm/mm/alignment.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/mm/fault.c~git-arm arch/arm/mm/fault.c --- a/arch/arm/mm/fault.c~git-arm +++ a/arch/arm/mm/fault.c @@ -10,7 +10,6 @@ */ #include #include -#include #include #include @@ -438,7 +437,7 @@ hook_fault_code(int nr, int (*fn)(unsign /* * Dispatch a data abort to the relevant handler. */ -asmlinkage void +asmlinkage void __exception do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) { const struct fsr_info *inf = fsr_info + (fsr & 15) + ((fsr & (1 << 10)) >> 6); @@ -457,7 +456,7 @@ do_DataAbort(unsigned long addr, unsigne notify_die("", regs, &info, fsr, 0); } -asmlinkage void +asmlinkage void __exception do_PrefetchAbort(unsigned long addr, struct pt_regs *regs) { do_translation_fault(addr, 0, regs); diff -puN arch/arm/mm/init.c~git-arm arch/arm/mm/init.c --- a/arch/arm/mm/init.c~git-arm +++ a/arch/arm/mm/init.c @@ -9,7 +9,6 @@ */ #include #include -#include #include #include #include diff -puN arch/arm/plat-omap/gpio.c~git-arm arch/arm/plat-omap/gpio.c --- a/arch/arm/plat-omap/gpio.c~git-arm +++ a/arch/arm/plat-omap/gpio.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff -puN arch/arm/plat-s3c24xx/irq.c~git-arm arch/arm/plat-s3c24xx/irq.c --- a/arch/arm/plat-s3c24xx/irq.c~git-arm +++ a/arch/arm/plat-s3c24xx/irq.c @@ -54,7 +54,6 @@ #include #include #include -#include #include #include diff -puN arch/arm/plat-s3c24xx/s3c244x-irq.c~git-arm arch/arm/plat-s3c24xx/s3c244x-irq.c --- a/arch/arm/plat-s3c24xx/s3c244x-irq.c~git-arm +++ a/arch/arm/plat-s3c24xx/s3c244x-irq.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff -puN drivers/i2c/busses/i2c-pxa.c~git-arm drivers/i2c/busses/i2c-pxa.c --- a/drivers/i2c/busses/i2c-pxa.c~git-arm +++ a/drivers/i2c/busses/i2c-pxa.c @@ -839,9 +839,7 @@ static int i2c_pxa_probe(struct platform { struct pxa_i2c *i2c = &i2c_pxa; struct resource *res; -#ifdef CONFIG_I2C_PXA_SLAVE struct i2c_pxa_platform_data *plat = dev->dev.platform_data; -#endif int ret; int irq; @@ -911,6 +909,10 @@ static int i2c_pxa_probe(struct platform i2c->adap.algo_data = i2c; i2c->adap.dev.parent = &dev->dev; + if (plat) { + i2c->adap.class = plat->class; + } + ret = i2c_add_adapter(&i2c->adap); if (ret < 0) { printk(KERN_INFO "I2C: Failed to add bus\n"); diff -puN include/asm-arm/arch-ebsa110/io.h~git-arm include/asm-arm/arch-ebsa110/io.h --- a/include/asm-arm/arch-ebsa110/io.h~git-arm +++ a/include/asm-arm/arch-ebsa110/io.h @@ -81,4 +81,12 @@ extern void outsb(unsigned int port, con extern void outsw(unsigned int port, const void *buf, int sz); extern void outsl(unsigned int port, const void *buf, int sz); +/* can't support writesb atm */ +extern void writesw(void __iomem *addr, const void *data, int wordlen); +extern void writesl(void __iomem *addr, const void *data, int longlen); + +/* can't support readsb atm */ +extern void readsw(const void __iomem *addr, void *data, int wordlen); +extern void readsl(const void __iomem *addr, void *data, int longlen); + #endif diff -puN include/asm-arm/arch-pxa/i2c.h~git-arm include/asm-arm/arch-pxa/i2c.h --- a/include/asm-arm/arch-pxa/i2c.h~git-arm +++ a/include/asm-arm/arch-pxa/i2c.h @@ -64,6 +64,7 @@ struct i2c_slave_client; struct i2c_pxa_platform_data { unsigned int slave_addr; struct i2c_slave_client *slave; + unsigned int class; }; extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info); diff -puN include/asm-arm/system.h~git-arm include/asm-arm/system.h --- a/include/asm-arm/system.h~git-arm +++ a/include/asm-arm/system.h @@ -75,6 +75,8 @@ #include #include +#define __exception __attribute__((section(".exception.text"))) + struct thread_info; struct task_struct; _