aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/include/asm/assembler.h2
-rw-r--r--arch/arm/include/asm/kgdb.h5
-rw-r--r--arch/arm/kernel/kgdb.c2
-rw-r--r--arch/arm/lib/findbit.S6
-rw-r--r--arch/arm/mach-at91/include/mach/at91_mci.h2
-rw-r--r--arch/arm/mach-cns3xxx/include/mach/debug-macro.S2
-rw-r--r--arch/arm/mach-cns3xxx/pcie.c2
-rw-r--r--arch/arm/mm/cache-v6.S28
-rw-r--r--arch/arm/mm/fault-armv.c28
-rw-r--r--arch/arm/mm/init.c6
-rw-r--r--arch/arm/plat-omap/dma.c50
-rw-r--r--arch/arm/plat-omap/include/plat/dma.h4
12 files changed, 113 insertions, 24 deletions
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 6e8f05c8a1c8..d7575554e407 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -215,7 +215,7 @@
215 @ Slightly optimised to avoid incrementing the pointer twice 215 @ Slightly optimised to avoid incrementing the pointer twice
216 usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort 216 usraccoff \instr, \reg, \ptr, \inc, 0, \cond, \abort
217 .if \rept == 2 217 .if \rept == 2
218 usraccoff \instr, \reg, \ptr, \inc, 4, \cond, \abort 218 usraccoff \instr, \reg, \ptr, \inc, \inc, \cond, \abort
219 .endif 219 .endif
220 220
221 add\cond \ptr, #\rept * \inc 221 add\cond \ptr, #\rept * \inc
diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h
index 08265993227f..48066ce9ea34 100644
--- a/arch/arm/include/asm/kgdb.h
+++ b/arch/arm/include/asm/kgdb.h
@@ -70,7 +70,8 @@ extern int kgdb_fault_expected;
70#define _GP_REGS 16 70#define _GP_REGS 16
71#define _FP_REGS 8 71#define _FP_REGS 8
72#define _EXTRA_REGS 2 72#define _EXTRA_REGS 2
73#define DBG_MAX_REG_NUM (_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS) 73#define GDB_MAX_REGS (_GP_REGS + (_FP_REGS * 3) + _EXTRA_REGS)
74#define DBG_MAX_REG_NUM (_GP_REGS + _FP_REGS + _EXTRA_REGS)
74 75
75#define KGDB_MAX_NO_CPUS 1 76#define KGDB_MAX_NO_CPUS 1
76#define BUFMAX 400 77#define BUFMAX 400
@@ -93,7 +94,7 @@ extern int kgdb_fault_expected;
93#define _SPT 13 94#define _SPT 13
94#define _LR 14 95#define _LR 14
95#define _PC 15 96#define _PC 15
96#define _CPSR (DBG_MAX_REG_NUM - 1) 97#define _CPSR (GDB_MAX_REGS - 1)
97 98
98/* 99/*
99 * So that we can denote the end of a frame for tracing, 100 * So that we can denote the end of a frame for tracing,
diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c
index d6e8b4d2e60d..778c2f7024ff 100644
--- a/arch/arm/kernel/kgdb.c
+++ b/arch/arm/kernel/kgdb.c
@@ -79,7 +79,7 @@ sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *task)
79 return; 79 return;
80 80
81 /* Initialize to zero */ 81 /* Initialize to zero */
82 for (regno = 0; regno < DBG_MAX_REG_NUM; regno++) 82 for (regno = 0; regno < GDB_MAX_REGS; regno++)
83 gdb_regs[regno] = 0; 83 gdb_regs[regno] = 0;
84 84
85 /* Otherwise, we have only some registers from switch_to() */ 85 /* Otherwise, we have only some registers from switch_to() */
diff --git a/arch/arm/lib/findbit.S b/arch/arm/lib/findbit.S
index 1e4cbd4e7be9..64f6bc1a9132 100644
--- a/arch/arm/lib/findbit.S
+++ b/arch/arm/lib/findbit.S
@@ -174,8 +174,8 @@ ENDPROC(_find_next_bit_be)
174 */ 174 */
175.L_found: 175.L_found:
176#if __LINUX_ARM_ARCH__ >= 5 176#if __LINUX_ARM_ARCH__ >= 5
177 rsb r1, r3, #0 177 rsb r0, r3, #0
178 and r3, r3, r1 178 and r3, r3, r0
179 clz r3, r3 179 clz r3, r3
180 rsb r3, r3, #31 180 rsb r3, r3, #31
181 add r0, r2, r3 181 add r0, r2, r3
@@ -190,5 +190,7 @@ ENDPROC(_find_next_bit_be)
190 addeq r2, r2, #1 190 addeq r2, r2, #1
191 mov r0, r2 191 mov r0, r2
192#endif 192#endif
193 cmp r1, r0 @ Clamp to maxbit
194 movlo r0, r1
193 mov pc, lr 195 mov pc, lr
194 196
diff --git a/arch/arm/mach-at91/include/mach/at91_mci.h b/arch/arm/mach-at91/include/mach/at91_mci.h
index 57f8ee154943..27ac6f550fe3 100644
--- a/arch/arm/mach-at91/include/mach/at91_mci.h
+++ b/arch/arm/mach-at91/include/mach/at91_mci.h
@@ -74,6 +74,8 @@
74#define AT91_MCI_TRTYP_BLOCK (0 << 19) 74#define AT91_MCI_TRTYP_BLOCK (0 << 19)
75#define AT91_MCI_TRTYP_MULTIPLE (1 << 19) 75#define AT91_MCI_TRTYP_MULTIPLE (1 << 19)
76#define AT91_MCI_TRTYP_STREAM (2 << 19) 76#define AT91_MCI_TRTYP_STREAM (2 << 19)
77#define AT91_MCI_TRTYP_SDIO_BYTE (4 << 19)
78#define AT91_MCI_TRTYP_SDIO_BLOCK (5 << 19)
77 79
78#define AT91_MCI_BLKR 0x18 /* Block Register */ 80#define AT91_MCI_BLKR 0x18 /* Block Register */
79#define AT91_MCI_BLKR_BCNT(n) ((0xffff & (n)) << 0) /* Block count */ 81#define AT91_MCI_BLKR_BCNT(n) ((0xffff & (n)) << 0) /* Block count */
diff --git a/arch/arm/mach-cns3xxx/include/mach/debug-macro.S b/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
index d16ce7eb00e9..9b50442d4b9b 100644
--- a/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
+++ b/arch/arm/mach-cns3xxx/include/mach/debug-macro.S
@@ -10,7 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11 */ 11 */
12 12
13 .macro addruart,rx 13 .macro addruart,rx,rtmp
14 mrc p15, 0, \rx, c1, c0 14 mrc p15, 0, \rx, c1, c0
15 tst \rx, #1 @ MMU enabled? 15 tst \rx, #1 @ MMU enabled?
16 moveq \rx, #0x10000000 16 moveq \rx, #0x10000000
diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c
index 38088c36936c..78defd71a829 100644
--- a/arch/arm/mach-cns3xxx/pcie.c
+++ b/arch/arm/mach-cns3xxx/pcie.c
@@ -369,7 +369,7 @@ static int __init cns3xxx_pcie_init(void)
369{ 369{
370 int i; 370 int i;
371 371
372 hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, 372 hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, 0,
373 "imprecise external abort"); 373 "imprecise external abort");
374 374
375 for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) { 375 for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
index 86aa689ef1aa..47010d8114b0 100644
--- a/arch/arm/mm/cache-v6.S
+++ b/arch/arm/mm/cache-v6.S
@@ -196,6 +196,10 @@ ENTRY(v6_flush_kern_dcache_area)
196 * - end - virtual end address of region 196 * - end - virtual end address of region
197 */ 197 */
198v6_dma_inv_range: 198v6_dma_inv_range:
199#ifdef CONFIG_DMA_CACHE_RWFO
200 ldrb r2, [r0] @ read for ownership
201 strb r2, [r0] @ write for ownership
202#endif
199 tst r0, #D_CACHE_LINE_SIZE - 1 203 tst r0, #D_CACHE_LINE_SIZE - 1
200 bic r0, r0, #D_CACHE_LINE_SIZE - 1 204 bic r0, r0, #D_CACHE_LINE_SIZE - 1
201#ifdef HARVARD_CACHE 205#ifdef HARVARD_CACHE
@@ -204,6 +208,10 @@ v6_dma_inv_range:
204 mcrne p15, 0, r0, c7, c11, 1 @ clean unified line 208 mcrne p15, 0, r0, c7, c11, 1 @ clean unified line
205#endif 209#endif
206 tst r1, #D_CACHE_LINE_SIZE - 1 210 tst r1, #D_CACHE_LINE_SIZE - 1
211#ifdef CONFIG_DMA_CACHE_RWFO
212 ldrneb r2, [r1, #-1] @ read for ownership
213 strneb r2, [r1, #-1] @ write for ownership
214#endif
207 bic r1, r1, #D_CACHE_LINE_SIZE - 1 215 bic r1, r1, #D_CACHE_LINE_SIZE - 1
208#ifdef HARVARD_CACHE 216#ifdef HARVARD_CACHE
209 mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line 217 mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line
@@ -211,10 +219,6 @@ v6_dma_inv_range:
211 mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line 219 mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line
212#endif 220#endif
2131: 2211:
214#ifdef CONFIG_DMA_CACHE_RWFO
215 ldr r2, [r0] @ read for ownership
216 str r2, [r0] @ write for ownership
217#endif
218#ifdef HARVARD_CACHE 222#ifdef HARVARD_CACHE
219 mcr p15, 0, r0, c7, c6, 1 @ invalidate D line 223 mcr p15, 0, r0, c7, c6, 1 @ invalidate D line
220#else 224#else
@@ -222,6 +226,10 @@ v6_dma_inv_range:
222#endif 226#endif
223 add r0, r0, #D_CACHE_LINE_SIZE 227 add r0, r0, #D_CACHE_LINE_SIZE
224 cmp r0, r1 228 cmp r0, r1
229#ifdef CONFIG_DMA_CACHE_RWFO
230 ldrlo r2, [r0] @ read for ownership
231 strlo r2, [r0] @ write for ownership
232#endif
225 blo 1b 233 blo 1b
226 mov r0, #0 234 mov r0, #0
227 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 235 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
@@ -256,12 +264,12 @@ v6_dma_clean_range:
256 * - end - virtual end address of region 264 * - end - virtual end address of region
257 */ 265 */
258ENTRY(v6_dma_flush_range) 266ENTRY(v6_dma_flush_range)
259 bic r0, r0, #D_CACHE_LINE_SIZE - 1
2601:
261#ifdef CONFIG_DMA_CACHE_RWFO 267#ifdef CONFIG_DMA_CACHE_RWFO
262 ldr r2, [r0] @ read for ownership 268 ldrb r2, [r0] @ read for ownership
263 str r2, [r0] @ write for ownership 269 strb r2, [r0] @ write for ownership
264#endif 270#endif
271 bic r0, r0, #D_CACHE_LINE_SIZE - 1
2721:
265#ifdef HARVARD_CACHE 273#ifdef HARVARD_CACHE
266 mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line 274 mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line
267#else 275#else
@@ -269,6 +277,10 @@ ENTRY(v6_dma_flush_range)
269#endif 277#endif
270 add r0, r0, #D_CACHE_LINE_SIZE 278 add r0, r0, #D_CACHE_LINE_SIZE
271 cmp r0, r1 279 cmp r0, r1
280#ifdef CONFIG_DMA_CACHE_RWFO
281 ldrlob r2, [r0] @ read for ownership
282 strlob r2, [r0] @ write for ownership
283#endif
272 blo 1b 284 blo 1b
273 mov r0, #0 285 mov r0, #0
274 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 286 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer
diff --git a/arch/arm/mm/fault-armv.c b/arch/arm/mm/fault-armv.c
index 9b906dec1ca1..56036ff04deb 100644
--- a/arch/arm/mm/fault-armv.c
+++ b/arch/arm/mm/fault-armv.c
@@ -65,6 +65,30 @@ static int do_adjust_pte(struct vm_area_struct *vma, unsigned long address,
65 return ret; 65 return ret;
66} 66}
67 67
68#if USE_SPLIT_PTLOCKS
69/*
70 * If we are using split PTE locks, then we need to take the page
71 * lock here. Otherwise we are using shared mm->page_table_lock
72 * which is already locked, thus cannot take it.
73 */
74static inline void do_pte_lock(spinlock_t *ptl)
75{
76 /*
77 * Use nested version here to indicate that we are already
78 * holding one similar spinlock.
79 */
80 spin_lock_nested(ptl, SINGLE_DEPTH_NESTING);
81}
82
83static inline void do_pte_unlock(spinlock_t *ptl)
84{
85 spin_unlock(ptl);
86}
87#else /* !USE_SPLIT_PTLOCKS */
88static inline void do_pte_lock(spinlock_t *ptl) {}
89static inline void do_pte_unlock(spinlock_t *ptl) {}
90#endif /* USE_SPLIT_PTLOCKS */
91
68static int adjust_pte(struct vm_area_struct *vma, unsigned long address, 92static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
69 unsigned long pfn) 93 unsigned long pfn)
70{ 94{
@@ -89,11 +113,11 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address,
89 */ 113 */
90 ptl = pte_lockptr(vma->vm_mm, pmd); 114 ptl = pte_lockptr(vma->vm_mm, pmd);
91 pte = pte_offset_map_nested(pmd, address); 115 pte = pte_offset_map_nested(pmd, address);
92 spin_lock(ptl); 116 do_pte_lock(ptl);
93 117
94 ret = do_adjust_pte(vma, address, pfn, pte); 118 ret = do_adjust_pte(vma, address, pfn, pte);
95 119
96 spin_unlock(ptl); 120 do_pte_unlock(ptl);
97 pte_unmap_nested(pte); 121 pte_unmap_nested(pte);
98 122
99 return ret; 123 return ret;
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 7185b00650fe..4e2f620de09b 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -282,6 +282,12 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
282 memblock_reserve(__pa(_stext), _end - _stext); 282 memblock_reserve(__pa(_stext), _end - _stext);
283#endif 283#endif
284#ifdef CONFIG_BLK_DEV_INITRD 284#ifdef CONFIG_BLK_DEV_INITRD
285 if (phys_initrd_size &&
286 memblock_is_region_reserved(phys_initrd_start, phys_initrd_size)) {
287 pr_err("INITRD: 0x%08lx+0x%08lx overlaps in-use memory region - disabling initrd\n",
288 phys_initrd_start, phys_initrd_size);
289 phys_initrd_start = phys_initrd_size = 0;
290 }
285 if (phys_initrd_size) { 291 if (phys_initrd_size) {
286 memblock_reserve(phys_initrd_start, phys_initrd_size); 292 memblock_reserve(phys_initrd_start, phys_initrd_size);
287 293
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index ec7eddf9e525..f5c5b8da9a87 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -30,6 +30,7 @@
30#include <linux/irq.h> 30#include <linux/irq.h>
31#include <linux/io.h> 31#include <linux/io.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/delay.h>
33 34
34#include <asm/system.h> 35#include <asm/system.h>
35#include <mach/hardware.h> 36#include <mach/hardware.h>
@@ -996,11 +997,17 @@ void omap_start_dma(int lch)
996 l = dma_read(CCR(lch)); 997 l = dma_read(CCR(lch));
997 998
998 /* 999 /*
999 * Errata: On ES2.0 BUFFERING disable must be set. 1000 * Errata: Inter Frame DMA buffering issue (All OMAP2420 and
1000 * This will always fail on ES1.0 1001 * OMAP2430ES1.0): DMA will wrongly buffer elements if packing and
1002 * bursting is enabled. This might result in data gets stalled in
1003 * FIFO at the end of the block.
1004 * Workaround: DMA channels must have BUFFERING_DISABLED bit set to
1005 * guarantee no data will stay in the DMA FIFO in case inter frame
1006 * buffering occurs.
1001 */ 1007 */
1002 if (cpu_is_omap24xx()) 1008 if (cpu_is_omap2420() ||
1003 l |= OMAP_DMA_CCR_EN; 1009 (cpu_is_omap2430() && (omap_type() == OMAP2430_REV_ES1_0)))
1010 l |= OMAP_DMA_CCR_BUFFERING_DISABLE;
1004 1011
1005 l |= OMAP_DMA_CCR_EN; 1012 l |= OMAP_DMA_CCR_EN;
1006 dma_write(l, CCR(lch)); 1013 dma_write(l, CCR(lch));
@@ -1018,8 +1025,39 @@ void omap_stop_dma(int lch)
1018 dma_write(0, CICR(lch)); 1025 dma_write(0, CICR(lch));
1019 1026
1020 l = dma_read(CCR(lch)); 1027 l = dma_read(CCR(lch));
1021 l &= ~OMAP_DMA_CCR_EN; 1028 /* OMAP3 Errata i541: sDMA FIFO draining does not finish */
1022 dma_write(l, CCR(lch)); 1029 if (cpu_is_omap34xx() && (l & OMAP_DMA_CCR_SEL_SRC_DST_SYNC)) {
1030 int i = 0;
1031 u32 sys_cf;
1032
1033 /* Configure No-Standby */
1034 l = dma_read(OCP_SYSCONFIG);
1035 sys_cf = l;
1036 l &= ~DMA_SYSCONFIG_MIDLEMODE_MASK;
1037 l |= DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_NO_IDLE);
1038 dma_write(l , OCP_SYSCONFIG);
1039
1040 l = dma_read(CCR(lch));
1041 l &= ~OMAP_DMA_CCR_EN;
1042 dma_write(l, CCR(lch));
1043
1044 /* Wait for sDMA FIFO drain */
1045 l = dma_read(CCR(lch));
1046 while (i < 100 && (l & (OMAP_DMA_CCR_RD_ACTIVE |
1047 OMAP_DMA_CCR_WR_ACTIVE))) {
1048 udelay(5);
1049 i++;
1050 l = dma_read(CCR(lch));
1051 }
1052 if (i >= 100)
1053 printk(KERN_ERR "DMA drain did not complete on "
1054 "lch %d\n", lch);
1055 /* Restore OCP_SYSCONFIG */
1056 dma_write(sys_cf, OCP_SYSCONFIG);
1057 } else {
1058 l &= ~OMAP_DMA_CCR_EN;
1059 dma_write(l, CCR(lch));
1060 }
1023 1061
1024 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) { 1062 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
1025 int next_lch, cur_lch = lch; 1063 int next_lch, cur_lch = lch;
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index af3a03941add..cf66f85a011c 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -335,6 +335,10 @@
335#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11) 335#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11)
336 336
337#define OMAP_DMA_CCR_EN (1 << 7) 337#define OMAP_DMA_CCR_EN (1 << 7)
338#define OMAP_DMA_CCR_RD_ACTIVE (1 << 9)
339#define OMAP_DMA_CCR_WR_ACTIVE (1 << 10)
340#define OMAP_DMA_CCR_SEL_SRC_DST_SYNC (1 << 24)
341#define OMAP_DMA_CCR_BUFFERING_DISABLE (1 << 25)
338 342
339#define OMAP_DMA_DATA_TYPE_S8 0x00 343#define OMAP_DMA_DATA_TYPE_S8 0x00
340#define OMAP_DMA_DATA_TYPE_S16 0x01 344#define OMAP_DMA_DATA_TYPE_S16 0x01