aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/setup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-14 16:05:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-14 16:05:21 -0500
commit4964e0664c80680fa6b28ef91381c076a5b25c2c (patch)
tree62099c5aaeee7274bcc66bcfba35d479affa97cf /arch/mips/kernel/setup.c
parent0a80939b3e6af4b0dc93bf88ec02fd7e90a16f1b (diff)
parent7bf6612e8a9d6a0b3b82e8e2611942be1258b307 (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (119 commits) MIPS: Delete unused function add_temporary_entry. MIPS: Set default pci cache line size. MIPS: Flush huge TLB MIPS: Octeon: Remove SYS_SUPPORTS_HIGHMEM. MIPS: Octeon: Add support for OCTEON II PCIe MIPS: Octeon: Update PCI Latency timer and enable more error reporting. MIPS: Alchemy: Update cpu-feature-overrides MIPS: Alchemy: db1200: Improve PB1200 detection. MIPS: Alchemy: merge Au1000 and Au1300-style IRQ controller code. MIPS: Alchemy: chain IRQ controllers to MIPS IRQ controller MIPS: Alchemy: irq: register pm at irq init time MIPS: Alchemy: Touchscreen support on DB1100 MIPS: Alchemy: Hook up IrDA on DB1000/DB1100 net/irda: convert au1k_ir to platform driver. MIPS: Alchemy: remove unused board headers MTD: nand: make au1550nd.c a platform_driver MIPS: Netlogic: Mark Netlogic chips as SMT capable MIPS: Netlogic: Add support for XLP 3XX cores MIPS: Netlogic: Merge some of XLR/XLP wakup code MIPS: Netlogic: Add default XLP config. ... Fix up trivial conflicts in arch/mips/kernel/{perf_event_mipsxx.c, traps.c} and drivers/tty/serial/Makefile
Diffstat (limited to 'arch/mips/kernel/setup.c')
-rw-r--r--arch/mips/kernel/setup.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index b1cb8f87d7b4..058e964e7303 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -122,6 +122,9 @@ static void __init print_memory_map(void)
122 case BOOT_MEM_RAM: 122 case BOOT_MEM_RAM:
123 printk(KERN_CONT "(usable)\n"); 123 printk(KERN_CONT "(usable)\n");
124 break; 124 break;
125 case BOOT_MEM_INIT_RAM:
126 printk(KERN_CONT "(usable after init)\n");
127 break;
125 case BOOT_MEM_ROM_DATA: 128 case BOOT_MEM_ROM_DATA:
126 printk(KERN_CONT "(ROM data)\n"); 129 printk(KERN_CONT "(ROM data)\n");
127 break; 130 break;
@@ -362,15 +365,24 @@ static void __init bootmem_init(void)
362 for (i = 0; i < boot_mem_map.nr_map; i++) { 365 for (i = 0; i < boot_mem_map.nr_map; i++) {
363 unsigned long start, end, size; 366 unsigned long start, end, size;
364 367
368 start = PFN_UP(boot_mem_map.map[i].addr);
369 end = PFN_DOWN(boot_mem_map.map[i].addr
370 + boot_mem_map.map[i].size);
371
365 /* 372 /*
366 * Reserve usable memory. 373 * Reserve usable memory.
367 */ 374 */
368 if (boot_mem_map.map[i].type != BOOT_MEM_RAM) 375 switch (boot_mem_map.map[i].type) {
376 case BOOT_MEM_RAM:
377 break;
378 case BOOT_MEM_INIT_RAM:
379 memory_present(0, start, end);
369 continue; 380 continue;
381 default:
382 /* Not usable memory */
383 continue;
384 }
370 385
371 start = PFN_UP(boot_mem_map.map[i].addr);
372 end = PFN_DOWN(boot_mem_map.map[i].addr
373 + boot_mem_map.map[i].size);
374 /* 386 /*
375 * We are rounding up the start address of usable memory 387 * We are rounding up the start address of usable memory
376 * and at the end of the usable range downwards. 388 * and at the end of the usable range downwards.
@@ -456,11 +468,33 @@ early_param("mem", early_parse_mem);
456 468
457static void __init arch_mem_init(char **cmdline_p) 469static void __init arch_mem_init(char **cmdline_p)
458{ 470{
471 phys_t init_mem, init_end, init_size;
472
459 extern void plat_mem_setup(void); 473 extern void plat_mem_setup(void);
460 474
461 /* call board setup routine */ 475 /* call board setup routine */
462 plat_mem_setup(); 476 plat_mem_setup();
463 477
478 init_mem = PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT;
479 init_end = PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT;
480 init_size = init_end - init_mem;
481 if (init_size) {
482 /* Make sure it is in the boot_mem_map */
483 int i, found;
484 found = 0;
485 for (i = 0; i < boot_mem_map.nr_map; i++) {
486 if (init_mem >= boot_mem_map.map[i].addr &&
487 init_mem < (boot_mem_map.map[i].addr +
488 boot_mem_map.map[i].size)) {
489 found = 1;
490 break;
491 }
492 }
493 if (!found)
494 add_memory_region(init_mem, init_size,
495 BOOT_MEM_INIT_RAM);
496 }
497
464 pr_info("Determined physical RAM map:\n"); 498 pr_info("Determined physical RAM map:\n");
465 print_memory_map(); 499 print_memory_map();
466 500
@@ -524,6 +558,7 @@ static void __init resource_init(void)
524 res = alloc_bootmem(sizeof(struct resource)); 558 res = alloc_bootmem(sizeof(struct resource));
525 switch (boot_mem_map.map[i].type) { 559 switch (boot_mem_map.map[i].type) {
526 case BOOT_MEM_RAM: 560 case BOOT_MEM_RAM:
561 case BOOT_MEM_INIT_RAM:
527 case BOOT_MEM_ROM_DATA: 562 case BOOT_MEM_ROM_DATA:
528 res->name = "System RAM"; 563 res->name = "System RAM";
529 break; 564 break;