xtensa: dump sysmem from the bootmem_init
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 22 Mar 2014 23:26:46 +0000 (03:26 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 1 Apr 2014 21:35:55 +0000 (01:35 +0400)
Debug dump of physical memory configuration. Useful for inspection of
resulting memory map, esp. in the presence of memmap= kernel option.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/mm/init.c

index d70ba93..03bd025 100644 (file)
 
 struct sysmem_info sysmem __initdata;
 
+static void __init sysmem_dump(void)
+{
+       unsigned i;
+
+       pr_debug("Sysmem:\n");
+       for (i = 0; i < sysmem.nr_banks; ++i)
+               pr_debug("  0x%08lx - 0x%08lx (%ldK)\n",
+                        sysmem.bank[i].start, sysmem.bank[i].end,
+                        (sysmem.bank[i].end - sysmem.bank[i].start) >> 10);
+}
+
 /*
  * Find bank with maximal .start such that bank.start <= start
  */
@@ -227,6 +238,7 @@ void __init bootmem_init(void)
        unsigned long bootmap_start, bootmap_size;
        int i;
 
+       sysmem_dump();
        max_low_pfn = max_pfn = 0;
        min_low_pfn = ~0;