Module Name:    src
Committed By:   skrll
Date:           Sun Dec 12 08:23:15 UTC 2010

Modified Files:
        src/sys/arch/hp700/dev: mem.c power.c uturn.c
        src/sys/arch/hp700/hp700: machdep.c mainbus.c
        src/sys/arch/hp700/include: cpu.h pdc.h

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

Rename cpu_hvers to cpu_modelno.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/hp700/dev/mem.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp700/dev/power.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp700/dev/uturn.c
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/hp700/hp700/machdep.c
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/hp700/hp700/mainbus.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/hp700/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp700/include/pdc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hp700/dev/mem.c
diff -u src/sys/arch/hp700/dev/mem.c:1.25 src/sys/arch/hp700/dev/mem.c:1.26
--- src/sys/arch/hp700/dev/mem.c:1.25	Thu Jun  3 22:34:26 2010
+++ src/sys/arch/hp700/dev/mem.c	Sun Dec 12 08:23:14 2010
@@ -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:

Index: src/sys/arch/hp700/dev/power.c
diff -u src/sys/arch/hp700/dev/power.c:1.4 src/sys/arch/hp700/dev/power.c:1.5
--- src/sys/arch/hp700/dev/power.c:1.4	Sat May  9 11:39:30 2009
+++ src/sys/arch/hp700/dev/power.c	Sun Dec 12 08:23:14 2010
@@ -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:

Index: src/sys/arch/hp700/dev/uturn.c
diff -u src/sys/arch/hp700/dev/uturn.c:1.12 src/sys/arch/hp700/dev/uturn.c:1.13
--- src/sys/arch/hp700/dev/uturn.c:1.12	Fri Nov 12 13:18:57 2010
+++ src/sys/arch/hp700/dev/uturn.c	Sun Dec 12 08:23:14 2010
@@ -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:

Index: src/sys/arch/hp700/hp700/machdep.c
diff -u src/sys/arch/hp700/hp700/machdep.c:1.91 src/sys/arch/hp700/hp700/machdep.c:1.92
--- src/sys/arch/hp700/hp700/machdep.c:1.91	Thu Dec  9 10:19:23 2010
+++ src/sys/arch/hp700/hp700/machdep.c	Sun Dec 12 08:23:14 2010
@@ -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:

Index: src/sys/arch/hp700/hp700/mainbus.c
diff -u src/sys/arch/hp700/hp700/mainbus.c:1.73 src/sys/arch/hp700/hp700/mainbus.c:1.74
--- src/sys/arch/hp700/hp700/mainbus.c:1.73	Mon Nov 15 06:24:53 2010
+++ src/sys/arch/hp700/hp700/mainbus.c	Sun Dec 12 08:23:14 2010
@@ -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:

Index: src/sys/arch/hp700/include/cpu.h
diff -u src/sys/arch/hp700/include/cpu.h:1.52 src/sys/arch/hp700/include/cpu.h:1.53
--- src/sys/arch/hp700/include/cpu.h:1.52	Sun Jun  6 12:13:36 2010
+++ src/sys/arch/hp700/include/cpu.h	Sun Dec 12 08:23:15 2010
@@ -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

Index: src/sys/arch/hp700/include/pdc.h
diff -u src/sys/arch/hp700/include/pdc.h:1.15 src/sys/arch/hp700/include/pdc.h:1.16
--- src/sys/arch/hp700/include/pdc.h:1.15	Sat Dec  4 16:04:45 2010
+++ src/sys/arch/hp700/include/pdc.h	Sun Dec 12 08:23:15 2010
@@ -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 */

Reply via email to