NetBSD Problem Report #41379

From tsutsui@ceres.dti.ne.jp  Thu May  7 12:10:45 2009
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 15F3E63B8DF
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  7 May 2009 12:10:45 +0000 (UTC)
Message-Id: <200905071210.n47CAfO1025408@mirage.ceres.dti.ne.jp>
Date: Thu, 7 May 2009 21:10:41 +0900 (JST)
From: tsutsui@ceres.dti.ne.jp
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@gnats.NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: PA7150 CPU on 735/125 is not probed properly
X-Send-Pr-Version: 3.95

>Number:         41379
>Category:       port-hp700
>Synopsis:       PA7150 CPU on 735/125 is not probed properly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-hp700-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu May 07 12:15:01 +0000 2009
>Closed-Date:    Wed May 13 16:07:24 +0000 2009
>Last-Modified:  Wed May 13 16:07:24 +0000 2009
>Originator:     Izumi Tsutsui
>Release:        NetBSD 5.99.11
>Organization:
>Environment:
System: NetBSD 5.99.11, GENERIC kernel after nick-hppapmap merge
Architecture: hppa
Machine: hp700, 735/125
>Description:
5.0 GENERIC kernel detect PA7150 CPU on 735/125 properly:
---
cpu0 at mainbus0 hpa 0xfffbe000 path 8 irq 31 ipl 0: PA7150 (T-Bird) rev 2
cpu0: PCX-T, PA-RISC 1.1b, lev 1, cat A, 125 MHz clk
cpu0: shadows, 256K/256K D/I caches, 120 shared TLB, 16 shared BTLB
cpu0: PCX-T (Rolex - CMOS-26B) floating point, rev 1
---

but -current 5.99.11 GENERIC kernel assumes it's PA7100LC:
---
cpu0 at mainbus0 hpa 0xfffbe000 path 8 irq 31 ipl 0: PA7100LC (Hummingbird) rev 0
cpu0: PCXL, PA-RISC 1.1c, lev 1, cat A, 125 MHz clk
cpu0: shadows, 256K/256K D/I caches, 120 shared TLB, 16 shared BTLB
cpu0: PCXT (Rolex - CMOS-26B) floating point, rev 1
---

1.1c CPUs support uncached memory mappings but 1.1b ones not, so
iee(4) driver doesn't work because it depends on cpu_type to see how
DMA descriptors should be prepared as mentioned in PR port-hp700/35531.

DEBUG output of hp700/machdep.c:hppa_init() says:
---
Start @ 0x200000 [1=0xa92000-0xb16d0c]...
PDC_CACHE_SETCS: 0, 0, 0, 0 (-2)
SPID bits: 0x0, error = -2
pdc_model.hvers 8288
cpuid: model 735/130 (Snake Cheetah)
WARNING: PDC_MODEL_CPUID error -2
pdc_coproc: 0xc0, 0xc0; model 9 rev 1
cpuid: bootstrap fpu
btlb info: minsz=128, maxsz=16384
btlb fixed: i=0, d=0, c=16
btlb varbl: i=0, d=0, c=0
hppa_btlb_size_min 0x80
hppa_btlb_size_max 0x4000
cpuid: pmap_hptsize 0x10000
hppa_init: PDC_CHASSIS
hppa_init: intr bootstrap
---
and it looks earlier models don't support PDC_MODEL_CPUID
in pdc_call() function. In that case cpu_features is used
to check CPU types, but PA7150 seems to support HPPA_FTRS_HVT
while it isn't set in the PA7100 (PCXT) entry of cpu_types[].

>How-To-Repeat:
Boot GENERIC kernel on 735/125.

>Fix:
- use the same strategy with 5.0 (hppa_mod_info(HPPA_TYPE_BOARD) etc.)
- use PDC_COPROC type
- check more proper cpu_features
etc?

---
Izumi Tsutsui

>Release-Note:

>Audit-Trail:
From: Nick Hudson <nick.hudson@gmx.co.uk>
To: gnats-bugs@netbsd.org
Cc: port-hp700-maintainer@netbsd.org,
 gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: port-hp700/41379: PA7150 CPU on 735/125 is not probed properly
