* This file handles the architecture-dependent parts of initialization
*
* Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2002 - 2007 Paul Mundt
+ * Copyright (C) 2002 - 2010 Paul Mundt
*/
#include <linux/screen_info.h>
#include <linux/ioport.h>
#include <asm/clock.h>
#include <asm/smp.h>
#include <asm/mmu_context.h>
+#include <asm/mmzone.h>
/*
* Initialize loops_per_jiffy as 10000000 (1000MIPS).
add_active_range(nid, start_pfn, end_pfn);
}
-void __init setup_bootmem_allocator(unsigned long free_pfn)
+void __init do_init_bootmem(void)
{
unsigned long bootmap_size;
unsigned long bootmap_pages, bootmem_paddr;
sparse_memory_present_with_active_regions(0);
}
-#ifndef CONFIG_NEED_MULTIPLE_NODES
static void __init setup_memory(void)
{
unsigned long start_pfn;
- u64 base = min_low_pfn << PAGE_SHIFT;
- u64 size = (max_low_pfn << PAGE_SHIFT) - base;
/*
* Partially used pages are not usable - thus
*/
start_pfn = PFN_UP(__pa(_end));
- lmb_add(base, size);
-
/*
* Reserve the kernel text and
* Reserve the bootmem bitmap. We do this in two steps (first step
lmb_analyze();
lmb_dump_all();
- setup_bootmem_allocator(start_pfn);
+ do_init_bootmem();
+ plat_mem_setup();
}
-#else
-extern void __init setup_memory(void);
-#endif
/*
* Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
early_param("elfcorehdr", parse_elfcorehdr);
#endif
-void __init __attribute__ ((weak)) plat_early_device_setup(void)
+void __init __weak plat_early_device_setup(void)
+{
+}
+
+void __init __weak plat_mem_setup(void)
{
}
/* Let earlyprintk output early console messages */
early_platform_driver_probe("earlyprintk", 1, 1);
+ lmb_init();
+
sh_mv_setup();
+ sh_mv.mv_mem_init();
/*
* Find the highest page frame number we have available
nodes_clear(node_online_map);
pmb_init();
- lmb_init();
setup_memory();
sparse_init();
* linux/arch/sh/mm/init.c
*
* Copyright (C) 1999 Niibe Yutaka
- * Copyright (C) 2002 - 2007 Paul Mundt
+ * Copyright (C) 2002 - 2010 Paul Mundt
*
* Based on linux/arch/i386/mm/init.c:
* Copyright (C) 1995 Linus Torvalds
#include <linux/pagemap.h>
#include <linux/percpu.h>
#include <linux/io.h>
+#include <linux/lmb.h>
#include <linux/dma-mapping.h>
#include <asm/mmu_context.h>
#include <asm/tlb.h>
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
pgd_t swapper_pg_dir[PTRS_PER_PGD];
+void __init generic_mem_init(void)
+{
+ lmb_add(__MEMORY_START, __MEMORY_SIZE);
+}
+
#ifdef CONFIG_MMU
static pte_t *__get_pte_phys(unsigned long addr)
{