2005-04-16 18:20:36 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 1995, 1996, 2001 Ralf Baechle
|
2005-05-05 12:45:59 -04:00
|
|
|
* Copyright (C) 2001, 2004 MIPS Technologies, Inc.
|
|
|
|
* Copyright (C) 2004 Maciej W. Rozycki
|
2005-04-16 18:20:36 -04:00
|
|
|
*/
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/sched.h>
|
|
|
|
#include <linux/seq_file.h>
|
|
|
|
#include <asm/bootinfo.h>
|
|
|
|
#include <asm/cpu.h>
|
|
|
|
#include <asm/cpu-features.h>
|
|
|
|
#include <asm/mipsregs.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
|
|
|
|
unsigned int vced_count, vcei_count;
|
|
|
|
|
|
|
|
static int show_cpuinfo(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
unsigned long n = (unsigned long) v - 1;
|
2006-10-07 19:15:02 -04:00
|
|
|
unsigned int version = cpu_data[n].processor_id;
|
|
|
|
unsigned int fp_vers = cpu_data[n].fpu_id;
|
2005-04-16 18:20:36 -04:00
|
|
|
char fmt [64];
|
2008-09-23 03:07:16 -04:00
|
|
|
int i;
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
if (!cpu_isset(n, cpu_online_map))
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For the first processor also print the system type
|
|
|
|
*/
|
|
|
|
if (n == 0)
|
|
|
|
seq_printf(m, "system type\t\t: %s\n", get_system_type());
|
|
|
|
|
|
|
|
seq_printf(m, "processor\t\t: %ld\n", n);
|
|
|
|
sprintf(fmt, "cpu model\t\t: %%s V%%d.%%d%s\n",
|
2006-10-08 11:10:01 -04:00
|
|
|
cpu_data[n].options & MIPS_CPU_FPU ? " FPU V%d.%d" : "");
|
2008-10-13 13:36:21 -04:00
|
|
|
seq_printf(m, fmt, __cpu_name[n],
|
2005-04-16 18:20:36 -04:00
|
|
|
(version >> 4) & 0x0f, version & 0x0f,
|
|
|
|
(fp_vers >> 4) & 0x0f, fp_vers & 0x0f);
|
2009-02-28 04:44:28 -05:00
|
|
|
seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
|
2005-02-21 16:34:24 -05:00
|
|
|
cpu_data[n].udelay_val / (500000/HZ),
|
|
|
|
(cpu_data[n].udelay_val / (5000/HZ)) % 100);
|
2005-04-16 18:20:36 -04:00
|
|
|
seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
|
|
|
|
seq_printf(m, "microsecond timers\t: %s\n",
|
|
|
|
cpu_has_counter ? "yes" : "no");
|
2006-10-07 19:15:02 -04:00
|
|
|
seq_printf(m, "tlb_entries\t\t: %d\n", cpu_data[n].tlbsize);
|
2005-04-16 18:20:36 -04:00
|
|
|
seq_printf(m, "extra interrupt vector\t: %s\n",
|
|
|
|
cpu_has_divec ? "yes" : "no");
|
2008-09-23 03:07:16 -04:00
|
|
|
seq_printf(m, "hardware watchpoint\t: %s",
|
|
|
|
cpu_has_watch ? "yes, " : "no\n");
|
|
|
|
if (cpu_has_watch) {
|
|
|
|
seq_printf(m, "count: %d, address/irw mask: [",
|
|
|
|
cpu_data[n].watch_reg_count);
|
|
|
|
for (i = 0; i < cpu_data[n].watch_reg_count; i++)
|
|
|
|
seq_printf(m, "%s0x%04x", i ? ", " : "" ,
|
|
|
|
cpu_data[n].watch_reg_masks[i]);
|
|
|
|
seq_printf(m, "]\n");
|
|
|
|
}
|
2005-08-16 12:39:15 -04:00
|
|
|
seq_printf(m, "ASEs implemented\t:%s%s%s%s%s%s\n",
|
2005-05-05 12:45:59 -04:00
|
|
|
cpu_has_mips16 ? " mips16" : "",
|
|
|
|
cpu_has_mdmx ? " mdmx" : "",
|
|
|
|
cpu_has_mips3d ? " mips3d" : "",
|
2005-08-16 12:39:15 -04:00
|
|
|
cpu_has_smartmips ? " smartmips" : "",
|
|
|
|
cpu_has_dsp ? " dsp" : "",
|
|
|
|
cpu_has_mipsmt ? " mt" : ""
|
|
|
|
);
|
2007-11-08 13:02:29 -05:00
|
|
|
seq_printf(m, "shadow register sets\t: %d\n",
|
|
|
|
cpu_data[n].srsets);
|
2007-03-02 15:42:04 -05:00
|
|
|
seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core);
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
sprintf(fmt, "VCE%%c exceptions\t\t: %s\n",
|
|
|
|
cpu_has_vce ? "%u" : "not available");
|
|
|
|
seq_printf(m, fmt, 'D', vced_count);
|
|
|
|
seq_printf(m, fmt, 'I', vcei_count);
|
2006-03-19 21:51:20 -05:00
|
|
|
seq_printf(m, "\n");
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *c_start(struct seq_file *m, loff_t *pos)
|
|
|
|
{
|
|
|
|
unsigned long i = *pos;
|
|
|
|
|
|
|
|
return i < NR_CPUS ? (void *) (i + 1) : NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void *c_next(struct seq_file *m, void *v, loff_t *pos)
|
|
|
|
{
|
|
|
|
++*pos;
|
|
|
|
return c_start(m, pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void c_stop(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2008-01-22 14:42:33 -05:00
|
|
|
const struct seq_operations cpuinfo_op = {
|
2005-04-16 18:20:36 -04:00
|
|
|
.start = c_start,
|
|
|
|
.next = c_next,
|
|
|
|
.stop = c_stop,
|
|
|
|
.show = show_cpuinfo,
|
|
|
|
};
|