aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/init.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-06 21:15:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-06 21:15:25 -0500
commit770e1b035dcb6ec3f8ee69dda0815dd1e220a683 (patch)
treee6d36abfdb053fbc722aea8d7e946d6d1b93c7e1 /arch/arm/mm/init.c
parentd3d0b024348c040f0d6851e2e59fc961677d5169 (diff)
parent7b9dd47136c07ffd883aff6926c7b281e4c1eea4 (diff)
Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm
* 'for-linus' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm: (207 commits) ARM: 7267/1: Remove BUILD_BUG_ON from asm/bug.h ARM: 7269/1: mach-sa1100: fix sched_clock breakage ARM: 7198/1: arm/imx6: add restart support for imx6q ARM: restart: remove the now empty arch_reset() ARM: restart: remove comments about adding code to arch_reset() ARM: restart: lpc32xx & u300: remove unnecessary printk ARM: restart: plat-samsung: remove plat/reset.h and s5p_reset_hook ARM: restart: w90x900: use new restart hook ARM: restart: Versatile Express: use new restart hook ARM: restart: versatile: use new restart hook ARM: restart: u300: use new restart hook ARM: restart: tegra: use new restart hook ARM: restart: spear: use new restart hook ARM: restart: shark: use new restart hook ARM: restart: sa1100: use new restart hook ARM: 7252/1: restart: S5PV210: use new restart hook ARM: 7251/1: restart: S5PC100: use new restart hook ARM: 7250/1: restart: S5P64X0: use new restart hook ARM: 7266/1: restart: S3C64XX: use new restart hook ARM: 7265/1: restart: S3C24XX: use new restart hook ... Fix up trivial conflict in arch/arm/mm/init.c due to removal of memblock_init() clashing with the movement of the sorting of the meminfo array.
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r--arch/arm/mm/init.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 7c38474e533a..e34ea8adc1f9 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -20,7 +20,6 @@
20#include <linux/highmem.h> 20#include <linux/highmem.h>
21#include <linux/gfp.h> 21#include <linux/gfp.h>
22#include <linux/memblock.h> 22#include <linux/memblock.h>
23#include <linux/sort.h>
24 23
25#include <asm/mach-types.h> 24#include <asm/mach-types.h>
26#include <asm/prom.h> 25#include <asm/prom.h>
@@ -135,30 +134,18 @@ void show_mem(unsigned int filter)
135} 134}
136 135
137static void __init find_limits(unsigned long *min, unsigned long *max_low, 136static void __init find_limits(unsigned long *min, unsigned long *max_low,
138 unsigned long *max_high) 137 unsigned long *max_high)
139{ 138{
140 struct meminfo *mi = &meminfo; 139 struct meminfo *mi = &meminfo;
141 int i; 140 int i;
142 141
143 *min = -1UL; 142 /* This assumes the meminfo array is properly sorted */
144 *max_low = *max_high = 0; 143 *min = bank_pfn_start(&mi->bank[0]);
145 144 for_each_bank (i, mi)
146 for_each_bank (i, mi) { 145 if (mi->bank[i].highmem)
147 struct membank *bank = &mi->bank[i]; 146 break;
148 unsigned long start, end; 147 *max_low = bank_pfn_end(&mi->bank[i - 1]);
149 148 *max_high = bank_pfn_end(&mi->bank[mi->nr_banks - 1]);
150 start = bank_pfn_start(bank);
151 end = bank_pfn_end(bank);
152
153 if (*min > start)
154 *min = start;
155 if (*max_high < end)
156 *max_high = end;
157 if (bank->highmem)
158 continue;
159 if (*max_low < end)
160 *max_low = end;
161 }
162} 149}
163 150
164static void __init arm_bootmem_init(unsigned long start_pfn, 151static void __init arm_bootmem_init(unsigned long start_pfn,
@@ -320,19 +307,10 @@ static void arm_memory_present(void)
320} 307}
321#endif 308#endif
322 309
323static int __init meminfo_cmp(const void *_a, const void *_b)
324{
325 const struct membank *a = _a, *b = _b;
326 long cmp = bank_pfn_start(a) - bank_pfn_start(b);
327 return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
328}
329
330void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) 310void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
331{ 311{
332 int i; 312 int i;
333 313
334 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
335
336 for (i = 0; i < mi->nr_banks; i++) 314 for (i = 0; i < mi->nr_banks; i++)
337 memblock_add(mi->bank[i].start, mi->bank[i].size); 315 memblock_add(mi->bank[i].start, mi->bank[i].size);
338 316
@@ -403,8 +381,6 @@ void __init bootmem_init(void)
403 */ 381 */
404 arm_bootmem_free(min, max_low, max_high); 382 arm_bootmem_free(min, max_low, max_high);
405 383
406 high_memory = __va(((phys_addr_t)max_low << PAGE_SHIFT) - 1) + 1;
407
408 /* 384 /*
409 * This doesn't seem to be used by the Linux memory manager any 385 * This doesn't seem to be used by the Linux memory manager any
410 * more, but is used by ll_rw_block. If we can get rid of it, we 386 * more, but is used by ll_rw_block. If we can get rid of it, we