From owner-FreeBSD-users-jp@jp.freebsd.org  Wed Mar 11 19:59:48 1998
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) id TAA24166
	Wed, 11 Mar 1998 19:59:48 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) with ESMTP id TAA24161
	for <FreeBSD-users-jp@jp.freebsd.org>; Wed, 11 Mar 1998 19:59:46 +0900 (JST)
Received: (from ohashi@localhost)
	by atohasi.mickey.ai.kyutech.ac.jp (8.8.7/8.8.7) id TAA00622;
	Wed, 11 Mar 1998 19:59:45 +0900 (JST)
	(envelope-from ohashi)
Date: Wed, 11 Mar 1998 19:59:45 +0900 (JST)
Message-Id: <199803111059.TAA00622@atohasi.mickey.ai.kyutech.ac.jp>
To: FreeBSD-users-jp@jp.freebsd.org
In-Reply-To: Your message of "Tue, 10 Mar 1998 18:45:06 +0900 (JST)".
	<199803100945.SAA24315@atohasi.mickey.ai.kyutech.ac.jp>
From: ohashi@mickey.ai.kyutech.ac.jp (Takeshi Ohashi)
X-Mailer: mnews [version 1.20] 1996-12/08(Sun)
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=24]
X-Sequence: FreeBSD-users-jp 25743
Subject: [FreeBSD-users-jp 25743] Re: PCI tools
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org

