summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-08-22 18:09:54 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-08-22 18:09:54 +0000
commit06b8eb36c1b3574c96e77fa83f863f2262bc45c5 (patch)
treedb9e51a8d32d5cc7957077d56c364be0ae800f79
parent417f4db2c236acbb7c4f35ab8f4df35295a38767 (diff)
rework cpu identification
-rw-r--r--sys/arch/hppa/dev/cpu.c42
-rw-r--r--sys/arch/hppa/dev/cpudevs6
2 files changed, 10 insertions, 38 deletions
diff --git a/sys/arch/hppa/dev/cpu.c b/sys/arch/hppa/dev/cpu.c
index 9ea23a6e156..6169677e173 100644
--- a/sys/arch/hppa/dev/cpu.c
+++ b/sys/arch/hppa/dev/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.22 2003/08/07 19:47:33 mickey Exp $ */
+/* $OpenBSD: cpu.c,v 1.23 2003/08/22 18:09:52 mickey Exp $ */
/*
* Copyright (c) 1998-2002 Michael Shalayeff
@@ -94,47 +94,19 @@ cpuattach(parent, self, aux)
void *aux;
{
/* machdep.c */
+ extern struct pdc_model pdc_model;
extern struct pdc_cache pdc_cache;
extern struct pdc_btlb pdc_btlb;
extern u_int cpu_ticksnum, cpu_ticksdenom;
extern u_int fpu_enable;
- struct pdc_model pdc_model PDC_ALIGNMENT;
- struct pdc_cpuid pdc_cpuid PDC_ALIGNMENT;
- u_int pdc_cversion[32] PDC_ALIGNMENT;
- register struct cpu_softc *sc = (struct cpu_softc *)self;
- register struct confargs *ca = aux;
- const char *p = NULL;
+ struct cpu_softc *sc = (struct cpu_softc *)self;
+ struct confargs *ca = aux;
u_int mhz = 100 * cpu_ticksnum / cpu_ticksdenom;
- int err;
-
- bzero (&pdc_cpuid, sizeof(pdc_cpuid));
- if (pdc_call((iodcio_t)pdc, 0, PDC_MODEL, PDC_MODEL_CPUID,
- &pdc_cpuid, sc->sc_dev.dv_unit, 0, 0, 0) >= 0) {
-
- /* patch for old 8200 */
- if (pdc_cpuid.version == HPPA_CPU_PCXUP &&
- pdc_cpuid.revision > 0x0d)
- pdc_cpuid.version = HPPA_CPU_PCXUP1;
-
- p = hppa_mod_info(HPPA_TYPE_CPU, pdc_cpuid.version);
- }
- /* otherwise try to guess on component version numbers */
- else if (pdc_call((iodcio_t)pdc, 0, PDC_MODEL, PDC_MODEL_COMP,
- &pdc_cversion, sc->sc_dev.dv_unit) >= 0) {
- /* XXX p = hppa_mod_info(HPPA_TYPE_CPU,pdc_cversion[0]); */
- }
-
- printf (": %s ", p? p : cpu_typename);
- if (sc->sc_dev.dv_xname)
- (*cpu_desidhash)();
+ const char *p;
- if ((err = pdc_call((iodcio_t)pdc, 0, PDC_MODEL, PDC_MODEL_INFO,
- &pdc_model)) < 0) {
-#ifdef DEBUG
- printf("PDC_MODEL(%d) ", err);
-#endif
- } else {
+ printf (": %s ", cpu_typename);
+ if (pdc_model.hvers) {
static const char lvls[4][4] = { "0", "1", "1.5", "2" };
printf("L%s-%c ", lvls[pdc_model.pa_lvl], "AB"[pdc_model.mc]);
diff --git a/sys/arch/hppa/dev/cpudevs b/sys/arch/hppa/dev/cpudevs
index c8e10c0fdd1..d8faf4e9719 100644
--- a/sys/arch/hppa/dev/cpudevs
+++ b/sys/arch/hppa/dev/cpudevs
@@ -1,4 +1,4 @@
-$OpenBSD: cpudevs,v 1.28 2003/08/21 06:39:10 mickey Exp $
+$OpenBSD: cpudevs,v 1.29 2003/08/22 18:09:53 mickey Exp $
/*
* Copyright (c) 1998,1999 Michael Shalayeff
@@ -314,9 +314,9 @@ bus MERCED 16 Merced
cpu SOFTEMU 0x01 Software Emulation
cpu PCXT2 0x0b PCXT'
cpu PCXL 0x0d PCXL
-cpu PCXUP 0x0e PCXU
+cpu PCXU 0x0e PCXU
cpu PCXL2 0x0f PCXL2
-cpu PCXUP1 0x10 PCXU+
+cpu PCXUP 0x10 PCXU+
cpu PCXW 0x11 PCXW
fpu SOFTEMU 0x01 Software Emulation