Subject: Re: vaio and cardbus
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: None <ks@ub.uni-mainz.de>
List: current-users
Date: 12/17/1999 15:53:28
hi,

> I'd like to include those unconditionally in all i386 kernels, but it
> would be nice to know if it breaks any currently-working systems,
> first.

hm, maybe here's some breaking candidate ;-)
I'm using a toshiba 490xcdt with a 3com 3C562D Lan+modem card in one
of the pcmcia-slots of the notebook and a 3Com 3c574-TX 10/100Mbps
Ethernet card in a cardstationIII expansion box. I normally have
pcmcia-compatibily in bios-setup configured for pcic, and that's doing
ok. (I've attached some excerpt from dmesg below.) 
pcmcia-compatibily can be changed to "auto" or "cardbus/16-bit"
booting dos an using the "tsetup" tool from toshiba.
to use the build-in sound hardware, I configure pcibios in and ym.

last night i tried to get the beasty up and running with cardbus
configured in. setting pcmcia-compatibily to cardbus/16-bit and
configuring a kernel w/ cardbus enabled (and pcic commented out), then
booting the notebook standalone, i.e. not placed in the cardstationIII
i could boot the kernel, but failed to get the 3C562D running: "can't
allocate i/o space".
putting some printf in ep_pcmcia_attach around line 312 of
/sys/dev/pcmcia/if_ep_pcmcia.c, I found that both pa->pf->sc->iobase
and pa->pf->sc->iosize are 0, so the for-loop will be skipped and no
i/o space is allocated...hm! that's what i get w/o using 
PCIC_ISA_ALLOC_IOBASE in my normal config...
the relevant lines from /sys/dev/pcmcia/if_ep_pcmcia.c:

    310         if (pa->product == PCMCIA_PRODUCT_3COM_3C562) {
    311                 bus_addr_t maxaddr = (pa->pf->sc->iobase + pa->pf->sc->iosize);
    312 
    313                 for (i = pa->pf->sc->iobase; i < maxaddr; i += 0x10) {

i then tried booting the notebook while placed in the
cardstation. that gives:
...
root on wd1a dumps on wd1b
uvm_fault(0xf0275d60, 0xf97e3000, 0, 1) -> 1
kernel: page fault trap, code=0
Stopped in cardslot0 at pcmcia_scan_cis+0x1a2
db> t
pcmcia_scan_cis(...)
pcmcia_read_cis(...)
pcmcia_card_attach(...)
cardslot_event_thread(...)
Bad frame pointer
db>

hm! not nice!

any ideas/patches what i can try next? I'm willing to test patches, 
provide more information, put crashdumps somewhere ...

    -kurt

so here's the excerpts from the config file and from dmesg:

first the normally used and working setup:
...

# PCMCIA bus support
pcmcia* at pcic? controller ? socket ?
#pcmcia*        at tcic? controller ? socket ?

# ISA PCMCIA controllers
pcic0   at isa? port 0x3e0 iomem 0xd0000 iosiz 0x4000
pcic1   at isa? port 0x3e2 iomem 0xd4000 iosiz 0x4000
#tcic0  at isa? port 0x240 iomem 0xd0000 iosiz 0x4000
...
# set probing for this beast
# w/o setting PCIC_ISA_ALLOC_IOBASE the 3C562D can't find io space.
options         PCIC_ISA_ALLOC_IOBASE=0x400
options         PCIC_ISA_ALLOC_IOSIZE=0x100
#options                PCIC_ISA_INTR_ALLOC_MASK=0x0608
options         PCIC_ISA_INTR_ALLOC_MASK=0x04b8
...

pcmcia0 at pcic0 controller 0 socket 0
pcmcia0: CIS version PCMCIA 2.0 or 2.1
pcmcia0: CIS info: 3Com Corporation, 3C562D/3C563D, EtherLink III, LAN+Modem PC Card
pcmcia0: Manufacturer code 0x101, product 0x562
pcmcia0: function 0: network adapter, ccr addr 1800 mask 3ff
pcmcia0: function 0, config table entry 7: I/O card; irq mask ffff; iomask 4, iospace 0-f; rdybsy_active wp_active bvd_active io8 io16 irqlevel
pcmcia0: function 1: serial port, ccr addr 1900 mask 3ff
pcmcia0: function 1, config table entry 7: I/O card; irq mask 86b8; iomask 3, iospace 2f8-2ff; io8 audio
pcmcia0: function 1, config table entry 23: I/O card; irq mask 86b8; iomask 3, iospace 2e8-2ef; io8 audio
pcmcia0: function 1, config table entry 39: I/O card; irq mask 86b8; iomask 3, iospace 0-7; io8 audio
ep0 at pcmcia0 function 0 port 0x400-0x40f: 3Com 3c562 33.6 Modem/10Mbps Ethernet
ep0: supplying EUI64: 00:60:97:ff:fe:fe:75:dd
ep0: address 00:60:97:fe:75:dd, 8KB byte-wide FIFO, 5:3 Rx:Tx split
ep0: 10baseT, 10base5, 10base2 (default 10baseT)
com1 at pcmcia0 function 1 port 0x410-0x417: serial device
com1: ns16550a, working fifo
pcmcia1 at pcic0 controller 0 socket 1
pcic1 at isa0 port 0x3e2-0x3e3 iomem 0xd4000-0xd7fff: using irq 7
pcic1: controller 0 (Intel 82365SL Revision 1) has sockets A and B
pcmcia2 at pcic1 controller 0 socket 0
pcmcia2: CIS version PCMCIA 2.0 or 2.1
pcmcia2: CIS info: 3Com, Megahertz 574B, B, 001
pcmcia2: Manufacturer code 0x101, product 0x574
pcmcia2: function 0: network adapter, ccr addr 10000 mask 3
pcmcia2: function 0, config table entry 1: I/O card; irq mask ffff; iomask 5, iospace 0-1f; rdybsy_active wp_active bvd_active io8 io16 irqlevel
ep1 at pcmcia2 function 0 port 0x420-0x43f: 3Com 3c574-TX 10/100Mbps Ethernet
ep1: address 00:50:04:f2:68:d1, 64KB word-wide FIFO, 1:1 Rx:Tx split
ukphy0 at ep1 phy 0: Generic IEEE 802.3u media interface
ukphy0: OUI 0x00c039, model 0x0014, rev. 10
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pcmcia3 at pcic1 controller 0 socket 1


and that's what I used for cardbus:

...
# CardBus bus support
cardbus*        at cardslot?
pcmcia*         at cardslot?

cbb*    at pci? dev? function ?
cardslot*       at cbb? 
...

Toshiba America Info Systems Fast Infrared Type O (miscellaneous communications, revision 0x33) at pci0 dev 9 function 0 not configured
cbb0 at pci0 dev 11 function 0 (ToPIC95B), chipflags 2
cbb1 at pci0 dev 11 function 1 (ToPIC95B), chipflags 2
cbb0: interrupting at irq 11
cbb0: cacheline 0x0 lattimer 0x0
cbb0: bhlc 0x820000 lscp 0x141400
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 20 device 0 cacheline 0x0, lattimer 0x0
pcmcia0 at cardslot0
cbb1: interrupting at irq 11
cbb1: cacheline 0x0 lattimer 0x0
cbb1: bhlc 0x820000 lscp 0x151500
cardslot1 at cbb1 slot 1 flags 0
cardbus1 at cardslot1: bus 21 device 0 cacheline 0x0, lattimer 0x0
pcmcia1 at cardslot1
...
...
pcmcia0: CIS version PCMCIA 2.0 or 2.1
pcmcia0: CIS info: 3Com Corporation, 3C562D/3C563D, EtherLink III, LAN+Modem PC Card
pcmcia0: Manufacturer code 0x101, product 0x562
pcmcia0: function 0: network adapter, ccr addr 1800 mask 3ff
pcmcia0: function 0, config table entry 7: I/O card; irq mask ffff; iomask 4, iospace 0-f; rdybsy_active wp_active bvd_active io8 io16 irqlevel
pcmcia0: function 1: serial port, ccr addr 1900 mask 3ff
pcmcia0: function 1, config table entry 7: I/O card; irq mask 86b8; iomask 3, iospace 2f8-2ff; io8 audio
pcmcia0: function 1, config table entry 23: I/O card; irq mask 86b8; iomask 3, iospace 2e8-2ef; io8 audio
pcmcia0: function 1, config table entry 39: I/O card; irq mask 86b8; iomask 3, iospace 0-7; io8 audio
ep0 at pcmcia0 function 0: can't allocate i/o space
com1 at pcmcia0 function 1: serial device
com1: ns16550a, working fifo