diff options
Diffstat (limited to 'arch/powerpc/platforms/iseries/setup.c')
-rw-r--r-- | arch/powerpc/platforms/iseries/setup.c | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 1544c6f10a38..fda712b42168 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/kdev_t.h> | 27 | #include <linux/kdev_t.h> |
28 | #include <linux/major.h> | 28 | #include <linux/major.h> |
29 | #include <linux/root_dev.h> | 29 | #include <linux/root_dev.h> |
30 | #include <linux/kernel.h> | ||
30 | 31 | ||
31 | #include <asm/processor.h> | 32 | #include <asm/processor.h> |
32 | #include <asm/machdep.h> | 33 | #include <asm/machdep.h> |
@@ -40,19 +41,19 @@ | |||
40 | #include <asm/firmware.h> | 41 | #include <asm/firmware.h> |
41 | 42 | ||
42 | #include <asm/time.h> | 43 | #include <asm/time.h> |
43 | #include <asm/naca.h> | ||
44 | #include <asm/paca.h> | 44 | #include <asm/paca.h> |
45 | #include <asm/cache.h> | 45 | #include <asm/cache.h> |
46 | #include <asm/sections.h> | 46 | #include <asm/sections.h> |
47 | #include <asm/abs_addr.h> | 47 | #include <asm/abs_addr.h> |
48 | #include <asm/iSeries/HvLpConfig.h> | 48 | #include <asm/iseries/hv_lp_config.h> |
49 | #include <asm/iSeries/HvCallEvent.h> | 49 | #include <asm/iseries/hv_call_event.h> |
50 | #include <asm/iSeries/HvCallXm.h> | 50 | #include <asm/iseries/hv_call_xm.h> |
51 | #include <asm/iSeries/ItLpQueue.h> | 51 | #include <asm/iseries/it_lp_queue.h> |
52 | #include <asm/iSeries/mf.h> | 52 | #include <asm/iseries/mf.h> |
53 | #include <asm/iSeries/HvLpEvent.h> | 53 | #include <asm/iseries/hv_lp_event.h> |
54 | #include <asm/iSeries/LparMap.h> | 54 | #include <asm/iseries/lpar_map.h> |
55 | 55 | ||
56 | #include "naca.h" | ||
56 | #include "setup.h" | 57 | #include "setup.h" |
57 | #include "irq.h" | 58 | #include "irq.h" |
58 | #include "vpd_areas.h" | 59 | #include "vpd_areas.h" |
@@ -94,6 +95,8 @@ extern unsigned long iSeries_recal_titan; | |||
94 | 95 | ||
95 | static int mf_initialized; | 96 | static int mf_initialized; |
96 | 97 | ||
98 | static unsigned long cmd_mem_limit; | ||
99 | |||
97 | struct MemoryBlock { | 100 | struct MemoryBlock { |
98 | unsigned long absStart; | 101 | unsigned long absStart; |
99 | unsigned long absEnd; | 102 | unsigned long absEnd; |
@@ -341,23 +344,6 @@ static void __init iSeries_init_early(void) | |||
341 | */ | 344 | */ |
342 | iommu_init_early_iSeries(); | 345 | iommu_init_early_iSeries(); |
343 | 346 | ||
344 | iSeries_get_cmdline(); | ||
345 | |||
346 | /* Save unparsed command line copy for /proc/cmdline */ | ||
347 | strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); | ||
348 | |||
349 | /* Parse early parameters, in particular mem=x */ | ||
350 | parse_early_param(); | ||
351 | |||
352 | if (memory_limit) { | ||
353 | if (memory_limit < systemcfg->physicalMemorySize) | ||
354 | systemcfg->physicalMemorySize = memory_limit; | ||
355 | else { | ||
356 | printk("Ignoring mem=%lu >= ram_top.\n", memory_limit); | ||
357 | memory_limit = 0; | ||
358 | } | ||
359 | } | ||
360 | |||
361 | /* Initialize machine-dependency vectors */ | 347 | /* Initialize machine-dependency vectors */ |
362 | #ifdef CONFIG_SMP | 348 | #ifdef CONFIG_SMP |
363 | smp_init_iSeries(); | 349 | smp_init_iSeries(); |
@@ -971,6 +957,8 @@ void build_flat_dt(struct iseries_flat_dt *dt) | |||
971 | /* /chosen */ | 957 | /* /chosen */ |
972 | dt_start_node(dt, "chosen"); | 958 | dt_start_node(dt, "chosen"); |
973 | dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); | 959 | dt_prop_u32(dt, "linux,platform", PLATFORM_ISERIES_LPAR); |
960 | if (cmd_mem_limit) | ||
961 | dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit); | ||
974 | dt_end_node(dt); | 962 | dt_end_node(dt); |
975 | 963 | ||
976 | dt_cpus(dt); | 964 | dt_cpus(dt); |
@@ -990,7 +978,27 @@ void * __init iSeries_early_setup(void) | |||
990 | */ | 978 | */ |
991 | build_iSeries_Memory_Map(); | 979 | build_iSeries_Memory_Map(); |
992 | 980 | ||
981 | iSeries_get_cmdline(); | ||
982 | |||
983 | /* Save unparsed command line copy for /proc/cmdline */ | ||
984 | strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE); | ||
985 | |||
986 | /* Parse early parameters, in particular mem=x */ | ||
987 | parse_early_param(); | ||
988 | |||
993 | build_flat_dt(&iseries_dt); | 989 | build_flat_dt(&iseries_dt); |
994 | 990 | ||
995 | return (void *) __pa(&iseries_dt); | 991 | return (void *) __pa(&iseries_dt); |
996 | } | 992 | } |
993 | |||
994 | /* | ||
995 | * On iSeries we just parse the mem=X option from the command line. | ||
996 | * On pSeries it's a bit more complicated, see prom_init_mem() | ||
997 | */ | ||
998 | static int __init early_parsemem(char *p) | ||
999 | { | ||
1000 | if (p) | ||
1001 | cmd_mem_limit = ALIGN(memparse(p, &p), PAGE_SIZE); | ||
1002 | return 0; | ||
1003 | } | ||
1004 | early_param("mem", early_parsemem); | ||