[U-Boot,16/18] ARC: cache: move pae exists check into slc_upper_region_init

Message ID 20180213173451.6317-17-Eugeniy.Paltsev@synopsys.com
State New
Delegated to: Alexey Brodkin
Headers show
Series
  • ARC: cache subsystem improvement/refactoring
Related show

Commit Message

Eugeniy Paltsev Feb. 13, 2018, 5:34 p.m.
Move pae exists check into slc_upper_region_init function itself
instead of its caller as more appropriate place.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 arch/arc/lib/cache.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

Patch

diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index c706fbd..4e93ab9 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -139,6 +139,14 @@  static void __slc_entire_op(const int op)
 static void slc_upper_region_init(void)
 {
 	/*
+	 * ARC_AUX_SLC_RGN_START1 and ARC_AUX_SLC_RGN_END1 register exist
+	 * only if PAE exists in current HW. So we had to check pae_exist
+	 * before using them.
+	 */
+	if (!pae_exists())
+		return;
+
+	/*
 	 * ARC_AUX_SLC_RGN_END1 and ARC_AUX_SLC_RGN_START1 are always == 0
 	 * as we don't use PAE40.
 	 */
@@ -267,12 +275,7 @@  void cache_init(void)
 	if (is_isa_arcv2() && ioc_status())
 		arc_ioc_setup();
 
-	/*
-	 * ARC_AUX_SLC_RGN_START1 and ARC_AUX_SLC_RGN_END1 register exist
-	 * only if PAE exists in current HW. So we had to check pae_exist
-	 * before using them.
-	 */
-	if (is_isa_arcv2() && slc_exists() && pae_exists())
+	if (is_isa_arcv2() && slc_exists())
 		slc_upper_region_init();
 }