aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2006-05-17 04:00:46 -0400
committerPaul Mackerras <paulus@samba.org>2006-05-19 01:02:15 -0400
commit2babf5c2ec2f2d5de3e38d20f7df7fd815fd10c9 (patch)
tree9ecda21067fe36f36fbefae87141150b62c39acd /arch/powerpc/platforms
parent846f77b08c8301682ded5ce127c56397327a60d0 (diff)
[PATCH] powerpc: Unify mem= handling
We currently do mem= handling in three seperate places. And as benh pointed out I wrote two of them. Now that we parse command line parameters earlier we can clean this mess up. Moving the parsing out of prom_init means the device tree might be allocated above the memory limit. If that happens we'd have to move it. As it happens we already have logic to do that for kdump, so just genericise it. This also means we might have reserved regions above the memory limit, if we do the bootmem allocator will blow up, so we have to modify lmb_enforce_memory_limit() to truncate the reserves as well. Tested on P5 LPAR, iSeries, F50, 44p. Tested moving device tree on P5 and 44p and F50. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/iseries/setup.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 074d1d949708..fd6d0ebe8ddd 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -90,8 +90,6 @@ extern unsigned long embedded_sysmap_end;
90extern unsigned long iSeries_recal_tb; 90extern unsigned long iSeries_recal_tb;
91extern unsigned long iSeries_recal_titan; 91extern unsigned long iSeries_recal_titan;
92 92
93static unsigned long cmd_mem_limit;
94
95struct MemoryBlock { 93struct MemoryBlock {
96 unsigned long absStart; 94 unsigned long absStart;
97 unsigned long absEnd; 95 unsigned long absEnd;
@@ -1026,8 +1024,6 @@ void build_flat_dt(struct iseries_flat_dt *dt, unsigned long phys_mem_size)
1026 /* /chosen */ 1024 /* /chosen */
1027 dt_start_node(dt, "chosen"); 1025 dt_start_node(dt, "chosen");
1028 dt_prop_str(dt, "bootargs", cmd_line); 1026 dt_prop_str(dt, "bootargs", cmd_line);
1029 if (cmd_mem_limit)
1030 dt_prop_u64(dt, "linux,memory-limit", cmd_mem_limit);
1031 dt_end_node(dt); 1027 dt_end_node(dt);
1032 1028
1033 dt_cpus(dt); 1029 dt_cpus(dt);
@@ -1053,29 +1049,11 @@ void * __init iSeries_early_setup(void)
1053 1049
1054 iSeries_get_cmdline(); 1050 iSeries_get_cmdline();
1055 1051
1056 /* Save unparsed command line copy for /proc/cmdline */
1057 strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
1058
1059 /* Parse early parameters, in particular mem=x */
1060 parse_early_param();
1061
1062 build_flat_dt(&iseries_dt, phys_mem_size); 1052 build_flat_dt(&iseries_dt, phys_mem_size);
1063 1053
1064 return (void *) __pa(&iseries_dt); 1054 return (void *) __pa(&iseries_dt);
1065} 1055}
1066 1056
1067/*
1068 * On iSeries we just parse the mem=X option from the command line.
1069 * On pSeries it's a bit more complicated, see prom_init_mem()
1070 */
1071static int __init early_parsemem(char *p)
1072{
1073 if (p)
1074 cmd_mem_limit = ALIGN(memparse(p, &p), PAGE_SIZE);
1075 return 0;
1076}
1077early_param("mem", early_parsemem);
1078
1079static void hvputc(char c) 1057static void hvputc(char c)
1080{ 1058{
1081 if (c == '\n') 1059 if (c == '\n')