Please bear with me - another rename checkin. This qualifies as trivial, no
[coreboot.git] / src / arch / ppc / lib / cpuid.c
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2000 AG Electronics Ltd.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
18  */
19
20 #include "ppc.h"
21 #include "ppcreg.h"
22 #include <device/device.h>
23 #include <console/console.h>
24
25 void display_cpuid(struct device *cpu)
26 {
27         unsigned type    = cpu->device >> 16;
28         unsigned version = cpu->device & 0xffff;
29         const char *cpu_string = 0;
30         switch(type) {
31         case 0x0001:
32                 cpu_string = "601";
33                 break;
34         case 0x0003:
35                 cpu_string = "603";
36                 break;
37         case 0x0004:
38                 cpu_string = "604";
39                 break;
40         case 0x0006:
41                 cpu_string = "603e";
42                 break;
43         case 0x0007:
44                 cpu_string = "603ev";
45                 break;
46         case 0x0008:
47                 cpu_string = "750";
48                 break;
49         case 0x0009:
50                 cpu_string = "604e";
51                 break;
52         case 0x000a:
53                 cpu_string = "604ev5 (MachV)";
54                 break;
55         case 0x000c:
56                 cpu_string = "7400";
57                 break;
58         case 0x0032:
59                 cpu_string = "821";
60                 break;
61         case 0x0050:
62                 cpu_string = "860";
63                 break;
64         case 0x4011:
65                 cpu_string = "405GP";
66                 break;
67         case 0x5091:
68                 cpu_string = "405GPr";
69                 break;
70         case 0x5121:
71                 cpu_string = "405EP";
72                 break;
73         case 0x800c:
74                 cpu_string = "7410";
75                 break;
76         }
77         if (cpu_string)
78                 printk_info("PowerPC %s", cpu_string);       
79         else
80                 printk_info("PowerPC unknown (0x%x)", type);
81         printk_info(" CPU, version %d.%d\n", version >> 8, version & 0xff);       
82 }
83