common/board_f: Make reserve_mmu generic
Introduce arch_reserve_mmu to allow for architecture-specific reserve_mmu
routines. Also, define a weak nop stub for it.
Signed-off-by: Ovidiu Panait <ovpanait@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c
index 3cbed60..44dde26 100644
--- a/arch/arm/lib/cache.c
+++ b/arch/arm/lib/cache.c
@@ -121,7 +121,7 @@
}
#endif
-__weak int reserve_mmu(void)
+int arch_reserve_mmu(void)
{
return arm_reserve_mmu();
}
diff --git a/common/board_f.c b/common/board_f.c
index 26309c4..5c650f0 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -385,6 +385,11 @@
return 0;
}
+__weak int arch_reserve_mmu(void)
+{
+ return 0;
+}
+
static int reserve_video(void)
{
#ifdef CONFIG_DM_VIDEO
@@ -951,9 +956,7 @@
reserve_pram,
#endif
reserve_round_4k,
-#ifdef CONFIG_ARM
- reserve_mmu,
-#endif
+ arch_reserve_mmu,
reserve_video,
reserve_trace,
reserve_uboot,
diff --git a/include/init.h b/include/init.h
index 2a33a3f..9ef88c9 100644
--- a/include/init.h
+++ b/include/init.h
@@ -130,6 +130,18 @@
int arch_reserve_stacks(void);
/**
+ * arch_reserve_mmu() - Reserve memory for MMU TLB table
+ *
+ * Architecture-specific routine for reserving memory for the MMU TLB table.
+ * This is used in generic board init sequence in common/board_f.c.
+ *
+ * If an implementation is not provided, it will just be a nop stub.
+ *
+ * Return: 0 if OK
+ */
+int arch_reserve_mmu(void);
+
+/**
* init_cache_f_r() - Turn on the cache in preparation for relocation
*
* Return: 0 if OK, -ve on error
@@ -145,7 +157,6 @@
int print_cpuinfo(void);
#endif
int timer_init(void);
-int reserve_mmu(void);
int misc_init_f(void);
#if defined(CONFIG_DTB_RESELECT)