From 95b0f9ea66661681f6ae081ea28416744d622c07 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 8 Feb 2010 16:41:38 +0100 Subject: microblaze: Improve TLB calculation for small systems Systems with small amount of memory need to be handled differently. Linux can't allocate the whole 32MB with two TLBs because then there is no MMU protection. Signed-off-by: Michal Simek --- arch/microblaze/mm/init.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'arch/microblaze/mm') diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c index 95297b13dd9..ce80823051b 100644 --- a/arch/microblaze/mm/init.c +++ b/arch/microblaze/mm/init.c @@ -398,10 +398,16 @@ asmlinkage void __init mmu_init(void) machine_restart(NULL); } - if ((u32) memblock.memory.regions[0].size < 0x1000000) { - printk(KERN_EMERG "Memory must be greater than 16MB\n"); + if ((u32) memblock.memory.regions[0].size < 0x400000) { + printk(KERN_EMERG "Memory must be greater than 4MB\n"); machine_restart(NULL); } + + if ((u32) memblock.memory.regions[0].size < kernel_tlb) { + printk(KERN_EMERG "Kernel size is greater than memory node\n"); + machine_restart(NULL); + } + /* Find main memory where the kernel is */ memory_start = (u32) memblock.memory.regions[0].base; lowmem_size = memory_size = (u32) memblock.memory.regions[0].size; @@ -462,11 +468,11 @@ void __init *early_get_page(void) p = alloc_bootmem_pages(PAGE_SIZE); } else { /* - * Mem start + 32MB -> here is limit + * Mem start + kernel_tlb -> here is limit * because of mem mapping from head.S */ p = __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE, - memory_start + 0x2000000)); + memory_start + kernel_tlb)); } return p; } -- cgit v1.2.3-70-g09d2