summaryrefslogtreecommitdiff
path: root/src/arch/ppc/lib/cpuid.c
diff options
context:
space:
mode:
authorGreg Watson <jarrah@users.sourceforge.net>2003-06-13 16:54:40 +0000
committerGreg Watson <jarrah@users.sourceforge.net>2003-06-13 16:54:40 +0000
commit88e467f38e60cbf45bd372832102bb0503886aa3 (patch)
treeabec26e0b0740b697d92313219b65c9d124d9dd6 /src/arch/ppc/lib/cpuid.c
parent93247c0428f749b7dfbbbfaa0a56d20c0a10ad7c (diff)
downloadcoreboot-88e467f38e60cbf45bd372832102bb0503886aa3.tar.xz
PPC cpu stuff
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@872 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/ppc/lib/cpuid.c')
-rw-r--r--src/arch/ppc/lib/cpuid.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/arch/ppc/lib/cpuid.c b/src/arch/ppc/lib/cpuid.c
new file mode 100644
index 0000000000..ff4e3cccad
--- /dev/null
+++ b/src/arch/ppc/lib/cpuid.c
@@ -0,0 +1,58 @@
+/* $Id$ */
+/* Copyright 2000 AG Electronics Ltd. */
+/* This code is distributed without warranty under the GPL v2 (see COPYING) */
+
+#include "ppc.h"
+#include "ppcreg.h"
+#include <console/console.h>
+
+void display_cpuid(void)
+{
+ unsigned type = __getpvr() >> 16;
+ unsigned version = __getpvr() & 0xffff;
+ const char *cpu_string = 0;
+ switch(type) {
+ case 1:
+ cpu_string = "601";
+ break;
+ case 3:
+ cpu_string = "603";
+ break;
+ case 4:
+ cpu_string = "604";
+ break;
+ case 6:
+ cpu_string = "603e";
+ break;
+ case 7:
+ cpu_string = "603ev";
+ break;
+ case 8:
+ cpu_string = "750";
+ break;
+ case 9:
+ cpu_string = "604e";
+ break;
+ case 10:
+ cpu_string = "604ev5 (MachV)";
+ break;
+ case 12:
+ cpu_string = "7400";
+ break;
+ case 50:
+ cpu_string = "821";
+ break;
+ case 80:
+ cpu_string = "860";
+ break;
+ case 0x800c:
+ cpu_string = "7410";
+ break;
+ }
+ if (cpu_string)
+ printk_info("PowerPC %s", cpu_string);
+ else
+ printk_info("PowerPC unknown (0x%x)", type);
+ printk_info(" CPU, version %d.%d\n", version >> 8, version & 0xff);
+}
+