Commit af9a224e authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] ppc64: use early_param

Make use of Rusty's early_param code. Its good stuff.

We appear to be the first user :)

Move vpa_init and idle_setup later in boot, we dont have to do them
right up front in setup_system.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 103361b4
...@@ -244,7 +244,21 @@ static void __init setup_cpu_maps(void) ...@@ -244,7 +244,21 @@ static void __init setup_cpu_maps(void)
systemcfg->processorCount = num_present_cpus(); systemcfg->processorCount = num_present_cpus();
} }
#endif /* !defined(CONFIG_PPC_ISERIES) && defined(CONFIG_SMP) */ #endif /* !defined(CONFIG_PPC_ISERIES) && defined(CONFIG_SMP) */
#ifdef CONFIG_XMON
static int __init early_xmon(char *p)
{
/* ensure xmon is enabled */
xmon_init();
debugger(0);
return 0;
}
early_param("xmon", early_xmon);
#endif
/* /*
* Do some initial setup of the system. The parameters are those which * Do some initial setup of the system. The parameters are those which
* were passed in from the bootloader. * were passed in from the bootloader.
...@@ -256,10 +270,6 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -256,10 +270,6 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
int ret, i; int ret, i;
#endif #endif
#ifdef CONFIG_XMON_DEFAULT
xmon_init();
#endif
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
/* pSeries systems are identified in prom.c via OF. */ /* pSeries systems are identified in prom.c via OF. */
if (itLpNaca.xLparInstalled == 1) if (itLpNaca.xLparInstalled == 1)
...@@ -290,6 +300,9 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -290,6 +300,9 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
#endif /* CONFIG_PPC_PMAC */ #endif /* CONFIG_PPC_PMAC */
} }
#ifdef CONFIG_XMON_DEFAULT
xmon_init();
#endif
/* If we were passed an initrd, set the ROOT_DEV properly if the values /* If we were passed an initrd, set the ROOT_DEV properly if the values
* look sensible. If not, clear initrd reference. * look sensible. If not, clear initrd reference.
*/ */
...@@ -330,6 +343,11 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -330,6 +343,11 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
iSeries_parse_cmdline(); iSeries_parse_cmdline();
#endif #endif
/* Save unparsed command line copy for /proc/cmdline */
strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
parse_early_param();
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
#ifndef CONFIG_PPC_ISERIES #ifndef CONFIG_PPC_ISERIES
/* /*
...@@ -351,6 +369,10 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -351,6 +369,10 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
i); i);
} }
} }
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR)
vpa_init(boot_cpuid);
#endif /* CONFIG_PPC_PSERIES */ #endif /* CONFIG_PPC_PSERIES */
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
...@@ -380,15 +402,6 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -380,15 +402,6 @@ void setup_system(unsigned long r3, unsigned long r4, unsigned long r5,
printk("-----------------------------------------------------\n"); printk("-----------------------------------------------------\n");
mm_init_ppc64(); mm_init_ppc64();
#if defined(CONFIG_SMP) && defined(CONFIG_PPC_PSERIES)
if (cur_cpu_spec->firmware_features & FW_FEATURE_SPLPAR) {
vpa_init(boot_cpuid);
}
#endif
/* Select the correct idle loop for the platform. */
idle_setup();
} }
void machine_restart(char *cmd) void machine_restart(char *cmd)
...@@ -512,30 +525,20 @@ struct seq_operations cpuinfo_op = { ...@@ -512,30 +525,20 @@ struct seq_operations cpuinfo_op = {
.show = show_cpuinfo, .show = show_cpuinfo,
}; };
#endif #if 0 /* XXX not currently used */
unsigned long memory_limit;
/* Look for mem= option on command line */ static int __init early_parsemem(char *p)
if (strstr(cmd_line, "mem=")) { {
char *p, *q; if (!p)
unsigned long maxmem = 0; return 0;
extern unsigned long __max_memory;
memory_limit = memparse(p, &p);
for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
q = p + 4; return 0;
if (p > cmd_line && p[-1] != ' ')
continue;
maxmem = simple_strtoul(q, &q, 0);
if (*q == 'k' || *q == 'K') {
maxmem <<= 10;
++q;
} else if (*q == 'm' || *q == 'M') {
maxmem <<= 20;
++q;
}
}
__max_memory = maxmem;
}
} }
early_param("mem", early_parsemem);
#endif
#ifdef CONFIG_PPC_PSERIES #ifdef CONFIG_PPC_PSERIES
static int __init set_preferred_console(void) static int __init set_preferred_console(void)
...@@ -681,16 +684,10 @@ void __init setup_arch(char **cmdline_p) ...@@ -681,16 +684,10 @@ void __init setup_arch(char **cmdline_p)
extern int panic_timeout; extern int panic_timeout;
extern void do_init_bootmem(void); extern void do_init_bootmem(void);
ppc64_boot_msg(0x12, "Setup Arch"); ppc64_boot_msg(0x12, "Setup Arch");
#ifdef CONFIG_XMON *cmdline_p = cmd_line;
if (strstr(cmd_line, "xmon")) {
/* ensure xmon is enabled */
xmon_init();
debugger(0);
}
#endif /* CONFIG_XMON */
/* /*
* Set cache line size based on type of cpu as a default. * Set cache line size based on type of cpu as a default.
...@@ -711,16 +708,15 @@ void __init setup_arch(char **cmdline_p) ...@@ -711,16 +708,15 @@ void __init setup_arch(char **cmdline_p)
init_mm.end_data = (unsigned long) _edata; init_mm.end_data = (unsigned long) _edata;
init_mm.brk = klimit; init_mm.brk = klimit;
/* Save unparsed command line copy for /proc/cmdline */
strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
*cmdline_p = cmd_line;
irqstack_early_init(); irqstack_early_init();
emergency_stack_init(); emergency_stack_init();
/* set up the bootmem stuff with available memory */ /* set up the bootmem stuff with available memory */
do_init_bootmem(); do_init_bootmem();
/* Select the correct idle loop for the platform. */
idle_setup();
ppc_md.setup_arch(); ppc_md.setup_arch();
paging_init(); paging_init();
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/abs_addr.h> #include <asm/abs_addr.h>
static int numa_enabled = 1;
static int numa_debug; static int numa_debug;
#define dbg(args...) if (numa_debug) { printk(KERN_INFO args); } #define dbg(args...) if (numa_debug) { printk(KERN_INFO args); }
...@@ -189,10 +191,7 @@ static int __init parse_numa_properties(void) ...@@ -189,10 +191,7 @@ static int __init parse_numa_properties(void)
long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT; long entries = lmb_end_of_DRAM() >> MEMORY_INCREMENT_SHIFT;
unsigned long i; unsigned long i;
if (strstr(saved_command_line, "numa=debug")) if (numa_enabled == 0) {
numa_debug = 1;
if (strstr(saved_command_line, "numa=off")) {
printk(KERN_WARNING "NUMA disabled by user\n"); printk(KERN_WARNING "NUMA disabled by user\n");
return -1; return -1;
} }
...@@ -587,3 +586,18 @@ void __init paging_init(void) ...@@ -587,3 +586,18 @@ void __init paging_init(void)
start_pfn, zholes_size); start_pfn, zholes_size);
} }
} }
static int __init early_numa(char *p)
{
if (!p)
return 0;
if (strstr(p, "off"))
numa_enabled = 0;
if (strstr(p, "debug"))
numa_debug = 1;
return 0;
}
early_param("numa", early_numa);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment