]> nv-tegra.nvidia Code Review - linux-3.10.git/blob - arch/cris/arch-v32/kernel/setup.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[linux-3.10.git] / arch / cris / arch-v32 / kernel / setup.c
1 /*
2  * Display CPU info in /proc/cpuinfo.
3  *
4  * Copyright (C) 2003, Axis Communications AB.
5  */
6
7 #include <linux/seq_file.h>
8 #include <linux/proc_fs.h>
9 #include <linux/delay.h>
10 #include <linux/param.h>
11
12 #ifdef CONFIG_PROC_FS
13
14 #define HAS_FPU         0x0001
15 #define HAS_MMU         0x0002
16 #define HAS_ETHERNET100 0x0004
17 #define HAS_TOKENRING   0x0008
18 #define HAS_SCSI        0x0010
19 #define HAS_ATA         0x0020
20 #define HAS_USB         0x0040
21 #define HAS_IRQ_BUG     0x0080
22 #define HAS_MMU_BUG     0x0100
23
24 struct cpu_info {
25         char *cpu_model;
26         unsigned short rev;
27         unsigned short cache_size;
28         unsigned short flags;
29 };
30
31 /* Some of these model are here for historical reasons only. */
32 static struct cpu_info cpinfo[] = {
33         {"ETRAX 1", 0, 0, 0},
34         {"ETRAX 2", 1, 0, 0},
35         {"ETRAX 3", 2, 0, 0},
36         {"ETRAX 4", 3, 0, 0},
37         {"Simulator", 7, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA},
38         {"ETRAX 100", 8, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_IRQ_BUG},
39         {"ETRAX 100", 9, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA},
40
41         {"ETRAX 100LX", 10, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_USB
42                              | HAS_MMU | HAS_MMU_BUG},
43
44         {"ETRAX 100LX v2", 11, 8, HAS_ETHERNET100 | HAS_SCSI | HAS_ATA | HAS_USB
45                                 | HAS_MMU},
46
47         {"ETRAX FS", 32, 32, HAS_ETHERNET100 | HAS_ATA | HAS_MMU},
48
49         {"Unknown", 0, 0, 0}
50 };
51
52 int
53 show_cpuinfo(struct seq_file *m, void *v)
54 {
55         int i;
56         int cpu = (int)v - 1;
57         int entries;
58         unsigned long revision;
59         struct cpu_info *info;
60
61         entries = sizeof cpinfo / sizeof(struct cpu_info);
62         info = &cpinfo[entries - 1];
63
64 #ifdef CONFIG_SMP
65         if (!cpu_online(cpu))
66                 return 0;
67 #endif
68
69         revision = rdvr();
70
71         for (i = 0; i < entries; i++) {
72                 if (cpinfo[i].rev == revision) {
73                         info = &cpinfo[i];
74                         break;
75                 }
76         }
77
78         return seq_printf(m,
79                 "processor\t: %d\n"
80                 "cpu\t\t: CRIS\n"
81                 "cpu revision\t: %lu\n"
82                 "cpu model\t: %s\n"
83                 "cache size\t: %d KB\n"
84                 "fpu\t\t: %s\n"
85                 "mmu\t\t: %s\n"
86                 "mmu DMA bug\t: %s\n"
87                 "ethernet\t: %s Mbps\n"
88                 "token ring\t: %s\n"
89                 "scsi\t\t: %s\n"
90                 "ata\t\t: %s\n"
91                 "usb\t\t: %s\n"
92                 "bogomips\t: %lu.%02lu\n\n",
93
94                 cpu,
95                 revision,
96                 info->cpu_model,
97                 info->cache_size,
98                 info->flags & HAS_FPU ? "yes" : "no",
99                 info->flags & HAS_MMU ? "yes" : "no",
100                 info->flags & HAS_MMU_BUG ? "yes" : "no",
101                 info->flags & HAS_ETHERNET100 ? "10/100" : "10",
102                 info->flags & HAS_TOKENRING ? "4/16 Mbps" : "no",
103                 info->flags & HAS_SCSI ? "yes" : "no",
104                 info->flags & HAS_ATA ? "yes" : "no",
105                 info->flags & HAS_USB ? "yes" : "no",
106                 (loops_per_jiffy * HZ + 500) / 500000,
107                 ((loops_per_jiffy * HZ + 500) / 5000) % 100);
108 }
109
110 #endif /* CONFIG_PROC_FS */
111
112 void
113 show_etrax_copyright(void)
114 {
115         printk(KERN_INFO
116                "Linux/CRISv32 port on ETRAX FS (C) 2003, 2004 Axis Communications AB\n");
117 }