Subject: kern/14149: PCI-CardBus bridge misbehaves
To: None <gnats-bugs@gnats.netbsd.org>
From: None <xs@nitric.net>
List: netbsd-bugs
Date: 10/03/2001 03:42:58
>Number:         14149
>Category:       kern
>Synopsis:       PCI-CardBus bridge misbehaves
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 03 04:15:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     xs
>Release:        1.5.1, 1.5X
>Organization:
>Environment:
NetBSD 1.5.1 (laptop) #1: Wed Oct  3 02:30:54 BST 2001
    root@build:/usr/src/sys/arch/i386/compile/laptop

>Description:
CardBus is detected, but fails to initialize properly. This results
in the inability to use any CardBus functionality.
cbb0 and cbb1 report a bad Vcc and bail out.

There was some commented code in /sys/dev/pci/pccbb.c. I uncommented
it as it described the CardBus state I was encountering. However
this did not fix the problem. It simply allowed the boot to
progress further. The supported PCMCIA network card was still
not detected during boot up.

This is an unbranded laptop, it functions running windows and freebsd,
I believe the hardware is also present in some Dell laptops.

Here is the dmesg from the laptop, the kernel had the patch in
"fix to the problem" applied, with various verbose and diagnostic
options in the kernel:

NetBSD 1.5.1 (laptop) #1: Wed Oct  3 02:30:54 BST 2001
    root@build:/usr/src/sys/arch/i386/compile/laptop
cpu0: Intel Celeron (Mendocino) (686-class), 464.58 MHz
total memory = 65088 KB
avail memory = 57216 KB
using 839 buffers containing 3356 KB of memory
biostramp installed @ 1000
RTC BIOS diagnostic error 20<config_unit>
BIOS32 rev. 0 found at 0xeb030
PCI BIOS rev. 2.1 found at 0xeb070
pcibios: config mechanism [1][x], special cycles [1][x], last bus 1
PCI IRQ Routing Table rev. 1.0 found at 0xfe840, size 96 bytes (4 entries)
PCI Interrupt Router at 000:07:0 (Intel 82371FB PCI-to-ISA Bridge (PIIX))
------------------------------------------
  device vendor product pin PIRQ IRQ stage
------------------------------------------
000:07:2 0x8086 0x7112   D  0x03  10  2    WARNING: preserving irq 128
000:08:0 0x104c 0xac1c   A  0x00  10  0    already assigned
000:08:1 0x104c 0xac1c   A  0x00  10  0    already assigned
000:09:0 0x1013 0x6003   A  0x02   5  0    already assigned
------------------------------------------
PCI bridge 0: primary 0, secondary 1, subordinate 1
PCI bridge 1: primary 0, secondary 2, subordinate 2
PCI bridge 2: primary 0, secondary 3, subordinate 3
PCI bus #3 is the last bus
[System BIOS Setting]-----------------------
  device vendor product
  register space address    size
--------------------------------------------
000:00:0 0x8086 0x7190
        10h mem  0x10000000 0x10000000
                [OK]
000:01:0 0x8086 0x7191
                [OK]
000:07:0 0x8086 0x7110
                [OK]
000:07:1 0x8086 0x7111
        20h port 0x00001100 0x00000010
                [OK]
000:07:2 0x8086 0x7112
        20h port 0x00005800 0x00000020
                [OK]
000:07:3 0x8086 0x7113
                [OK]
000:08:0 0x104c 0xac1c
        10h mem  0x04000000 0x00001000
                [OK]
000:08:1 0x104c 0xac1c
        10h mem  0x04001000 0x00001000
                [OK]
000:09:0 0x1013 0x6003
        10h mem  0xe8000000 0x00001000
        14h mem  0xe9000000 0x00100000
                [OK]
001:00:0 0x1002 0x4c42
        10h mem  0xe4000000 0x01000000
        14h port 0x0000d000 0x00000100
        18h mem  0xe6000000 0x00001000
                [OK]