$BBg66!w6e9)Bg$G$9!%(B

ohashi>>GNU-Win32 $B$N(B gcc $B$GLdBj$J$/%3%s%Q%$%k$G$-$^$7$?!%$3$l$r2~B$$7$F!$(B
ohashi>>BIOS $B$d(B Windows95$B$N%I%i%$%P!<$,@_Dj$7$?(B PCI $B%l%8%9%?$,8+$l$^$9!%(B

GNU-Win32 $B$G;H$($k$3$H$O!$:n<T$N(B Robin Cutshaw $B$5$s$KO"Mm:Q$_$G$9!%(B

ohashi>>$B@^3Q$J$N$G!$(BQandA $B$K$7$F$_$^$7$?!%$40U8+$r$*4j$$$7$^$9!%(B

$B$3$A$i$O(B QandA $B$KAw$C$A$c$$$^$7$?!%(B

*$B$*$^$1(B*
XFree86-3.3.2 $B$N(B scanpci.c $B$KG'<1$9$k%G%P%$%9$rDI2C$7$?$N$H!$(B-d $B%*%W%7%g(B
$B%s$GA4$F$N%l%8%9%?$rI=<($9$k$h$&$K$7$F$_$^$7$?!%$3$l$b:n<T$KAw$m$&$H;W(B
$B$$$^$9!%7A<0$O!$(BPAO$BF~$j%+!<%M%k$N5/F0;~$K(B CardBus $B$N%l%8%9%?$r%@%s%W$9(B
$B$k$N$K9g$o$;$F$"$j$^$9!%(B
--
$B$*$*$O$7(B

--- scanpci.c.orig	Wed Mar 11 15:36:22 1998
+++ scanpci.c	Wed Mar 11 16:19:33 1998
@@ -461,6 +461,7 @@
     unsigned short _configtype;   /* config type found                   */
     unsigned short _ioaddr;       /* config type 1 - private I/O addr    */
     unsigned long _cardnum;       /* config type 2 - private card number */
+    unsigned long _dump[64];
 };
 #else
 /* ppc is big endian, swapping bytes is not quite enough
@@ -603,6 +604,7 @@
     unsigned short _ioaddr;       /* config type 1 - private I/O addr    */
     unsigned short _configtype;   /* config type found                   */
     unsigned long _cardnum;       /* config type 2 - private card number */
+    unsigned long _dump[64];
 };
 #endif
 
@@ -727,8 +729,8 @@
                             { 0x00BC, "GD 5480", NF },
                             { 0x00D0, "GD 5462", NF },
                             { 0x00D4, "GD 5464", NF },
-                            { 0x1100, "CL 6729", NF },
-                            { 0x1110, "CL 6832", NF },
+                            { 0x1100, "CL 6729 CardBus bridge", NF },
+                            { 0x1110, "CL 6832 CardBus bridge", NF },
                             { 0x1200, "GD 7542", NF },
                             { 0x1202, "GD 7543", NF },
                             { 0x1204, "GD 7541", NF },
@@ -774,6 +776,7 @@
                             { 0x00DC, "65548", NF },
                             { 0x00E0, "65550", NF },
                             { 0x00E4, "65554", NF },
+                            { 0x00E5, "65555", NF },
                             { 0x0000, (char *)NULL, NF } } },
         { 0x1031, "Miro", {
                             { 0x5601, "ZR36050", NF },
@@ -832,8 +835,9 @@
         { 0x104C, "Texas Instruments", {
                             { 0x3d04, "3DLabs Permedia", NF },
                             { 0x3d07, "3DLabs Permedia 2", NF },
-                            { 0xAC12, "PCI1130", NF },
-                            { 0xAC15, "PCI1131", NF },
+                            { 0xAC12, "PCI1130 CardBus bridge", NF },
+                            { 0xAC15, "PCI1131 CardBus bridge", NF },
+                            { 0xAC16, "PCI1250 CardBus bridge", NF },
                             { 0x0000, (char *)NULL, NF } } },
         { 0x104E, "Oak", {
                             { 0x0107, "OTI107", NF },
@@ -1064,6 +1068,12 @@
                             { 0x0000, (char *)NULL, NF } } },
         { 0x120E, "Cyclades", {
                             { 0x0000, (char *)NULL, NF } } },
+        { 0x1217, "O2Micro", {
+                            { 0x6829, "OZ6729 PC-Card bridge", NF },
+                            { 0x683A, "OZ6730 PC-Card bridge", NF },
+                            { 0x6832, "OZ6832 CardBus bridge", NF },
+                            { 0x6836, "OZ6832 CardBus bridge", NF },
+                            { 0x0000, (char *)NULL, NF } } }, 
         { 0x121A, "3Dfx Interactive", {
                             { 0x0001, "Voodoo Graphics", NF },
                             { 0x0000, (char *)NULL, NF } } },
@@ -1136,6 +1146,7 @@
                             { 0x7111, "82371AB PIIX4 IDE", NF },
                             { 0x7112, "82371AB PIIX4 USB", NF },
                             { 0x7113, "82371AB PIIX4 ACPI", NF },
+                            { 0x7030, "82437VX PCI cache memory controller", NF },
                             { 0x0000, (char *)NULL, NF } } },
         { 0x9004, "Adaptec", {
                             { 0x5078, "7850", NF },
@@ -1186,9 +1197,9 @@
     unsigned int idx;
     struct pci_config_reg pcr;
     int ch, verbose = 0, do_mode1_scan = 0, do_mode2_scan = 0;
-    int func;
+    int func, j;
 
-    while((ch = getopt(argc, argv, "v12")) != EOF) {
+    while((ch = getopt(argc, argv, "dv12")) != EOF) {
      	switch((char)ch) {
 	case '1':
 		do_mode1_scan = 1;
@@ -1197,10 +1208,13 @@
 		do_mode2_scan = 1;
 		break;
 	case 'v':
-		verbose = 1;
+		if (verbose == 0) verbose = 1;
+		break;
+	case 'd':
+		verbose = 2;
 		break;
 	default :
-		printf("Usage: %s [-v12] \n", argv[0]);
+		printf("Usage: %s [-dv12] \n", argv[0]);
 		exit(1);
         }
     }
@@ -1303,6 +1317,11 @@
 	    pcr._max_min_ipin_iline = inl(PCI_MODE1_DATA_REG);
             outl(PCI_MODE1_ADDRESS_REG, config_cmd | 0x40);
 	    pcr._user_config = inl(PCI_MODE1_DATA_REG);
+
+            for (j=0; j<0x100; j+=4) {
+                outl(PCI_MODE1_ADDRESS_REG, config_cmd | j);
+                pcr._dump[j/4] = inl(PCI_MODE1_DATA_REG);
+            }
 #else
 	    pciconfig_read(pcr._pcibuses[pcr._pcibusidx], pcr._cardnum<<3,
 			PCI_CMD_STAT_REG, 4, &pcr._status_command);
@@ -1328,6 +1347,11 @@
 			PCI_INTERRUPT_REG, 4, &pcr._max_min_ipin_iline);
 	    pciconfig_read(pcr._pcibuses[pcr._pcibusidx], pcr._cardnum<<3,
 			PCI_REG_USERCONFIG, 4, &pcr._user_config);
+
+            for (j=0; j<0x100; j+=4) {
+	        pciconfig_read(pcr._pcibuses[pcr._pcibusidx], pcr._cardnum<<3,
+			       j, 4, &pcr._dump[j/4]);
+            }
 #endif
 
             /* check for pci-pci bridges */
@@ -1402,6 +1426,9 @@
             pcr._baserom = inl(pcr._ioaddr + 0x30);
             pcr._max_min_ipin_iline = inl(pcr._ioaddr + 0x3C);
             pcr._user_config = inl(pcr._ioaddr + 0x40);
+            for (j=0; j<0x100; j+=4) {
+		pcr._dump[j/4] = inl(pcr._ioaddr + j);
+            }
 	    outb(PCI_MODE2_FORWARD_REG, 0x00); /* bus 0 for now */
 
             /* check for pci-pci bridges (currently we only know Digital) */
@@ -1515,6 +1542,15 @@
                 printf("  BYTE_0    0x%02x  BYTE_1  0x%02x  BYTE_2  0x%02x  BYTE_3  0x%02x\n",
                     pcr->_user_config_0, pcr->_user_config_1, 
 		    pcr->_user_config_2, pcr->_user_config_3);
+	}
+	if (verbose > 1) {
+	    for (j=0; j<0x100; j+=16) {
+	        printf("  %02x: ", j);
+		for (i=0; i<4; i++) {
+		    printf(" %08x", pcr->_dump[j/4+i]);
+		}
+		printf("\n");
+	    }
 	}
 }
 
