aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/machvec.c45
-rw-r--r--arch/sh/kernel/setup.c7
2 files changed, 38 insertions, 14 deletions
diff --git a/arch/sh/kernel/machvec.c b/arch/sh/kernel/machvec.c
index 1e78191154e3..e8121de5faa4 100644
--- a/arch/sh/kernel/machvec.c
+++ b/arch/sh/kernel/machvec.c
@@ -29,7 +29,7 @@ static struct sh_machine_vector * __init get_mv_byname(const char *name)
29 struct sh_machine_vector *mv; 29 struct sh_machine_vector *mv;
30 30
31 for_each_mv(mv) 31 for_each_mv(mv)
32 if (strcasecmp(name, get_system_type()) == 0) 32 if (strcasecmp(name, mv->mv_name) == 0)
33 return mv; 33 return mv;
34 34
35 return NULL; 35 return NULL;
@@ -55,20 +55,17 @@ static int __init early_parse_mv(char *from)
55 mv_name[mv_len] = '\0'; 55 mv_name[mv_len] = '\0';
56 from = mv_end; 56 from = mv_end;
57 57
58 if (strcmp(sh_mv.mv_name, mv_name) != 0) { 58 mvp = get_mv_byname(mv_name);
59 mvp = get_mv_byname(mv_name); 59 if (unlikely(!mvp)) {
60 if (unlikely(!mvp)) { 60 printk("Available vectors:\n\n\t");
61 printk("Available vectors:\n\n\t"); 61 for_each_mv(mvp)
62 for_each_mv(mvp) 62 printk("'%s', ", mvp->mv_name);
63 printk("'%s', ", mvp->mv_name); 63 printk("\n\n");
64 printk("\n\n"); 64 panic("Failed to select machvec '%s' -- halting.\n",
65 panic("Failed to select machvec '%s' -- halting.\n", 65 mv_name);
66 mv_name); 66 } else
67 } else 67 sh_mv = *mvp;
68 sh_mv = *mvp;
69 }
70 68
71 printk(KERN_NOTICE "Booting machvec: %s\n", sh_mv.mv_name);
72 return 0; 69 return 0;
73} 70}
74early_param("sh_mv", early_parse_mv); 71early_param("sh_mv", early_parse_mv);
@@ -76,6 +73,26 @@ early_param("sh_mv", early_parse_mv);
76void __init sh_mv_setup(void) 73void __init sh_mv_setup(void)
77{ 74{
78 /* 75 /*
76 * Only overload the machvec if one hasn't been selected on
77 * the command line with sh_mv=
78 */
79 if (strcmp(sh_mv.mv_name, "Unknown") != 0) {
80 unsigned long machvec_size;
81
82 machvec_size = ((unsigned long)&__machvec_end -
83 (unsigned long)&__machvec_start);
84
85 /*
86 * If the machvec hasn't been preselected, use the first
87 * vector (usually the only one) from .machvec.init.
88 */
89 if (machvec_size >= sizeof(struct sh_machine_vector))
90 sh_mv = *(struct sh_machine_vector *)&__machvec_start;
91 }
92
93 printk(KERN_NOTICE "Booting machvec: %s\n", get_system_type());
94
95 /*
79 * Manually walk the vec, fill in anything that the board hasn't yet 96 * Manually walk the vec, fill in anything that the board hasn't yet
80 * by hand, wrapping to the generic implementation. 97 * by hand, wrapping to the generic implementation.
81 */ 98 */
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 65c093145dac..55ed653c7a67 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -42,6 +42,13 @@ extern void * __rd_start, * __rd_end;
42 * The bigger value means no problem. 42 * The bigger value means no problem.
43 */ 43 */
44struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, }; 44struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, };
45
46/*
47 * The machine vector. First entry in .machvec.init, or clobbered by
48 * sh_mv= on the command line, prior to .machvec.init teardown.
49 */
50struct sh_machine_vector sh_mv = { .mv_name = "Unknown", };
51
45#ifdef CONFIG_VT 52#ifdef CONFIG_VT
46struct screen_info screen_info; 53struct screen_info screen_info;
47#endif 54#endif