identcpu.c revision 84192
1178523Sjfv/*
287189Spdeuskar * Initial implementation:
3194865Sjfv * Copyright (c) 2001 Robert Drehmel
4178523Sjfv * All rights reserved.
5178523Sjfv *
6178523Sjfv * As long as the above copyright statement and this notice remain
7178523Sjfv * unchanged, you can do what ever you want with this file.
8178523Sjfv *
9178523Sjfv * $FreeBSD: head/sys/sparc64/sparc64/identcpu.c 84192 2001-09-30 19:45:34Z jake $
10178523Sjfv */
11178523Sjfv#include <sys/param.h>
12178523Sjfv#include <sys/systm.h>
13178523Sjfv
14178523Sjfv#include <machine/cpu.h>
15178523Sjfv#include <machine/cpufunc.h>
16178523Sjfv#include <machine/ver.h>
17178523Sjfv
18178523Sjfvvoid
19178523Sjfvcpu_identify(unsigned int freq)
20178523Sjfv{
21178523Sjfv	const char *manus;
22178523Sjfv	const char *impls;
23178523Sjfv	unsigned long vers;
24178523Sjfv
25178523Sjfv	manus = NULL;
26178523Sjfv	impls = NULL;
27178523Sjfv	vers = rdpr(ver);
28178523Sjfv
29178523Sjfv	switch (VER_MANUF(vers)) {
30178523Sjfv	case 0x04:
3187189Spdeuskar		manus = "HAL";
32178523Sjfv		break;
33178523Sjfv	case 0x13:
3487189Spdeuskar	case 0x17:
3587189Spdeuskar		manus = "Sun Microsystems";
3687189Spdeuskar		break;
3787189Spdeuskar	}
3887189Spdeuskar	switch (VER_IMPL(vers)) {
39194865Sjfv	case 0x01:
40108229Spdeuskar		impls = "SPARC64";
41108229Spdeuskar		break;
42108229Spdeuskar	case 0x10:
43152276Sglebius		impls = "UltraSparc-I";
44106649Spdeuskar		break;
45115878Spdeuskar	case 0x11:
46106649Spdeuskar		impls = "UltraSparc-II";
47106649Spdeuskar		break;
48106649Spdeuskar	case 0x12:
49108229Spdeuskar		impls = "UltraSparc-IIi";
50152645Syongari		break;
51152645Syongari	case 0x13:
52169240Sjfv		/* V9 Manual says `UltraSparc-e'.  I assume this is wrong. */
53108229Spdeuskar		impls = "UltraSparc-IIe";
54152545Sglebius		break;
55152545Sglebius	}
56152545Sglebius	if (manus == NULL || impls == NULL) {
57152545Sglebius		printf(
58106649Spdeuskar		    "CPU: unknown; please e-mail the following value together\n"
59106649Spdeuskar		    "     with the exact name of your processor to "
60152276Sglebius		    "<freebsd-sparc@FreeBSD.org>.\n"
61106649Spdeuskar		    "     version register: <0x%lx>\n", vers);
62115878Spdeuskar		return;
63108229Spdeuskar	}
64106649Spdeuskar
65106649Spdeuskar	printf("CPU: %s %s Processor (%d.%02d MHZ CPU)\n", manus, impls,
66106649Spdeuskar	    (freq + 4999) / 1000000, ((freq + 4999) / 10000) % 100);
67106649Spdeuskar	if (bootverbose) {
68152645Syongari		printf("  mask=0x%x maxtl=%d maxwin=%d\n", VER_MASK(vers),
69152645Syongari		    VER_MAXTL(vers), VER_MAXWIN(vers));
70169240Sjfv	}
71106649Spdeuskar}
72152545Sglebius