diff options
author | Masahiro Yamada | 2016-01-17 10:13:18 +0900 |
---|---|---|
committer | Masahiro Yamada | 2016-01-20 08:40:02 +0900 |
commit | 6d95778283e239bce0ed2c2c466823a1404f7948 (patch) | |
tree | 261f17a5271a470765967b69d93a90ba1e7b2493 | |
parent | 5407735935359c6c7f6accc0b3839550107dced3 (diff) |
ARM: uniphier: fix range invalidate for outer cache
If invalidate operation is invoked against a cache-unaliged region,
the both ends of the region should be flushed, not invalidated.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | arch/arm/mach-uniphier/cache_uniphier.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-uniphier/cache_uniphier.c b/arch/arm/mach-uniphier/cache_uniphier.c index 6c773161ba4..8435a3300a4 100644 --- a/arch/arm/mach-uniphier/cache_uniphier.c +++ b/arch/arm/mach-uniphier/cache_uniphier.c @@ -105,6 +105,29 @@ void v7_outer_cache_flush_range(u32 start, u32 end) void v7_outer_cache_inval_range(u32 start, u32 end) { + if (start & (SSC_LINE_SIZE - 1)) { + start &= ~(SSC_LINE_SIZE - 1); + __uniphier_cache_maint_range(start, SSC_LINE_SIZE, + SSCOQM_CM_WB_INV); + start += SSC_LINE_SIZE; + } + + if (start >= end) { + uniphier_cache_sync(); + return; + } + + if (end & (SSC_LINE_SIZE - 1)) { + end &= ~(SSC_LINE_SIZE - 1); + __uniphier_cache_maint_range(end, SSC_LINE_SIZE, + SSCOQM_CM_WB_INV); + } + + if (start >= end) { + uniphier_cache_sync(); + return; + } + uniphier_cache_maint_range(start, end, SSCOQM_CM_INV); } |