--------------------------[  0 devices bogus]
 Physical memory end: 0x03fed000
 PCI memory mapped I/O space start: 0x04000000
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 82443BX Host Bridge/Controller (rev. 0x03)
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: ATI Technologies Mach64 LB (rev. 0xdc)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
pcib0 at pci0 dev 7 function 0
pcib0: Intel 82371AB PCI-to-ISA Bridge (PIIX4) (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4) (rev. 0x01)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <FUJITSU MHK2060AT>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 5729 MB, 12416 cyl, 15 head, 63 sec, 512 bytes/sect x 11733120 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4
pciide0: primary channel interrupting at irq 14
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
pciide0: secondary channel wired to compatibility mode
atapibus0 at pciide0 channel 1
cd0 at atapibus0 drive 0: <CD-224E, , 1.5A> type 5 cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2
pciide0: secondary channel interrupting at irq 15
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
uhci0 at pci0 dev 7 function 2: Intel 82371AB USB Host Controller (PIIX4) (rev. 0x01)
pci_intr_map: bad interrupt line 128
uhci0: couldn't map interrupt
Intel 82371AB Power Management Controller (PIIX4) (miscellaneous bridge, revision 0x02) at pci0 dev 7 function 3 not configured
cbb0 at pci0 dev 8 function 0: Texas Instruments PCI1225 PCI-CardBus Bridge (rev. 0x01) (chipflags 3)
cbb0: socket base address 0x4000000
cbb0: intrpin A, intrtag 10
cbb1 at pci0 dev 8 function 1: Texas Instruments PCI1225 PCI-CardBus Bridge (rev. 0x01) (chipflags 3)
cbb1: socket base address 0x4001000
cbb1: intrpin A, intrtag 10
clcs0 at pci0 dev 9 function 0: Cirrus Logic CS4280 CrystalClear Audio Interface (rev. 0x01)
clcs0: interrupting at irq 5
clcs0: Crystal CS4297 codec; headphone, 18 bit DAC, 18 bit ADC, no 3D stereo
audio0 at clcs0: full duplex, independent
midi0 at clcs0: CS4280 MIDI UART
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pmsiprobe: intellimode -> 6
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
lpt0 at isa0 port 0x378-0x37b irq 7
lptprobe: mask ff data 55 failed
lptprobe: mask ff data 55 failed
pcppi0 at isa0 port 0x61
midi1 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
isapnp0: no ISA Plug 'n Play devices found
CardBus latency timer 0x20 (20020200)
PCI latency timer 0x10 (821008)
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
cbb0: bad Vcc request. sock_ctrl 0xffffff88, sock_status 0xffffffff
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
new status 0xffffffff
cbb0: interrupting at irq 10
cbb0: cacheline 0x8 lattimer 0x20
cbb0: bhlc 0x821008 lscp 0x20020200
PCI config regs:
 0x00: ac1c104c 02100007 06070001 00821008
 0x10: 04000000 020000a0 20020200 fffff000
 0x20: 00000000 fffff000 00000000 fffffffc
 0x30: 00000000 fffffffc 00000000 07c0010a
 0x40: ac1c1071 00000001 00000000 00000000
 0x80: 20449060 00000000 00000000 01dc1622
 0x90: 606402c0 00000000 00000000 00000000
 0xa0: 7e210001 00808003 00000814 0000000b
socket regs: ffffffff ffffffff ffffffff ffffffff ffffffff
ExCA regs: ff ff ff ff ff ff ff ff
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 2 device 0 cacheline 0x8, lattimer 0x20
pcmcia0 at cardslot0
pccbb_pcmcia_card_detect
pccbbattach: found cardslot
CardBus latency timer 0x20 (20030300)
PCI latency timer 0x10 (821008)
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
cbb1: bad Vcc request. sock_ctrl 0xffffff88, sock_status 0xffffffff
pccbb_power: CARDBUS_VCC_0V and CARDBUS_VPP_0V [44]
new status 0xffffffff
cbb1: interrupting at irq 10
cbb1: cacheline 0x8 lattimer 0x20
cbb1: bhlc 0x821008 lscp 0x20030300
PCI config regs:
 0x00: ac1c104c 02100007 06070001 00821008
 0x10: 04001000 020000a0 20030300 fffff000
 0x20: 00000000 fffff000 00000000 fffffffc
 0x30: 00000000 fffffffc 00000000 07c0010a
 0x40: ac1c1071 00000001 00000000 00000000
 0x80: 2044b060 00000000 00000000 01dc1622
 0x90: 606403c0 00000000 00000000 00000000
 0xa0: 7e210001 00808003 00000814 0000000b
socket regs: ffffffff ffffffff ffffffff ffffffff ffffffff
ExCA regs: ff ff ff ff ff ff ff ff
cardslot1 at cbb1 slot 1 flags 0
cardbus1 at cardslot1: bus 3 device 0 cacheline 0x8, lattimer 0x20
pcmcia1 at cardslot1
pccbb_pcmcia_card_detect
pccbbattach: found cardslot
apm0 at mainbus0: Power Management spec V1.2
apm: 1 batteries, global standby, global suspend, rtimer suspend, internal standby, pccard standby
biomask ef4d netmask ef4d ttymask ffcf
boot device: wd0
root on wd0a dumps on wd0b
mountroot: trying cd9660...
mountroot: trying ffs...
root file system type: ffs
init: copying out path `/sbin/init' 11


>How-To-Repeat:
Boot a laptop with NetBSD and a PCMCIA card supported with a
Texas Instruments PCI1225 PCI-CardBus Bridge revision 1 chip.

>Fix:
This patch improved the situation very slightly.

--- pccbb.c.orig        Tue Oct  2 22:25:00 2001
+++ pccbb.c     Tue Oct  2 22:26:21 2001
@@ -30,9 +30,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

-/*
 #define CBB_DEBUG
 #define SHOW_REGS
+/*
 #define PCCBB_PCMCIA_POLL
 */
 /* #define CBB_DEBUG */
@@ -1258,7 +1258,7 @@
                    CARDBUS_VPP_VCC ? "CARDBUS_VPP_VCC" : (command &
                    CARDBUS_VPPMASK) ==
                    CARDBUS_VPP_0V ? "CARDBUS_VPP_0V" : "UNKNOWN", command));
-#if 0
+
                if (command == (CARDBUS_VCC_0V | CARDBUS_VPP_0V)) {
                        u_int32_t force =
                            bus_space_read_4(memt, memh, CB_SOCKET_FORCE);
@@ -1269,7 +1269,7 @@
                            CB_SOCKET_STAT));
                        return 1;
                }
-#endif
+
                return 0;
        }


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