Date: Wed, 13 May 2009 10:39:31 +0100

 --Boundary-00=_UVpCKxb98MWLit+
 Content-Type: text/plain;
   charset="iso-8859-6"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline

 On Thursday 07 May 2009 13:15:01 tsutsui@ceres.dti.ne.jp wrote:
 > >Number:         41379
 > >Category:       port-hp700
 > >Synopsis:       PA7150 CPU on 735/125 is not probed properly

 Please test this patch.

 Thanks,
 Nick

 --Boundary-00=_UVpCKxb98MWLit+
 Content-Type: text/x-diff;
   charset="iso 8859-15";
   name="cpu.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename="cpu.diff"

 Index: arch/hp700/hp700/machdep.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/hp700/hp700/machdep.c,v
 retrieving revision 1.62
 diff -u -p -u -r1.62 machdep.c
 --- arch/hp700/hp700/machdep.c	9 May 2009 11:39:30 -0000	1.62
 +++ arch/hp700/hp700/machdep.c	13 May 2009 09:13:05 -0000
 @@ -270,6 +270,7 @@ void delay_init(void);
  static inline void fall(int, int, int, int, int);
  void dumpsys(void);
  void cpuid(void);
 +enum hppa_cpu_type cpu_model_cpuid(int);

  /*
   * wide used hardware params
 @@ -622,6 +623,7 @@ cpuid(void)
  	extern int kpsw;

  	/* may the scientific guessing begin */
 +	cpu_type = hpc_unknown;
  	cpu_features = 0;
  	cpu_version = 0;

 @@ -648,8 +650,10 @@ cpuid(void)
  	if ((error = pdc_call((iodcio_t)pdc, 0, PDC_MODEL, PDC_MODEL_CPUID,
  	   &pdc_cpuid, 0, 0, 0, 0)) < 0) {
  #ifdef DEBUG
 -		printf("WARNING: PDC_MODEL_CPUID error %d\n", error);
 +		printf("WARNING: PDC_MODEL_CPUID error %d."
 +		    "Using cpu_hvers based cpu_type.\n", error);
  #endif
 +		cpu_type = cpu_model_cpuid(cpu_hvers);
  	} else {
  #ifdef DEBUG
  		printf("%s: cpuid.version  = %x\n", __func__,
 @@ -752,7 +756,12 @@ cpuid(void)

  	if (cpu_version)
  		for (p = cpu_types; p->hci_chip_name; p++) {
 -			if (p->hci_cpuid == cpu_version)
 +			if (p->hci_cpuversion == cpu_version)
 +				break;
 +		}
 +	else if (cpu_type != hpc_unknown)
 +		for (p = cpu_types; p->hci_chip_name; p++) {
 +			if (p->hci_cputype == cpu_type)
  				break;
  		}
  	else
 @@ -802,6 +811,38 @@ cpuid(void)
  	hppa_fpu_bootstrap(pdc_coproc.ccr_enable);
  }

 +enum hppa_cpu_type
 +cpu_model_cpuid(int hvers)
 +{
 +	switch (hvers) {
 +	/* no supported HP8xx/9xx models with pcx */
 +	case HPPA_BOARD_HP720:
 +	case HPPA_BOARD_HP750_66:
 +	case HPPA_BOARD_HP730_66:
 +	case HPPA_BOARD_HP710:
 +	case HPPA_BOARD_HP705:
 +		return hpcxs;
 +
 +	case HPPA_BOARD_HP735_99:
 +	case HPPA_BOARD_HP755_99:
 +	case HPPA_BOARD_HP755_125:
 +	case HPPA_BOARD_HP735_130:
 +	case HPPA_BOARD_HP715_50:
 +	case HPPA_BOARD_HP715_33:
 +	case HPPA_BOARD_HP715S_50:
 +	case HPPA_BOARD_HP715S_33:
 +	case HPPA_BOARD_HP715T_50:
 +	case HPPA_BOARD_HP715T_33:
 +	case HPPA_BOARD_HP715_75:
 +	case HPPA_BOARD_HP715_99:
 +	case HPPA_BOARD_HP725_50:
 +	case HPPA_BOARD_HP725_75:
 +	case HPPA_BOARD_HP725_99:
 +		return hpcxt;
 +	}
 +	return hpc_unknown;
 +}
 +
  void
  cpu_startup(void)
  {
 Index: arch/hp700/include/cpu.h
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/hp700/include/cpu.h,v
 retrieving revision 1.32
 diff -u -p -u -r1.32 cpu.h
 --- arch/hp700/include/cpu.h	9 May 2009 11:39:31 -0000	1.32
 +++ arch/hp700/include/cpu.h	13 May 2009 09:13:06 -0000
 @@ -62,6 +62,7 @@

  /* types */
  enum hppa_cpu_type {
 +	hpc_unknown,
  	hpcx,	/* PA7000 (x)		PA 1.0 */
  	hpcxs,	/* PA7000 (s)		PA 1.1a */
  	hpcxt,	/* PA7100 (t)		PA 1.1b */
 @@ -89,7 +90,7 @@ struct hppa_cpu_info {
  	/* The type and PA-RISC specification of the chip. */
  	const char hci_chip_type[8];
  	enum hppa_cpu_type hci_cputype;
 -	int  hci_cpuid;
 +	int  hci_cpuversion;
  	int  hci_features;		/* CPU types and features */
  #define	HPPA_FTRS_TLBU		0x00000001
  #define	HPPA_FTRS_BTLBU		0x00000002

 --Boundary-00=_UVpCKxb98MWLit+--

From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: nick.hudson@gmx.co.uk
Cc: gnats-bugs@NetBSD.org, port-hp700-maintainer@NetBSD.org,
        gnats-admin@NetBSD.org, netbsd-bugs@NetBSD.org,
        tsutsui@ceres.dti.ne.jp
Subject: Re: port-hp700/41379: PA7150 CPU on 735/125 is not probed properly
Date: Wed, 13 May 2009 22:29:33 +0900

 > > >Number:         41379
 > > >Category:       port-hp700
 > > >Synopsis:       PA7150 CPU on 735/125 is not probed properly
 > 
 > Please test this patch.

 Works fine:
 ---
 Boot: [[[dk6a:]netbsd][-a][-c][-d][-s][-v][-q]] :- -s
 7624724+110592+487424 [277888+266014]=0x917184
 Start @ 0x200000 [1=0xa92000-0xb17184]...
 PDC_CACHE_SETCS: 0, 0, 0, 0 (-2)
 SPID bits: 0x0, error = -2
 pdc_model.hvers 8288
 cpuid: model 735/130 (Snake Cheetah)
 WARNING: PDC_MODEL_CPUID error -2.Using cpu_hvers based cpu_type.
 pdc_coproc: 0xc0, 0xc0; model 9 rev 1
 cpuid: bootstrap fpu
 btlb info: minsz=128, maxsz=16384
 btlb fixed: i=0, d=0, c=16
 btlb varbl: i=0, d=0, c=0
 hppa_btlb_size_min 0x80
 hppa_btlb_size_max 0x4000
 cpuid: pmap_hptsize 0x10000
 hppa_init: PDC_CHASSIS
 hppa_init: intr bootstrap
  :
 cpu0 at mainbus0 hpa 0xfffbe000 path 8 irq 31 ipl 0: PA7100 (T-Bird) rev 0
 cpu0: PCXT, PA-RISC 1.1b, lev 1, cat A, 125 MHz clk
 cpu0: shadows, 256K/256K D/I caches, 120 shared TLB, 16 shared BTLB
 cpu0: PCXT (Rolex - CMOS-26B) floating point, rev 1
 ---

 BTW, is it worth to identify PA7100 and PA7150 as 5.0?
 (different cache size?)

 ---
 Izumi Tsutsui

From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41379 CVS commit: src/sys/arch/hp700
Date: Wed, 13 May 2009 14:33:42 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Wed May 13 14:33:42 UTC 2009

 Modified Files:
 	src/sys/arch/hp700/hp700: machdep.c
 	src/sys/arch/hp700/include: cpu.h

 Log Message:
 If the PDC_MODEL_CPUID call fails use cpu_hvers to work out cpu_type.

 Fixes PR/41379.


 To generate a diff of this commit:
 cvs rdiff -u -r1.62 -r1.63 src/sys/arch/hp700/hp700/machdep.c
 cvs rdiff -u -r1.32 -r1.33 src/sys/arch/hp700/include/cpu.h

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

State-Changed-From-To: open->closed
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Wed, 13 May 2009 16:07:24 +0000
State-Changed-Why:
Fixed tested/committed. Thanks for the PR.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.