summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>2018-03-21 15:59:05 +0300
committerAlexey Brodkin <abrodkin@synopsys.com>2018-03-21 17:06:55 +0300
commit6b85b26e4bc76bcc92571ae90c913b57ae32423c (patch)
treea46be65f753b56d371088a71eafd3e590a7e3f18
parent9f0253c61acaa5c86adb3f6d41a5f95102609aa0 (diff)
ARC: Cache: Refactor arc_ioc_setup()
Move all checks before cache flush and IOC setup. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
-rw-r--r--arch/arc/lib/cache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index 99776066d3..8203fae145 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -386,11 +386,15 @@ static void arc_ioc_setup(void)
if (!dcache_enabled())
panic("Try to enable IOC but L1 D$ is disabled");
- flush_n_invalidate_dcache_all();
-
if (!is_power_of_2(ap_size) || ap_size < 4096)
panic("IOC Aperture size must be power of 2 and bigger 4Kib");
+ /* IOC Aperture start must be aligned to the size of the aperture */
+ if (ap_base % ap_size != 0)
+ panic("IOC Aperture start must be aligned to the size of the aperture");
+
+ flush_n_invalidate_dcache_all();
+
/*
* IOC Aperture size decoded as 2 ^ (SIZE + 2) KB,
* so setting 0x11 implies 512M, 0x12 implies 1G...
@@ -398,10 +402,6 @@ static void arc_ioc_setup(void)
write_aux_reg(ARC_AUX_IO_COH_AP0_SIZE,
order_base_2(ap_size / 1024) - 2);
- /* IOC Aperture start must be aligned to the size of the aperture */
- if (ap_base % ap_size != 0)
- panic("IOC Aperture start must be aligned to the size of the aperture");
-
write_aux_reg(ARC_AUX_IO_COH_AP0_BASE, ap_base >> 12);
write_aux_reg(ARC_AUX_IO_COH_PARTIAL, 1);
write_aux_reg(ARC_AUX_IO_COH_ENABLE, 1);