aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig3
-rw-r--r--arch/arm/include/asm/processor.h4
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c4
-rw-r--r--arch/arm/mach-omap2/clock44xx_data.c2
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c9
-rw-r--r--arch/arm/mach-omap2/pm34xx.c4
-rw-r--r--arch/arm/mach-omap2/usb-ehci.c2
-rw-r--r--arch/arm/mach-realview/realview_eb.c3
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c3
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c3
-rw-r--r--arch/arm/mach-realview/realview_pba8.c3
-rw-r--r--arch/arm/mach-realview/realview_pbx.c3
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c4
-rw-r--r--arch/arm/mm/Kconfig19
-rw-r--r--arch/arm/mm/cache-v6.S18
-rw-r--r--arch/arm/mm/dma-mapping.c18
-rw-r--r--arch/arm/plat-omap/dmtimer.c6
-rw-r--r--arch/arm/plat-omap/gpio.c1
-rw-r--r--arch/arm/plat-omap/iovmm.c4
19 files changed, 81 insertions, 32 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1f254bd6c93..98922f7d2d1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -955,7 +955,8 @@ config XSCALE_PMU
955 default y 955 default y
956 956
957config CPU_HAS_PMU 957config CPU_HAS_PMU
958 depends on CPU_V6 || CPU_V7 || XSCALE_PMU 958 depends on (CPU_V6 || CPU_V7 || XSCALE_PMU) && \
959 (!ARCH_OMAP3 || OMAP3_EMU)
959 default y 960 default y
960 bool 961 bool
961 962
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index 6a89567ffc5..7bed3daf83b 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -91,7 +91,11 @@ extern void release_thread(struct task_struct *);
91 91
92unsigned long get_wchan(struct task_struct *p); 92unsigned long get_wchan(struct task_struct *p);
93 93
94#if __LINUX_ARM_ARCH__ == 6
95#define cpu_relax() smp_mb()
96#else
94#define cpu_relax() barrier() 97#define cpu_relax() barrier()
98#endif
95 99
96/* 100/*
97 * Create a new kernel thread 101 * Create a new kernel thread
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index f848ba8dbc1..a04cffd691c 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -538,9 +538,7 @@ static void ads7846_dev_init(void)
538 printk(KERN_ERR "can't get ads7846 pen down GPIO\n"); 538 printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
539 539
540 gpio_direction_input(OMAP3_STALKER_TS_GPIO); 540 gpio_direction_input(OMAP3_STALKER_TS_GPIO);
541 541 gpio_set_debounce(OMAP3_STALKER_TS_GPIO, 310);
542 omap_set_gpio_debounce(OMAP3_STALKER_TS_GPIO, 1);
543 omap_set_gpio_debounce_time(OMAP3_STALKER_TS_GPIO, 0xa);
544} 542}
545 543
546static int ads7846_get_pendown_state(void) 544static int ads7846_get_pendown_state(void)
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c
index 02804224517..e10db7a90cb 100644
--- a/arch/arm/mach-omap2/clock44xx_data.c
+++ b/arch/arm/mach-omap2/clock44xx_data.c
@@ -1369,6 +1369,7 @@ static struct clk emif1_ick = {
1369 .ops = &clkops_omap2_dflt, 1369 .ops = &clkops_omap2_dflt,
1370 .enable_reg = OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL, 1370 .enable_reg = OMAP4430_CM_MEMIF_EMIF_1_CLKCTRL,
1371 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1371 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1372 .flags = ENABLE_ON_INIT,
1372 .clkdm_name = "l3_emif_clkdm", 1373 .clkdm_name = "l3_emif_clkdm",
1373 .parent = &ddrphy_ck, 1374 .parent = &ddrphy_ck,
1374 .recalc = &followparent_recalc, 1375 .recalc = &followparent_recalc,
@@ -1379,6 +1380,7 @@ static struct clk emif2_ick = {
1379 .ops = &clkops_omap2_dflt, 1380 .ops = &clkops_omap2_dflt,
1380 .enable_reg = OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL, 1381 .enable_reg = OMAP4430_CM_MEMIF_EMIF_2_CLKCTRL,
1381 .enable_bit = OMAP4430_MODULEMODE_HWCTRL, 1382 .enable_bit = OMAP4430_MODULEMODE_HWCTRL,
1383 .flags = ENABLE_ON_INIT,
1382 .clkdm_name = "l3_emif_clkdm", 1384 .clkdm_name = "l3_emif_clkdm",
1383 .parent = &ddrphy_ck, 1385 .parent = &ddrphy_ck,
1384 .recalc = &followparent_recalc, 1386 .recalc = &followparent_recalc,
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 95c9a5f774e..b7a4133267d 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -409,10 +409,11 @@ static int _init_main_clk(struct omap_hwmod *oh)
409 return 0; 409 return 0;
410 410
411 oh->_clk = omap_clk_get_by_name(oh->main_clk); 411 oh->_clk = omap_clk_get_by_name(oh->main_clk);
412 if (!oh->_clk) 412 if (!oh->_clk) {
413 pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n", 413 pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n",
414 oh->name, oh->main_clk); 414 oh->name, oh->main_clk);
415 return -EINVAL; 415 return -EINVAL;
416 }
416 417
417 if (!oh->_clk->clkdm) 418 if (!oh->_clk->clkdm)
418 pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n", 419 pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n",
@@ -444,10 +445,11 @@ static int _init_interface_clks(struct omap_hwmod *oh)
444 continue; 445 continue;
445 446
446 c = omap_clk_get_by_name(os->clk); 447 c = omap_clk_get_by_name(os->clk);
447 if (!c) 448 if (!c) {
448 pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n", 449 pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n",
449 oh->name, os->clk); 450 oh->name, os->clk);
450 ret = -EINVAL; 451 ret = -EINVAL;
452 }
451 os->_clk = c; 453 os->_clk = c;
452 } 454 }
453 455
@@ -470,10 +472,11 @@ static int _init_opt_clks(struct omap_hwmod *oh)
470 472
471 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) { 473 for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) {
472 c = omap_clk_get_by_name(oc->clk); 474 c = omap_clk_get_by_name(oc->clk);
473 if (!c) 475 if (!c) {
474 pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n", 476 pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n",
475 oh->name, oc->clk); 477 oh->name, oc->clk);
476 ret = -EINVAL; 478 ret = -EINVAL;
479 }
477 oc->_clk = c; 480 oc->_clk = c;
478 } 481 }
479 482
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 2e967716cc3..b88737fd6cf 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -99,7 +99,7 @@ static void omap3_enable_io_chain(void)
99 /* Do a readback to assure write has been done */ 99 /* Do a readback to assure write has been done */
100 prm_read_mod_reg(WKUP_MOD, PM_WKEN); 100 prm_read_mod_reg(WKUP_MOD, PM_WKEN);
101 101
102 while (!(prm_read_mod_reg(WKUP_MOD, PM_WKST) & 102 while (!(prm_read_mod_reg(WKUP_MOD, PM_WKEN) &
103 OMAP3430_ST_IO_CHAIN_MASK)) { 103 OMAP3430_ST_IO_CHAIN_MASK)) {
104 timeout++; 104 timeout++;
105 if (timeout > 1000) { 105 if (timeout > 1000) {
@@ -108,7 +108,7 @@ static void omap3_enable_io_chain(void)
108 return; 108 return;
109 } 109 }
110 prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK, 110 prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK,
111 WKUP_MOD, PM_WKST); 111 WKUP_MOD, PM_WKEN);
112 } 112 }
113 } 113 }
114} 114}
diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c
index c68f799e83c..d72d1ac3033 100644
--- a/arch/arm/mach-omap2/usb-ehci.c
+++ b/arch/arm/mach-omap2/usb-ehci.c
@@ -20,6 +20,8 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/dma-mapping.h>
24
23#include <asm/io.h> 25#include <asm/io.h>
24#include <plat/mux.h> 26#include <plat/mux.h>
25 27
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 422ccd70d5f..4425018fab8 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -32,6 +32,7 @@
32#include <asm/leds.h> 32#include <asm/leds.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/pmu.h> 34#include <asm/pmu.h>
35#include <asm/pgtable.h>
35#include <asm/hardware/gic.h> 36#include <asm/hardware/gic.h>
36#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
37#include <asm/localtimer.h> 38#include <asm/localtimer.h>
@@ -457,7 +458,7 @@ static void __init realview_eb_init(void)
457 458
458MACHINE_START(REALVIEW_EB, "ARM-RealView EB") 459MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
459 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 460 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
460 .phys_io = REALVIEW_EB_UART0_BASE, 461 .phys_io = REALVIEW_EB_UART0_BASE & SECTION_MASK,
461 .io_pg_offst = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc, 462 .io_pg_offst = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc,
462 .boot_params = PHYS_OFFSET + 0x00000100, 463 .boot_params = PHYS_OFFSET + 0x00000100,
463 .fixup = realview_fixup, 464 .fixup = realview_fixup,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 96568ebfa2b..099a1f125cf 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -32,6 +32,7 @@
32#include <asm/leds.h> 32#include <asm/leds.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/pmu.h> 34#include <asm/pmu.h>
35#include <asm/pgtable.h>
35#include <asm/hardware/gic.h> 36#include <asm/hardware/gic.h>
36#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
37 38
@@ -351,7 +352,7 @@ static void __init realview_pb1176_init(void)
351 352
352MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176") 353MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
353 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 354 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
354 .phys_io = REALVIEW_PB1176_UART0_BASE, 355 .phys_io = REALVIEW_PB1176_UART0_BASE & SECTION_MASK,
355 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc, 356 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc,
356 .boot_params = PHYS_OFFSET + 0x00000100, 357 .boot_params = PHYS_OFFSET + 0x00000100,
357 .fixup = realview_pb1176_fixup, 358 .fixup = realview_pb1176_fixup,
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index 7fbefbbebaf..0e07a5ccb75 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -32,6 +32,7 @@
32#include <asm/leds.h> 32#include <asm/leds.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include <asm/pmu.h> 34#include <asm/pmu.h>
35#include <asm/pgtable.h>
35#include <asm/hardware/gic.h> 36#include <asm/hardware/gic.h>
36#include <asm/hardware/cache-l2x0.h> 37#include <asm/hardware/cache-l2x0.h>
37#include <asm/localtimer.h> 38#include <asm/localtimer.h>
@@ -373,7 +374,7 @@ static void __init realview_pb11mp_init(void)
373 374
374MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore") 375MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
375 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 376 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
376 .phys_io = REALVIEW_PB11MP_UART0_BASE, 377 .phys_io = REALVIEW_PB11MP_UART0_BASE & SECTION_MASK,
377 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc, 378 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc,
378 .boot_params = PHYS_OFFSET + 0x00000100, 379 .boot_params = PHYS_OFFSET + 0x00000100,
379 .fixup = realview_fixup, 380 .fixup = realview_fixup,
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index d3c113b3dfc..ac2f06f1ca5 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -31,6 +31,7 @@
31#include <asm/leds.h> 31#include <asm/leds.h>
32#include <asm/mach-types.h> 32#include <asm/mach-types.h>
33#include <asm/pmu.h> 33#include <asm/pmu.h>
34#include <asm/pgtable.h>
34#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
35 36
36#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
@@ -323,7 +324,7 @@ static void __init realview_pba8_init(void)
323 324
324MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8") 325MACHINE_START(REALVIEW_PBA8, "ARM-RealView PB-A8")
325 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 326 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
326 .phys_io = REALVIEW_PBA8_UART0_BASE, 327 .phys_io = REALVIEW_PBA8_UART0_BASE & SECTION_MASK,
327 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBA8_UART0_BASE) >> 18) & 0xfffc, 328 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBA8_UART0_BASE) >> 18) & 0xfffc,
328 .boot_params = PHYS_OFFSET + 0x00000100, 329 .boot_params = PHYS_OFFSET + 0x00000100,
329 .fixup = realview_fixup, 330 .fixup = realview_fixup,
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index a235ba30996..08fd683adc4 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -31,6 +31,7 @@
31#include <asm/mach-types.h> 31#include <asm/mach-types.h>
32#include <asm/pmu.h> 32#include <asm/pmu.h>
33#include <asm/smp_twd.h> 33#include <asm/smp_twd.h>
34#include <asm/pgtable.h>
34#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
35#include <asm/hardware/cache-l2x0.h> 36#include <asm/hardware/cache-l2x0.h>
36 37
@@ -409,7 +410,7 @@ static void __init realview_pbx_init(void)
409 410
410MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX") 411MACHINE_START(REALVIEW_PBX, "ARM-RealView PBX")
411 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 412 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
412 .phys_io = REALVIEW_PBX_UART0_BASE, 413 .phys_io = REALVIEW_PBX_UART0_BASE & SECTION_MASK,
413 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBX_UART0_BASE) >> 18) & 0xfffc, 414 .io_pg_offst = (IO_ADDRESS(REALVIEW_PBX_UART0_BASE) >> 18) & 0xfffc,
414 .boot_params = PHYS_OFFSET + 0x00000100, 415 .boot_params = PHYS_OFFSET + 0x00000100,
415 .fixup = realview_pbx_fixup, 416 .fixup = realview_pbx_fixup,
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index e6f73030d5f..6353459bb56 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -2,6 +2,7 @@
2 * Versatile Express Core Tile Cortex A9x4 Support 2 * Versatile Express Core Tile Cortex A9x4 Support
3 */ 3 */
4#include <linux/init.h> 4#include <linux/init.h>
5#include <linux/gfp.h>
5#include <linux/device.h> 6#include <linux/device.h>
6#include <linux/dma-mapping.h> 7#include <linux/dma-mapping.h>
7#include <linux/platform_device.h> 8#include <linux/platform_device.h>
@@ -9,6 +10,7 @@
9#include <linux/amba/clcd.h> 10#include <linux/amba/clcd.h>
10 11
11#include <asm/clkdev.h> 12#include <asm/clkdev.h>
13#include <asm/pgtable.h>
12#include <asm/hardware/arm_timer.h> 14#include <asm/hardware/arm_timer.h>
13#include <asm/hardware/cache-l2x0.h> 15#include <asm/hardware/cache-l2x0.h>
14#include <asm/hardware/gic.h> 16#include <asm/hardware/gic.h>
@@ -235,7 +237,7 @@ static void ct_ca9x4_init(void)
235} 237}
236 238
237MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4") 239MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4")
238 .phys_io = V2M_UART0, 240 .phys_io = V2M_UART0 & SECTION_MASK,
239 .io_pg_offst = (__MMIO_P2V(V2M_UART0) >> 18) & 0xfffc, 241 .io_pg_offst = (__MMIO_P2V(V2M_UART0) >> 18) & 0xfffc,
240 .boot_params = PHYS_OFFSET + 0x00000100, 242 .boot_params = PHYS_OFFSET + 0x00000100,
241 .map_io = ct_ca9x4_map_io, 243 .map_io = ct_ca9x4_map_io,
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 346ae14824a..fc1b2fa5942 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -735,6 +735,25 @@ config NEEDS_SYSCALL_FOR_CMPXCHG
735 Forget about fast user space cmpxchg support. 735 Forget about fast user space cmpxchg support.
736 It is just not possible. 736 It is just not possible.
737 737
738config DMA_CACHE_RWFO
739 bool "Enable read/write for ownership DMA cache maintenance"
740 depends on CPU_V6 && SMP
741 default y
742 help
743 The Snoop Control Unit on ARM11MPCore does not detect the
744 cache maintenance operations and the dma_{map,unmap}_area()
745 functions may leave stale cache entries on other CPUs. By
746 enabling this option, Read or Write For Ownership in the ARMv6
747 DMA cache maintenance functions is performed. These LDR/STR
748 instructions change the cache line state to shared or modified
749 so that the cache operation has the desired effect.
750
751 Note that the workaround is only valid on processors that do
752 not perform speculative loads into the D-cache. For such
753 processors, if cache maintenance operations are not broadcast
754 in hardware, other workarounds are needed (e.g. cache
755 maintenance broadcasting in software via FIQ).
756
738config OUTER_CACHE 757config OUTER_CACHE
739 bool 758 bool
740 759
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S
index e46ecd84713..86aa689ef1a 100644
--- a/arch/arm/mm/cache-v6.S
+++ b/arch/arm/mm/cache-v6.S
@@ -211,8 +211,9 @@ v6_dma_inv_range:
211 mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line 211 mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line
212#endif 212#endif
2131: 2131:
214#ifdef CONFIG_SMP 214#ifdef CONFIG_DMA_CACHE_RWFO
215 str r0, [r0] @ write for ownership 215 ldr r2, [r0] @ read for ownership
216 str r2, [r0] @ write for ownership
216#endif 217#endif
217#ifdef HARVARD_CACHE 218#ifdef HARVARD_CACHE
218 mcr p15, 0, r0, c7, c6, 1 @ invalidate D line 219 mcr p15, 0, r0, c7, c6, 1 @ invalidate D line
@@ -234,7 +235,7 @@ v6_dma_inv_range:
234v6_dma_clean_range: 235v6_dma_clean_range:
235 bic r0, r0, #D_CACHE_LINE_SIZE - 1 236 bic r0, r0, #D_CACHE_LINE_SIZE - 1
2361: 2371:
237#ifdef CONFIG_SMP 238#ifdef CONFIG_DMA_CACHE_RWFO
238 ldr r2, [r0] @ read for ownership 239 ldr r2, [r0] @ read for ownership
239#endif 240#endif
240#ifdef HARVARD_CACHE 241#ifdef HARVARD_CACHE
@@ -257,7 +258,7 @@ v6_dma_clean_range:
257ENTRY(v6_dma_flush_range) 258ENTRY(v6_dma_flush_range)
258 bic r0, r0, #D_CACHE_LINE_SIZE - 1 259 bic r0, r0, #D_CACHE_LINE_SIZE - 1
2591: 2601:
260#ifdef CONFIG_SMP 261#ifdef CONFIG_DMA_CACHE_RWFO
261 ldr r2, [r0] @ read for ownership 262 ldr r2, [r0] @ read for ownership
262 str r2, [r0] @ write for ownership 263 str r2, [r0] @ write for ownership
263#endif 264#endif
@@ -283,9 +284,13 @@ ENTRY(v6_dma_map_area)
283 add r1, r1, r0 284 add r1, r1, r0
284 teq r2, #DMA_FROM_DEVICE 285 teq r2, #DMA_FROM_DEVICE
285 beq v6_dma_inv_range 286 beq v6_dma_inv_range
287#ifndef CONFIG_DMA_CACHE_RWFO
288 b v6_dma_clean_range
289#else
286 teq r2, #DMA_TO_DEVICE 290 teq r2, #DMA_TO_DEVICE
287 beq v6_dma_clean_range 291 beq v6_dma_clean_range
288 b v6_dma_flush_range 292 b v6_dma_flush_range
293#endif
289ENDPROC(v6_dma_map_area) 294ENDPROC(v6_dma_map_area)
290 295
291/* 296/*
@@ -295,6 +300,11 @@ ENDPROC(v6_dma_map_area)
295 * - dir - DMA direction 300 * - dir - DMA direction
296 */ 301 */
297ENTRY(v6_dma_unmap_area) 302ENTRY(v6_dma_unmap_area)
303#ifndef CONFIG_DMA_CACHE_RWFO
304 add r1, r1, r0
305 teq r2, #DMA_TO_DEVICE
306 bne v6_dma_inv_range
307#endif
298 mov pc, lr 308 mov pc, lr
299ENDPROC(v6_dma_unmap_area) 309ENDPROC(v6_dma_unmap_area)
300 310
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 13fa536d82e..9e7742f0a10 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -24,15 +24,6 @@
24#include <asm/tlbflush.h> 24#include <asm/tlbflush.h>
25#include <asm/sizes.h> 25#include <asm/sizes.h>
26 26
27/* Sanity check size */
28#if (CONSISTENT_DMA_SIZE % SZ_2M)
29#error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
30#endif
31
32#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
33#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
34#define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
35
36static u64 get_coherent_dma_mask(struct device *dev) 27static u64 get_coherent_dma_mask(struct device *dev)
37{ 28{
38 u64 mask = ISA_DMA_THRESHOLD; 29 u64 mask = ISA_DMA_THRESHOLD;
@@ -123,6 +114,15 @@ static void __dma_free_buffer(struct page *page, size_t size)
123} 114}
124 115
125#ifdef CONFIG_MMU 116#ifdef CONFIG_MMU
117/* Sanity check size */
118#if (CONSISTENT_DMA_SIZE % SZ_2M)
119#error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
120#endif
121
122#define CONSISTENT_OFFSET(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
123#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
124#define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
125
126/* 126/*
127 * These are the page tables (2MB each) covering uncached, DMA consistent allocations 127 * These are the page tables (2MB each) covering uncached, DMA consistent allocations
128 */ 128 */
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index c64875f11fa..44bafdab2dc 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -541,11 +541,11 @@ void omap_dm_timer_stop(struct omap_dm_timer *timer)
541 * timer is stopped 541 * timer is stopped
542 */ 542 */
543 udelay(3500000 / clk_get_rate(timer->fclk) + 1); 543 udelay(3500000 / clk_get_rate(timer->fclk) + 1);
544 /* Ack possibly pending interrupt */
545 omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG,
546 OMAP_TIMER_INT_OVERFLOW);
547#endif 544#endif
548 } 545 }
546 /* Ack possibly pending interrupt */
547 omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG,
548 OMAP_TIMER_INT_OVERFLOW);
549} 549}
550EXPORT_SYMBOL_GPL(omap_dm_timer_stop); 550EXPORT_SYMBOL_GPL(omap_dm_timer_stop);
551 551
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 393e9219a5b..9b7e3545f32 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -673,6 +673,7 @@ static void _set_gpio_debounce(struct gpio_bank *bank, unsigned gpio,
673 if (cpu_is_omap34xx() || cpu_is_omap44xx()) 673 if (cpu_is_omap34xx() || cpu_is_omap44xx())
674 clk_disable(bank->dbck); 674 clk_disable(bank->dbck);
675 } 675 }
676 bank->dbck_enable_mask = val;
676 677
677 __raw_writel(val, reg); 678 __raw_writel(val, reg);
678} 679}
diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index e43983ba59c..8ce0de247c7 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -140,8 +140,10 @@ static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags)
140 return ERR_PTR(-ENOMEM); 140 return ERR_PTR(-ENOMEM);
141 141
142 err = sg_alloc_table(sgt, nr_entries, GFP_KERNEL); 142 err = sg_alloc_table(sgt, nr_entries, GFP_KERNEL);
143 if (err) 143 if (err) {
144 kfree(sgt);
144 return ERR_PTR(err); 145 return ERR_PTR(err);
146 }
145 147
146 pr_debug("%s: sgt:%p(%d entries)\n", __func__, sgt, nr_entries); 148 pr_debug("%s: sgt:%p(%d entries)\n", __func__, sgt, nr_entries);
147 149