aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/mm
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2010-02-08 10:41:38 -0500
committerMichal Simek <monstr@monstr.eu>2012-03-23 04:28:18 -0400
commit95b0f9ea66661681f6ae081ea28416744d622c07 (patch)
treec4d387b9e4a5add47945be3036c7e5682ea5330c /arch/microblaze/mm
parent3a1d26769f61fe8a1f517a66dfcee935a76fd61c (diff)
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 <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/mm')
-rw-r--r--arch/microblaze/mm/init.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/arch/microblaze/mm/init.c b/arch/microblaze/mm/init.c
index 95297b13dd9e..ce80823051ba 100644
--- a/arch/microblaze/mm/init.c
+++ b/arch/microblaze/mm/init.c
@@ -398,10 +398,16 @@ asmlinkage void __init mmu_init(void)
398 machine_restart(NULL); 398 machine_restart(NULL);
399 } 399 }
400 400
401 if ((u32) memblock.memory.regions[0].size < 0x1000000) { 401 if ((u32) memblock.memory.regions[0].size < 0x400000) {
402 printk(KERN_EMERG "Memory must be greater than 16MB\n"); 402 printk(KERN_EMERG "Memory must be greater than 4MB\n");
403 machine_restart(NULL); 403 machine_restart(NULL);
404 } 404 }
405
406 if ((u32) memblock.memory.regions[0].size < kernel_tlb) {
407 printk(KERN_EMERG "Kernel size is greater than memory node\n");
408 machine_restart(NULL);
409 }
410
405 /* Find main memory where the kernel is */ 411 /* Find main memory where the kernel is */
406 memory_start = (u32) memblock.memory.regions[0].base; 412 memory_start = (u32) memblock.memory.regions[0].base;
407 lowmem_size = memory_size = (u32) memblock.memory.regions[0].size; 413 lowmem_size = memory_size = (u32) memblock.memory.regions[0].size;
@@ -462,11 +468,11 @@ void __init *early_get_page(void)
462 p = alloc_bootmem_pages(PAGE_SIZE); 468 p = alloc_bootmem_pages(PAGE_SIZE);
463 } else { 469 } else {
464 /* 470 /*
465 * Mem start + 32MB -> here is limit 471 * Mem start + kernel_tlb -> here is limit
466 * because of mem mapping from head.S 472 * because of mem mapping from head.S
467 */ 473 */
468 p = __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE, 474 p = __va(memblock_alloc_base(PAGE_SIZE, PAGE_SIZE,
469 memory_start + 0x2000000)); 475 memory_start + kernel_tlb));
470 } 476 }
471 return p; 477 return p;
472} 478}