Subject: port-i386/17353: Intel PCI Bridge (82452KX/GX?) support in pchb.c
To: None <gnats-bugs@gnats.netbsd.org>
From: None <mochid@netside.co.jp>
List: netbsd-bugs
Date: 06/22/2002 00:35:31
>Number:         17353
>Category:       port-i386
>Synopsis:       Intel PCI Bridge (82452KX/GX?) support in pchb.c
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 21 08:39:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     MOCHIDA Shuji
>Release:        NetBSD-current 2002-05-25
>Organization:
NETside Technologies Inc.
>Environment:
System: NetBSD gee 1.6A NetBSD 1.6A (BEECH1) #0: Mon May 27 18:17:43 JST 2002 mochid@gee:/NetBSD-current/src/sys/arch/i386/compile/BEECH1 i386


>Description:

 On old Pentium 100MHz server box with two Adaptec aic7870 HBA,
NetBSD kernel did not detect ahc[01], but FreeBSD 4.6RC4 install
floppy boot message showed that ahc[01] was under pci1.
NetBSD kernel detected only one PCI bus (pci0), 
seemed lack of Intel PCI Bridge (device ID 0x1225).

  NetBSD boot message:

    mainbus0 (root)
    pci0 at mainbus0 bus 0: configuration mode 1
    pci0: i/o space, memory space enabled
    pchb0 at pci0 dev 0 function 0
    pchb0: Intel product 0x1225 (rev. 0x02)


  FreeBSD boot message:

    pcib0: <Intel 824?? host to PCI bridge> on motherboard
    pci0: <PCI bus> on pcib0
      :
    pcib1: <Intel 824?? host to PCI bridge> on motherboard
    pci1: <PCI bus> on pcib1
    ahc0: <Adaptec aic7870 SCSI adapter> port .. on pci1
    ahc0: Using left over BIOS settings
    aic7870: Wide Channel A, SCSI Id=7, 16/253 SCBs
    ahc1: <Adaptec aic7870 SCSI adapter> port .. on pci1
    ahc1: Host Adapter Bios disabled.  Using default SCSI device parameters
    aic7870: Wide Channel A, SCSI Id=7, 16/253 SCBs


>How-To-Repeat:

>Fix:

 Masanori Kanaoka send me a patch for this. It seems work good for me.
The kernel detects pci1 at pchb0, and I can use sd[0-5] scsi disks
at ahc[01] at pci1. 
 He said he refered to FreeBSD sys/pci/pcisupport.c.
 Test operation supported by Nobuo Kato.

(Device name taken from 
  http://members.hyperlink.net.au/~chart/download/pcidevs.txt
 may be too long.)

    mainbus0 (root)
    pci0 at mainbus0 bus 0: configuration mode 1
    pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
    pchb0 at pci0 dev 0 function 0
    pchb0: Intel 82452KX/GX Orion Extended Express Processor to PCI Bridge (rev. 0x02)
    pbnum: 0x0
    pci1 at pchb0 bus 1
    pci1: i/o space, memory space enabled
    pchb1 at pci1 dev 0 function 0
    pchb1: Intel 82452KX/GX Orion Extended Express Processor to PCI Bridge (rev. 0x02)
    pbnum: 0xff
    ahc0 at pci1 dev 13 function 0
    ahc0: interrupting at irq 11
    ahc0: Using left over BIOS settings
    ahc0: aic7870 Wide Channel A, SCSI Id=7, 16/255 SCBs
    scsibus0 at ahc0: 16 targets, 8 luns per target
    ahc1 at pci1 dev 14 function 0
    ahc1: interrupting at irq 9
    ahc1: aic7870 Wide Channel A, SCSI Id=7, 16/255 SCBs
    ahc1: Host Adapter Bios disabled.  Using default SCSI device parameters
    scsibus1 at ahc1: 16 targets, 8 luns per target


-- sys/dev/pci/pcidevs.ORIG	Sat Apr  6 05:37:45 2002
+++ sys/dev/pci/pcidevs	Tue Jun 18 10:08:18 2002
@@ -1294,6 +1294,7 @@
 product INTEL 82559ER		0x1209	82559ER Fast Ethernet LAN Controller
 product INTEL 82092AA		0x1222	82092AA IDE controller
 product INTEL SAA7116		0x1223	SAA7116
+product INTEL 82452_PB		0x1225	82452KX/GX Orion Extended Express Processor to PCI Bridge
 product INTEL 82596		0x1226	82596 LAN Controller
 product INTEL EEPRO100		0x1227	EE Pro 100 10/100 Fast Ethernet
 product INTEL EEPRO100S		0x1228	EE Pro 100 Smart 10/100 Fast Ethernet
--- sys/arch/i386/pci/pchb.c.ORIG	Sun Mar 17 07:17:27 2002
+++ sys/arch/i386/pci/pchb.c	Tue Jun 18 10:21:08 2002
@@ -156,6 +156,16 @@
 
 	case PCI_VENDOR_INTEL:
 		switch (PCI_PRODUCT(pa->pa_id)) {
+		case PCI_PRODUCT_INTEL_82452_PB:
+			bcreg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x40);
+			pbnum = PCISET_BRIDGE_NUMBER(bcreg);
+
+			printf("pbnum: 0x%x\n", pbnum);
+			if (pbnum != 0xff) {
+				pbnum++;
+				doattach = 1;
+			}
+			break;  
 		case PCI_PRODUCT_INTEL_82443BX_AGP:
 		case PCI_PRODUCT_INTEL_82443BX_NOAGP:
 			/*

>Release-Note:
>Audit-Trail:
>Unformatted: