#include <linux/cpu.h>
#include <asm/uaccess.h>
#include <asm/io.h>
-#include <asm/io_generic.h>
#include <asm/sections.h>
#include <asm/irq.h>
#include <asm/setup.h>
+#include <asm/clock.h>
#ifdef CONFIG_SH_KGDB
#include <asm/kgdb.h>
* This value will be used at the very early stage of serial setup.
* The bigger value means no problem.
*/
-struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 0, 10000000, };
+struct sh_cpuinfo boot_cpu_data = { CPU_SH_NONE, 10000000, };
struct screen_info screen_info;
#if defined(CONFIG_SH_UNKNOWN)
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = (unsigned long) _end;
- code_resource.start = virt_to_bus(_text);
- code_resource.end = virt_to_bus(_etext)-1;
- data_resource.start = virt_to_bus(_etext);
- data_resource.end = virt_to_bus(_edata)-1;
+ code_resource.start = (unsigned long)virt_to_phys(_text);
+ code_resource.end = (unsigned long)virt_to_phys(_etext)-1;
+ data_resource.start = (unsigned long)virt_to_phys(_etext);
+ data_resource.end = (unsigned long)virt_to_phys(_edata)-1;
sh_mv_setup(cmdline_p);
[CPU_ST40GX1] = "ST40GX1",
[CPU_SH4_202] = "SH4-202",
[CPU_SH4_501] = "SH4-501",
+ [CPU_SH7770] = "SH7770",
+ [CPU_SH7780] = "SH7780",
+ [CPU_SH7781] = "SH7781",
[CPU_SH_NONE] = "Unknown"
};
#ifdef CONFIG_PROC_FS
static const char *cpu_flags[] = {
- "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr",
+ "none", "fpu", "p2flush", "mmuassoc", "dsp", "perfctr", "ptea", NULL
};
static void show_cpuflags(struct seq_file *m)
return;
}
- for (i = 0; i < cpu_data->flags; i++)
+ for (i = 0; cpu_flags[i]; i++)
if ((cpu_data->flags & (1 << i)))
seq_printf(m, " %s", cpu_flags[i+1]);
cache_size = info.ways * info.sets * info.linesz;
- seq_printf(m, "%s size\t: %dKiB\n", type, cache_size >> 10);
+ seq_printf(m, "%s size\t: %2dKiB (%d-way)\n",
+ type, cache_size >> 10, info.ways);
}
/*
boot_cpu_data.loops_per_jiffy/(500000/HZ),
(boot_cpu_data.loops_per_jiffy/(5000/HZ)) % 100);
-#define PRINT_CLOCK(name, value) \
- seq_printf(m, name " clock\t: %d.%02dMHz\n", \
- ((value) / 1000000), ((value) % 1000000)/10000)
-
- PRINT_CLOCK("cpu", boot_cpu_data.cpu_clock);
- PRINT_CLOCK("bus", boot_cpu_data.bus_clock);
-#ifdef CONFIG_CPU_SUBTYPE_ST40STB1
- PRINT_CLOCK("memory", boot_cpu_data.memory_clock);
-#endif
- PRINT_CLOCK("module", boot_cpu_data.module_clock);
-
- return 0;
+ return show_clocks(m);
}
-
static void *c_start(struct seq_file *m, loff_t *pos)
{
return *pos < NR_CPUS ? cpu_data + *pos : NULL;
options += map->namelen + 1;
options = (*options == ',') ? options+1 : options;
-
+
/* Read optional parameters (baud/parity/bits) */
baud = simple_strtoul(options, &options, 10);
if (baud != 0) {
#include <asm/page.h>
#include <asm/types.h>
#include <asm/cache.h>
-#include <linux/threads.h>
#include <asm/ptrace.h>
/*
* CPU type and hardware bug flags. Kept separately for each CPU.
*
* Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry
- * in arch/sh/Kconfig, as well as an entry in arch/sh/kernel/setup.c
+ * in arch/sh/mm/Kconfig, as well as an entry in arch/sh/kernel/setup.c
* for parsing the subtype in get_cpu_subtype().
*/
enum cpu_type {
/* SH-4 types */
CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R,
CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501,
- CPU_SH73180,
+ CPU_SH73180, CPU_SH7770, CPU_SH7780, CPU_SH7781,
/* Unknown subtype */
CPU_SH_NONE
struct sh_cpuinfo {
enum cpu_type type;
- char hard_math;
unsigned long loops_per_jiffy;
- unsigned int cpu_clock, master_clock, bus_clock, module_clock;
-#ifdef CONFIG_CPU_SUBTYPE_ST40STB1
- unsigned int memory_clock;
-#endif
-
struct cache_info icache;
struct cache_info dcache;
struct sh_fpu_soft_struct soft;
};
-/*
+/*
* Processor flags
*/
#define CPU_HAS_MMU_PAGE_ASSOC 0x0004 /* SH3: TLB way selection bit support */
#define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */
#define CPU_HAS_PERF_COUNTER 0x0010 /* Hardware performance counters */
+#define CPU_HAS_PTEA 0x0020 /* PTEA register */
struct thread_struct {
unsigned long sp;
#define INIT_THREAD { \
sizeof(init_stack) + (long) &init_stack, /* sp */ \
0, /* pc */ \
- 0, 0, \
- 0, \
- 0, \
- {{{0,}},} /* fpu state */ \
+ 0, 0, \
+ 0, \
+ 0, \
+ {{{0,}},} /* fpu state */ \
}
/*
*/
#define start_thread(regs, new_pc, new_sp) \
set_fs(USER_DS); \
- regs->pr = 0; \
+ regs->pr = 0; \
regs->sr = SR_FD; /* User mode. */ \
regs->pc = new_pc; \
regs->regs[15] = new_sp
#define save_fpu(tsk) do { } while (0)
#endif
-#define unlazy_fpu(tsk, regs) do { \
+#define unlazy_fpu(tsk, regs) do { \
if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \
- save_fpu(tsk, regs); \
+ save_fpu(tsk, regs); \
} \
} while (0)
-#define clear_fpu(tsk, regs) do { \
- if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \
- clear_tsk_thread_flag(tsk, TIF_USEDFPU); \
- release_fpu(regs); \
+#define clear_fpu(tsk, regs) do { \
+ if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \
+ clear_tsk_thread_flag(tsk, TIF_USEDFPU); \
+ release_fpu(regs); \
} \
} while (0)