Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hp700 Update struct pdc_model with hwmodel and hv f...



details:   https://anonhg.NetBSD.org/src/rev/a26a1d09489e
branches:  trunk
changeset: 759515:a26a1d09489e
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Dec 12 08:23:14 2010 +0000

description:
Update struct pdc_model with hwmodel and hv fields for hvers.

Rename cpu_hvers to cpu_modelno.

diffstat:

 sys/arch/hp700/dev/mem.c       |   6 +++---
 sys/arch/hp700/dev/power.c     |   4 ++--
 sys/arch/hp700/dev/uturn.c     |   4 ++--
 sys/arch/hp700/hp700/machdep.c |  23 ++++++++++++-----------
 sys/arch/hp700/hp700/mainbus.c |   6 +++---
 sys/arch/hp700/include/cpu.h   |   4 ++--
 sys/arch/hp700/include/pdc.h   |   6 ++++--
 7 files changed, 28 insertions(+), 25 deletions(-)

diffs (208 lines):

diff -r f3db47bbc3f9 -r a26a1d09489e sys/arch/hp700/dev/mem.c
--- a/sys/arch/hp700/dev/mem.c  Sun Dec 12 04:06:19 2010 +0000
+++ b/sys/arch/hp700/dev/mem.c  Sun Dec 12 08:23:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mem.c,v 1.25 2010/06/03 22:34:26 skrll Exp $   */
+/*     $NetBSD: mem.c,v 1.26 2010/12/12 08:23:14 skrll Exp $   */
 
 /*     $OpenBSD: mem.c,v 1.30 2007/09/22 16:21:32 krw Exp $    */
 /*
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.25 2010/06/03 22:34:26 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.26 2010/12/12 08:23:14 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -205,7 +205,7 @@
                        uint32_t vic;
                        int s, settimeout;
 
-                       switch (cpu_hvers) {
+                       switch (cpu_modelno) {
                        case HPPA_BOARD_HP715_33:
                        case HPPA_BOARD_HP715S_33:
                        case HPPA_BOARD_HP715T_33:
diff -r f3db47bbc3f9 -r a26a1d09489e sys/arch/hp700/dev/power.c
--- a/sys/arch/hp700/dev/power.c        Sun Dec 12 04:06:19 2010 +0000
+++ b/sys/arch/hp700/dev/power.c        Sun Dec 12 08:23:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: power.c,v 1.4 2009/05/09 11:39:30 skrll Exp $  */
+/*     $NetBSD: power.c,v 1.5 2010/12/12 08:23:14 skrll Exp $  */
 
 /*
  * Copyright (c) 2004 Jochen Kunz.
@@ -141,7 +141,7 @@
                ca->ca_hpa = pdc_power_info.addr;
        }
 
-       switch (cpu_hvers) {
+       switch (cpu_modelno) {
        case HPPA_BOARD_HP712_60:
        case HPPA_BOARD_HP712_80:
        case HPPA_BOARD_HP712_100:
diff -r f3db47bbc3f9 -r a26a1d09489e sys/arch/hp700/dev/uturn.c
--- a/sys/arch/hp700/dev/uturn.c        Sun Dec 12 04:06:19 2010 +0000
+++ b/sys/arch/hp700/dev/uturn.c        Sun Dec 12 08:23:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uturn.c,v 1.12 2010/11/12 13:18:57 uebayasi Exp $      */
+/*     $NetBSD: uturn.c,v 1.13 2010/12/12 08:23:14 skrll Exp $ */
 
 /*     $OpenBSD: uturn.c,v 1.6 2007/12/29 01:26:14 kettenis Exp $      */
 
@@ -207,7 +207,7 @@
        pdc_scanbus(self, &nca, uturn_callback);
 
        /* XXX On some machines, PDC doesn't tell us about all devices. */
-       switch (cpu_hvers) {
+       switch (cpu_modelno) {
        case HPPA_BOARD_HP809:
        case HPPA_BOARD_HP819:
        case HPPA_BOARD_HP829:
diff -r f3db47bbc3f9 -r a26a1d09489e sys/arch/hp700/hp700/machdep.c
--- a/sys/arch/hp700/hp700/machdep.c    Sun Dec 12 04:06:19 2010 +0000
+++ b/sys/arch/hp700/hp700/machdep.c    Sun Dec 12 08:23:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.91 2010/12/09 10:19:23 skrll Exp $       */
+/*     $NetBSD: machdep.c,v 1.92 2010/12/12 08:23:14 skrll Exp $       */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.91 2010/12/09 10:19:23 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.92 2010/12/12 08:23:14 skrll Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -203,7 +203,7 @@
 char   cpu_model[128];
 const struct hppa_cpu_info *hppa_cpu_info;
 enum hppa_cpu_type cpu_type;
-int    cpu_hvers;
+int    cpu_modelno;
 int    cpu_revision;
 
 #if NLCD > 0
@@ -655,15 +655,16 @@
 #ifdef DEBUG
                printf("WARNING: PDC_MODEL_INFO error %d\n", error);
 #endif
-               pdc_model.hvers = 0;
+               pdc_model.hwmodel = 0;
+               pdc_model.hv = 0;
        } else {
 #ifdef DEBUG
                printf("pdc_model.hvers %d\n", pdc_model.hvers);
 #endif
        }
        /* XXXNH - check */
-       cpu_hvers = pdc_model.hvers >> 4;
-       model = hppa_mod_info(HPPA_TYPE_BOARD, cpu_hvers);
+       cpu_modelno = pdc_model.hwmodel;
+       model = hppa_mod_info(HPPA_TYPE_BOARD, cpu_modelno);
 #ifdef DEBUG
        printf("%s: model %s\n", __func__, model);
 #endif
@@ -673,9 +674,9 @@
           &pdc_cpuid, 0, 0, 0, 0)) < 0) {
 #ifdef DEBUG
                printf("WARNING: PDC_MODEL_CPUID error %d. "
-                   "Using cpu_hvers based cpu_type.\n", error);
+                   "Using cpu_modelno based cpu_type.\n", error);
 #endif
