Greetings m...@!

I have a D400 laptop, i386 OpenBSD 4.5 release, and at boot time, I get the 
following messages from kernel (full dmesg in the end of the msg):

cbb0 at pci1 dev 1 function 0 "TI PCI7510 CardBus" rev 0x01: irq 11, CardBus 
support disabled
cbb1 at pci1 dev 1 function 1 "TI PCI7610 CardBus (Smart Card mode)" rev 0x01: 
irq 11, CardBus support disabled

I dived into kernel's source code and found the place where this happens: 
sys/dev/pci/pccbb.c, function pccbbattach() (search "disabled").
The function reads the TI PCI7510 PCI-to-CardBus bridge's PCI configuration 
register 0x18, where the Subordiante Bus, Secondary Bus and Primary Bus numbers 
are stored, sees that they are all 0, and disables CardBus, because it's not 
addressable, because 0 is the address of root PCI bus.

Right now, I added the following code just before the 0x18 register is read in 
sys/dev/pci/pccbb.c:pccbbattach(), which fixes the problem for me:

    tmpreg = pci_conf_read(0, pa->pa_tag, 0);
    if (PCI_PRODUCT(tmpreg) == PCI_PRODUCT_TI_PCI7510_CB) {
        printf("\nD400 fix\n");
        busreg = (pcireg_t) (0x20 << 24) | (0x2 << 16) | (0x2 << 8) | (0x1);
        pci_conf_write(0, pa->pa_tag, PCI_BUSNUM, busreg);
    }

It programs the bridge with a hardcoded Secondary Bus number of 2 (which I 
devised from seeing in dmesg that the greatest bus number is 1).


I'm actually a novice at this, I've started learning about PCI just a few days 
ago (primarily from osdev.org and sites it links to) so I don't completely 
understand the whole system and how it all works/should work. Some questions:

What could be the reason for bus nums in 0x18 reg being set to 0 at autoconf 
time?
Whose responsibility is it to assign bus numbers to PCI bridges, BIOS's or 
kernel's?
Is this my hardware's fault or this could happen to other comps too?
If this is D400's bug of some sort is it possible to incorporate a fix for it 
into kernel, so that it wouldn't impair normal systems?
And can you recommend some good and preferably fresh books or maybe online 
resources on the PC system architecture? The ones that would be useful to an OS 
developer? The PCI specs I downloaded (for free, ALL HAIL GOOGLE: "PCI spec 
filetype:pdf") are too dry and hard to understand.

Thanks!



OpenBSD 4.5 (GENERIC) #1749: Sat Feb 28 14:51:18 MST 2009
    dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) M processor 1400MHz ("GenuineIntel" 686-class) 1.40 
GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,TM,SBF,EST,TM2
real mem  = 535023616 (510MB)
avail mem = 509046784 (485MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 06/28/05, BIOS32 rev. 0 @ 0xffe90, SMBIOS 
rev. 2.3 @ 0xf8cf0 (61 entries)
bios0: vendor Dell Computer Corporation version "A08" date 06/28/2005
bios0: Dell Computer Corporation Latitude D400
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP ASF!
acpi0: wakeup devices LID_(S3) PBTN(S4) PCI0(S3) USB0(S1) USB1(S1) USB2(S1) 
USB3(S1) MODM(S3) PCIE(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (PCIE)
acpicpu0 at acpi0: C3, C3, C2, C1, FVS, 1400, 1400, 1400, 1400, 1200, 1000, 
800, 600 MHz
acpitz0 at acpi0: critical temperature 99 degC
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT0 model "DELL 0006T0" serial 2021 type LION oem "Sanyo"
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: PBTN
acpibtn2 at acpi0: SBTN
acpidock at acpi0 not configured
acpivideo at acpi0 not configured
acpivideo at acpi0 not configured
bios0: ROM list: 0xc0000/0xd800! 0xcd800/0x800! 0xce000/0x800 0xce800/0x800 
0xcf000/0x800 0xcf800/0x800
cpu0 at mainbus0: (uniprocessor)
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82855GM Host" rev 0x02
"Intel 82855GM Memory" rev 0x02 at pci0 dev 0 function 1 not configured
"Intel 82855GM Config" rev 0x02 at pci0 dev 0 function 3 not configured
vga1 at pci0 dev 2 function 0 "Intel 82855GM Video" rev 0x02
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xf0000000, size 0x8000000
inteldrm0 at vga1: irq 11
drm0 at inteldrm0
"Intel 82855GM Video" rev 0x02 at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 29 function 0 "Intel 82801DB USB" rev 0x01: irq 11
uhci1 at pci0 dev 29 function 1 "Intel 82801DB USB" rev 0x01: irq 11
uhci2 at pci0 dev 29 function 2 "Intel 82801DB USB" rev 0x01: irq 11
ehci0 at pci0 dev 29 function 7 "Intel 82801DB USB" rev 0x01: irq 11
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb0 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x81
pci1 at ppb0 bus 1
bge0 at pci1 dev 0 function 0 "Broadcom BCM5705M" rev 0x01, BCM5705 A1 
(0x3001): irq 11, address 00:0f:1f:ab:e2:2a
brgphy0 at bge0 phy 1: BCM5705 10/100/1000baseT PHY, rev. 1
cbb0 at pci1 dev 1 function 0 "TI PCI7510 CardBus" rev 0x01: irq 11, CardBus 
support disabled
cbb1 at pci1 dev 1 function 1 "TI PCI7610 CardBus (Smart Card mode)" rev 0x01: 
irq 11, CardBus support disabled
"TI PCI7(4-6)10 FireWire" rev 0x00 at pci1 dev 1 function 2 not configured
vendor "TI", unknown product 0x8204 (class system subclass miscellaneous, rev 
0x00) at pci1 dev 1 function 3 not configured
ipw0 at pci1 dev 3 function 0 "Intel PRO/Wireless 2100" rev 0x04: irq 11, 
address 00:0c:f1:35:e8:d8
cardslot0 at cbb0 slot 0 flags 0
pcmcia0 at cardslot0
cardslot1 at cbb1 slot 1 flags 0
pcmcia1 at cardslot1
ichpcib0 at pci0 dev 31 function 0 "Intel 82801DBM LPC" rev 0x01
pciide0 at pci0 dev 31 function 1 "Intel 82801DBM IDE" rev 0x01: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <IC25N030ATMR04-0>
wd0: 16-sector PIO, LBA48, 28615MB, 58605120 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
pciide0: channel 1 disabled (no drives)
auich0 at pci0 dev 31 function 5 "Intel 82801DB AC97" rev 0x01: irq 11, ICH4 
AC97
ac97: codec id 0x83847650 (SigmaTel STAC9750/51)
ac97: codec features headphone, 20 bit DAC, 20 bit ADC, SigmaTel 3D
audio0 at auich0
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
biomask ed6d netmask ed6d ttymask ffff
mtrr: Pentium Pro MTRR support
uhidev0 at uhub3 port 1 configuration 1 interface 0 "Logitech USB Optical 
Mouse" rev 2.00/43.01 addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse1 at ums0 mux 0
softraid0 at root
root on wd0a swap on wd0b dump on wd0b

Reply via email to