diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-02-01 06:06:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-01 11:53:19 -0500 |
commit | de02797aa744c96a90f47be7bc081ce2f74b17fd (patch) | |
tree | 24e507b19a7180e8ae08d786598061479f660369 /arch/sh | |
parent | 091904ae5fc6f018680f83d71301ceac4f39d77f (diff) |
[PATCH] sh: Cleanup struct sh_cpuinfo for clock framework changes
Now that the clock framework changes have been integrated, the manual clock
accounting that was done in sh_cpuinfo can be dropped.
Also correct a bug with running past the end of the CPU flags when there's a
mismatch between the added flags and printed ones.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/setup.c | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 036050b377cd..0f1fbe72cce4 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c | |||
@@ -22,10 +22,10 @@ | |||
22 | #include <linux/cpu.h> | 22 | #include <linux/cpu.h> |
23 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
25 | #include <asm/io_generic.h> | ||
26 | #include <asm/sections.h> | 25 | #include <asm/sections.h> |
27 | #include <asm/irq.h> | 26 | #include <asm/irq.h> |
28 | #include <asm/setup.h> | 27 | #include <asm/setup.h> |
28 | #include <asm/clock.h> | ||
29 | 29 | ||
30 | #ifdef CONFIG_SH_KGDB | 30 | #ifdef CONFIG_SH_KGDB |
31 | #include <asm/kgdb.h> | 31 | #include <asm/kgdb.h> |
@@ -41,7 +41,7 @@ extern void * __rd_start, * __rd_end; | |||
41 | * This value will be used at the very early stage of serial setup. | 41 | * This value will be used at the very early stage of serial setup. |
42 | * The bigger value means no problem. | 42 | * The bigger value means no problem. |
43 | */ | 43 | */ |
44 | struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 0, 10000000, }; | 44 | struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, }; |
45 | struct screen_info screen_info; | 45 | struct screen_info screen_info; |
46 | 46 | ||
47 | #if defined(CONFIG_SH_UNKNOWN) | 47 | #if defined(CONFIG_SH_UNKNOWN) |
@@ -273,10 +273,10 @@ void __init setup_arch(char **cmdline_p) | |||
273 | init_mm.end_data = (unsigned long) _edata; | 273 | init_mm.end_data = (unsigned long) _edata; |
274 | init_mm.brk = (unsigned long) _end; | 274 | init_mm.brk = (unsigned long) _end; |
275 | 275 | ||
276 | code_resource.start = virt_to_bus(_text); | 276 | code_resource.start = (unsigned long)virt_to_phys(_text); |
277 | code_resource.end = virt_to_bus(_etext)-1; | 277 | code_resource.end = (unsigned long)virt_to_phys(_etext)-1; |
278 | data_resource.start = virt_to_bus(_etext); | 278 | data_resource.start = (unsigned long)virt_to_phys(_etext); |
279 | data_resource.end = virt_to_bus(_edata)-1; | 279 | data_resource.end = (unsigned long)virt_to_phys(_edata)-1; |
280 | 280 | ||
281 | sh_mv_setup(cmdline_p); | 281 | sh_mv_setup(cmdline_p); |
282 | 282 | ||
@@ -435,6 +435,9 @@ static const char *cpu_name[] = { | |||
435 | [CPU_ST40GX1] = "ST40GX1", | 435 | [CPU_ST40GX1] = "ST40GX1", |
436 | [CPU_SH4_202] = "SH4-202", | 436 | [CPU_SH4_202] = "SH4-202", |
437 | [CPU_SH4_501] = "SH4-501", | 437 | [CPU_SH4_501] = "SH4-501", |
438 | [CPU_SH7770] = "SH7770", | ||
439 | [CPU_SH7780] = "SH7780", | ||
440 | [CPU_SH7781] = "SH7781", | ||
438 | [CPU_SH_NONE] = "Unknown" | 441 | [CPU_SH_NONE] = "Unknown" |
439 | }; | 442 | }; |
440 | 443 | ||
@@ -445,7 +448,7 @@ const char *get_cpu_subtype(void) | |||
445 | 448 | ||
446 | #ifdef CONFIG_PROC_FS | 449 | #ifdef CONFIG_PROC_FS |
447 | static const char *cpu_flags[] = { | 450 | static const char *cpu_flags[] = { |
448 | "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", | 451 | "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", "ptea", NULL |
449 | }; | 452 | }; |
450 | 453 | ||
451 | static void show_cpuflags(struct seq_file *m) | 454 | static void show_cpuflags(struct seq_file *m) |
@@ -459,7 +462,7 @@ static void show_cpuflags(struct seq_file *m) | |||
459 | return; | 462 | return; |
460 | } | 463 | } |
461 | 464 | ||
462 | for (i = 0; i < cpu_data->flags; i++) | 465 | for (i = 0; cpu_flags[i]; i++) |
463 | if ((cpu_data->flags & (1 << i))) | 466 | if ((cpu_data->flags & (1 << i))) |
464 | seq_printf(m, " %s", cpu_flags[i+1]); | 467 | seq_printf(m, " %s", cpu_flags[i+1]); |
465 | 468 | ||
@@ -472,7 +475,8 @@ static void show_cacheinfo(struct seq_file *m, const char *type, struct cache_in | |||
472 | 475 | ||
473 | cache_size = info.ways * info.sets * info.linesz; | 476 | cache_size = info.ways * info.sets * info.linesz; |
474 | 477 | ||
475 | seq_printf(m, "%s size\t: %dKiB\n", type, cache_size >> 10); | 478 | seq_printf(m, "%s size\t: %2dKiB (%d-way)\n", |
479 | type, cache_size >> 10, info.ways); | ||
476 | } | 480 | } |
477 | 481 | ||
478 | /* | 482 | /* |
@@ -511,21 +515,9 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
511 | boot_cpu_data.loops_per_jiffy/(500000/HZ), | 515 | boot_cpu_data.loops_per_jiffy/(500000/HZ), |
512 | (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100); | 516 | (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100); |
513 | 517 | ||
514 | #define PRINT_CLOCK(name, value) \ | 518 | return show_clocks(m); |
515 | seq_printf(m, name " clock\t: %d.%02dMHz\n", \ | ||
516 | ((value) / 1000000), ((value) % 1000000)/10000) | ||
517 | |||
518 | PRINT_CLOCK("cpu", boot_cpu_data.cpu_clock); | ||
519 | PRINT_CLOCK("bus", boot_cpu_data.bus_clock); | ||
520 | #ifdef CONFIG_CPU_SUBTYPE_ST40STB1 | ||
521 | PRINT_CLOCK("memory", boot_cpu_data.memory_clock); | ||
522 | #endif | ||
523 | PRINT_CLOCK("module", boot_cpu_data.module_clock); | ||
524 | |||
525 | return 0; | ||
526 | } | 519 | } |
527 | 520 | ||
528 | |||
529 | static void *c_start(struct seq_file *m, loff_t *pos) | 521 | static void *c_start(struct seq_file *m, loff_t *pos) |
530 | { | 522 | { |
531 | return *pos < NR_CPUS ? cpu_data + *pos : NULL; | 523 | return *pos < NR_CPUS ? cpu_data + *pos : NULL; |
@@ -596,7 +588,7 @@ static int __init kgdb_parse_options(char *options) | |||
596 | options += map->namelen + 1; | 588 | options += map->namelen + 1; |
597 | 589 | ||
598 | options = (*options == ',') ? options+1 : options; | 590 | options = (*options == ',') ? options+1 : options; |
599 | 591 | ||
600 | /* Read optional parameters (baud/parity/bits) */ | 592 | /* Read optional parameters (baud/parity/bits) */ |
601 | baud = simple_strtoul(options, &options, 10); | 593 | baud = simple_strtoul(options, &options, 10); |
602 | if (baud != 0) { | 594 | if (baud != 0) { |