diff options
| -rw-r--r-- | arch/arm/include/asm/pgtable.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/system.h | 2 | ||||
| -rw-r--r-- | arch/arm/mm/Kconfig | 19 |
3 files changed, 21 insertions, 2 deletions
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h index 11397687f42c..ab68cf1ef80f 100644 --- a/arch/arm/include/asm/pgtable.h +++ b/arch/arm/include/asm/pgtable.h | |||
| @@ -314,7 +314,7 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
| 314 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED) | 314 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_UNCACHED) |
| 315 | #define pgprot_writecombine(prot) \ | 315 | #define pgprot_writecombine(prot) \ |
| 316 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE) | 316 | __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE) |
| 317 | #if __LINUX_ARM_ARCH__ >= 7 | 317 | #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE |
| 318 | #define pgprot_dmacoherent(prot) \ | 318 | #define pgprot_dmacoherent(prot) \ |
| 319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) | 319 | __pgprot_modify(prot, L_PTE_MT_MASK|L_PTE_EXEC, L_PTE_MT_BUFFERABLE) |
| 320 | #else | 320 | #else |
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index ca88e6a84707..02f5d99adbc0 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
| @@ -137,7 +137,7 @@ extern unsigned int user_debug; | |||
| 137 | #define dmb() __asm__ __volatile__ ("" : : : "memory") | 137 | #define dmb() __asm__ __volatile__ ("" : : : "memory") |
| 138 | #endif | 138 | #endif |
| 139 | 139 | ||
| 140 | #if __LINUX_ARM_ARCH__ >= 7 || defined(CONFIG_SMP) | 140 | #if defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) |
| 141 | #define mb() dmb() | 141 | #define mb() dmb() |
| 142 | #define rmb() dmb() | 142 | #define rmb() dmb() |
| 143 | #define wmb() dmb() | 143 | #define wmb() dmb() |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index c4ed9f93f646..573528d9c6d8 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
| @@ -781,3 +781,22 @@ config ARM_L1_CACHE_SHIFT | |||
| 781 | int | 781 | int |
| 782 | default 6 if ARM_L1_CACHE_SHIFT_6 | 782 | default 6 if ARM_L1_CACHE_SHIFT_6 |
| 783 | default 5 | 783 | default 5 |
| 784 | |||
| 785 | config ARM_DMA_MEM_BUFFERABLE | ||
| 786 | bool "Use non-cacheable memory for DMA" if CPU_V6 && !CPU_V7 | ||
| 787 | default y if CPU_V6 || CPU_V7 | ||
| 788 | help | ||
| 789 | Historically, the kernel has used strongly ordered mappings to | ||
| 790 | provide DMA coherent memory. With the advent of ARMv7, mapping | ||
| 791 | memory with differing types results in unpredictable behaviour, | ||
| 792 | so on these CPUs, this option is forced on. | ||
| 793 | |||
| 794 | Multiple mappings with differing attributes is also unpredictable | ||
| 795 | on ARMv6 CPUs, but since they do not have aggressive speculative | ||
| 796 | prefetch, no harm appears to occur. | ||
| 797 | |||
| 798 | However, drivers may be missing the necessary barriers for ARMv6, | ||
| 799 | and therefore turning this on may result in unpredictable driver | ||
| 800 | behaviour. Therefore, we offer this as an option. | ||
| 801 | |||
| 802 | You are recommended say 'Y' here and debug any affected drivers. | ||
