|
@@ -28,6 +28,7 @@
|
|
#include <linux/errno.h>
|
|
#include <linux/errno.h>
|
|
#include <linux/string.h>
|
|
#include <linux/string.h>
|
|
#include <linux/bootmem.h>
|
|
#include <linux/bootmem.h>
|
|
|
|
+#include <linux/memblock.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/init.h>
|
|
#include <linux/init.h>
|
|
#include <linux/initrd.h>
|
|
#include <linux/initrd.h>
|
|
@@ -85,8 +86,6 @@ void (*mach_power_off)(void);
|
|
|
|
|
|
void __init setup_arch(char **cmdline_p)
|
|
void __init setup_arch(char **cmdline_p)
|
|
{
|
|
{
|
|
- int bootmap_size;
|
|
|
|
-
|
|
|
|
memory_start = PAGE_ALIGN(_ramstart);
|
|
memory_start = PAGE_ALIGN(_ramstart);
|
|
memory_end = _ramend;
|
|
memory_end = _ramend;
|
|
|
|
|
|
@@ -141,6 +140,8 @@ void __init setup_arch(char **cmdline_p)
|
|
pr_debug("MEMORY -> ROMFS=0x%p-0x%06lx MEM=0x%06lx-0x%06lx\n ",
|
|
pr_debug("MEMORY -> ROMFS=0x%p-0x%06lx MEM=0x%06lx-0x%06lx\n ",
|
|
__bss_stop, memory_start, memory_start, memory_end);
|
|
__bss_stop, memory_start, memory_start, memory_end);
|
|
|
|
|
|
|
|
+ memblock_add(memory_start, memory_end - memory_start);
|
|
|
|
+
|
|
/* Keep a copy of command line */
|
|
/* Keep a copy of command line */
|
|
*cmdline_p = &command_line[0];
|
|
*cmdline_p = &command_line[0];
|
|
memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
|
|
memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
|
|
@@ -157,23 +158,10 @@ void __init setup_arch(char **cmdline_p)
|
|
min_low_pfn = PFN_DOWN(memory_start);
|
|
min_low_pfn = PFN_DOWN(memory_start);
|
|
max_pfn = max_low_pfn = PFN_DOWN(memory_end);
|
|
max_pfn = max_low_pfn = PFN_DOWN(memory_end);
|
|
|
|
|
|
- bootmap_size = init_bootmem_node(
|
|
|
|
- NODE_DATA(0),
|
|
|
|
- min_low_pfn, /* map goes here */
|
|
|
|
- PFN_DOWN(PAGE_OFFSET),
|
|
|
|
- max_pfn);
|
|
|
|
- /*
|
|
|
|
- * Free the usable memory, we have to make sure we do not free
|
|
|
|
- * the bootmem bitmap so we then reserve it after freeing it :-)
|
|
|
|
- */
|
|
|
|
- free_bootmem(memory_start, memory_end - memory_start);
|
|
|
|
- reserve_bootmem(memory_start, bootmap_size, BOOTMEM_DEFAULT);
|
|
|
|
-
|
|
|
|
#if defined(CONFIG_UBOOT) && defined(CONFIG_BLK_DEV_INITRD)
|
|
#if defined(CONFIG_UBOOT) && defined(CONFIG_BLK_DEV_INITRD)
|
|
if ((initrd_start > 0) && (initrd_start < initrd_end) &&
|
|
if ((initrd_start > 0) && (initrd_start < initrd_end) &&
|
|
(initrd_end < memory_end))
|
|
(initrd_end < memory_end))
|
|
- reserve_bootmem(initrd_start, initrd_end - initrd_start,
|
|
|
|
- BOOTMEM_DEFAULT);
|
|
|
|
|
|
+ memblock_reserve(initrd_start, initrd_end - initrd_start);
|
|
#endif /* if defined(CONFIG_BLK_DEV_INITRD) */
|
|
#endif /* if defined(CONFIG_BLK_DEV_INITRD) */
|
|
|
|
|
|
/*
|
|
/*
|