Compaq R3000 Cardbus fix (and rant)

Jung-uk Kim jkim at niksun.com
Tue Jan 25 09:28:37 PST 2005


This brain-damaged laptop has lots of issues. :-(  One of the problems 
is Cardbus.  The culprit is BIOS which forgot to set subordinate bus 
number for a PCI-to-PCI bridge.  For more info, please read:

http://bugzilla.kernel.org/show_bug.cgi?id=2944

Since we cannot possitively identify BIOS version in FreeBSD/amd64, 
work-around is setting it manually or flipping '#if 0' to '#if 1' at 
the first chunk of the attached patch (yeah, I know this is really 
ugly).  To set it manually, type:

pciconf -w -b pci0:10:0 0x1a 0x0a

as root.

The second problem is src/sys/dev/pci/pci_pci.c complains the I/O 
range is unsupported.  The attachment fixes the second problem.

Be careful!  You *must* correct the subordinate bus number before 
inseting a card.

Enjoy,

Jung-uk Kim

* PS: Can anybody tell me why it doesn't set `ok' to 1 after the 
correction?

* PS: Does anybody know how to deal with this insane nForce3 APIC?  
Using atpic and ACPI, we get ATA timeouts, NIC watchdog timeouts, 
frozen statclock (i. e., rtc stops generating periodic interrupts), 
etc.  It's just keeps on losing interrupts...  I know you guys said 
'stay away from it' many times but this is what I got. :-(
-------------- next part --------------
--- src/sys/dev/pci/pci_pci.c.orig	Thu Jul  1 03:46:28 2004
+++ src/sys/dev/pci/pci_pci.c	Sat Jan 22 01:21:50 2005
@@ -185,6 +185,12 @@
     case 0x060513d7:		/* Toshiba ???? */
 	sc->flags |= PCIB_SUBTRACTIVE;
 	break;
+
+#if 0
+    case 0x00dd10de:		/* XXX: Compaq R3000 */
+	pci_write_config(dev, PCIR_SUBBUS_1, 0xa, 1);
+	break;
+#endif
     }
 
     /*
@@ -319,6 +319,8 @@
 					start = sc->iobase;
 				if (end > sc->iolimit)
 					end = sc->iolimit;
+				if (start <= end)
+					ok = 1;
 			}
 		} else {
 			ok = 1;


More information about the freebsd-amd64 mailing list