diff options
Diffstat (limited to 'arch/sh/kernel/setup.c')
| -rw-r--r-- | arch/sh/kernel/setup.c | 117 |
1 files changed, 49 insertions, 68 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index e75189cb1db7..5f587332234a 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 | */ |
| 45 | struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, }; | 45 | struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, }; |
| 46 | #ifdef CONFIG_VT | ||
| 46 | struct screen_info screen_info; | 47 | struct screen_info screen_info; |
| 48 | #endif | ||
| 47 | 49 | ||
| 48 | #if defined(CONFIG_SH_UNKNOWN) | 50 | #if defined(CONFIG_SH_UNKNOWN) |
| 49 | struct sh_machine_vector sh_mv; | 51 | struct sh_machine_vector sh_mv; |
| 50 | #endif | 52 | #endif |
| 51 | 53 | ||
| 52 | /* We need this to satisfy some external references. */ | ||
| 53 | struct 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 | |||
| 65 | extern void platform_setup(void); | ||
| 66 | extern char *get_system_type(void); | ||
| 67 | extern int root_mountflags; | 54 | extern 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 | ||
| 91 | static char command_line[COMMAND_LINE_SIZE] = { 0, }; | 78 | static char command_line[COMMAND_LINE_SIZE] = { 0, }; |
| 92 | 79 | ||
| 93 | struct resource standard_io_resources[] = { | 80 | static struct resource code_resource = { .name = "Kernel code", }; |
| 94 | { "dma1", 0x00, 0x1f }, | 81 | static 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]) | ||
| 109 | static 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 | ||
| 117 | unsigned long memory_start, memory_end; | 83 | unsigned long memory_start, memory_end; |
| 118 | 84 | ||
| @@ -145,6 +111,24 @@ static inline void parse_cmdline (char ** cmdline_p, char mv_name[MV_NAME_SIZE], | |||
| 145 | memory_end = memory_start + mem_size; | 111 | memory_end = memory_start + mem_size; |
| 146 | } | 112 | } |
| 147 | } | 113 | } |
| 114 | |||
| 115 | #ifdef CONFIG_EARLY_PRINTK | ||
| 116 | if (c == ' ' && !memcmp(from, "earlyprintk=", 12)) { | ||
| 117 | char *ep_end; | ||
| 118 | |||
| 119 | if (to != command_line) | ||
| 120 | to--; | ||
| 121 | |||
| 122 | from += 12; | ||
| 123 | ep_end = strchr(from, ' '); | ||
| 124 | |||
| 125 | setup_early_printk(from); | ||
| 126 | printk("early console enabled\n"); | ||
| 127 | |||
| 128 | from = ep_end; | ||
| 129 | } | ||
| 130 | #endif | ||
| 131 | |||
| 148 | if (c == ' ' && !memcmp(from, "sh_mv=", 6)) { | 132 | if (c == ' ' && !memcmp(from, "sh_mv=", 6)) { |
| 149 | char* mv_end; | 133 | char* mv_end; |
| 150 | char* mv_comma; | 134 | char* mv_comma; |
| @@ -237,6 +221,9 @@ static int __init sh_mv_setup(char **cmdline_p) | |||
| 237 | __set_io_port_base(mv_io_base); | 221 | __set_io_port_base(mv_io_base); |
| 238 | #endif | 222 | #endif |
| 239 | 223 | ||
| 224 | if (!sh_mv.mv_nr_irqs) | ||
| 225 | sh_mv.mv_nr_irqs = NR_IRQS; | ||
| 226 | |||
| 240 | return 0; | 227 | return 0; |
| 241 | } | 228 | } |
| 242 | 229 | ||
| @@ -245,11 +232,6 @@ void __init setup_arch(char **cmdline_p) | |||
| 245 | unsigned long bootmap_size; | 232 | unsigned long bootmap_size; |
| 246 | unsigned long start_pfn, max_pfn, max_low_pfn; | 233 | unsigned long start_pfn, max_pfn, max_low_pfn; |
| 247 | 234 | ||
| 248 | #ifdef CONFIG_EARLY_PRINTK | ||
| 249 | extern void enable_early_printk(void); | ||
| 250 | |||
| 251 | enable_early_printk(); | ||
| 252 | #endif | ||
| 253 | #ifdef CONFIG_CMDLINE_BOOL | 235 | #ifdef CONFIG_CMDLINE_BOOL |
| 254 | strcpy(COMMAND_LINE, CONFIG_CMDLINE); | 236 | strcpy(COMMAND_LINE, CONFIG_CMDLINE); |
| 255 | #endif | 237 | #endif |
| @@ -368,14 +350,14 @@ void __init setup_arch(char **cmdline_p) | |||
| 368 | #endif | 350 | #endif |
| 369 | 351 | ||
| 370 | /* Perform the machine specific initialisation */ | 352 | /* Perform the machine specific initialisation */ |
| 371 | platform_setup(); | 353 | if (likely(sh_mv.mv_setup)) |
| 354 | sh_mv.mv_setup(cmdline_p); | ||
| 372 | 355 | ||
| 373 | paging_init(); | 356 | paging_init(); |
| 374 | } | 357 | } |
| 375 | 358 | ||
| 376 | struct sh_machine_vector* __init get_mv_byname(const char* name) | 359 | struct sh_machine_vector* __init get_mv_byname(const char* name) |
| 377 | { | 360 | { |
| 378 | extern int strcasecmp(const char *, const char *); | ||
| 379 | extern long __machvec_start, __machvec_end; | 361 | extern long __machvec_start, __machvec_end; |
| 380 | struct sh_machine_vector *all_vecs = | 362 | struct sh_machine_vector *all_vecs = |
| 381 | (struct sh_machine_vector *)&__machvec_start; | 363 | (struct sh_machine_vector *)&__machvec_start; |
| @@ -410,25 +392,18 @@ static int __init topology_init(void) | |||
| 410 | subsys_initcall(topology_init); | 392 | subsys_initcall(topology_init); |
| 411 | 393 | ||
| 412 | static const char *cpu_name[] = { | 394 | static const char *cpu_name[] = { |
| 413 | [CPU_SH7604] = "SH7604", | 395 | [CPU_SH7604] = "SH7604", [CPU_SH7300] = "SH7300", |
| 414 | [CPU_SH7705] = "SH7705", | 396 | [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706", |
| 415 | [CPU_SH7708] = "SH7708", | 397 | [CPU_SH7707] = "SH7707", [CPU_SH7708] = "SH7708", |
| 416 | [CPU_SH7729] = "SH7729", | 398 | [CPU_SH7709] = "SH7709", [CPU_SH7710] = "SH7710", |
| 417 | [CPU_SH7300] = "SH7300", | 399 | [CPU_SH7729] = "SH7729", [CPU_SH7750] = "SH7750", |
| 418 | [CPU_SH7750] = "SH7750", | 400 | [CPU_SH7750S] = "SH7750S", [CPU_SH7750R] = "SH7750R", |
| 419 | [CPU_SH7750S] = "SH7750S", | 401 | [CPU_SH7751] = "SH7751", [CPU_SH7751R] = "SH7751R", |
| 420 | [CPU_SH7750R] = "SH7750R", | 402 | [CPU_SH7760] = "SH7760", [CPU_SH73180] = "SH73180", |
| 421 | [CPU_SH7751] = "SH7751", | 403 | [CPU_ST40RA] = "ST40RA", [CPU_ST40GX1] = "ST40GX1", |
| 422 | [CPU_SH7751R] = "SH7751R", | 404 | [CPU_SH4_202] = "SH4-202", [CPU_SH4_501] = "SH4-501", |
| 423 | [CPU_SH7760] = "SH7760", | 405 | [CPU_SH7770] = "SH7770", [CPU_SH7780] = "SH7780", |
| 424 | [CPU_SH73180] = "SH73180", | 406 | [CPU_SH7781] = "SH7781", [CPU_SH7343] = "SH7343", |
| 425 | [CPU_ST40RA] = "ST40RA", | ||
| 426 | [CPU_ST40GX1] = "ST40GX1", | ||
| 427 | [CPU_SH4_202] = "SH4-202", | ||
| 428 | [CPU_SH4_501] = "SH4-501", | ||
| 429 | [CPU_SH7770] = "SH7770", | ||
| 430 | [CPU_SH7780] = "SH7780", | ||
| 431 | [CPU_SH7781] = "SH7781", | ||
| 432 | [CPU_SH_NONE] = "Unknown" | 407 | [CPU_SH_NONE] = "Unknown" |
| 433 | }; | 408 | }; |
| 434 | 409 | ||
| @@ -438,8 +413,10 @@ const char *get_cpu_subtype(void) | |||
| 438 | } | 413 | } |
| 439 | 414 | ||
| 440 | #ifdef CONFIG_PROC_FS | 415 | #ifdef CONFIG_PROC_FS |
| 416 | /* Symbolic CPU flags, keep in sync with asm/cpu-features.h */ | ||
| 441 | static const char *cpu_flags[] = { | 417 | static const char *cpu_flags[] = { |
| 442 | "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", "ptea", NULL | 418 | "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", |
| 419 | "ptea", "llsc", "l2", NULL | ||
| 443 | }; | 420 | }; |
| 444 | 421 | ||
| 445 | static void show_cpuflags(struct seq_file *m) | 422 | static void show_cpuflags(struct seq_file *m) |
| @@ -460,7 +437,8 @@ static void show_cpuflags(struct seq_file *m) | |||
| 460 | seq_printf(m, "\n"); | 437 | seq_printf(m, "\n"); |
| 461 | } | 438 | } |
| 462 | 439 | ||
| 463 | static void show_cacheinfo(struct seq_file *m, const char *type, struct cache_info info) | 440 | static void show_cacheinfo(struct seq_file *m, const char *type, |
| 441 | struct cache_info info) | ||
| 464 | { | 442 | { |
| 465 | unsigned int cache_size; | 443 | unsigned int cache_size; |
| 466 | 444 | ||
| @@ -493,7 +471,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
| 493 | * unified cache on the SH-2 and SH-3, as well as the harvard | 471 | * unified cache on the SH-2 and SH-3, as well as the harvard |
| 494 | * style cache on the SH-4. | 472 | * style cache on the SH-4. |
| 495 | */ | 473 | */ |
| 496 | if (test_bit(SH_CACHE_COMBINED, &(boot_cpu_data.icache.flags))) { | 474 | if (boot_cpu_data.icache.flags & SH_CACHE_COMBINED) { |
| 497 | seq_printf(m, "unified\n"); | 475 | seq_printf(m, "unified\n"); |
| 498 | show_cacheinfo(m, "cache", boot_cpu_data.icache); | 476 | show_cacheinfo(m, "cache", boot_cpu_data.icache); |
| 499 | } else { | 477 | } else { |
| @@ -502,6 +480,10 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
| 502 | show_cacheinfo(m, "dcache", boot_cpu_data.dcache); | 480 | show_cacheinfo(m, "dcache", boot_cpu_data.dcache); |
| 503 | } | 481 | } |
| 504 | 482 | ||
| 483 | /* Optional secondary cache */ | ||
| 484 | if (boot_cpu_data.flags & CPU_HAS_L2_CACHE) | ||
| 485 | show_cacheinfo(m, "scache", boot_cpu_data.scache); | ||
| 486 | |||
| 505 | seq_printf(m, "bogomips\t: %lu.%02lu\n", | 487 | seq_printf(m, "bogomips\t: %lu.%02lu\n", |
| 506 | boot_cpu_data.loops_per_jiffy/(500000/HZ), | 488 | boot_cpu_data.loops_per_jiffy/(500000/HZ), |
| 507 | (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100); | 489 | (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100); |
| @@ -617,4 +599,3 @@ static int __init kgdb_parse_options(char *options) | |||
| 617 | } | 599 | } |
| 618 | __setup("kgdb=", kgdb_parse_options); | 600 | __setup("kgdb=", kgdb_parse_options); |
| 619 | #endif /* CONFIG_SH_KGDB */ | 601 | #endif /* CONFIG_SH_KGDB */ |
| 620 | |||