-               cpu_type = cpu_model_cpuid(cpu_hvers);
+               cpu_type = cpu_model_cpuid(cpu_modelno);
        } else {
 #ifdef DEBUG
                printf("%s: cpuid.version  = %x\n", __func__,
@@ -797,7 +798,7 @@
        hppa_cpu_info = p;
 
        if (hppa_cpu_info->hci_chip_name == NULL)
-               panic("bad model string for 0x%x", pdc_model.hvers >> 4);
+               panic("bad model string for 0x%x", pdc_model.hwmodel);
        else if (hppa_cpu_info->desidhash == NULL)
                panic("no kernel support for %s",
                    hppa_cpu_info->hci_chip_name);
@@ -835,9 +836,9 @@
 }
 
 enum hppa_cpu_type
-cpu_model_cpuid(int hvers)
+cpu_model_cpuid(int modelno)
 {
-       switch (hvers) {
+       switch (modelno) {
        /* no supported HP8xx/9xx models with pcx */
        case HPPA_BOARD_HP720:
        case HPPA_BOARD_HP750_66:
diff -r f3db47bbc3f9 -r a26a1d09489e sys/arch/hp700/hp700/mainbus.c
--- a/sys/arch/hp700/hp700/mainbus.c    Sun Dec 12 04:06:19 2010 +0000
+++ b/sys/arch/hp700/hp700/mainbus.c    Sun Dec 12 08:23:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.73 2010/11/15 06:24:53 uebayasi Exp $    */
+/*     $NetBSD: mainbus.c,v 1.74 2010/12/12 08:23:14 skrll Exp $       */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.73 2010/11/15 06:24:53 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.74 2010/12/12 08:23:14 skrll Exp $");
 
 #include "locators.h"
 #include "power.h"
@@ -1425,7 +1425,7 @@
        }
 #endif 
 
-       switch (cpu_hvers) {
+       switch (cpu_modelno) {
        case HPPA_BOARD_HPE23:
        case HPPA_BOARD_HPE25:
        case HPPA_BOARD_HPE35:
diff -r f3db47bbc3f9 -r a26a1d09489e sys/arch/hp700/include/cpu.h
--- a/sys/arch/hp700/include/cpu.h      Sun Dec 12 04:06:19 2010 +0000
+++ b/sys/arch/hp700/include/cpu.h      Sun Dec 12 08:23:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.52 2010/06/06 12:13:36 skrll Exp $   */
+/*     $NetBSD: cpu.h,v 1.53 2010/12/12 08:23:15 skrll Exp $   */
 
 /*     $OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $       */
 
@@ -112,7 +112,7 @@
 
 #ifdef _KERNEL
 extern const struct hppa_cpu_info *hppa_cpu_info;
-extern int cpu_hvers;
+extern int cpu_modelno;
 extern int cpu_revision;
 extern register_t kpsw;
 #endif
diff -r f3db47bbc3f9 -r a26a1d09489e sys/arch/hp700/include/pdc.h
--- a/sys/arch/hp700/include/pdc.h      Sun Dec 12 04:06:19 2010 +0000
+++ b/sys/arch/hp700/include/pdc.h      Sun Dec 12 08:23:14 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pdc.h,v 1.15 2010/12/04 16:04:45 skrll Exp $   */
+/*     $NetBSD: pdc.h,v 1.16 2010/12/12 08:23:15 skrll Exp $   */
 
 /*     $OpenBSD: pdc.h,v 1.35 2007/07/15 20:03:48 kettenis Exp $       */
 
@@ -345,7 +345,9 @@
 };
 
 struct pdc_model {     /* PDC_MODEL */
-       u_int   hvers;          /* hardware version */
+       u_int   res1 : 16;      /* reserved */
+       u_int   hwmodel : 12;   /* hardware model. */
+       u_int   hv : 4;
        u_int   rev : 4;        /* zero for all native processors */
        u_int   model : 20;     /* 4 for all native processors */
        u_int   sh : 1;         /* shadow registers are present */



Home | Main Index | Thread Index | Old Index