aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 05:17:31 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 05:17:31 -0400
commit2c7834a6f15fe6c50ed4766f1bb6f9183b9e2740 (patch)
tree2dee1fc4b2cd69d8e7f07e0462c57c98261a9fcf /arch/sh/kernel
parentbc8fb5d0471473f775378d09db712dcb8eeece75 (diff)
sh: machvec rework.
Some more machvec overhauling and setup code cleanup. Kill off get_system_type() and platform_setup(), we can do these both through the machvec. While we're add it, kill off more useless mach.c's and drop some legacy cruft from setup.c. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/setup.c54
1 files changed, 11 insertions, 43 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 86ef17fe48b5..de8df969d6af 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -43,27 +43,14 @@ extern void * __rd_start, * __rd_end;
43 * The bigger value means no problem. 43 * The bigger value means no problem.
44 */ 44 */
45struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, }; 45struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, };
46#ifdef CONFIG_VT
46struct screen_info screen_info; 47struct screen_info screen_info;
48#endif
47 49
48#if defined(CONFIG_SH_UNKNOWN) 50#if defined(CONFIG_SH_UNKNOWN)
49struct sh_machine_vector sh_mv; 51struct sh_machine_vector sh_mv;
50#endif 52#endif
51 53
52/* We need this to satisfy some external references. */
53struct screen_info screen_info = {
54 0, 25, /* orig-x, orig-y */
55 0, /* unused */
56 0, /* orig-video-page */
57 0, /* orig-video-mode */
58 80, /* orig-video-cols */
59 0,0,0, /* ega_ax, ega_bx, ega_cx */
60 25, /* orig-video-lines */
61 0, /* orig-video-isVGA */
62 16 /* orig-video-points */
63};
64
65extern void platform_setup(void);
66extern char *get_system_type(void);
67extern int root_mountflags; 54extern int root_mountflags;
68 55
69#define MV_NAME_SIZE 32 56#define MV_NAME_SIZE 32
@@ -90,29 +77,8 @@ static struct sh_machine_vector* __init get_mv_byname(const char* name);
90 77
91static char command_line[COMMAND_LINE_SIZE] = { 0, }; 78static char command_line[COMMAND_LINE_SIZE] = { 0, };
92 79
93struct resource standard_io_resources[] = { 80static struct resource code_resource = { .name = "Kernel code", };
94 { "dma1", 0x00, 0x1f }, 81static struct resource data_resource = { .name = "Kernel data", };
95 { "pic1", 0x20, 0x3f },
96 { "timer", 0x40, 0x5f },
97 { "keyboard", 0x60, 0x6f },
98 { "dma page reg", 0x80, 0x8f },
99 { "pic2", 0xa0, 0xbf },
100 { "dma2", 0xc0, 0xdf },
101 { "fpu", 0xf0, 0xff }
102};
103
104#define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource))
105
106/* System RAM - interrupted by the 640kB-1M hole */
107#define code_resource (ram_resources[3])
108#define data_resource (ram_resources[4])
109static struct resource ram_resources[] = {
110 { "System RAM", 0x000000, 0x09ffff, IORESOURCE_BUSY },
111 { "System RAM", 0x100000, 0x100000, IORESOURCE_BUSY },
112 { "Video RAM area", 0x0a0000, 0x0bffff },
113 { "Kernel code", 0x100000, 0 },
114 { "Kernel data", 0, 0 }
115};
116 82
117unsigned long memory_start, memory_end; 83unsigned long memory_start, memory_end;
118 84
@@ -255,6 +221,9 @@ static int __init sh_mv_setup(char **cmdline_p)
255 __set_io_port_base(mv_io_base); 221 __set_io_port_base(mv_io_base);
256#endif 222#endif
257 223
224 if (!sh_mv.mv_nr_irqs)
225 sh_mv.mv_nr_irqs = NR_IRQS;
226
258 return 0; 227 return 0;
259} 228}
260 229
@@ -263,7 +232,6 @@ void __init setup_arch(char **cmdline_p)
263 unsigned long bootmap_size; 232 unsigned long bootmap_size;
264 unsigned long start_pfn, max_pfn, max_low_pfn; 233 unsigned long start_pfn, max_pfn, max_low_pfn;
265 234
266
267#ifdef CONFIG_CMDLINE_BOOL 235#ifdef CONFIG_CMDLINE_BOOL
268 strcpy(COMMAND_LINE, CONFIG_CMDLINE); 236 strcpy(COMMAND_LINE, CONFIG_CMDLINE);
269#endif 237#endif
@@ -382,14 +350,14 @@ void __init setup_arch(char **cmdline_p)
382#endif 350#endif
383 351
384 /* Perform the machine specific initialisation */ 352 /* Perform the machine specific initialisation */
385 platform_setup(); 353 if (likely(sh_mv.mv_setup))
354 sh_mv.mv_setup(cmdline_p);
386 355
387 paging_init(); 356 paging_init();
388} 357}
389 358
390struct sh_machine_vector* __init get_mv_byname(const char* name) 359struct sh_machine_vector* __init get_mv_byname(const char* name)
391{ 360{
392 extern int strcasecmp(const char *, const char *);
393 extern long __machvec_start, __machvec_end; 361 extern long __machvec_start, __machvec_end;
394 struct sh_machine_vector *all_vecs = 362 struct sh_machine_vector *all_vecs =
395 (struct sh_machine_vector *)&__machvec_start; 363 (struct sh_machine_vector *)&__machvec_start;
@@ -467,7 +435,8 @@ static void show_cpuflags(struct seq_file *m)
467 seq_printf(m, "\n"); 435 seq_printf(m, "\n");
468} 436}
469 437
470static void show_cacheinfo(struct seq_file *m, const char *type, struct cache_info info) 438static void show_cacheinfo(struct seq_file *m, const char *type,
439 struct cache_info info)
471{ 440{
472 unsigned int cache_size; 441 unsigned int cache_size;
473 442
@@ -624,4 +593,3 @@ static int __init kgdb_parse_options(char *options)
624} 593}
625__setup("kgdb=", kgdb_parse_options); 594__setup("kgdb=", kgdb_parse_options);
626#endif /* CONFIG_SH_KGDB */ 595#endif /* CONFIG_SH_KGDB */
627