summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-01-17 10:13:17 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2016-01-20 08:39:52 +0900
commit5407735935359c6c7f6accc0b3839550107dced3 (patch)
tree60a41392f6d0ca03f46658f17c2efbac881ea4fb /arch
parentcefca48ca7f1c46bf2e3a64a40fa0c1aaf575a42 (diff)
downloadu-boot-5407735935359c6c7f6accc0b3839550107dced3.tar.gz
u-boot-5407735935359c6c7f6accc0b3839550107dced3.tar.xz
u-boot-5407735935359c6c7f6accc0b3839550107dced3.zip
ARM: uniphier: factor out outer cache sync as a helper function
Avoid repeating the same code. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-uniphier/cache_uniphier.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/arm/mach-uniphier/cache_uniphier.c b/arch/arm/mach-uniphier/cache_uniphier.c
index 4a79966659..6c773161ba 100644
--- a/arch/arm/mach-uniphier/cache_uniphier.c
+++ b/arch/arm/mach-uniphier/cache_uniphier.c
@@ -11,6 +11,12 @@
#include "ssc-regs.h"
#ifdef CONFIG_UNIPHIER_L2CACHE_ON
+static void uniphier_cache_sync(void)
+{
+ writel(SSCOPE_CM_SYNC, SSCOPE); /* drain internal buffers */
+ readl(SSCOPE); /* need a read back to confirm */
+}
+
static void uniphier_cache_maint_all(u32 operation)
{
/* try until the command is successfully set */
@@ -25,8 +31,7 @@ static void uniphier_cache_maint_all(u32 operation)
/* clear the complete notification flag */
writel(SSCOLPQS_EF, SSCOLPQS);
- writel(SSCOPE_CM_SYNC, SSCOPE); /* drain internal buffers */
- readl(SSCOPE); /* need a read back to confirm */
+ uniphier_cache_sync();
}
void v7_outer_cache_flush_all(void)
@@ -90,8 +95,7 @@ static void uniphier_cache_maint_range(u32 start, u32 end, u32 operation)
size -= chunk_size;
}
- writel(SSCOPE_CM_SYNC, SSCOPE); /* drain internal buffers */
- readl(SSCOPE); /* need a read back to confirm */
+ uniphier_cache_sync();
}
void v7_outer_cache_flush_range(u32 start, u32 end)