aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/setup.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-06-01 04:04:36 -0400
committerPaul Mundt <lethal@hera.kernel.org>2007-06-07 22:43:45 -0400
commit2826fa61c13716816c7ae658b8f1c5a4a505d8ac (patch)
tree0bde8f69ff7bde75c63b0c4e6dcf5992a5eb9066 /arch/sh/kernel/setup.c
parentd22d9b3a1d129349518c807e7997922f869e1f48 (diff)
sh: Mark sparsemem regions present earlier.
We have to call in to sparse_memory_present_with_active_regions() earlier in order for sparsemem to be happy. This was being called too late, and was causing troubles with the platforms that needed to enable sparsemem. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/setup.c')
-rw-r--r--arch/sh/kernel/setup.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 3241a6274b81..c2c6bfdf4dfe 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -116,7 +116,7 @@ static void __init register_bootmem_low_pages(void)
116 free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages)); 116 free_bootmem(PFN_PHYS(curr_pfn), PFN_PHYS(pages));
117} 117}
118 118
119void __init setup_bootmem_allocator(unsigned long start_pfn) 119void __init setup_bootmem_allocator(unsigned long free_pfn)
120{ 120{
121 unsigned long bootmap_size; 121 unsigned long bootmap_size;
122 122
@@ -125,7 +125,7 @@ void __init setup_bootmem_allocator(unsigned long start_pfn)
125 * bootstrap step all allocations (until the page allocator 125 * bootstrap step all allocations (until the page allocator
126 * is intact) must be done via bootmem_alloc(). 126 * is intact) must be done via bootmem_alloc().
127 */ 127 */
128 bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, 128 bootmap_size = init_bootmem_node(NODE_DATA(0), free_pfn,
129 min_low_pfn, max_low_pfn); 129 min_low_pfn, max_low_pfn);
130 130
131 add_active_range(0, min_low_pfn, max_low_pfn); 131 add_active_range(0, min_low_pfn, max_low_pfn);
@@ -141,7 +141,7 @@ void __init setup_bootmem_allocator(unsigned long start_pfn)
141 * an invalid RAM area. 141 * an invalid RAM area.
142 */ 142 */
143 reserve_bootmem(__MEMORY_START+PAGE_SIZE, 143 reserve_bootmem(__MEMORY_START+PAGE_SIZE,
144 (PFN_PHYS(start_pfn)+bootmap_size+PAGE_SIZE-1)-__MEMORY_START); 144 (PFN_PHYS(free_pfn)+bootmap_size+PAGE_SIZE-1)-__MEMORY_START);
145 145
146 /* 146 /*
147 * reserve physical page 0 - it's a special BIOS page on many boxes, 147 * reserve physical page 0 - it's a special BIOS page on many boxes,
@@ -149,6 +149,8 @@ void __init setup_bootmem_allocator(unsigned long start_pfn)
149 */ 149 */
150 reserve_bootmem(__MEMORY_START, PAGE_SIZE); 150 reserve_bootmem(__MEMORY_START, PAGE_SIZE);
151 151
152 sparse_memory_present_with_active_regions(0);
153
152#ifdef CONFIG_BLK_DEV_INITRD 154#ifdef CONFIG_BLK_DEV_INITRD
153 ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0); 155 ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
154 if (&__rd_start != &__rd_end) { 156 if (&__rd_start != &__rd_end) {
@@ -193,7 +195,6 @@ static void __init setup_memory(void)
193 */ 195 */
194 start_pfn = PFN_UP(__pa(_end)); 196 start_pfn = PFN_UP(__pa(_end));
195 setup_bootmem_allocator(start_pfn); 197 setup_bootmem_allocator(start_pfn);
196 sparse_memory_present_with_active_regions(0);
197} 198}
198#else 199#else
199extern void __init setup_memory(void); 200extern void __init setup_memory(void);