@@ -96,6 +96,7 @@ static inline int pmb_unmap(void __iomem *addr)
#endif /* CONFIG_PMB */
+void __init early_reserve_mem(void);
static inline void __iomem *
pmb_remap(phys_addr_t phys, unsigned long size, pgprot_t prot)
{
@@ -40,6 +40,7 @@
#include <asm/setup.h>
#include <asm/clock.h>
#include <asm/smp.h>
+#include <asm/mmu.h>
#include <asm/mmu_context.h>
#include <asm/mmzone.h>
#include <asm/processor.h>
@@ -319,6 +320,8 @@ void __init setup_arch(char **cmdline_p)
sh_mv_setup();
+ early_reserve_mem();
+
/* Let earlyprintk output early console messages */
sh_early_platform_driver_probe("earlyprintk", 1, 1);
@@ -19,6 +19,7 @@
#include <linux/io.h>
#include <linux/dma-mapping.h>
#include <linux/export.h>
+#include <asm/mmu.h>
#include <asm/mmu_context.h>
#include <asm/mmzone.h>
#include <asm/kexec.h>
@@ -242,7 +243,7 @@ static void __init do_init_bootmem(void)
sparse_init();
}
-static void __init early_reserve_mem(void)
+void __init early_reserve_mem(void)
{
unsigned long start_pfn;
u32 zero_base = (u32)__MEMORY_START + (u32)PHYSICAL_OFFSET;
@@ -282,8 +283,6 @@ void __init paging_init(void)
sh_mv.mv_mem_init();
- early_reserve_mem();
-
/*
* Once the early reservations are out of the way, give the
* platforms a chance to kick out some memory.
early_reserve_mem() reserves memory for important regions in the kernel such as kernel text region and bootmem bitmap. Reserving these memory regions should take precedence over any other reserved memory allocations so that the system does not unknowingly reserve them for some other use case. Hence, move the call site of early_reserve_mem() out of the paging_init() function and into an earlier point in setup_arch() Signed-off-by: Oreoluwa Babatunde <quic_obabatun@quicinc.com> --- arch/sh/include/asm/mmu.h | 1 + arch/sh/kernel/setup.c | 3 +++ arch/sh/mm/init.c | 5 ++--- 3 files changed, 6 insertions(+), 3 deletions(-)