diff options
48 files changed, 554 insertions, 243 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ade7e924bef5..bbd48cc1ad20 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -5,8 +5,9 @@ config ARM | |||
5 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE | 5 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE |
6 | select ARCH_HAVE_CUSTOM_GPIO_H | 6 | select ARCH_HAVE_CUSTOM_GPIO_H |
7 | select ARCH_WANT_IPC_PARSE_VERSION | 7 | select ARCH_WANT_IPC_PARSE_VERSION |
8 | select BUILDTIME_EXTABLE_SORT if MMU | ||
8 | select CPU_PM if (SUSPEND || CPU_IDLE) | 9 | select CPU_PM if (SUSPEND || CPU_IDLE) |
9 | select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN | 10 | select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN && MMU |
10 | select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI) | 11 | select GENERIC_ATOMIC64 if (CPU_V6 || !CPU_32v6K || !AEABI) |
11 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP | 12 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP |
12 | select GENERIC_IRQ_PROBE | 13 | select GENERIC_IRQ_PROBE |
@@ -21,6 +22,7 @@ config ARM | |||
21 | select HAVE_AOUT | 22 | select HAVE_AOUT |
22 | select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL | 23 | select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL |
23 | select HAVE_ARCH_KGDB | 24 | select HAVE_ARCH_KGDB |
25 | select HAVE_ARCH_SECCOMP_FILTER | ||
24 | select HAVE_ARCH_TRACEHOOK | 26 | select HAVE_ARCH_TRACEHOOK |
25 | select HAVE_BPF_JIT | 27 | select HAVE_BPF_JIT |
26 | select HAVE_C_RECORDMCOUNT | 28 | select HAVE_C_RECORDMCOUNT |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 5f914fca911b..03363e202a5b 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -32,6 +32,7 @@ KBUILD_DEFCONFIG := versatile_defconfig | |||
32 | # defines filename extension depending memory management type. | 32 | # defines filename extension depending memory management type. |
33 | ifeq ($(CONFIG_MMU),) | 33 | ifeq ($(CONFIG_MMU),) |
34 | MMUEXT := -nommu | 34 | MMUEXT := -nommu |
35 | KBUILD_CFLAGS += $(call cc-option,-mno-unaligned-access) | ||
35 | endif | 36 | endif |
36 | 37 | ||
37 | ifeq ($(CONFIG_FRAME_POINTER),y) | 38 | ifeq ($(CONFIG_FRAME_POINTER),y) |
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index e0d538803cc3..e4df17ca90c7 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c | |||
@@ -218,7 +218,7 @@ static void __init vic_register(void __iomem *base, unsigned int irq, | |||
218 | v->resume_sources = resume_sources; | 218 | v->resume_sources = resume_sources; |
219 | v->irq = irq; | 219 | v->irq = irq; |
220 | vic_id++; | 220 | vic_id++; |
221 | v->domain = irq_domain_add_legacy(node, fls(valid_sources), irq, 0, | 221 | v->domain = irq_domain_add_simple(node, fls(valid_sources), irq, |
222 | &vic_irqdomain_ops, v); | 222 | &vic_irqdomain_ops, v); |
223 | } | 223 | } |
224 | 224 | ||
@@ -350,7 +350,7 @@ static void __init vic_init_st(void __iomem *base, unsigned int irq_start, | |||
350 | vic_register(base, irq_start, vic_sources, 0, node); | 350 | vic_register(base, irq_start, vic_sources, 0, node); |
351 | } | 351 | } |
352 | 352 | ||
353 | void __init __vic_init(void __iomem *base, unsigned int irq_start, | 353 | void __init __vic_init(void __iomem *base, int irq_start, |
354 | u32 vic_sources, u32 resume_sources, | 354 | u32 vic_sources, u32 resume_sources, |
355 | struct device_node *node) | 355 | struct device_node *node) |
356 | { | 356 | { |
@@ -407,7 +407,6 @@ void __init vic_init(void __iomem *base, unsigned int irq_start, | |||
407 | int __init vic_of_init(struct device_node *node, struct device_node *parent) | 407 | int __init vic_of_init(struct device_node *node, struct device_node *parent) |
408 | { | 408 | { |
409 | void __iomem *regs; | 409 | void __iomem *regs; |
410 | int irq_base; | ||
411 | 410 | ||
412 | if (WARN(parent, "non-root VICs are not supported")) | 411 | if (WARN(parent, "non-root VICs are not supported")) |
413 | return -EINVAL; | 412 | return -EINVAL; |
@@ -416,18 +415,12 @@ int __init vic_of_init(struct device_node *node, struct device_node *parent) | |||
416 | if (WARN_ON(!regs)) | 415 | if (WARN_ON(!regs)) |
417 | return -EIO; | 416 | return -EIO; |
418 | 417 | ||
419 | irq_base = irq_alloc_descs(-1, 0, 32, numa_node_id()); | 418 | /* |
420 | if (WARN_ON(irq_base < 0)) | 419 | * Passing -1 as first IRQ makes the simple domain allocate descriptors |
421 | goto out_unmap; | 420 | */ |
422 | 421 | __vic_init(regs, -1, ~0, ~0, node); | |
423 | __vic_init(regs, irq_base, ~0, ~0, node); | ||
424 | 422 | ||
425 | return 0; | 423 | return 0; |
426 | |||
427 | out_unmap: | ||
428 | iounmap(regs); | ||
429 | |||
430 | return -EIO; | ||
431 | } | 424 | } |
432 | #endif /* CONFIG OF */ | 425 | #endif /* CONFIG OF */ |
433 | 426 | ||
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h index c4c87bc12231..3b2c40b5bfa2 100644 --- a/arch/arm/include/asm/hardware/cache-l2x0.h +++ b/arch/arm/include/asm/hardware/cache-l2x0.h | |||
@@ -102,6 +102,10 @@ | |||
102 | 102 | ||
103 | #define L2X0_ADDR_FILTER_EN 1 | 103 | #define L2X0_ADDR_FILTER_EN 1 |
104 | 104 | ||
105 | #define L2X0_CTRL_EN 1 | ||
106 | |||
107 | #define L2X0_WAY_SIZE_SHIFT 3 | ||
108 | |||
105 | #ifndef __ASSEMBLY__ | 109 | #ifndef __ASSEMBLY__ |
106 | extern void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask); | 110 | extern void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask); |
107 | #if defined(CONFIG_CACHE_L2X0) && defined(CONFIG_OF) | 111 | #if defined(CONFIG_CACHE_L2X0) && defined(CONFIG_OF) |
@@ -126,6 +130,7 @@ struct l2x0_regs { | |||
126 | unsigned long filter_end; | 130 | unsigned long filter_end; |
127 | unsigned long prefetch_ctrl; | 131 | unsigned long prefetch_ctrl; |
128 | unsigned long pwr_ctrl; | 132 | unsigned long pwr_ctrl; |
133 | unsigned long ctrl; | ||
129 | }; | 134 | }; |
130 | 135 | ||
131 | extern struct l2x0_regs l2x0_saved_regs; | 136 | extern struct l2x0_regs l2x0_saved_regs; |
diff --git a/arch/arm/include/asm/hardware/vic.h b/arch/arm/include/asm/hardware/vic.h index e14af1a1a320..2bebad36fc83 100644 --- a/arch/arm/include/asm/hardware/vic.h +++ b/arch/arm/include/asm/hardware/vic.h | |||
@@ -47,7 +47,7 @@ | |||
47 | struct device_node; | 47 | struct device_node; |
48 | struct pt_regs; | 48 | struct pt_regs; |
49 | 49 | ||
50 | void __vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, | 50 | void __vic_init(void __iomem *base, int irq_start, u32 vic_sources, |
51 | u32 resume_sources, struct device_node *node); | 51 | u32 resume_sources, struct device_node *node); |
52 | void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources); | 52 | void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources); |
53 | int vic_of_init(struct device_node *node, struct device_node *parent); | 53 | int vic_of_init(struct device_node *node, struct device_node *parent); |
diff --git a/arch/arm/include/asm/mach/serial_at91.h b/arch/arm/include/asm/mach/serial_at91.h deleted file mode 100644 index ea6d063923b8..000000000000 --- a/arch/arm/include/asm/mach/serial_at91.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/mach/serial_at91.h | ||
3 | * | ||
4 | * Based on serial_sa1100.h by Nicolas Pitre | ||
5 | * | ||
6 | * Copyright (C) 2002 ATMEL Rousset | ||
7 | * | ||
8 | * Low level machine dependent UART functions. | ||
9 | */ | ||
10 | |||
11 | struct uart_port; | ||
12 | |||
13 | /* | ||
14 | * This is a temporary structure for registering these | ||
15 | * functions; it is intended to be discarded after boot. | ||
16 | */ | ||
17 | struct atmel_port_fns { | ||
18 | void (*set_mctrl)(struct uart_port *, u_int); | ||
19 | u_int (*get_mctrl)(struct uart_port *); | ||
20 | void (*enable_ms)(struct uart_port *); | ||
21 | void (*pm)(struct uart_port *, u_int, u_int); | ||
22 | int (*set_wake)(struct uart_port *, u_int); | ||
23 | int (*open)(struct uart_port *); | ||
24 | void (*close)(struct uart_port *); | ||
25 | }; | ||
26 | |||
27 | #if defined(CONFIG_SERIAL_ATMEL) | ||
28 | void atmel_register_uart_fns(struct atmel_port_fns *fns); | ||
29 | #else | ||
30 | #define atmel_register_uart_fns(fns) do { } while (0) | ||
31 | #endif | ||
32 | |||
33 | |||
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h index 2e3be16c6766..d3a22bebe6ce 100644 --- a/arch/arm/include/asm/smp.h +++ b/arch/arm/include/asm/smp.h | |||
@@ -79,6 +79,7 @@ extern void cpu_die(void); | |||
79 | 79 | ||
80 | extern void arch_send_call_function_single_ipi(int cpu); | 80 | extern void arch_send_call_function_single_ipi(int cpu); |
81 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | 81 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
82 | extern void arch_send_wakeup_ipi_mask(const struct cpumask *mask); | ||
82 | 83 | ||
83 | struct smp_operations { | 84 | struct smp_operations { |
84 | #ifdef CONFIG_SMP | 85 | #ifdef CONFIG_SMP |
diff --git a/arch/arm/include/asm/syscall.h b/arch/arm/include/asm/syscall.h index 9fdded6b1089..f1d96d4e8092 100644 --- a/arch/arm/include/asm/syscall.h +++ b/arch/arm/include/asm/syscall.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #ifndef _ASM_ARM_SYSCALL_H | 7 | #ifndef _ASM_ARM_SYSCALL_H |
8 | #define _ASM_ARM_SYSCALL_H | 8 | #define _ASM_ARM_SYSCALL_H |
9 | 9 | ||
10 | #include <linux/audit.h> /* for AUDIT_ARCH_* */ | ||
11 | #include <linux/elf.h> /* for ELF_EM */ | ||
10 | #include <linux/err.h> | 12 | #include <linux/err.h> |
11 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
12 | 14 | ||
@@ -95,4 +97,11 @@ static inline void syscall_set_arguments(struct task_struct *task, | |||
95 | memcpy(®s->ARM_r0 + i, args, n * sizeof(args[0])); | 97 | memcpy(®s->ARM_r0 + i, args, n * sizeof(args[0])); |
96 | } | 98 | } |
97 | 99 | ||
100 | static inline int syscall_get_arch(struct task_struct *task, | ||
101 | struct pt_regs *regs) | ||
102 | { | ||
103 | /* ARM tasks don't change audit architectures on the fly. */ | ||
104 | return AUDIT_ARCH_ARM; | ||
105 | } | ||
106 | |||
98 | #endif /* _ASM_ARM_SYSCALL_H */ | 107 | #endif /* _ASM_ARM_SYSCALL_H */ |
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index 8477b4c1d39f..cddda1f41f0f 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h | |||
@@ -151,10 +151,10 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, | |||
151 | #define TIF_SYSCALL_TRACE 8 | 151 | #define TIF_SYSCALL_TRACE 8 |
152 | #define TIF_SYSCALL_AUDIT 9 | 152 | #define TIF_SYSCALL_AUDIT 9 |
153 | #define TIF_SYSCALL_TRACEPOINT 10 | 153 | #define TIF_SYSCALL_TRACEPOINT 10 |
154 | #define TIF_SECCOMP 11 /* seccomp syscall filtering active */ | ||
154 | #define TIF_USING_IWMMXT 17 | 155 | #define TIF_USING_IWMMXT 17 |
155 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ | 156 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
156 | #define TIF_RESTORE_SIGMASK 20 | 157 | #define TIF_RESTORE_SIGMASK 20 |
157 | #define TIF_SECCOMP 21 | ||
158 | #define TIF_SWITCH_MM 22 /* deferred switch_mm */ | 158 | #define TIF_SWITCH_MM 22 /* deferred switch_mm */ |
159 | 159 | ||
160 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 160 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
@@ -163,11 +163,12 @@ extern int vfp_restore_user_hwstate(struct user_vfp __user *, | |||
163 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 163 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
164 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) | 164 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) |
165 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) | 165 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) |
166 | #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) | ||
167 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) | 166 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) |
167 | #define _TIF_USING_IWMMXT (1 << TIF_USING_IWMMXT) | ||
168 | 168 | ||
169 | /* Checks for any syscall work in entry-common.S */ | 169 | /* Checks for any syscall work in entry-common.S */ |
170 | #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SYSCALL_TRACEPOINT) | 170 | #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ |
171 | _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP) | ||
171 | 172 | ||
172 | /* | 173 | /* |
173 | * Change these and you break ASM code in entry-common.S | 174 | * Change these and you break ASM code in entry-common.S |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 34711757ba59..804153c0a9cf 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -417,16 +417,6 @@ local_restart: | |||
417 | ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing | 417 | ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing |
418 | stmdb sp!, {r4, r5} @ push fifth and sixth args | 418 | stmdb sp!, {r4, r5} @ push fifth and sixth args |
419 | 419 | ||
420 | #ifdef CONFIG_SECCOMP | ||
421 | tst r10, #_TIF_SECCOMP | ||
422 | beq 1f | ||
423 | mov r0, scno | ||
424 | bl __secure_computing | ||
425 | add r0, sp, #S_R0 + S_OFF @ pointer to regs | ||
426 | ldmia r0, {r0 - r3} @ have to reload r0 - r3 | ||
427 | 1: | ||
428 | #endif | ||
429 | |||
430 | tst r10, #_TIF_SYSCALL_WORK @ are we tracing syscalls? | 420 | tst r10, #_TIF_SYSCALL_WORK @ are we tracing syscalls? |
431 | bne __sys_trace | 421 | bne __sys_trace |
432 | 422 | ||
@@ -458,11 +448,13 @@ __sys_trace: | |||
458 | ldmccia r1, {r0 - r6} @ have to reload r0 - r6 | 448 | ldmccia r1, {r0 - r6} @ have to reload r0 - r6 |
459 | stmccia sp, {r4, r5} @ and update the stack args | 449 | stmccia sp, {r4, r5} @ and update the stack args |
460 | ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine | 450 | ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine |
461 | b 2b | 451 | cmp scno, #-1 @ skip the syscall? |
452 | bne 2b | ||
453 | add sp, sp, #S_OFF @ restore stack | ||
454 | b ret_slow_syscall | ||
462 | 455 | ||
463 | __sys_trace_return: | 456 | __sys_trace_return: |
464 | str r0, [sp, #S_R0 + S_OFF]! @ save returned r0 | 457 | str r0, [sp, #S_R0 + S_OFF]! @ save returned r0 |
465 | mov r1, scno | ||
466 | mov r0, sp | 458 | mov r0, sp |
467 | bl syscall_trace_exit | 459 | bl syscall_trace_exit |
468 | b ret_slow_syscall | 460 | b ret_slow_syscall |
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index 278cfc144f44..2c228a07e58c 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S | |||
@@ -68,7 +68,7 @@ __after_proc_init: | |||
68 | * CP15 system control register value returned in r0 from | 68 | * CP15 system control register value returned in r0 from |
69 | * the CPU init function. | 69 | * the CPU init function. |
70 | */ | 70 | */ |
71 | #ifdef CONFIG_ALIGNMENT_TRAP | 71 | #if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6 |
72 | orr r0, r0, #CR_A | 72 | orr r0, r0, #CR_A |
73 | #else | 73 | #else |
74 | bic r0, r0, #CR_A | 74 | bic r0, r0, #CR_A |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 90084a6de35a..44bc0b327e2b 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/leds.h> | 34 | #include <linux/leds.h> |
35 | 35 | ||
36 | #include <asm/cacheflush.h> | 36 | #include <asm/cacheflush.h> |
37 | #include <asm/idmap.h> | ||
37 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
38 | #include <asm/thread_notify.h> | 39 | #include <asm/thread_notify.h> |
39 | #include <asm/stacktrace.h> | 40 | #include <asm/stacktrace.h> |
@@ -56,8 +57,6 @@ static const char *isa_modes[] = { | |||
56 | "ARM" , "Thumb" , "Jazelle", "ThumbEE" | 57 | "ARM" , "Thumb" , "Jazelle", "ThumbEE" |
57 | }; | 58 | }; |
58 | 59 | ||
59 | extern void setup_mm_for_reboot(void); | ||
60 | |||
61 | static volatile int hlt_counter; | 60 | static volatile int hlt_counter; |
62 | 61 | ||
63 | void disable_hlt(void) | 62 | void disable_hlt(void) |
@@ -70,6 +69,7 @@ EXPORT_SYMBOL(disable_hlt); | |||
70 | void enable_hlt(void) | 69 | void enable_hlt(void) |
71 | { | 70 | { |
72 | hlt_counter--; | 71 | hlt_counter--; |
72 | BUG_ON(hlt_counter < 0); | ||
73 | } | 73 | } |
74 | 74 | ||
75 | EXPORT_SYMBOL(enable_hlt); | 75 | EXPORT_SYMBOL(enable_hlt); |
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 739db3a1b2d2..03deeffd9f6d 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -916,16 +916,11 @@ enum ptrace_syscall_dir { | |||
916 | PTRACE_SYSCALL_EXIT, | 916 | PTRACE_SYSCALL_EXIT, |
917 | }; | 917 | }; |
918 | 918 | ||
919 | static int ptrace_syscall_trace(struct pt_regs *regs, int scno, | 919 | static int tracehook_report_syscall(struct pt_regs *regs, |
920 | enum ptrace_syscall_dir dir) | 920 | enum ptrace_syscall_dir dir) |
921 | { | 921 | { |
922 | unsigned long ip; | 922 | unsigned long ip; |
923 | 923 | ||
924 | current_thread_info()->syscall = scno; | ||
925 | |||
926 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | ||
927 | return scno; | ||
928 | |||
929 | /* | 924 | /* |
930 | * IP is used to denote syscall entry/exit: | 925 | * IP is used to denote syscall entry/exit: |
931 | * IP = 0 -> entry, =1 -> exit | 926 | * IP = 0 -> entry, =1 -> exit |
@@ -944,19 +939,41 @@ static int ptrace_syscall_trace(struct pt_regs *regs, int scno, | |||
944 | 939 | ||
945 | asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno) | 940 | asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno) |
946 | { | 941 | { |
947 | scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_ENTER); | 942 | current_thread_info()->syscall = scno; |
943 | |||
944 | /* Do the secure computing check first; failures should be fast. */ | ||
945 | if (secure_computing(scno) == -1) | ||
946 | return -1; | ||
947 | |||
948 | if (test_thread_flag(TIF_SYSCALL_TRACE)) | ||
949 | scno = tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER); | ||
950 | |||
948 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) | 951 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) |
949 | trace_sys_enter(regs, scno); | 952 | trace_sys_enter(regs, scno); |
953 | |||
950 | audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1, | 954 | audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0, regs->ARM_r1, |
951 | regs->ARM_r2, regs->ARM_r3); | 955 | regs->ARM_r2, regs->ARM_r3); |
956 | |||
952 | return scno; | 957 | return scno; |
953 | } | 958 | } |
954 | 959 | ||
955 | asmlinkage int syscall_trace_exit(struct pt_regs *regs, int scno) | 960 | asmlinkage void syscall_trace_exit(struct pt_regs *regs) |
956 | { | 961 | { |
957 | scno = ptrace_syscall_trace(regs, scno, PTRACE_SYSCALL_EXIT); | 962 | /* |
958 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) | 963 | * Audit the syscall before anything else, as a debugger may |
959 | trace_sys_exit(regs, scno); | 964 | * come in and change the current registers. |
965 | */ | ||
960 | audit_syscall_exit(regs); | 966 | audit_syscall_exit(regs); |
961 | return scno; | 967 | |
968 | /* | ||
969 | * Note that we haven't updated the ->syscall field for the | ||
970 | * current thread. This isn't a problem because it will have | ||
971 | * been set on syscall entry and there hasn't been an opportunity | ||
972 | * for a PTRACE_SET_SYSCALL since then. | ||
973 | */ | ||
974 | if (test_thread_flag(TIF_SYSCALL_TRACEPOINT)) | ||
975 | trace_sys_exit(regs, regs_return_value(regs)); | ||
976 | |||
977 | if (test_thread_flag(TIF_SYSCALL_TRACE)) | ||
978 | tracehook_report_syscall(regs, PTRACE_SYSCALL_EXIT); | ||
962 | } | 979 | } |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index fc4d526e2906..57f537731979 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -421,6 +421,11 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask) | |||
421 | smp_cross_call(mask, IPI_CALL_FUNC); | 421 | smp_cross_call(mask, IPI_CALL_FUNC); |
422 | } | 422 | } |
423 | 423 | ||
424 | void arch_send_wakeup_ipi_mask(const struct cpumask *mask) | ||
425 | { | ||
426 | smp_cross_call(mask, IPI_WAKEUP); | ||
427 | } | ||
428 | |||
424 | void arch_send_call_function_single_ipi(int cpu) | 429 | void arch_send_call_function_single_ipi(int cpu) |
425 | { | 430 | { |
426 | smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); | 431 | smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE); |
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index b22d700fea27..ff07879ad95d 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
@@ -31,6 +31,8 @@ static void __iomem *twd_base; | |||
31 | 31 | ||
32 | static struct clk *twd_clk; | 32 | static struct clk *twd_clk; |
33 | static unsigned long twd_timer_rate; | 33 | static unsigned long twd_timer_rate; |
34 | static bool common_setup_called; | ||
35 | static DEFINE_PER_CPU(bool, percpu_setup_called); | ||
34 | 36 | ||
35 | static struct clock_event_device __percpu **twd_evt; | 37 | static struct clock_event_device __percpu **twd_evt; |
36 | static int twd_ppi; | 38 | static int twd_ppi; |
@@ -248,17 +250,9 @@ static struct clk *twd_get_clock(void) | |||
248 | return clk; | 250 | return clk; |
249 | } | 251 | } |
250 | 252 | ||
251 | err = clk_prepare(clk); | 253 | err = clk_prepare_enable(clk); |
252 | if (err) { | 254 | if (err) { |
253 | pr_err("smp_twd: clock failed to prepare: %d\n", err); | 255 | pr_err("smp_twd: clock failed to prepare+enable: %d\n", err); |
254 | clk_put(clk); | ||
255 | return ERR_PTR(err); | ||
256 | } | ||
257 | |||
258 | err = clk_enable(clk); | ||
259 | if (err) { | ||
260 | pr_err("smp_twd: clock failed to enable: %d\n", err); | ||
261 | clk_unprepare(clk); | ||
262 | clk_put(clk); | 256 | clk_put(clk); |
263 | return ERR_PTR(err); | 257 | return ERR_PTR(err); |
264 | } | 258 | } |
@@ -272,15 +266,45 @@ static struct clk *twd_get_clock(void) | |||
272 | static int __cpuinit twd_timer_setup(struct clock_event_device *clk) | 266 | static int __cpuinit twd_timer_setup(struct clock_event_device *clk) |
273 | { | 267 | { |
274 | struct clock_event_device **this_cpu_clk; | 268 | struct clock_event_device **this_cpu_clk; |
269 | int cpu = smp_processor_id(); | ||
270 | |||
271 | /* | ||
272 | * If the basic setup for this CPU has been done before don't | ||
273 | * bother with the below. | ||
274 | */ | ||
275 | if (per_cpu(percpu_setup_called, cpu)) { | ||
276 | __raw_writel(0, twd_base + TWD_TIMER_CONTROL); | ||
277 | clockevents_register_device(*__this_cpu_ptr(twd_evt)); | ||
278 | enable_percpu_irq(clk->irq, 0); | ||
279 | return 0; | ||
280 | } | ||
281 | per_cpu(percpu_setup_called, cpu) = true; | ||
275 | 282 | ||
276 | if (!twd_clk) | 283 | /* |
284 | * This stuff only need to be done once for the entire TWD cluster | ||
285 | * during the runtime of the system. | ||
286 | */ | ||
287 | if (!common_setup_called) { | ||
277 | twd_clk = twd_get_clock(); | 288 | twd_clk = twd_get_clock(); |
278 | 289 | ||
279 | if (!IS_ERR_OR_NULL(twd_clk)) | 290 | /* |
280 | twd_timer_rate = clk_get_rate(twd_clk); | 291 | * We use IS_ERR_OR_NULL() here, because if the clock stubs |
281 | else | 292 | * are active we will get a valid clk reference which is |
282 | twd_calibrate_rate(); | 293 | * however NULL and will return the rate 0. In that case we |
294 | * need to calibrate the rate instead. | ||
295 | */ | ||
296 | if (!IS_ERR_OR_NULL(twd_clk)) | ||
297 | twd_timer_rate = clk_get_rate(twd_clk); | ||
298 | else | ||
299 | twd_calibrate_rate(); | ||
300 | |||
301 | common_setup_called = true; | ||
302 | } | ||
283 | 303 | ||
304 | /* | ||
305 | * The following is done once per CPU the first time .setup() is | ||
306 | * called. | ||
307 | */ | ||
284 | __raw_writel(0, twd_base + TWD_TIMER_CONTROL); | 308 | __raw_writel(0, twd_base + TWD_TIMER_CONTROL); |
285 | 309 | ||
286 | clk->name = "local_timer"; | 310 | clk->name = "local_timer"; |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 36ff15bbfdd4..b9f38e388b43 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -114,6 +114,15 @@ SECTIONS | |||
114 | 114 | ||
115 | RO_DATA(PAGE_SIZE) | 115 | RO_DATA(PAGE_SIZE) |
116 | 116 | ||
117 | . = ALIGN(4); | ||
118 | __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { | ||
119 | __start___ex_table = .; | ||
120 | #ifdef CONFIG_MMU | ||
121 | *(__ex_table) | ||
122 | #endif | ||
123 | __stop___ex_table = .; | ||
124 | } | ||
125 | |||
117 | #ifdef CONFIG_ARM_UNWIND | 126 | #ifdef CONFIG_ARM_UNWIND |
118 | /* | 127 | /* |
119 | * Stack unwinding tables | 128 | * Stack unwinding tables |
@@ -220,16 +229,6 @@ SECTIONS | |||
220 | READ_MOSTLY_DATA(L1_CACHE_BYTES) | 229 | READ_MOSTLY_DATA(L1_CACHE_BYTES) |
221 | 230 | ||
222 | /* | 231 | /* |
223 | * The exception fixup table (might need resorting at runtime) | ||
224 | */ | ||
225 | . = ALIGN(4); | ||
226 | __start___ex_table = .; | ||
227 | #ifdef CONFIG_MMU | ||
228 | *(__ex_table) | ||
229 | #endif | ||
230 | __stop___ex_table = .; | ||
231 | |||
232 | /* | ||
233 | * and the usual data section | 232 | * and the usual data section |
234 | */ | 233 | */ |
235 | DATA_DATA | 234 | DATA_DATA |
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index e428f3ab15c7..5973109fb874 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -402,9 +402,10 @@ static int impd1_probe(struct lm_device *dev) | |||
402 | 402 | ||
403 | pc_base = dev->resource.start + idev->offset; | 403 | pc_base = dev->resource.start + idev->offset; |
404 | snprintf(devname, 32, "lm%x:%5.5lx", dev->id, idev->offset >> 12); | 404 | snprintf(devname, 32, "lm%x:%5.5lx", dev->id, idev->offset >> 12); |
405 | d = amba_ahb_device_add(&dev->dev, devname, pc_base, SZ_4K, | 405 | d = amba_ahb_device_add_res(&dev->dev, devname, pc_base, SZ_4K, |
406 | dev->irq, dev->irq, | 406 | dev->irq, dev->irq, |
407 | idev->platform_data, idev->id); | 407 | idev->platform_data, idev->id, |
408 | &dev->resource); | ||
408 | if (IS_ERR(d)) { | 409 | if (IS_ERR(d)) { |
409 | dev_err(&dev->dev, "unable to register device: %ld\n", PTR_ERR(d)); | 410 | dev_err(&dev->dev, "unable to register device: %ld\n", PTR_ERR(d)); |
410 | continue; | 411 | continue; |
diff --git a/arch/arm/mach-ixp4xx/include/mach/udc.h b/arch/arm/mach-ixp4xx/include/mach/udc.h index 80d6da2eafac..7bd8b96c8843 100644 --- a/arch/arm/mach-ixp4xx/include/mach/udc.h +++ b/arch/arm/mach-ixp4xx/include/mach/udc.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * arch/arm/mach-ixp4xx/include/mach/udc.h | 2 | * arch/arm/mach-ixp4xx/include/mach/udc.h |
3 | * | 3 | * |
4 | */ | 4 | */ |
5 | #include <asm/mach/udc_pxa2xx.h> | 5 | #include <linux/platform_data/pxa2xx_udc.h> |
6 | 6 | ||
7 | extern void ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info); | 7 | extern void ixp4xx_set_udc_info(struct pxa2xx_udc_mach_info *info); |
8 | 8 | ||
diff --git a/arch/arm/mach-pxa/include/mach/udc.h b/arch/arm/mach-pxa/include/mach/udc.h index 2f82332e81a0..9a827e32db98 100644 --- a/arch/arm/mach-pxa/include/mach/udc.h +++ b/arch/arm/mach-pxa/include/mach/udc.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * arch/arm/mach-pxa/include/mach/udc.h | 2 | * arch/arm/mach-pxa/include/mach/udc.h |
3 | * | 3 | * |
4 | */ | 4 | */ |
5 | #include <asm/mach/udc_pxa2xx.h> | 5 | #include <linux/platform_data/pxa2xx_udc.h> |
6 | 6 | ||
7 | extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); | 7 | extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info); |
8 | 8 | ||
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c index 6a7ad3c2a3fc..9a23739f7026 100644 --- a/arch/arm/mach-sa1100/assabet.c +++ b/arch/arm/mach-sa1100/assabet.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
16 | #include <linux/ioport.h> | 16 | #include <linux/ioport.h> |
17 | #include <linux/platform_data/sa11x0-serial.h> | ||
17 | #include <linux/serial_core.h> | 18 | #include <linux/serial_core.h> |
18 | #include <linux/mfd/ucb1x00.h> | 19 | #include <linux/mfd/ucb1x00.h> |
19 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
@@ -37,7 +38,6 @@ | |||
37 | #include <asm/mach/flash.h> | 38 | #include <asm/mach/flash.h> |
38 | #include <asm/mach/irda.h> | 39 | #include <asm/mach/irda.h> |
39 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
40 | #include <asm/mach/serial_sa1100.h> | ||
41 | #include <mach/assabet.h> | 41 | #include <mach/assabet.h> |
42 | #include <linux/platform_data/mfd-mcp-sa11x0.h> | 42 | #include <linux/platform_data/mfd-mcp-sa11x0.h> |
43 | #include <mach/irqs.h> | 43 | #include <mach/irqs.h> |
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c index 038df4894b0f..b2dadf3ea3df 100644 --- a/arch/arm/mach-sa1100/badge4.c +++ b/arch/arm/mach-sa1100/badge4.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/platform_data/sa11x0-serial.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
21 | #include <linux/tty.h> | 22 | #include <linux/tty.h> |
@@ -34,7 +35,6 @@ | |||
34 | #include <asm/mach/flash.h> | 35 | #include <asm/mach/flash.h> |
35 | #include <asm/mach/map.h> | 36 | #include <asm/mach/map.h> |
36 | #include <asm/hardware/sa1111.h> | 37 | #include <asm/hardware/sa1111.h> |
37 | #include <asm/mach/serial_sa1100.h> | ||
38 | 38 | ||
39 | #include <mach/badge4.h> | 39 | #include <mach/badge4.h> |
40 | 40 | ||
diff --git a/arch/arm/mach-sa1100/cerf.c b/arch/arm/mach-sa1100/cerf.c index ad0eb08ea077..304bca4a07c0 100644 --- a/arch/arm/mach-sa1100/cerf.c +++ b/arch/arm/mach-sa1100/cerf.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/tty.h> | 15 | #include <linux/tty.h> |
16 | #include <linux/platform_data/sa11x0-serial.h> | ||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
18 | #include <linux/mtd/mtd.h> | 19 | #include <linux/mtd/mtd.h> |
@@ -27,7 +28,6 @@ | |||
27 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/flash.h> | 29 | #include <asm/mach/flash.h> |
29 | #include <asm/mach/map.h> | 30 | #include <asm/mach/map.h> |
30 | #include <asm/mach/serial_sa1100.h> | ||
31 | 31 | ||
32 | #include <mach/cerf.h> | 32 | #include <mach/cerf.h> |
33 | #include <linux/platform_data/mfd-mcp-sa11x0.h> | 33 | #include <linux/platform_data/mfd-mcp-sa11x0.h> |
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 170cb6107f68..45f424f5fca6 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/tty.h> | 22 | #include <linux/tty.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/platform_data/sa11x0-serial.h> | ||
24 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
25 | #include <linux/mfd/ucb1x00.h> | 26 | #include <linux/mfd/ucb1x00.h> |
26 | #include <linux/mtd/mtd.h> | 27 | #include <linux/mtd/mtd.h> |
@@ -40,7 +41,6 @@ | |||
40 | #include <asm/mach/arch.h> | 41 | #include <asm/mach/arch.h> |
41 | #include <asm/mach/flash.h> | 42 | #include <asm/mach/flash.h> |
42 | #include <asm/mach/map.h> | 43 | #include <asm/mach/map.h> |
43 | #include <asm/mach/serial_sa1100.h> | ||
44 | 44 | ||
45 | #include <asm/hardware/scoop.h> | 45 | #include <asm/hardware/scoop.h> |
46 | #include <asm/mach/sharpsl_param.h> | 46 | #include <asm/mach/sharpsl_param.h> |
diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c index 63150e1ffe9e..f17e7382242a 100644 --- a/arch/arm/mach-sa1100/h3xxx.c +++ b/arch/arm/mach-sa1100/h3xxx.c | |||
@@ -17,12 +17,12 @@ | |||
17 | #include <linux/mfd/htc-egpio.h> | 17 | #include <linux/mfd/htc-egpio.h> |
18 | #include <linux/mtd/mtd.h> | 18 | #include <linux/mtd/mtd.h> |
19 | #include <linux/mtd/partitions.h> | 19 | #include <linux/mtd/partitions.h> |
20 | #include <linux/platform_data/sa11x0-serial.h> | ||
20 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
21 | #include <linux/serial_core.h> | 22 | #include <linux/serial_core.h> |
22 | 23 | ||
23 | #include <asm/mach/flash.h> | 24 | #include <asm/mach/flash.h> |
24 | #include <asm/mach/map.h> | 25 | #include <asm/mach/map.h> |
25 | #include <asm/mach/serial_sa1100.h> | ||
26 | 26 | ||
27 | #include <mach/h3xxx.h> | 27 | #include <mach/h3xxx.h> |
28 | 28 | ||
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c index fc106aab7c7e..d005939c41fc 100644 --- a/arch/arm/mach-sa1100/hackkit.c +++ b/arch/arm/mach-sa1100/hackkit.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/cpufreq.h> | 20 | #include <linux/cpufreq.h> |
21 | #include <linux/platform_data/sa11x0-serial.h> | ||
21 | #include <linux/serial_core.h> | 22 | #include <linux/serial_core.h> |
22 | #include <linux/mtd/mtd.h> | 23 | #include <linux/mtd/mtd.h> |
23 | #include <linux/mtd/partitions.h> | 24 | #include <linux/mtd/partitions.h> |
@@ -35,7 +36,6 @@ | |||
35 | #include <asm/mach/flash.h> | 36 | #include <asm/mach/flash.h> |
36 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
37 | #include <asm/mach/irq.h> | 38 | #include <asm/mach/irq.h> |
38 | #include <asm/mach/serial_sa1100.h> | ||
39 | 39 | ||
40 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
41 | #include <mach/irqs.h> | 41 | #include <mach/irqs.h> |
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c index e3084f47027d..35cfc428b4d4 100644 --- a/arch/arm/mach-sa1100/jornada720.c +++ b/arch/arm/mach-sa1100/jornada720.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/platform_data/sa11x0-serial.h> | ||
20 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
21 | #include <linux/ioport.h> | 22 | #include <linux/ioport.h> |
22 | #include <linux/mtd/mtd.h> | 23 | #include <linux/mtd/mtd.h> |
@@ -30,7 +31,6 @@ | |||
30 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
31 | #include <asm/mach/flash.h> | 32 | #include <asm/mach/flash.h> |
32 | #include <asm/mach/map.h> | 33 | #include <asm/mach/map.h> |
33 | #include <asm/mach/serial_sa1100.h> | ||
34 | 34 | ||
35 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
36 | #include <mach/irqs.h> | 36 | #include <mach/irqs.h> |
diff --git a/arch/arm/mach-sa1100/lart.c b/arch/arm/mach-sa1100/lart.c index 3048b17e84c5..f69f78fc3ddd 100644 --- a/arch/arm/mach-sa1100/lart.c +++ b/arch/arm/mach-sa1100/lart.c | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
7 | #include <linux/platform_data/sa11x0-serial.h> | ||
7 | #include <linux/tty.h> | 8 | #include <linux/tty.h> |
8 | #include <linux/gpio.h> | 9 | #include <linux/gpio.h> |
9 | #include <linux/leds.h> | 10 | #include <linux/leds.h> |
@@ -18,7 +19,6 @@ | |||
18 | 19 | ||
19 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
20 | #include <asm/mach/map.h> | 21 | #include <asm/mach/map.h> |
21 | #include <asm/mach/serial_sa1100.h> | ||
22 | #include <linux/platform_data/mfd-mcp-sa11x0.h> | 22 | #include <linux/platform_data/mfd-mcp-sa11x0.h> |
23 | #include <mach/irqs.h> | 23 | #include <mach/irqs.h> |
24 | 24 | ||
diff --git a/arch/arm/mach-sa1100/nanoengine.c b/arch/arm/mach-sa1100/nanoengine.c index 41f69d97066f..102e08f7b109 100644 --- a/arch/arm/mach-sa1100/nanoengine.c +++ b/arch/arm/mach-sa1100/nanoengine.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/platform_data/sa11x0-serial.h> | ||
16 | #include <linux/mtd/mtd.h> | 17 | #include <linux/mtd/mtd.h> |
17 | #include <linux/mtd/partitions.h> | 18 | #include <linux/mtd/partitions.h> |
18 | #include <linux/root_dev.h> | 19 | #include <linux/root_dev.h> |
@@ -24,7 +25,6 @@ | |||
24 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
25 | #include <asm/mach/flash.h> | 26 | #include <asm/mach/flash.h> |
26 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
27 | #include <asm/mach/serial_sa1100.h> | ||
28 | 28 | ||
29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
30 | #include <mach/nanoengine.h> | 30 | #include <mach/nanoengine.h> |
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index 266db873a4e4..88be0474f3d7 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/irq.h> | 7 | #include <linux/irq.h> |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/platform_data/sa11x0-serial.h> | ||
10 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
11 | #include <linux/pm.h> | 12 | #include <linux/pm.h> |
12 | #include <linux/serial_core.h> | 13 | #include <linux/serial_core.h> |
@@ -14,7 +15,6 @@ | |||
14 | 15 | ||
15 | #include <asm/mach-types.h> | 16 | #include <asm/mach-types.h> |
16 | #include <asm/mach/map.h> | 17 | #include <asm/mach/map.h> |
17 | #include <asm/mach/serial_sa1100.h> | ||
18 | #include <asm/hardware/sa1111.h> | 18 | #include <asm/hardware/sa1111.h> |
19 | #include <asm/sizes.h> | 19 | #include <asm/sizes.h> |
20 | 20 | ||
diff --git a/arch/arm/mach-sa1100/pleb.c b/arch/arm/mach-sa1100/pleb.c index 37fe0a0a5369..c51bb63f90fb 100644 --- a/arch/arm/mach-sa1100/pleb.c +++ b/arch/arm/mach-sa1100/pleb.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
7 | #include <linux/tty.h> | 7 | #include <linux/tty.h> |
8 | #include <linux/ioport.h> | 8 | #include <linux/ioport.h> |
9 | #include <linux/platform_data/sa11x0-serial.h> | ||
9 | #include <linux/platform_device.h> | 10 | #include <linux/platform_device.h> |
10 | #include <linux/irq.h> | 11 | #include <linux/irq.h> |
11 | #include <linux/io.h> | 12 | #include <linux/io.h> |
@@ -18,7 +19,6 @@ | |||
18 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
19 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
20 | #include <asm/mach/flash.h> | 21 | #include <asm/mach/flash.h> |
21 | #include <asm/mach/serial_sa1100.h> | ||
22 | #include <mach/irqs.h> | 22 | #include <mach/irqs.h> |
23 | 23 | ||
24 | #include "generic.h" | 24 | #include "generic.h" |
diff --git a/arch/arm/mach-sa1100/shannon.c b/arch/arm/mach-sa1100/shannon.c index ff6b7b35bca9..6460d25fbb88 100644 --- a/arch/arm/mach-sa1100/shannon.c +++ b/arch/arm/mach-sa1100/shannon.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
6 | #include <linux/device.h> | 6 | #include <linux/device.h> |
7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
8 | #include <linux/platform_data/sa11x0-serial.h> | ||
8 | #include <linux/tty.h> | 9 | #include <linux/tty.h> |
9 | #include <linux/mtd/mtd.h> | 10 | #include <linux/mtd/mtd.h> |
10 | #include <linux/mtd/partitions.h> | 11 | #include <linux/mtd/partitions.h> |
@@ -18,7 +19,6 @@ | |||
18 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
19 | #include <asm/mach/flash.h> | 20 | #include <asm/mach/flash.h> |
20 | #include <asm/mach/map.h> | 21 | #include <asm/mach/map.h> |
21 | #include <asm/mach/serial_sa1100.h> | ||
22 | #include <linux/platform_data/mfd-mcp-sa11x0.h> | 22 | #include <linux/platform_data/mfd-mcp-sa11x0.h> |
23 | #include <mach/shannon.h> | 23 | #include <mach/shannon.h> |
24 | #include <mach/irqs.h> | 24 | #include <mach/irqs.h> |
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c index 71790e581d93..6d65f65fcb23 100644 --- a/arch/arm/mach-sa1100/simpad.c +++ b/arch/arm/mach-sa1100/simpad.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/proc_fs.h> | 9 | #include <linux/proc_fs.h> |
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/pm.h> | 11 | #include <linux/pm.h> |
12 | #include <linux/platform_data/sa11x0-serial.h> | ||
12 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
13 | #include <linux/mfd/ucb1x00.h> | 14 | #include <linux/mfd/ucb1x00.h> |
14 | #include <linux/mtd/mtd.h> | 15 | #include <linux/mtd/mtd.h> |
@@ -23,7 +24,6 @@ | |||
23 | #include <asm/mach/arch.h> | 24 | #include <asm/mach/arch.h> |
24 | #include <asm/mach/flash.h> | 25 | #include <asm/mach/flash.h> |
25 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
26 | #include <asm/mach/serial_sa1100.h> | ||
27 | #include <linux/platform_data/mfd-mcp-sa11x0.h> | 27 | #include <linux/platform_data/mfd-mcp-sa11x0.h> |
28 | #include <mach/simpad.h> | 28 | #include <mach/simpad.h> |
29 | #include <mach/irqs.h> | 29 | #include <mach/irqs.h> |
diff --git a/arch/arm/mm/cache-aurora-l2.h b/arch/arm/mm/cache-aurora-l2.h new file mode 100644 index 000000000000..c86124769831 --- /dev/null +++ b/arch/arm/mm/cache-aurora-l2.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * AURORA shared L2 cache controller support | ||
3 | * | ||
4 | * Copyright (C) 2012 Marvell | ||
5 | * | ||
6 | * Yehuda Yitschak <yehuday@marvell.com> | ||
7 | * Gregory CLEMENT <gregory.clement@free-electrons.com> | ||
8 | * | ||
9 | * This file is licensed under the terms of the GNU General Public | ||
10 | * License version 2. This program is licensed "as is" without any | ||
11 | * warranty of any kind, whether express or implied. | ||
12 | */ | ||
13 | |||
14 | #ifndef __ASM_ARM_HARDWARE_AURORA_L2_H | ||
15 | #define __ASM_ARM_HARDWARE_AURORA_L2_H | ||
16 | |||
17 | #define AURORA_SYNC_REG 0x700 | ||
18 | #define AURORA_RANGE_BASE_ADDR_REG 0x720 | ||
19 | #define AURORA_FLUSH_PHY_ADDR_REG 0x7f0 | ||
20 | #define AURORA_INVAL_RANGE_REG 0x774 | ||
21 | #define AURORA_CLEAN_RANGE_REG 0x7b4 | ||
22 | #define AURORA_FLUSH_RANGE_REG 0x7f4 | ||
23 | |||
24 | #define AURORA_ACR_REPLACEMENT_OFFSET 27 | ||
25 | #define AURORA_ACR_REPLACEMENT_MASK \ | ||
26 | (0x3 << AURORA_ACR_REPLACEMENT_OFFSET) | ||
27 | #define AURORA_ACR_REPLACEMENT_TYPE_WAYRR \ | ||
28 | (0 << AURORA_ACR_REPLACEMENT_OFFSET) | ||
29 | #define AURORA_ACR_REPLACEMENT_TYPE_LFSR \ | ||
30 | (1 << AURORA_ACR_REPLACEMENT_OFFSET) | ||
31 | #define AURORA_ACR_REPLACEMENT_TYPE_SEMIPLRU \ | ||
32 | (3 << AURORA_ACR_REPLACEMENT_OFFSET) | ||
33 | |||
34 | #define AURORA_ACR_FORCE_WRITE_POLICY_OFFSET 0 | ||
35 | #define AURORA_ACR_FORCE_WRITE_POLICY_MASK \ | ||
36 | (0x3 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET) | ||
37 | #define AURORA_ACR_FORCE_WRITE_POLICY_DIS \ | ||
38 | (0 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET) | ||
39 | #define AURORA_ACR_FORCE_WRITE_BACK_POLICY \ | ||
40 | (1 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET) | ||
41 | #define AURORA_ACR_FORCE_WRITE_THRO_POLICY \ | ||
42 | (2 << AURORA_ACR_FORCE_WRITE_POLICY_OFFSET) | ||
43 | |||
44 | #define MAX_RANGE_SIZE 1024 | ||
45 | |||
46 | #define AURORA_WAY_SIZE_SHIFT 2 | ||
47 | |||
48 | #define AURORA_CTRL_FW 0x100 | ||
49 | |||
50 | /* chose a number outside L2X0_CACHE_ID_PART_MASK to be sure to make | ||
51 | * the distinction between a number coming from hardware and a number | ||
52 | * coming from the device tree */ | ||
53 | #define AURORA_CACHE_ID 0x100 | ||
54 | |||
55 | #endif /* __ASM_ARM_HARDWARE_AURORA_L2_H */ | ||
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 8a97e6443c62..6911b8b2745c 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include <asm/cacheflush.h> | 26 | #include <asm/cacheflush.h> |
27 | #include <asm/hardware/cache-l2x0.h> | 27 | #include <asm/hardware/cache-l2x0.h> |
28 | #include "cache-aurora-l2.h" | ||
28 | 29 | ||
29 | #define CACHE_LINE_SIZE 32 | 30 | #define CACHE_LINE_SIZE 32 |
30 | 31 | ||
@@ -34,14 +35,20 @@ static u32 l2x0_way_mask; /* Bitmask of active ways */ | |||
34 | static u32 l2x0_size; | 35 | static u32 l2x0_size; |
35 | static unsigned long sync_reg_offset = L2X0_CACHE_SYNC; | 36 | static unsigned long sync_reg_offset = L2X0_CACHE_SYNC; |
36 | 37 | ||
38 | /* Aurora don't have the cache ID register available, so we have to | ||
39 | * pass it though the device tree */ | ||
40 | static u32 cache_id_part_number_from_dt; | ||
41 | |||
37 | struct l2x0_regs l2x0_saved_regs; | 42 | struct l2x0_regs l2x0_saved_regs; |
38 | 43 | ||
39 | struct l2x0_of_data { | 44 | struct l2x0_of_data { |
40 | void (*setup)(const struct device_node *, u32 *, u32 *); | 45 | void (*setup)(const struct device_node *, u32 *, u32 *); |
41 | void (*save)(void); | 46 | void (*save)(void); |
42 | void (*resume)(void); | 47 | struct outer_cache_fns outer_cache; |
43 | }; | 48 | }; |
44 | 49 | ||
50 | static bool of_init = false; | ||
51 | |||
45 | static inline void cache_wait_way(void __iomem *reg, unsigned long mask) | 52 | static inline void cache_wait_way(void __iomem *reg, unsigned long mask) |
46 | { | 53 | { |
47 | /* wait for cache operation by line or way to complete */ | 54 | /* wait for cache operation by line or way to complete */ |
@@ -168,7 +175,7 @@ static void l2x0_inv_all(void) | |||
168 | /* invalidate all ways */ | 175 | /* invalidate all ways */ |
169 | raw_spin_lock_irqsave(&l2x0_lock, flags); | 176 | raw_spin_lock_irqsave(&l2x0_lock, flags); |
170 | /* Invalidating when L2 is enabled is a nono */ | 177 | /* Invalidating when L2 is enabled is a nono */ |
171 | BUG_ON(readl(l2x0_base + L2X0_CTRL) & 1); | 178 | BUG_ON(readl(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN); |
172 | writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); | 179 | writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY); |
173 | cache_wait_way(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); | 180 | cache_wait_way(l2x0_base + L2X0_INV_WAY, l2x0_way_mask); |
174 | cache_sync(); | 181 | cache_sync(); |
@@ -292,11 +299,18 @@ static void l2x0_unlock(u32 cache_id) | |||
292 | int lockregs; | 299 | int lockregs; |
293 | int i; | 300 | int i; |
294 | 301 | ||
295 | if (cache_id == L2X0_CACHE_ID_PART_L310) | 302 | switch (cache_id) { |
303 | case L2X0_CACHE_ID_PART_L310: | ||
296 | lockregs = 8; | 304 | lockregs = 8; |
297 | else | 305 | break; |
306 | case AURORA_CACHE_ID: | ||
307 | lockregs = 4; | ||
308 | break; | ||
309 | default: | ||
298 | /* L210 and unknown types */ | 310 | /* L210 and unknown types */ |
299 | lockregs = 1; | 311 | lockregs = 1; |
312 | break; | ||
313 | } | ||
300 | 314 | ||
301 | for (i = 0; i < lockregs; i++) { | 315 | for (i = 0; i < lockregs; i++) { |
302 | writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_D_BASE + | 316 | writel_relaxed(0x0, l2x0_base + L2X0_LOCKDOWN_WAY_D_BASE + |
@@ -312,18 +326,22 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
312 | u32 cache_id; | 326 | u32 cache_id; |
313 | u32 way_size = 0; | 327 | u32 way_size = 0; |
314 | int ways; | 328 | int ways; |
329 | int way_size_shift = L2X0_WAY_SIZE_SHIFT; | ||
315 | const char *type; | 330 | const char *type; |
316 | 331 | ||
317 | l2x0_base = base; | 332 | l2x0_base = base; |
318 | 333 | if (cache_id_part_number_from_dt) | |
319 | cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID); | 334 | cache_id = cache_id_part_number_from_dt; |
335 | else | ||
336 | cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID) | ||
337 | & L2X0_CACHE_ID_PART_MASK; | ||
320 | aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); | 338 | aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); |
321 | 339 | ||
322 | aux &= aux_mask; | 340 | aux &= aux_mask; |
323 | aux |= aux_val; | 341 | aux |= aux_val; |
324 | 342 | ||
325 | /* Determine the number of ways */ | 343 | /* Determine the number of ways */ |
326 | switch (cache_id & L2X0_CACHE_ID_PART_MASK) { | 344 | switch (cache_id) { |
327 | case L2X0_CACHE_ID_PART_L310: | 345 | case L2X0_CACHE_ID_PART_L310: |
328 | if (aux & (1 << 16)) | 346 | if (aux & (1 << 16)) |
329 | ways = 16; | 347 | ways = 16; |
@@ -340,6 +358,14 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
340 | ways = (aux >> 13) & 0xf; | 358 | ways = (aux >> 13) & 0xf; |
341 | type = "L210"; | 359 | type = "L210"; |
342 | break; | 360 | break; |
361 | |||
362 | case AURORA_CACHE_ID: | ||
363 | sync_reg_offset = AURORA_SYNC_REG; | ||
364 | ways = (aux >> 13) & 0xf; | ||
365 | ways = 2 << ((ways + 1) >> 2); | ||
366 | way_size_shift = AURORA_WAY_SIZE_SHIFT; | ||
367 | type = "Aurora"; | ||
368 | break; | ||
343 | default: | 369 | default: |
344 | /* Assume unknown chips have 8 ways */ | 370 | /* Assume unknown chips have 8 ways */ |
345 | ways = 8; | 371 | ways = 8; |
@@ -353,7 +379,8 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
353 | * L2 cache Size = Way size * Number of ways | 379 | * L2 cache Size = Way size * Number of ways |
354 | */ | 380 | */ |
355 | way_size = (aux & L2X0_AUX_CTRL_WAY_SIZE_MASK) >> 17; | 381 | way_size = (aux & L2X0_AUX_CTRL_WAY_SIZE_MASK) >> 17; |
356 | way_size = 1 << (way_size + 3); | 382 | way_size = 1 << (way_size + way_size_shift); |
383 | |||
357 | l2x0_size = ways * way_size * SZ_1K; | 384 | l2x0_size = ways * way_size * SZ_1K; |
358 | 385 | ||
359 | /* | 386 | /* |
@@ -361,7 +388,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
361 | * If you are booting from non-secure mode | 388 | * If you are booting from non-secure mode |
362 | * accessing the below registers will fault. | 389 | * accessing the below registers will fault. |
363 | */ | 390 | */ |
364 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { | 391 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { |
365 | /* Make sure that I&D is not locked down when starting */ | 392 | /* Make sure that I&D is not locked down when starting */ |
366 | l2x0_unlock(cache_id); | 393 | l2x0_unlock(cache_id); |
367 | 394 | ||
@@ -371,7 +398,7 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
371 | l2x0_inv_all(); | 398 | l2x0_inv_all(); |
372 | 399 | ||
373 | /* enable L2X0 */ | 400 | /* enable L2X0 */ |
374 | writel_relaxed(1, l2x0_base + L2X0_CTRL); | 401 | writel_relaxed(L2X0_CTRL_EN, l2x0_base + L2X0_CTRL); |
375 | } | 402 | } |
376 | 403 | ||
377 | /* Re-read it in case some bits are reserved. */ | 404 | /* Re-read it in case some bits are reserved. */ |
@@ -380,13 +407,15 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
380 | /* Save the value for resuming. */ | 407 | /* Save the value for resuming. */ |
381 | l2x0_saved_regs.aux_ctrl = aux; | 408 | l2x0_saved_regs.aux_ctrl = aux; |
382 | 409 | ||
383 | outer_cache.inv_range = l2x0_inv_range; | 410 | if (!of_init) { |
384 | outer_cache.clean_range = l2x0_clean_range; | 411 | outer_cache.inv_range = l2x0_inv_range; |
385 | outer_cache.flush_range = l2x0_flush_range; | 412 | outer_cache.clean_range = l2x0_clean_range; |
386 | outer_cache.sync = l2x0_cache_sync; | 413 | outer_cache.flush_range = l2x0_flush_range; |
387 | outer_cache.flush_all = l2x0_flush_all; | 414 | outer_cache.sync = l2x0_cache_sync; |
388 | outer_cache.inv_all = l2x0_inv_all; | 415 | outer_cache.flush_all = l2x0_flush_all; |
389 | outer_cache.disable = l2x0_disable; | 416 | outer_cache.inv_all = l2x0_inv_all; |
417 | outer_cache.disable = l2x0_disable; | ||
418 | } | ||
390 | 419 | ||
391 | printk(KERN_INFO "%s cache controller enabled\n", type); | 420 | printk(KERN_INFO "%s cache controller enabled\n", type); |
392 | printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", | 421 | printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", |
@@ -394,6 +423,100 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask) | |||
394 | } | 423 | } |
395 | 424 | ||
396 | #ifdef CONFIG_OF | 425 | #ifdef CONFIG_OF |
426 | static int l2_wt_override; | ||
427 | |||
428 | /* | ||
429 | * Note that the end addresses passed to Linux primitives are | ||
430 | * noninclusive, while the hardware cache range operations use | ||
431 | * inclusive start and end addresses. | ||
432 | */ | ||
433 | static unsigned long calc_range_end(unsigned long start, unsigned long end) | ||
434 | { | ||
435 | /* | ||
436 | * Limit the number of cache lines processed at once, | ||
437 | * since cache range operations stall the CPU pipeline | ||
438 | * until completion. | ||
439 | */ | ||
440 | if (end > start + MAX_RANGE_SIZE) | ||
441 | end = start + MAX_RANGE_SIZE; | ||
442 | |||
443 | /* | ||
444 | * Cache range operations can't straddle a page boundary. | ||
445 | */ | ||
446 | if (end > PAGE_ALIGN(start+1)) | ||
447 | end = PAGE_ALIGN(start+1); | ||
448 | |||
449 | return end; | ||
450 | } | ||
451 | |||
452 | /* | ||
453 | * Make sure 'start' and 'end' reference the same page, as L2 is PIPT | ||
454 | * and range operations only do a TLB lookup on the start address. | ||
455 | */ | ||
456 | static void aurora_pa_range(unsigned long start, unsigned long end, | ||
457 | unsigned long offset) | ||
458 | { | ||
459 | unsigned long flags; | ||
460 | |||
461 | raw_spin_lock_irqsave(&l2x0_lock, flags); | ||
462 | writel(start, l2x0_base + AURORA_RANGE_BASE_ADDR_REG); | ||
463 | writel(end, l2x0_base + offset); | ||
464 | raw_spin_unlock_irqrestore(&l2x0_lock, flags); | ||
465 | |||
466 | cache_sync(); | ||
467 | } | ||
468 | |||
469 | static void aurora_inv_range(unsigned long start, unsigned long end) | ||
470 | { | ||
471 | /* | ||
472 | * round start and end adresses up to cache line size | ||
473 | */ | ||
474 | start &= ~(CACHE_LINE_SIZE - 1); | ||
475 | end = ALIGN(end, CACHE_LINE_SIZE); | ||
476 | |||
477 | /* | ||
478 | * Invalidate all full cache lines between 'start' and 'end'. | ||
479 | */ | ||
480 | while (start < end) { | ||
481 | unsigned long range_end = calc_range_end(start, end); | ||
482 | aurora_pa_range(start, range_end - CACHE_LINE_SIZE, | ||
483 | AURORA_INVAL_RANGE_REG); | ||
484 | start = range_end; | ||
485 | } | ||
486 | } | ||
487 | |||
488 | static void aurora_clean_range(unsigned long start, unsigned long end) | ||
489 | { | ||
490 | /* | ||
491 | * If L2 is forced to WT, the L2 will always be clean and we | ||
492 | * don't need to do anything here. | ||
493 | */ | ||
494 | if (!l2_wt_override) { | ||
495 | start &= ~(CACHE_LINE_SIZE - 1); | ||
496 | end = ALIGN(end, CACHE_LINE_SIZE); | ||
497 | while (start != end) { | ||
498 | unsigned long range_end = calc_range_end(start, end); | ||
499 | aurora_pa_range(start, range_end - CACHE_LINE_SIZE, | ||
500 | AURORA_CLEAN_RANGE_REG); | ||
501 | start = range_end; | ||
502 | } | ||
503 | } | ||
504 | } | ||
505 | |||
506 | static void aurora_flush_range(unsigned long start, unsigned long end) | ||
507 | { | ||
508 | if (!l2_wt_override) { | ||
509 | start &= ~(CACHE_LINE_SIZE - 1); | ||
510 | end = ALIGN(end, CACHE_LINE_SIZE); | ||
511 | while (start != end) { | ||
512 | unsigned long range_end = calc_range_end(start, end); | ||
513 | aurora_pa_range(start, range_end - CACHE_LINE_SIZE, | ||
514 | AURORA_FLUSH_RANGE_REG); | ||
515 | start = range_end; | ||
516 | } | ||
517 | } | ||
518 | } | ||
519 | |||
397 | static void __init l2x0_of_setup(const struct device_node *np, | 520 | static void __init l2x0_of_setup(const struct device_node *np, |
398 | u32 *aux_val, u32 *aux_mask) | 521 | u32 *aux_val, u32 *aux_mask) |
399 | { | 522 | { |
@@ -491,9 +614,15 @@ static void __init pl310_save(void) | |||
491 | } | 614 | } |
492 | } | 615 | } |
493 | 616 | ||
617 | static void aurora_save(void) | ||
618 | { | ||
619 | l2x0_saved_regs.ctrl = readl_relaxed(l2x0_base + L2X0_CTRL); | ||
620 | l2x0_saved_regs.aux_ctrl = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); | ||
621 | } | ||
622 | |||
494 | static void l2x0_resume(void) | 623 | static void l2x0_resume(void) |
495 | { | 624 | { |
496 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { | 625 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { |
497 | /* restore aux ctrl and enable l2 */ | 626 | /* restore aux ctrl and enable l2 */ |
498 | l2x0_unlock(readl_relaxed(l2x0_base + L2X0_CACHE_ID)); | 627 | l2x0_unlock(readl_relaxed(l2x0_base + L2X0_CACHE_ID)); |
499 | 628 | ||
@@ -502,7 +631,7 @@ static void l2x0_resume(void) | |||
502 | 631 | ||
503 | l2x0_inv_all(); | 632 | l2x0_inv_all(); |
504 | 633 | ||
505 | writel_relaxed(1, l2x0_base + L2X0_CTRL); | 634 | writel_relaxed(L2X0_CTRL_EN, l2x0_base + L2X0_CTRL); |
506 | } | 635 | } |
507 | } | 636 | } |
508 | 637 | ||
@@ -510,7 +639,7 @@ static void pl310_resume(void) | |||
510 | { | 639 | { |
511 | u32 l2x0_revision; | 640 | u32 l2x0_revision; |
512 | 641 | ||
513 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { | 642 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { |
514 | /* restore pl310 setup */ | 643 | /* restore pl310 setup */ |
515 | writel_relaxed(l2x0_saved_regs.tag_latency, | 644 | writel_relaxed(l2x0_saved_regs.tag_latency, |
516 | l2x0_base + L2X0_TAG_LATENCY_CTRL); | 645 | l2x0_base + L2X0_TAG_LATENCY_CTRL); |
@@ -536,22 +665,108 @@ static void pl310_resume(void) | |||
536 | l2x0_resume(); | 665 | l2x0_resume(); |
537 | } | 666 | } |
538 | 667 | ||
668 | static void aurora_resume(void) | ||
669 | { | ||
670 | if (!(readl(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { | ||
671 | writel(l2x0_saved_regs.aux_ctrl, l2x0_base + L2X0_AUX_CTRL); | ||
672 | writel(l2x0_saved_regs.ctrl, l2x0_base + L2X0_CTRL); | ||
673 | } | ||
674 | } | ||
675 | |||
676 | static void __init aurora_broadcast_l2_commands(void) | ||
677 | { | ||
678 | __u32 u; | ||
679 | /* Enable Broadcasting of cache commands to L2*/ | ||
680 | __asm__ __volatile__("mrc p15, 1, %0, c15, c2, 0" : "=r"(u)); | ||
681 | u |= AURORA_CTRL_FW; /* Set the FW bit */ | ||
682 | __asm__ __volatile__("mcr p15, 1, %0, c15, c2, 0\n" : : "r"(u)); | ||
683 | isb(); | ||
684 | } | ||
685 | |||
686 | static void __init aurora_of_setup(const struct device_node *np, | ||
687 | u32 *aux_val, u32 *aux_mask) | ||
688 | { | ||
689 | u32 val = AURORA_ACR_REPLACEMENT_TYPE_SEMIPLRU; | ||
690 | u32 mask = AURORA_ACR_REPLACEMENT_MASK; | ||
691 | |||
692 | of_property_read_u32(np, "cache-id-part", | ||
693 | &cache_id_part_number_from_dt); | ||
694 | |||
695 | /* Determine and save the write policy */ | ||
696 | l2_wt_override = of_property_read_bool(np, "wt-override"); | ||
697 | |||
698 | if (l2_wt_override) { | ||
699 | val |= AURORA_ACR_FORCE_WRITE_THRO_POLICY; | ||
700 | mask |= AURORA_ACR_FORCE_WRITE_POLICY_MASK; | ||
701 | } | ||
702 | |||
703 | *aux_val &= ~mask; | ||
704 | *aux_val |= val; | ||
705 | *aux_mask &= ~mask; | ||
706 | } | ||
707 | |||
539 | static const struct l2x0_of_data pl310_data = { | 708 | static const struct l2x0_of_data pl310_data = { |
540 | pl310_of_setup, | 709 | .setup = pl310_of_setup, |
541 | pl310_save, | 710 | .save = pl310_save, |
542 | pl310_resume, | 711 | .outer_cache = { |
712 | .resume = pl310_resume, | ||
713 | .inv_range = l2x0_inv_range, | ||
714 | .clean_range = l2x0_clean_range, | ||
715 | .flush_range = l2x0_flush_range, | ||
716 | .sync = l2x0_cache_sync, | ||
717 | .flush_all = l2x0_flush_all, | ||
718 | .inv_all = l2x0_inv_all, | ||
719 | .disable = l2x0_disable, | ||
720 | .set_debug = pl310_set_debug, | ||
721 | }, | ||
543 | }; | 722 | }; |
544 | 723 | ||
545 | static const struct l2x0_of_data l2x0_data = { | 724 | static const struct l2x0_of_data l2x0_data = { |
546 | l2x0_of_setup, | 725 | .setup = l2x0_of_setup, |
547 | NULL, | 726 | .save = NULL, |
548 | l2x0_resume, | 727 | .outer_cache = { |
728 | .resume = l2x0_resume, | ||
729 | .inv_range = l2x0_inv_range, | ||
730 | .clean_range = l2x0_clean_range, | ||
731 | .flush_range = l2x0_flush_range, | ||
732 | .sync = l2x0_cache_sync, | ||
733 | .flush_all = l2x0_flush_all, | ||
734 | .inv_all = l2x0_inv_all, | ||
735 | .disable = l2x0_disable, | ||
736 | }, | ||
737 | }; | ||
738 | |||
739 | static const struct l2x0_of_data aurora_with_outer_data = { | ||
740 | .setup = aurora_of_setup, | ||
741 | .save = aurora_save, | ||
742 | .outer_cache = { | ||
743 | .resume = aurora_resume, | ||
744 | .inv_range = aurora_inv_range, | ||
745 | .clean_range = aurora_clean_range, | ||
746 | .flush_range = aurora_flush_range, | ||
747 | .sync = l2x0_cache_sync, | ||
748 | .flush_all = l2x0_flush_all, | ||
749 | .inv_all = l2x0_inv_all, | ||
750 | .disable = l2x0_disable, | ||
751 | }, | ||
752 | }; | ||
753 | |||
754 | static const struct l2x0_of_data aurora_no_outer_data = { | ||
755 | .setup = aurora_of_setup, | ||
756 | .save = aurora_save, | ||
757 | .outer_cache = { | ||
758 | .resume = aurora_resume, | ||
759 | }, | ||
549 | }; | 760 | }; |
550 | 761 | ||
551 | static const struct of_device_id l2x0_ids[] __initconst = { | 762 | static const struct of_device_id l2x0_ids[] __initconst = { |
552 | { .compatible = "arm,pl310-cache", .data = (void *)&pl310_data }, | 763 | { .compatible = "arm,pl310-cache", .data = (void *)&pl310_data }, |
553 | { .compatible = "arm,l220-cache", .data = (void *)&l2x0_data }, | 764 | { .compatible = "arm,l220-cache", .data = (void *)&l2x0_data }, |
554 | { .compatible = "arm,l210-cache", .data = (void *)&l2x0_data }, | 765 | { .compatible = "arm,l210-cache", .data = (void *)&l2x0_data }, |
766 | { .compatible = "marvell,aurora-system-cache", | ||
767 | .data = (void *)&aurora_no_outer_data}, | ||
768 | { .compatible = "marvell,aurora-outer-cache", | ||
769 | .data = (void *)&aurora_with_outer_data}, | ||
555 | {} | 770 | {} |
556 | }; | 771 | }; |
557 | 772 | ||
@@ -577,17 +792,24 @@ int __init l2x0_of_init(u32 aux_val, u32 aux_mask) | |||
577 | data = of_match_node(l2x0_ids, np)->data; | 792 | data = of_match_node(l2x0_ids, np)->data; |
578 | 793 | ||
579 | /* L2 configuration can only be changed if the cache is disabled */ | 794 | /* L2 configuration can only be changed if the cache is disabled */ |
580 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & 1)) { | 795 | if (!(readl_relaxed(l2x0_base + L2X0_CTRL) & L2X0_CTRL_EN)) { |
581 | if (data->setup) | 796 | if (data->setup) |
582 | data->setup(np, &aux_val, &aux_mask); | 797 | data->setup(np, &aux_val, &aux_mask); |
798 | |||
799 | /* For aurora cache in no outer mode select the | ||
800 | * correct mode using the coprocessor*/ | ||
801 | if (data == &aurora_no_outer_data) | ||
802 | aurora_broadcast_l2_commands(); | ||
583 | } | 803 | } |
584 | 804 | ||
585 | if (data->save) | 805 | if (data->save) |
586 | data->save(); | 806 | data->save(); |
587 | 807 | ||
808 | of_init = true; | ||
588 | l2x0_init(l2x0_base, aux_val, aux_mask); | 809 | l2x0_init(l2x0_base, aux_val, aux_mask); |
589 | 810 | ||
590 | outer_cache.resume = data->resume; | 811 | memcpy(&outer_cache, &data->outer_cache, sizeof(outer_cache)); |
812 | |||
591 | return 0; | 813 | return 0; |
592 | } | 814 | } |
593 | #endif | 815 | #endif |
diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c index ab88ed4f8e08..99db769307ec 100644 --- a/arch/arm/mm/idmap.c +++ b/arch/arm/mm/idmap.c | |||
@@ -92,6 +92,9 @@ static int __init init_static_idmap(void) | |||
92 | (long long)idmap_start, (long long)idmap_end); | 92 | (long long)idmap_start, (long long)idmap_end); |
93 | identity_mapping_add(idmap_pgd, idmap_start, idmap_end); | 93 | identity_mapping_add(idmap_pgd, idmap_start, idmap_end); |
94 | 94 | ||
95 | /* Flush L1 for the hardware to see this page table content */ | ||
96 | flush_cache_louis(); | ||
97 | |||
95 | return 0; | 98 | return 0; |
96 | } | 99 | } |
97 | early_initcall(init_static_idmap); | 100 | early_initcall(init_static_idmap); |
@@ -103,12 +106,15 @@ early_initcall(init_static_idmap); | |||
103 | */ | 106 | */ |
104 | void setup_mm_for_reboot(void) | 107 | void setup_mm_for_reboot(void) |
105 | { | 108 | { |
106 | /* Clean and invalidate L1. */ | ||
107 | flush_cache_all(); | ||
108 | |||
109 | /* Switch to the identity mapping. */ | 109 | /* Switch to the identity mapping. */ |
110 | cpu_switch_mm(idmap_pgd, &init_mm); | 110 | cpu_switch_mm(idmap_pgd, &init_mm); |
111 | 111 | ||
112 | /* Flush the TLB. */ | 112 | #ifdef CONFIG_CPU_HAS_ASID |
113 | /* | ||
114 | * We don't have a clean ASID for the identity mapping, which | ||
115 | * may clash with virtual addresses of the previous page tables | ||
116 | * and therefore potentially in the TLB. | ||
117 | */ | ||
113 | local_flush_tlb_all(); | 118 | local_flush_tlb_all(); |
119 | #endif | ||
114 | } | 120 | } |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 846d279f3176..42cc833aa02f 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -57,7 +57,7 @@ ENTRY(cpu_v7_reset) | |||
57 | THUMB( bic r1, r1, #1 << 30 ) @ SCTLR.TE (Thumb exceptions) | 57 | THUMB( bic r1, r1, #1 << 30 ) @ SCTLR.TE (Thumb exceptions) |
58 | mcr p15, 0, r1, c1, c0, 0 @ disable MMU | 58 | mcr p15, 0, r1, c1, c0, 0 @ disable MMU |
59 | isb | 59 | isb |
60 | mov pc, r0 | 60 | bx r0 |
61 | ENDPROC(cpu_v7_reset) | 61 | ENDPROC(cpu_v7_reset) |
62 | .popsection | 62 | .popsection |
63 | 63 | ||
diff --git a/arch/avr32/include/asm/mach/serial_at91.h b/arch/avr32/include/asm/mach/serial_at91.h deleted file mode 100644 index 55b317a89061..000000000000 --- a/arch/avr32/include/asm/mach/serial_at91.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/mach/serial_at91.h | ||
3 | * | ||
4 | * Based on serial_sa1100.h by Nicolas Pitre | ||
5 | * | ||
6 | * Copyright (C) 2002 ATMEL Rousset | ||
7 | * | ||
8 | * Low level machine dependent UART functions. | ||
9 | */ | ||
10 | |||
11 | struct uart_port; | ||
12 | |||
13 | /* | ||
14 | * This is a temporary structure for registering these | ||
15 | * functions; it is intended to be discarded after boot. | ||
16 | */ | ||
17 | struct atmel_port_fns { | ||
18 | void (*set_mctrl)(struct uart_port *, u_int); | ||
19 | u_int (*get_mctrl)(struct uart_port *); | ||
20 | void (*enable_ms)(struct uart_port *); | ||
21 | void (*pm)(struct uart_port *, u_int, u_int); | ||
22 | int (*set_wake)(struct uart_port *, u_int); | ||
23 | int (*open)(struct uart_port *); | ||
24 | void (*close)(struct uart_port *); | ||
25 | }; | ||
26 | |||
27 | #if defined(CONFIG_SERIAL_ATMEL) | ||
28 | void atmel_register_uart_fns(struct atmel_port_fns *fns); | ||
29 | #else | ||
30 | #define atmel_register_uart_fns(fns) do { } while (0) | ||
31 | #endif | ||
32 | |||
33 | |||
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index e8eb91bd0d28..a2fc56d2e681 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -546,7 +546,8 @@ EXPORT_SYMBOL_GPL(amba_device_add); | |||
546 | static struct amba_device * | 546 | static struct amba_device * |
547 | amba_aphb_device_add(struct device *parent, const char *name, | 547 | amba_aphb_device_add(struct device *parent, const char *name, |
548 | resource_size_t base, size_t size, int irq1, int irq2, | 548 | resource_size_t base, size_t size, int irq1, int irq2, |
549 | void *pdata, unsigned int periphid, u64 dma_mask) | 549 | void *pdata, unsigned int periphid, u64 dma_mask, |
550 | struct resource *resbase) | ||
550 | { | 551 | { |
551 | struct amba_device *dev; | 552 | struct amba_device *dev; |
552 | int ret; | 553 | int ret; |
@@ -563,7 +564,7 @@ amba_aphb_device_add(struct device *parent, const char *name, | |||
563 | dev->dev.platform_data = pdata; | 564 | dev->dev.platform_data = pdata; |
564 | dev->dev.parent = parent; | 565 | dev->dev.parent = parent; |
565 | 566 | ||
566 | ret = amba_device_add(dev, &iomem_resource); | 567 | ret = amba_device_add(dev, resbase); |
567 | if (ret) { | 568 | if (ret) { |
568 | amba_device_put(dev); | 569 | amba_device_put(dev); |
569 | return ERR_PTR(ret); | 570 | return ERR_PTR(ret); |
@@ -578,7 +579,7 @@ amba_apb_device_add(struct device *parent, const char *name, | |||
578 | void *pdata, unsigned int periphid) | 579 | void *pdata, unsigned int periphid) |
579 | { | 580 | { |
580 | return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata, | 581 | return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata, |
581 | periphid, 0); | 582 | periphid, 0, &iomem_resource); |
582 | } | 583 | } |
583 | EXPORT_SYMBOL_GPL(amba_apb_device_add); | 584 | EXPORT_SYMBOL_GPL(amba_apb_device_add); |
584 | 585 | ||
@@ -588,10 +589,33 @@ amba_ahb_device_add(struct device *parent, const char *name, | |||
588 | void *pdata, unsigned int periphid) | 589 | void *pdata, unsigned int periphid) |
589 | { | 590 | { |
590 | return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata, | 591 | return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata, |
591 | periphid, ~0ULL); | 592 | periphid, ~0ULL, &iomem_resource); |
592 | } | 593 | } |
593 | EXPORT_SYMBOL_GPL(amba_ahb_device_add); | 594 | EXPORT_SYMBOL_GPL(amba_ahb_device_add); |
594 | 595 | ||
596 | struct amba_device * | ||
597 | amba_apb_device_add_res(struct device *parent, const char *name, | ||
598 | resource_size_t base, size_t size, int irq1, | ||
599 | int irq2, void *pdata, unsigned int periphid, | ||
600 | struct resource *resbase) | ||
601 | { | ||
602 | return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata, | ||
603 | periphid, 0, resbase); | ||
604 | } | ||
605 | EXPORT_SYMBOL_GPL(amba_apb_device_add_res); | ||
606 | |||
607 | struct amba_device * | ||
608 | amba_ahb_device_add_res(struct device *parent, const char *name, | ||
609 | resource_size_t base, size_t size, int irq1, | ||
610 | int irq2, void *pdata, unsigned int periphid, | ||
611 | struct resource *resbase) | ||
612 | { | ||
613 | return amba_aphb_device_add(parent, name, base, size, irq1, irq2, pdata, | ||
614 | periphid, ~0ULL, resbase); | ||
615 | } | ||
616 | EXPORT_SYMBOL_GPL(amba_ahb_device_add_res); | ||
617 | |||
618 | |||
595 | static void amba_device_initialize(struct amba_device *dev, const char *name) | 619 | static void amba_device_initialize(struct amba_device *dev, const char *name) |
596 | { | 620 | { |
597 | device_initialize(&dev->dev); | 621 | device_initialize(&dev->dev); |
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index edc3e9baf0e7..5e39b312c7cc 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/amba/mmci.h> | 33 | #include <linux/amba/mmci.h> |
34 | #include <linux/pm_runtime.h> | 34 | #include <linux/pm_runtime.h> |
35 | #include <linux/types.h> | 35 | #include <linux/types.h> |
36 | #include <linux/pinctrl/consumer.h> | ||
36 | 37 | ||
37 | #include <asm/div64.h> | 38 | #include <asm/div64.h> |
38 | #include <asm/io.h> | 39 | #include <asm/io.h> |
@@ -654,9 +655,31 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) | |||
654 | 655 | ||
655 | /* The ST Micro variants has a special bit to enable SDIO */ | 656 | /* The ST Micro variants has a special bit to enable SDIO */ |
656 | if (variant->sdio && host->mmc->card) | 657 | if (variant->sdio && host->mmc->card) |
657 | if (mmc_card_sdio(host->mmc->card)) | 658 | if (mmc_card_sdio(host->mmc->card)) { |
659 | /* | ||
660 | * The ST Micro variants has a special bit | ||
661 | * to enable SDIO. | ||
662 | */ | ||
663 | u32 clk; | ||
664 | |||
658 | datactrl |= MCI_ST_DPSM_SDIOEN; | 665 | datactrl |= MCI_ST_DPSM_SDIOEN; |
659 | 666 | ||
667 | /* | ||
668 | * The ST Micro variant for SDIO small write transfers | ||
669 | * needs to have clock H/W flow control disabled, | ||
670 | * otherwise the transfer will not start. The threshold | ||
671 | * depends on the rate of MCLK. | ||
672 | */ | ||
673 | if (data->flags & MMC_DATA_WRITE && | ||
674 | (host->size < 8 || | ||
675 | (host->size <= 8 && host->mclk > 50000000))) | ||
676 | clk = host->clk_reg & ~variant->clkreg_enable; | ||
677 | else | ||
678 | clk = host->clk_reg | variant->clkreg_enable; | ||
679 | |||
680 | mmci_write_clkreg(host, clk); | ||
681 | } | ||
682 | |||
660 | /* | 683 | /* |
661 | * Attempt to use DMA operation mode, if this | 684 | * Attempt to use DMA operation mode, if this |
662 | * should fail, fall back to PIO mode | 685 | * should fail, fall back to PIO mode |
@@ -840,14 +863,14 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema | |||
840 | if (unlikely(count & 0x3)) { | 863 | if (unlikely(count & 0x3)) { |
841 | if (count < 4) { | 864 | if (count < 4) { |
842 | unsigned char buf[4]; | 865 | unsigned char buf[4]; |
843 | readsl(base + MMCIFIFO, buf, 1); | 866 | ioread32_rep(base + MMCIFIFO, buf, 1); |
844 | memcpy(ptr, buf, count); | 867 | memcpy(ptr, buf, count); |
845 | } else { | 868 | } else { |
846 | readsl(base + MMCIFIFO, ptr, count >> 2); | 869 | ioread32_rep(base + MMCIFIFO, ptr, count >> 2); |
847 | count &= ~0x3; | 870 | count &= ~0x3; |
848 | } | 871 | } |
849 | } else { | 872 | } else { |
850 | readsl(base + MMCIFIFO, ptr, count >> 2); | 873 | ioread32_rep(base + MMCIFIFO, ptr, count >> 2); |
851 | } | 874 | } |
852 | 875 | ||
853 | ptr += count; | 876 | ptr += count; |
@@ -877,22 +900,6 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem | |||
877 | count = min(remain, maxcnt); | 900 | count = min(remain, maxcnt); |
878 | 901 | ||
879 | /* | 902 | /* |
880 | * The ST Micro variant for SDIO transfer sizes | ||
881 | * less then 8 bytes should have clock H/W flow | ||
882 | * control disabled. | ||
883 | */ | ||
884 | if (variant->sdio && | ||
885 | mmc_card_sdio(host->mmc->card)) { | ||
886 | u32 clk; | ||
887 | if (count < 8) | ||
888 | clk = host->clk_reg & ~variant->clkreg_enable; | ||
889 | else | ||
890 | clk = host->clk_reg | variant->clkreg_enable; | ||
891 | |||
892 | mmci_write_clkreg(host, clk); | ||
893 | } | ||
894 | |||
895 | /* | ||
896 | * SDIO especially may want to send something that is | 903 | * SDIO especially may want to send something that is |
897 | * not divisible by 4 (as opposed to card sectors | 904 | * not divisible by 4 (as opposed to card sectors |
898 | * etc), and the FIFO only accept full 32-bit writes. | 905 | * etc), and the FIFO only accept full 32-bit writes. |
@@ -900,7 +907,7 @@ static int mmci_pio_write(struct mmci_host *host, char *buffer, unsigned int rem | |||
900 | * byte become a 32bit write, 7 bytes will be two | 907 | * byte become a 32bit write, 7 bytes will be two |
901 | * 32bit writes etc. | 908 | * 32bit writes etc. |
902 | */ | 909 | */ |
903 | writesl(base + MMCIFIFO, ptr, (count + 3) >> 2); | 910 | iowrite32_rep(base + MMCIFIFO, ptr, (count + 3) >> 2); |
904 | 911 | ||
905 | ptr += count; | 912 | ptr += count; |
906 | remain -= count; | 913 | remain -= count; |
@@ -1360,6 +1367,23 @@ static int __devinit mmci_probe(struct amba_device *dev, | |||
1360 | mmc->f_max = min(host->mclk, fmax); | 1367 | mmc->f_max = min(host->mclk, fmax); |
1361 | dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); | 1368 | dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); |
1362 | 1369 | ||
1370 | host->pinctrl = devm_pinctrl_get(&dev->dev); | ||
1371 | if (IS_ERR(host->pinctrl)) { | ||
1372 | ret = PTR_ERR(host->pinctrl); | ||
1373 | goto clk_disable; | ||
1374 | } | ||
1375 | |||
1376 | host->pins_default = pinctrl_lookup_state(host->pinctrl, | ||
1377 | PINCTRL_STATE_DEFAULT); | ||
1378 | |||
1379 | /* enable pins to be muxed in and configured */ | ||
1380 | if (!IS_ERR(host->pins_default)) { | ||
1381 | ret = pinctrl_select_state(host->pinctrl, host->pins_default); | ||
1382 | if (ret) | ||
1383 | dev_warn(&dev->dev, "could not set default pins\n"); | ||
1384 | } else | ||
1385 | dev_warn(&dev->dev, "could not get default pinstate\n"); | ||
1386 | |||
1363 | #ifdef CONFIG_REGULATOR | 1387 | #ifdef CONFIG_REGULATOR |
1364 | /* If we're using the regulator framework, try to fetch a regulator */ | 1388 | /* If we're using the regulator framework, try to fetch a regulator */ |
1365 | host->vcc = regulator_get(&dev->dev, "vmmc"); | 1389 | host->vcc = regulator_get(&dev->dev, "vmmc"); |
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index d437ccf62d6b..d34d8c0add8e 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h | |||
@@ -195,6 +195,10 @@ struct mmci_host { | |||
195 | unsigned int size; | 195 | unsigned int size; |
196 | struct regulator *vcc; | 196 | struct regulator *vcc; |
197 | 197 | ||
198 | /* pinctrl handles */ | ||
199 | struct pinctrl *pinctrl; | ||
200 | struct pinctrl_state *pins_default; | ||
201 | |||
198 | #ifdef CONFIG_DMA_ENGINE | 202 | #ifdef CONFIG_DMA_ENGINE |
199 | /* DMA stuff */ | 203 | /* DMA stuff */ |
200 | struct dma_chan *dma_current; | 204 | struct dma_chan *dma_current; |
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 3d7e1ee2fa57..a6134c94a9fc 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <asm/io.h> | 43 | #include <asm/io.h> |
44 | #include <asm/ioctls.h> | 44 | #include <asm/ioctls.h> |
45 | 45 | ||
46 | #include <asm/mach/serial_at91.h> | ||
47 | #include <mach/board.h> | 46 | #include <mach/board.h> |
48 | 47 | ||
49 | #ifdef CONFIG_ARM | 48 | #ifdef CONFIG_ARM |
@@ -1513,23 +1512,6 @@ static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port, | |||
1513 | } | 1512 | } |
1514 | } | 1513 | } |
1515 | 1514 | ||
1516 | /* | ||
1517 | * Register board-specific modem-control line handlers. | ||
1518 | */ | ||
1519 | void __init atmel_register_uart_fns(struct atmel_port_fns *fns) | ||
1520 | { | ||
1521 | if (fns->enable_ms) | ||
1522 | atmel_pops.enable_ms = fns->enable_ms; | ||
1523 | if (fns->get_mctrl) | ||
1524 | atmel_pops.get_mctrl = fns->get_mctrl; | ||
1525 | if (fns->set_mctrl) | ||
1526 | atmel_pops.set_mctrl = fns->set_mctrl; | ||
1527 | atmel_open_hook = fns->open; | ||
1528 | atmel_close_hook = fns->close; | ||
1529 | atmel_pops.pm = fns->pm; | ||
1530 | atmel_pops.set_wake = fns->set_wake; | ||
1531 | } | ||
1532 | |||
1533 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 1515 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
1534 | 1516 | ||
1535 | #ifdef CONFIG_SERIAL_ATMEL_CONSOLE | 1517 | #ifdef CONFIG_SERIAL_ATMEL_CONSOLE |
diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index 2ca5959ec3fa..ecc1e16be623 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <linux/console.h> | 30 | #include <linux/console.h> |
31 | #include <linux/sysrq.h> | 31 | #include <linux/sysrq.h> |
32 | #include <linux/platform_data/sa11x0-serial.h> | ||
32 | #include <linux/platform_device.h> | 33 | #include <linux/platform_device.h> |
33 | #include <linux/tty.h> | 34 | #include <linux/tty.h> |
34 | #include <linux/tty_flip.h> | 35 | #include <linux/tty_flip.h> |
@@ -39,7 +40,6 @@ | |||
39 | #include <asm/irq.h> | 40 | #include <asm/irq.h> |
40 | #include <mach/hardware.h> | 41 | #include <mach/hardware.h> |
41 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
42 | #include <asm/mach/serial_sa1100.h> | ||
43 | 43 | ||
44 | /* We've been assigned a range on the "Low-density serial ports" major */ | 44 | /* We've been assigned a range on the "Low-density serial ports" major */ |
45 | #define SERIAL_SA1100_MAJOR 204 | 45 | #define SERIAL_SA1100_MAJOR 204 |
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index 8efbf08c3561..d4ca9f1f7f24 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/list.h> | 29 | #include <linux/list.h> |
30 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
31 | #include <linux/mm.h> | 31 | #include <linux/mm.h> |
32 | #include <linux/platform_data/pxa2xx_udc.h> | ||
32 | #include <linux/platform_device.h> | 33 | #include <linux/platform_device.h> |
33 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
34 | #include <linux/irq.h> | 35 | #include <linux/irq.h> |
@@ -59,9 +60,6 @@ | |||
59 | #include <mach/lubbock.h> | 60 | #include <mach/lubbock.h> |
60 | #endif | 61 | #endif |
61 | 62 | ||
62 | #include <asm/mach/udc_pxa2xx.h> | ||
63 | |||
64 | |||
65 | /* | 63 | /* |
66 | * This driver handles the USB Device Controller (UDC) in Intel's PXA 25x | 64 | * This driver handles the USB Device Controller (UDC) in Intel's PXA 25x |
67 | * series processors. The UDC for the IXP 4xx series is very similar. | 65 | * series processors. The UDC for the IXP 4xx series is very similar. |
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index e4841c36798b..dfddfbf5d9fe 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c | |||
@@ -284,8 +284,7 @@ static int __devexit sp805_wdt_remove(struct amba_device *adev) | |||
284 | return 0; | 284 | return 0; |
285 | } | 285 | } |
286 | 286 | ||
287 | #ifdef CONFIG_PM | 287 | static int __maybe_unused sp805_wdt_suspend(struct device *dev) |
288 | static int sp805_wdt_suspend(struct device *dev) | ||
289 | { | 288 | { |
290 | struct sp805_wdt *wdt = dev_get_drvdata(dev); | 289 | struct sp805_wdt *wdt = dev_get_drvdata(dev); |
291 | 290 | ||
@@ -295,7 +294,7 @@ static int sp805_wdt_suspend(struct device *dev) | |||
295 | return 0; | 294 | return 0; |
296 | } | 295 | } |
297 | 296 | ||
298 | static int sp805_wdt_resume(struct device *dev) | 297 | static int __maybe_unused sp805_wdt_resume(struct device *dev) |
299 | { | 298 | { |
300 | struct sp805_wdt *wdt = dev_get_drvdata(dev); | 299 | struct sp805_wdt *wdt = dev_get_drvdata(dev); |
301 | 300 | ||
@@ -304,7 +303,6 @@ static int sp805_wdt_resume(struct device *dev) | |||
304 | 303 | ||
305 | return 0; | 304 | return 0; |
306 | } | 305 | } |
307 | #endif /* CONFIG_PM */ | ||
308 | 306 | ||
309 | static SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend, | 307 | static SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend, |
310 | sp805_wdt_resume); | 308 | sp805_wdt_resume); |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index d36417158d8f..43ec7e247a80 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
@@ -71,6 +71,16 @@ struct amba_device *amba_ahb_device_add(struct device *parent, const char *name, | |||
71 | resource_size_t base, size_t size, | 71 | resource_size_t base, size_t size, |
72 | int irq1, int irq2, void *pdata, | 72 | int irq1, int irq2, void *pdata, |
73 | unsigned int periphid); | 73 | unsigned int periphid); |
74 | struct amba_device * | ||
75 | amba_apb_device_add_res(struct device *parent, const char *name, | ||
76 | resource_size_t base, size_t size, int irq1, | ||
77 | int irq2, void *pdata, unsigned int periphid, | ||
78 | struct resource *resbase); | ||
79 | struct amba_device * | ||
80 | amba_ahb_device_add_res(struct device *parent, const char *name, | ||
81 | resource_size_t base, size_t size, int irq1, | ||
82 | int irq2, void *pdata, unsigned int periphid, | ||
83 | struct resource *resbase); | ||
74 | void amba_device_unregister(struct amba_device *); | 84 | void amba_device_unregister(struct amba_device *); |
75 | struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); | 85 | struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); |
76 | int amba_request_regions(struct amba_device *, const char *); | 86 | int amba_request_regions(struct amba_device *, const char *); |
diff --git a/arch/arm/include/asm/mach/udc_pxa2xx.h b/include/linux/platform_data/pxa2xx_udc.h index ea297ac70bc6..c6c5e98b5b82 100644 --- a/arch/arm/include/asm/mach/udc_pxa2xx.h +++ b/include/linux/platform_data/pxa2xx_udc.h | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/include/asm/mach/udc_pxa2xx.h | ||
3 | * | ||
4 | * This supports machine-specific differences in how the PXA2xx | 2 | * This supports machine-specific differences in how the PXA2xx |
5 | * USB Device Controller (UDC) is wired. | 3 | * USB Device Controller (UDC) is wired. |
6 | * | 4 | * |
@@ -8,6 +6,8 @@ | |||
8 | * linux/arch/mach-ixp4xx/<machine>.c and used in | 6 | * linux/arch/mach-ixp4xx/<machine>.c and used in |
9 | * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c | 7 | * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c |
10 | */ | 8 | */ |
9 | #ifndef PXA2XX_UDC_H | ||
10 | #define PXA2XX_UDC_H | ||
11 | 11 | ||
12 | struct pxa2xx_udc_mach_info { | 12 | struct pxa2xx_udc_mach_info { |
13 | int (*udc_is_connected)(void); /* do we see host? */ | 13 | int (*udc_is_connected)(void); /* do we see host? */ |
@@ -24,3 +24,4 @@ struct pxa2xx_udc_mach_info { | |||
24 | int gpio_pullup; /* high == pullup activated */ | 24 | int gpio_pullup; /* high == pullup activated */ |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #endif | ||
diff --git a/arch/arm/include/asm/mach/serial_sa1100.h b/include/linux/platform_data/sa11x0-serial.h index d09064bf95a0..4504d5d592f0 100644 --- a/arch/arm/include/asm/mach/serial_sa1100.h +++ b/include/linux/platform_data/sa11x0-serial.h | |||
@@ -1,12 +1,12 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/include/asm/mach/serial_sa1100.h | ||
3 | * | ||
4 | * Author: Nicolas Pitre | 2 | * Author: Nicolas Pitre |
5 | * | 3 | * |
6 | * Moved and changed lots, Russell King | 4 | * Moved and changed lots, Russell King |
7 | * | 5 | * |
8 | * Low level machine dependent UART functions. | 6 | * Low level machine dependent UART functions. |
9 | */ | 7 | */ |
8 | #ifndef SA11X0_SERIAL_H | ||
9 | #define SA11X0_SERIAL_H | ||
10 | 10 | ||
11 | struct uart_port; | 11 | struct uart_port; |
12 | struct uart_info; | 12 | struct uart_info; |
@@ -29,3 +29,5 @@ void sa1100_register_uart(int idx, int port); | |||
29 | #define sa1100_register_uart_fns(fns) do { } while (0) | 29 | #define sa1100_register_uart_fns(fns) do { } while (0) |
30 | #define sa1100_register_uart(idx,port) do { } while (0) | 30 | #define sa1100_register_uart(idx,port) do { } while (0) |
31 | #endif | 31 | #endif |
32 | |||
33 | #endif | ||
diff --git a/scripts/sortextable.c b/scripts/sortextable.c index f19ddc47304c..1f10e89d15b4 100644 --- a/scripts/sortextable.c +++ b/scripts/sortextable.c | |||
@@ -248,6 +248,7 @@ do_file(char const *const fname) | |||
248 | case EM_S390: | 248 | case EM_S390: |
249 | custom_sort = sort_relative_table; | 249 | custom_sort = sort_relative_table; |
250 | break; | 250 | break; |
251 | case EM_ARM: | ||
251 | case EM_MIPS: | 252 | case EM_MIPS: |
252 | break; | 253 | break; |
253 | } /* end switch */ | 254 | } /* end switch */ |