aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-29 16:12:36 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-29 16:12:36 -0400
commit2fca877b68b2b4fc5b94277858a1bedd46017cde (patch)
treefd02725406299ba2f26354463b3c261721e9eb6b /arch/arm/kernel/setup.c
parentff40c6d3d1437ecdf295b8e39adcb06c3d6021ef (diff)
parent02b3e4e2d71b6058ec11cc01c72ac651eb3ded2b (diff)
/spare/repo/libata-dev branch 'v2.6.13'
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 9fed5fa194d9..c9b69771f92e 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -359,7 +359,8 @@ void cpu_init(void)
359 "I" (offsetof(struct stack, abt[0])), 359 "I" (offsetof(struct stack, abt[0])),
360 "I" (PSR_F_BIT | PSR_I_BIT | UND_MODE), 360 "I" (PSR_F_BIT | PSR_I_BIT | UND_MODE),
361 "I" (offsetof(struct stack, und[0])), 361 "I" (offsetof(struct stack, und[0])),
362 "I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE)); 362 "I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
363 : "r14");
363} 364}
364 365
365static struct machine_desc * __init setup_machine(unsigned int nr) 366static struct machine_desc * __init setup_machine(unsigned int nr)
@@ -395,6 +396,20 @@ static void __init early_initrd(char **p)
395} 396}
396__early_param("initrd=", early_initrd); 397__early_param("initrd=", early_initrd);
397 398
399static void __init add_memory(unsigned long start, unsigned long size)
400{
401 /*
402 * Ensure that start/size are aligned to a page boundary.
403 * Size is appropriately rounded down, start is rounded up.
404 */
405 size -= start & ~PAGE_MASK;
406
407 meminfo.bank[meminfo.nr_banks].start = PAGE_ALIGN(start);
408 meminfo.bank[meminfo.nr_banks].size = size & PAGE_MASK;
409 meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(start);
410 meminfo.nr_banks += 1;
411}
412
398/* 413/*
399 * Pick out the memory size. We look for mem=size@start, 414 * Pick out the memory size. We look for mem=size@start,
400 * where start and size are "size[KkMm]" 415 * where start and size are "size[KkMm]"
@@ -419,10 +434,7 @@ static void __init early_mem(char **p)
419 if (**p == '@') 434 if (**p == '@')
420 start = memparse(*p + 1, p); 435 start = memparse(*p + 1, p);
421 436
422 meminfo.bank[meminfo.nr_banks].start = start; 437 add_memory(start, size);
423 meminfo.bank[meminfo.nr_banks].size = size;
424 meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(start);
425 meminfo.nr_banks += 1;
426} 438}
427__early_param("mem=", early_mem); 439__early_param("mem=", early_mem);
428 440
@@ -564,11 +576,7 @@ static int __init parse_tag_mem32(const struct tag *tag)
564 tag->u.mem.start, tag->u.mem.size / 1024); 576 tag->u.mem.start, tag->u.mem.size / 1024);
565 return -EINVAL; 577 return -EINVAL;
566 } 578 }
567 meminfo.bank[meminfo.nr_banks].start = tag->u.mem.start; 579 add_memory(tag->u.mem.start, tag->u.mem.size);
568 meminfo.bank[meminfo.nr_banks].size = tag->u.mem.size;
569 meminfo.bank[meminfo.nr_banks].node = PHYS_TO_NID(tag->u.mem.start);
570 meminfo.nr_banks += 1;
571
572 return 0; 580 return 0;
573} 581}
574 582
@@ -729,8 +737,8 @@ void __init setup_arch(char **cmdline_p)
729 if (mdesc->soft_reboot) 737 if (mdesc->soft_reboot)
730 reboot_setup("s"); 738 reboot_setup("s");
731 739
732 if (mdesc->param_offset) 740 if (mdesc->boot_params)
733 tags = phys_to_virt(mdesc->param_offset); 741 tags = phys_to_virt(mdesc->boot_params);
734 742
735 /* 743 /*
736 * If we have the old style parameters, convert them to 744 * If we have the old style parameters, convert them to