forked from luck/tmp_suning_uos_patched
ARM: 6527/1: Use CTR instead of CCSIDR for the D-cache line size on ARMv7
The current implementation of the dcache_line_size macro reads the L1 cache size from the CCSIDR register. This, however, is not guaranteed to be the smallest cache line in the cache hierarchy. The patch changes to the macro to use the more architecturally correct CTR register. Reported-by: Kevin Sapp <ksapp@quicinc.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
6313e3c217
commit
f91e2c3bd4
@ -61,14 +61,14 @@
|
|||||||
.endm
|
.endm
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cache_line_size - get the cache line size from the CSIDR register
|
* dcache_line_size - get the minimum D-cache line size from the CTR register
|
||||||
* (available on ARMv7+). It assumes that the CSSR register was configured
|
* on ARMv7.
|
||||||
* to access the L1 data cache CSIDR.
|
|
||||||
*/
|
*/
|
||||||
.macro dcache_line_size, reg, tmp
|
.macro dcache_line_size, reg, tmp
|
||||||
mrc p15, 1, \tmp, c0, c0, 0 @ read CSIDR
|
mrc p15, 0, \tmp, c0, c0, 1 @ read ctr
|
||||||
and \tmp, \tmp, #7 @ cache line size encoding
|
lsr \tmp, \tmp, #16
|
||||||
mov \reg, #16 @ size offset
|
and \tmp, \tmp, #0xf @ cache line size encoding
|
||||||
|
mov \reg, #4 @ bytes per word
|
||||||
mov \reg, \reg, lsl \tmp @ actual cache line size
|
mov \reg, \reg, lsl \tmp @ actual cache line size
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user