aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sh/include/asm/io_generic.h1
-rw-r--r--arch/sh/include/asm/machvec.h2
-rw-r--r--arch/sh/include/asm/mmzone.h1
-rw-r--r--arch/sh/kernel/machvec.c1
-rw-r--r--arch/sh/kernel/setup.c26
-rw-r--r--arch/sh/mm/init.c8
6 files changed, 24 insertions, 15 deletions
diff --git a/arch/sh/include/asm/io_generic.h b/arch/sh/include/asm/io_generic.h
index 1e5d375f55dc..491df93cbf8e 100644
--- a/arch/sh/include/asm/io_generic.h
+++ b/arch/sh/include/asm/io_generic.h
@@ -38,5 +38,6 @@ void IO_CONCAT(__IO_PREFIX,iounmap)(void *addr);
38 38
39void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size); 39void __iomem *IO_CONCAT(__IO_PREFIX,ioport_map)(unsigned long addr, unsigned int size);
40void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr); 40void IO_CONCAT(__IO_PREFIX,ioport_unmap)(void __iomem *addr);
41void IO_CONCAT(__IO_PREFIX,mem_init)(void);
41 42
42#undef __IO_PREFIX 43#undef __IO_PREFIX
diff --git a/arch/sh/include/asm/machvec.h b/arch/sh/include/asm/machvec.h
index 9c30955630ff..bc0218cb72e1 100644
--- a/arch/sh/include/asm/machvec.h
+++ b/arch/sh/include/asm/machvec.h
@@ -49,6 +49,8 @@ struct sh_machine_vector {
49 49
50 int (*mv_clk_init)(void); 50 int (*mv_clk_init)(void);
51 int (*mv_mode_pins)(void); 51 int (*mv_mode_pins)(void);
52
53 void (*mv_mem_init)(void);
52}; 54};
53 55
54extern struct sh_machine_vector sh_mv; 56extern struct sh_machine_vector sh_mv;
diff --git a/arch/sh/include/asm/mmzone.h b/arch/sh/include/asm/mmzone.h
index 7f5363b29ba0..94f04b2f4fb1 100644
--- a/arch/sh/include/asm/mmzone.h
+++ b/arch/sh/include/asm/mmzone.h
@@ -42,7 +42,6 @@ setup_bootmem_node(int nid, unsigned long start, unsigned long end)
42void __init plat_mem_setup(void); 42void __init plat_mem_setup(void);
43 43
44/* arch/sh/kernel/setup.c */ 44/* arch/sh/kernel/setup.c */
45void __init setup_bootmem_allocator(unsigned long start_pfn);
46void __init __add_active_range(unsigned int nid, unsigned long start_pfn, 45void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
47 unsigned long end_pfn); 46 unsigned long end_pfn);
48 47
diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c
index 1652340ba3f2..85cfaf916fdc 100644
--- a/arch/sh/kernel/machvec.c
+++ b/arch/sh/kernel/machvec.c
@@ -131,6 +131,7 @@ void __init sh_mv_setup(void)
131 mv_set(ioport_unmap); 131 mv_set(ioport_unmap);
132 mv_set(irq_demux); 132 mv_set(irq_demux);
133 mv_set(mode_pins); 133 mv_set(mode_pins);
134 mv_set(mem_init);
134 135
135 if (!sh_mv.mv_nr_irqs) 136 if (!sh_mv.mv_nr_irqs)
136 sh_mv.mv_nr_irqs = NR_IRQS; 137 sh_mv.mv_nr_irqs = NR_IRQS;
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index e3f0da7b865d..2c9ab2842765 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -4,7 +4,7 @@
4 * This file handles the architecture-dependent parts of initialization 4 * This file handles the architecture-dependent parts of initialization
5 * 5 *
6 * Copyright (C) 1999 Niibe Yutaka 6 * Copyright (C) 1999 Niibe Yutaka
7 * Copyright (C) 2002 - 2007 Paul Mundt 7 * Copyright (C) 2002 - 2010 Paul Mundt
8 */ 8 */
9#include <linux/screen_info.h> 9#include <linux/screen_info.h>
10#include <linux/ioport.h> 10#include <linux/ioport.h>
@@ -41,6 +41,7 @@
41#include <asm/clock.h> 41#include <asm/clock.h>
42#include <asm/smp.h> 42#include <asm/smp.h>
43#include <asm/mmu_context.h> 43#include <asm/mmu_context.h>
44#include <asm/mmzone.h>
44 45
45/* 46/*
46 * Initialize loops_per_jiffy as 10000000 (1000MIPS). 47 * Initialize loops_per_jiffy as 10000000 (1000MIPS).
@@ -247,7 +248,7 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
247 add_active_range(nid, start_pfn, end_pfn); 248 add_active_range(nid, start_pfn, end_pfn);
248} 249}
249 250
250void __init setup_bootmem_allocator(unsigned long free_pfn) 251void __init do_init_bootmem(void)
251{ 252{
252 unsigned long bootmap_size; 253 unsigned long bootmap_size;
253 unsigned long bootmap_pages, bootmem_paddr; 254 unsigned long bootmap_pages, bootmem_paddr;
@@ -298,12 +299,9 @@ void __init setup_bootmem_allocator(unsigned long free_pfn)
298 sparse_memory_present_with_active_regions(0); 299 sparse_memory_present_with_active_regions(0);
299} 300}
300 301
301#ifndef CONFIG_NEED_MULTIPLE_NODES
302static void __init setup_memory(void) 302static void __init setup_memory(void)
303{ 303{
304 unsigned long start_pfn; 304 unsigned long start_pfn;
305 u64 base = min_low_pfn << PAGE_SHIFT;
306 u64 size = (max_low_pfn << PAGE_SHIFT) - base;
307 305
308 /* 306 /*
309 * Partially used pages are not usable - thus 307 * Partially used pages are not usable - thus
@@ -311,8 +309,6 @@ static void __init setup_memory(void)
311 */ 309 */
312 start_pfn = PFN_UP(__pa(_end)); 310 start_pfn = PFN_UP(__pa(_end));
313 311
314 lmb_add(base, size);
315
316 /* 312 /*
317 * Reserve the kernel text and 313 * Reserve the kernel text and
318 * Reserve the bootmem bitmap. We do this in two steps (first step 314 * Reserve the bootmem bitmap. We do this in two steps (first step
@@ -333,11 +329,9 @@ static void __init setup_memory(void)
333 lmb_analyze(); 329 lmb_analyze();
334 lmb_dump_all(); 330 lmb_dump_all();
335 331
336 setup_bootmem_allocator(start_pfn); 332 do_init_bootmem();
333 plat_mem_setup();
337} 334}
338#else
339extern void __init setup_memory(void);
340#endif
341 335
342/* 336/*
343 * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by 337 * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by
@@ -358,7 +352,11 @@ static int __init parse_elfcorehdr(char *arg)
358early_param("elfcorehdr", parse_elfcorehdr); 352early_param("elfcorehdr", parse_elfcorehdr);
359#endif 353#endif
360 354
361void __init __attribute__ ((weak)) plat_early_device_setup(void) 355void __init __weak plat_early_device_setup(void)
356{
357}
358
359void __init __weak plat_mem_setup(void)
362{ 360{
363} 361}
364 362
@@ -426,7 +424,10 @@ void __init setup_arch(char **cmdline_p)
426 /* Let earlyprintk output early console messages */ 424 /* Let earlyprintk output early console messages */
427 early_platform_driver_probe("earlyprintk", 1, 1); 425 early_platform_driver_probe("earlyprintk", 1, 1);
428 426
427 lmb_init();
428
429 sh_mv_setup(); 429 sh_mv_setup();
430 sh_mv.mv_mem_init();
430 431
431 /* 432 /*
432 * Find the highest page frame number we have available 433 * Find the highest page frame number we have available
@@ -442,7 +443,6 @@ void __init setup_arch(char **cmdline_p)
442 nodes_clear(node_online_map); 443 nodes_clear(node_online_map);
443 444
444 pmb_init(); 445 pmb_init();
445 lmb_init();
446 setup_memory(); 446 setup_memory();
447 sparse_init(); 447 sparse_init();
448 448
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index c505de61a5ca..9c5400b02f43 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -2,7 +2,7 @@
2 * linux/arch/sh/mm/init.c 2 * linux/arch/sh/mm/init.c
3 * 3 *
4 * Copyright (C) 1999 Niibe Yutaka 4 * Copyright (C) 1999 Niibe Yutaka
5 * Copyright (C) 2002 - 2007 Paul Mundt 5 * Copyright (C) 2002 - 2010 Paul Mundt
6 * 6 *
7 * Based on linux/arch/i386/mm/init.c: 7 * Based on linux/arch/i386/mm/init.c:
8 * Copyright (C) 1995 Linus Torvalds 8 * Copyright (C) 1995 Linus Torvalds
@@ -16,6 +16,7 @@
16#include <linux/pagemap.h> 16#include <linux/pagemap.h>
17#include <linux/percpu.h> 17#include <linux/percpu.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <linux/lmb.h>
19#include <linux/dma-mapping.h> 20#include <linux/dma-mapping.h>
20#include <asm/mmu_context.h> 21#include <asm/mmu_context.h>
21#include <asm/tlb.h> 22#include <asm/tlb.h>
@@ -27,6 +28,11 @@
27DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 28DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
28pgd_t swapper_pg_dir[PTRS_PER_PGD]; 29pgd_t swapper_pg_dir[PTRS_PER_PGD];
29 30
31void __init generic_mem_init(void)
32{
33 lmb_add(__MEMORY_START, __MEMORY_SIZE);
34}
35
30#ifdef CONFIG_MMU 36#ifdef CONFIG_MMU
31static pte_t *__get_pte_phys(unsigned long addr) 37static pte_t *__get_pte_phys(unsigned long addr)
32{ 38{