Commit a5b00bb4 authored by Horms's avatar Horms Committed by Tony Luck

IA64: Use early_parm to handle mvec_name and nomca

I'm not sure of the worthiness of this idea, so please consider it an RFC.
Its key merits are:

* Reuse existing infrastructure
* Greatly tightens up the parsing of nomca
* Greatly simplifies the parsing of machvec

Addition cleanup (moving setup_mvec() to machvec.c) by Ken Chen.
Signed-Off-By: default avatarHorms <horms@verge.net.au>
Signed-Off-By: default avatarTony Luck <tony.luck@intel.com>
parent 39e18de8
...@@ -14,7 +14,15 @@ ...@@ -14,7 +14,15 @@
struct ia64_machine_vector ia64_mv; struct ia64_machine_vector ia64_mv;
EXPORT_SYMBOL(ia64_mv); EXPORT_SYMBOL(ia64_mv);
static struct ia64_machine_vector * static __initdata const char *mvec_name;
static __init int setup_mvec(char *s)
{
mvec_name = s;
return 0;
}
early_param("machvec", setup_mvec);
static struct ia64_machine_vector * __init
lookup_machvec (const char *name) lookup_machvec (const char *name)
{ {
extern struct ia64_machine_vector machvec_start[]; extern struct ia64_machine_vector machvec_start[];
...@@ -33,10 +41,13 @@ machvec_init (const char *name) ...@@ -33,10 +41,13 @@ machvec_init (const char *name)
{ {
struct ia64_machine_vector *mv; struct ia64_machine_vector *mv;
if (!name)
name = mvec_name ? mvec_name : acpi_get_sysname();
mv = lookup_machvec(name); mv = lookup_machvec(name);
if (!mv) { if (!mv)
panic("generic kernel failed to find machine vector for platform %s!", name); panic("generic kernel failed to find machine vector for"
} " platform %s!", name);
ia64_mv = *mv; ia64_mv = *mv;
printk(KERN_INFO "booting generic kernel on platform %s\n", name); printk(KERN_INFO "booting generic kernel on platform %s\n", name);
} }
......
...@@ -389,6 +389,14 @@ check_for_logical_procs (void) ...@@ -389,6 +389,14 @@ check_for_logical_procs (void)
} }
#endif #endif
static __initdata int nomca;
static __init int setup_nomca(char *s)
{
nomca = 1;
return 0;
}
early_param("nomca", setup_nomca);
void __init void __init
setup_arch (char **cmdline_p) setup_arch (char **cmdline_p)
{ {
...@@ -402,35 +410,15 @@ setup_arch (char **cmdline_p) ...@@ -402,35 +410,15 @@ setup_arch (char **cmdline_p)
efi_init(); efi_init();
io_port_init(); io_port_init();
parse_early_param();
#ifdef CONFIG_IA64_GENERIC #ifdef CONFIG_IA64_GENERIC
{ machvec_init(NULL);
const char *mvec_name = strstr (*cmdline_p, "machvec=");
char str[64];
if (mvec_name) {
const char *end;
size_t len;
mvec_name += 8;
end = strchr (mvec_name, ' ');
if (end)
len = end - mvec_name;
else
len = strlen (mvec_name);
len = min(len, sizeof (str) - 1);
strncpy (str, mvec_name, len);
str[len] = '\0';
mvec_name = str;
} else
mvec_name = acpi_get_sysname();
machvec_init(mvec_name);
}
#endif #endif
if (early_console_setup(*cmdline_p) == 0) if (early_console_setup(*cmdline_p) == 0)
mark_bsp_online(); mark_bsp_online();
parse_early_param();
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
/* Initialize the ACPI boot-time table parser */ /* Initialize the ACPI boot-time table parser */
acpi_table_init(); acpi_table_init();
...@@ -493,7 +481,7 @@ setup_arch (char **cmdline_p) ...@@ -493,7 +481,7 @@ setup_arch (char **cmdline_p)
#endif #endif
/* enable IA-64 Machine Check Abort Handling unless disabled */ /* enable IA-64 Machine Check Abort Handling unless disabled */
if (!strstr(saved_command_line, "nomca")) if (!nomca)
ia64_mca_init(); ia64_mca_init();
platform_setup(cmdline_p); platform_setup(cmdline_p);
......
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