diff options
author | Will Deacon <will.deacon@arm.com> | 2013-12-17 13:50:11 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-12-29 07:46:50 -0500 |
commit | cb601185da996656e0bcef46a89a5a2d9619b071 (patch) | |
tree | 536a2d8a53326c3157295921a408b83e2af85a1d | |
parent | 5d49750933210457ec2d5e8507823e365b2604fb (diff) |
ARM: 7927/1: dcache: select DCACHE_WORD_ACCESS for big-endian CPUs
With commit 11ec50caedb5 ("word-at-a-time: provide generic big-endian
zero_bytemask implementation"), the asm-generic word-at-a-time code now
provides a zero_bytemask implementation, allowing us to make use of
DCACHE_WORD_ACCESS on big-endian CPUs, providing our
load_unaligned_zeropad function is endianness-clean.
This patch reworks the load_unaligned_zeropad fixup code to work for
both big- and little-endian CPUs, then removes the !CPU_BIG_ENDIAN check
when selecting DCACHE_WORD_ACCESS.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/word-at-a-time.h | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 75597213c5b8..810a0c4b03b4 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -12,7 +12,7 @@ config ARM | |||
12 | select BUILDTIME_EXTABLE_SORT if MMU | 12 | select BUILDTIME_EXTABLE_SORT if MMU |
13 | select CLONE_BACKWARDS | 13 | select CLONE_BACKWARDS |
14 | select CPU_PM if (SUSPEND || CPU_IDLE) | 14 | select CPU_PM if (SUSPEND || CPU_IDLE) |
15 | select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN && MMU | 15 | select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU |
16 | select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI) | 16 | select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI) |
17 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP | 17 | select GENERIC_CLOCKEVENTS_BROADCAST if SMP |
18 | select GENERIC_IDLE_POLL_SETUP | 18 | select GENERIC_IDLE_POLL_SETUP |
diff --git a/arch/arm/include/asm/word-at-a-time.h b/arch/arm/include/asm/word-at-a-time.h index 4d52f92967a6..a6d0a29861e7 100644 --- a/arch/arm/include/asm/word-at-a-time.h +++ b/arch/arm/include/asm/word-at-a-time.h | |||
@@ -48,10 +48,14 @@ static inline unsigned long find_zero(unsigned long mask) | |||
48 | return ret; | 48 | return ret; |
49 | } | 49 | } |
50 | 50 | ||
51 | #ifdef CONFIG_DCACHE_WORD_ACCESS | ||
52 | |||
53 | #define zero_bytemask(mask) (mask) | 51 | #define zero_bytemask(mask) (mask) |
54 | 52 | ||
53 | #else /* __ARMEB__ */ | ||
54 | #include <asm-generic/word-at-a-time.h> | ||
55 | #endif | ||
56 | |||
57 | #ifdef CONFIG_DCACHE_WORD_ACCESS | ||
58 | |||
55 | /* | 59 | /* |
56 | * Load an unaligned word from kernel space. | 60 | * Load an unaligned word from kernel space. |
57 | * | 61 | * |
@@ -73,7 +77,11 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) | |||
73 | " bic %2, %2, #0x3\n" | 77 | " bic %2, %2, #0x3\n" |
74 | " ldr %0, [%2]\n" | 78 | " ldr %0, [%2]\n" |
75 | " lsl %1, %1, #0x3\n" | 79 | " lsl %1, %1, #0x3\n" |
80 | #ifndef __ARMEB__ | ||
76 | " lsr %0, %0, %1\n" | 81 | " lsr %0, %0, %1\n" |
82 | #else | ||
83 | " lsl %0, %0, %1\n" | ||
84 | #endif | ||
77 | " b 2b\n" | 85 | " b 2b\n" |
78 | " .popsection\n" | 86 | " .popsection\n" |
79 | " .pushsection __ex_table,\"a\"\n" | 87 | " .pushsection __ex_table,\"a\"\n" |
@@ -86,11 +94,5 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) | |||
86 | return ret; | 94 | return ret; |
87 | } | 95 | } |
88 | 96 | ||
89 | |||
90 | #endif /* DCACHE_WORD_ACCESS */ | 97 | #endif /* DCACHE_WORD_ACCESS */ |
91 | |||
92 | #else /* __ARMEB__ */ | ||
93 | #include <asm-generic/word-at-a-time.h> | ||
94 | #endif | ||
95 | |||
96 | #endif /* __ASM_ARM_WORD_AT_A_TIME_H */ | 98 | #endif /* __ASM_ARM_WORD_AT_A_TIME_H */ |