aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/setup.c')
-rw-r--r--arch/sh/kernel/setup.c51
1 files changed, 19 insertions, 32 deletions
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 036050b377cd..a067a34e0b64 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 */
44struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 0, 10000000, }; 44struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, };
45struct screen_info screen_info; 45struct screen_info screen_info;
46 46
47#if defined(CONFIG_SH_UNKNOWN) 47#if defined(CONFIG_SH_UNKNOWN)
@@ -186,7 +186,7 @@ static inline void parse_cmdline (char ** cmdline_p, char mv_name[MV_NAME_SIZE],
186 186
187static int __init sh_mv_setup(char **cmdline_p) 187static int __init sh_mv_setup(char **cmdline_p)
188{ 188{
189#if defined(CONFIG_SH_UNKNOWN) 189#ifdef CONFIG_SH_UNKNOWN
190 extern struct sh_machine_vector mv_unknown; 190 extern struct sh_machine_vector mv_unknown;
191#endif 191#endif
192 struct sh_machine_vector *mv = NULL; 192 struct sh_machine_vector *mv = NULL;
@@ -196,7 +196,7 @@ static int __init sh_mv_setup(char **cmdline_p)
196 196
197 parse_cmdline(cmdline_p, mv_name, &mv, &mv_io_base, &mv_mmio_enable); 197 parse_cmdline(cmdline_p, mv_name, &mv, &mv_io_base, &mv_mmio_enable);
198 198
199#ifdef CONFIG_SH_GENERIC 199#ifdef CONFIG_SH_UNKNOWN
200 if (mv == NULL) { 200 if (mv == NULL) {
201 mv = &mv_unknown; 201 mv = &mv_unknown;
202 if (*mv_name != '\0') { 202 if (*mv_name != '\0') {
@@ -206,9 +206,6 @@ static int __init sh_mv_setup(char **cmdline_p)
206 } 206 }
207 sh_mv = *mv; 207 sh_mv = *mv;
208#endif 208#endif
209#ifdef CONFIG_SH_UNKNOWN
210 sh_mv = mv_unknown;
211#endif
212 209
213 /* 210 /*
214 * Manually walk the vec, fill in anything that the board hasn't yet 211 * Manually walk the vec, fill in anything that the board hasn't yet
@@ -231,10 +228,8 @@ static int __init sh_mv_setup(char **cmdline_p)
231 mv_set(readb); mv_set(readw); mv_set(readl); 228 mv_set(readb); mv_set(readw); mv_set(readl);
232 mv_set(writeb); mv_set(writew); mv_set(writel); 229 mv_set(writeb); mv_set(writew); mv_set(writel);
233 230
234 mv_set(ioremap); 231 mv_set(ioport_map);
235 mv_set(iounmap); 232 mv_set(ioport_unmap);
236
237 mv_set(isa_port2addr);
238 mv_set(irq_demux); 233 mv_set(irq_demux);
239 234
240#ifdef CONFIG_SH_UNKNOWN 235#ifdef CONFIG_SH_UNKNOWN
@@ -273,10 +268,10 @@ void __init setup_arch(char **cmdline_p)
273 init_mm.end_data = (unsigned long) _edata; 268 init_mm.end_data = (unsigned long) _edata;
274 init_mm.brk = (unsigned long) _end; 269 init_mm.brk = (unsigned long) _end;
275 270
276 code_resource.start = virt_to_bus(_text); 271 code_resource.start = (unsigned long)virt_to_phys(_text);
277 code_resource.end = virt_to_bus(_etext)-1; 272 code_resource.end = (unsigned long)virt_to_phys(_etext)-1;
278 data_resource.start = virt_to_bus(_etext); 273 data_resource.start = (unsigned long)virt_to_phys(_etext);
279 data_resource.end = virt_to_bus(_edata)-1; 274 data_resource.end = (unsigned long)virt_to_phys(_edata)-1;
280 275
281 sh_mv_setup(cmdline_p); 276 sh_mv_setup(cmdline_p);
282 277
@@ -435,6 +430,9 @@ static const char *cpu_name[] = {
435 [CPU_ST40GX1] = "ST40GX1", 430 [CPU_ST40GX1] = "ST40GX1",
436 [CPU_SH4_202] = "SH4-202", 431 [CPU_SH4_202] = "SH4-202",
437 [CPU_SH4_501] = "SH4-501", 432 [CPU_SH4_501] = "SH4-501",
433 [CPU_SH7770] = "SH7770",
434 [CPU_SH7780] = "SH7780",
435 [CPU_SH7781] = "SH7781",
438 [CPU_SH_NONE] = "Unknown" 436 [CPU_SH_NONE] = "Unknown"
439}; 437};
440 438
@@ -445,7 +443,7 @@ const char *get_cpu_subtype(void)
445 443
446#ifdef CONFIG_PROC_FS 444#ifdef CONFIG_PROC_FS
447static const char *cpu_flags[] = { 445static const char *cpu_flags[] = {
448 "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", 446 "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", "ptea", NULL
449}; 447};
450 448
451static void show_cpuflags(struct seq_file *m) 449static void show_cpuflags(struct seq_file *m)
@@ -459,7 +457,7 @@ static void show_cpuflags(struct seq_file *m)
459 return; 457 return;
460 } 458 }
461 459
462 for (i = 0; i < cpu_data->flags; i++) 460 for (i = 0; cpu_flags[i]; i++)
463 if ((cpu_data->flags & (1 << i))) 461 if ((cpu_data->flags & (1 << i)))
464 seq_printf(m, " %s", cpu_flags[i+1]); 462 seq_printf(m, " %s", cpu_flags[i+1]);
465 463
@@ -472,7 +470,8 @@ static void show_cacheinfo(struct seq_file *m, const char *type, struct cache_in
472 470
473 cache_size = info.ways * info.sets * info.linesz; 471 cache_size = info.ways * info.sets * info.linesz;
474 472
475 seq_printf(m, "%s size\t: %dKiB\n", type, cache_size >> 10); 473 seq_printf(m, "%s size\t: %2dKiB (%d-way)\n",
474 type, cache_size >> 10, info.ways);
476} 475}
477 476
478/* 477/*
@@ -511,21 +510,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
511 boot_cpu_data.loops_per_jiffy/(500000/HZ), 510 boot_cpu_data.loops_per_jiffy/(500000/HZ),
512 (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100); 511 (boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100);
513 512
514#define PRINT_CLOCK(name, value) \ 513 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} 514}
527 515
528
529static void *c_start(struct seq_file *m, loff_t *pos) 516static void *c_start(struct seq_file *m, loff_t *pos)
530{ 517{
531 return *pos < NR_CPUS ? cpu_data + *pos : NULL; 518 return *pos < NR_CPUS ? cpu_data + *pos : NULL;
@@ -596,7 +583,7 @@ static int __init kgdb_parse_options(char *options)
596 options += map->namelen + 1; 583 options += map->namelen + 1;
597 584
598 options = (*options == ',') ? options+1 : options; 585 options = (*options == ',') ? options+1 : options;
599 586
600 /* Read optional parameters (baud/parity/bits) */ 587 /* Read optional parameters (baud/parity/bits) */
601 baud = simple_strtoul(options, &options, 10); 588 baud = simple_strtoul(options, &options, 10);
602 if (baud != 0) { 589 if (baud != 0) {