Subject: Re: more fun and games with netbsd1,4 & PCMCIA
To: John Kohl <jtk@kolvir.arlington.ma.us>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: port-i386
Date: 05/26/1999 22:54:55
Sigh.  I managed to make it work once but foolishly forgot to make a copy
of that kernel and how I had the BIOS configured and nothing since has
worked.

Amusingly, the freeze when allocating IRQ is also affecting the modem
card which comes up as com3.  I get a "pcmcia0: card irq 9" when it
tries to bring the interface up and then:

panic: com_shutdown: not enabled?

when I eject the card :-)

Anyway, it appears NetBSD doesn't want to deal with both sb0 and wss0
enabled.  My current kernel config looks like this:
-----------------------------------
include "arch/i386/conf/std.i386"
maxusers	32		# estimated number of users
options 	I586_CPU
options 	I686_CPU
options 	MATH_EMULATE	# floating point emulation
options 	USER_LDT	# user-settable LDT; used by WINE
options 	XSERVER		# X server support in console drivers
options 	UCONSOLE	# users can use TIOCCONS (for xconsole)
options 	INSECURE	# disable kernel security levels
options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
options 	NTP		# NTP phase/frequency locked loop
options 	KTRACE		# system call tracing via ktrace(1)
options 	SYSVMSG		# System V-like message queues
options 	SYSVSEM		# System V-like semaphores
options 	SYSVSHM		# System V-like memory sharing
options 	LKM		# loadable kernel modules
options 	DIAGNOSTIC	# cheap kernel consistency checks
options 	DDB		# in-kernel debugger
options 	COMPAT_NOMID	# compatibility with 386BSD, BSDI, NetBSD 0.8,
options 	COMPAT_09	# NetBSD 0.9,
options 	COMPAT_10	# NetBSD 1.0,
options 	COMPAT_11	# NetBSD 1.1,
options 	COMPAT_12	# NetBSD 1.2,
options 	COMPAT_13	# NetBSD 1.3,
options 	COMPAT_43	# and 4.3BSD
options 	COMPAT_386BSD_MBRPART # recognize old partition ID
options 	COMPAT_SVR4	# binary compatibility with SVR4
options 	COMPAT_IBCS2	# binary compatibility with SCO and ISC
options 	COMPAT_LINUX	# binary compatibility with Linux
options 	COMPAT_FREEBSD	# binary compatibility with FreeBSD
options 	EXEC_ELF32	# 32-bit ELF executables (SVR4, Linux)
file-system 	FFS		# UFS
file-system 	NFS		# Network File System client
file-system 	CD9660		# ISO 9660 + Rock Ridge file system
file-system 	MSDOSFS		# MS-DOS file system
file-system 	FDESC		# /dev/fd
file-system 	KERNFS		# /kern
file-system 	NULLFS		# loopback file system
file-system 	PORTAL		# portal filesystem (still experimental)
file-system 	PROCFS		# /proc
file-system 	UMAPFS		# NULLFS + uid and gid remapping
file-system 	UNION		# union file system
options 	QUOTA		# UFS quotas
options 	NFSSERVER	# Network File System server
options 	INET		# IP + ICMP + TCP + UDP
options 	USBVERBOSE	# verbose USB device autoconfig messages
options 	NFS_BOOT_BOOTP,NFS_BOOT_BOOTPARAM
options 	WSEMUL_VT100		# VT100 / VT220 emulation
options 	WS_KERNEL_FG=WSCOL_GREEN
options 	WSDISPLAY_COMPAT_PCVT		# emulate some ioctls
options 	WSDISPLAY_COMPAT_SYSCONS	# emulate some ioctls
options 	WSDISPLAY_COMPAT_USL		# VT handling
options 	WSDISPLAY_COMPAT_RAWKBD		# can get raw scancodes
config		netbsd	root on ? type ?
mainbus0 at root
pci*	at mainbus? bus ?
pci*	at pchb? bus ?
pci*	at ppb? bus ?
pchb*	at pci? dev ? function ?	# PCI-Host bridges
pceb*	at pci? dev ? function ?	# PCI-EISA bridges
pcib*	at pci? dev ? function ?	# PCI-ISA bridges
ppb*	at pci? dev ? function ?	# PCI-PCI bridges
puc*	at pci? dev ? function ?	# PCI "universal" comm. cards
eisa*	at mainbus?
eisa*	at pceb?
isa*	at mainbus?
isa*	at pceb?
isa*	at pcib?
pcmcia*	at pcic? controller ? socket ?
pcic0	at isa? port 0x3e0 iomem 0xd0000 iosiz 0x4000 irq 10
pcic0	at pci? dev? function ?
isapnp0	at isa?
pcic*	at isapnp?
npx0	at isa? port 0xf0 irq 13	# x86 math coprocessor
pckbc0	at isa?			# pc keyboard controller
pckbd*	at pckbc?		# PC keyboard
opms*		at pckbc?		# backwards compatible PS/2 mouse
vga0		at isa?
vga*		at pci?
pcdisplay0	at isa?			# CGA, MDA, EGA, HGA
wsdisplay*	at vga? console ?
wsdisplay*	at pcdisplay? console ?
wskbd*	at pckbd? console ?
pcppi0	at isa?
sysbeep0	at pcppi?
com*	at puc? port ?			# 16x450s on "universal" comm boards
cy*	at pci? dev ? function ?	# Cyclades Cyclom-Y serial boards
com*	at isapnp?			# Modems and serial boards
com*	at pcmcia? function ?		# Modems and serial cards
pcmcom*	at pcmcia? function ?		# PCMCIA multi-port serial cards
com*	at pcmcom? slave ?		# ...and the slave devices
com0	at isa? port 0x3f8 irq 4	# Standard PC serial ports
com1	at isa? port 0x2f8 irq 3
lpt*	at puc? port ?			# || ports on "universal" comm boards
lpt0	at isa? port 0x378 irq 7	# standard PC parallel ports
pciide* at pci ? dev ? function ? flags 0x0000
wdc*	at isapnp? 
wdc*	at pcmcia? function ?
wdc0	at isa? port 0x1f0 irq 14
wdc1	at isa? port 0x170 irq 15
wd*	at wdc? channel ? drive ? flags 0x0000
wd*	at pciide? channel ? drive ? flags 0x0000
atapibus* at wdc? channel ?
atapibus* at pciide? channel ?
cd*	at atapibus? drive ? flags 0x0000	# ATAPI CD-ROM drives
sd*	at atapibus? drive ? flags 0x0000	# ATAPI disk drives
uk*	at atapibus? drive ? flags 0x0000	# ATAPI unknown
fdc0	at isa? port 0x3f0 irq 6 drq 2	# standard PC floppy controllers
fd*	at fdc? drive ?			# the drives themselves
ep*	at pci? dev ? function ?	# 3Com 3c59x
ep*	at eisa? slot ?			# 3Com 3c579 Ethernet
fea*	at eisa? slot ?			# DEC DEFEA FDDI
ep*	at isapnp?			# 3Com 3c509 Ethernet
ne*	at isapnp?			# NE2000-compatible Ethernet
tr*	at isapnp?			# IBM/3COM TROPIC Token-Ring
ep*	at pcmcia? function ?		# 3Com 3c589 and 3c562 Ethernet
exphy*	at mii? phy ?			# 3Com internal PHYs
icsphy*	at mii? phy ?			# Integrated Circuit Systems ICS1890
inphy*	at mii? phy ?			# Intel 82555 PHYs
lxtphy*	at mii? phy ?			# Level One LXT-970 PHYs
nsphy*	at mii? phy ?			# NS83840 PHYs
qsphy*	at mii? phy ?			# Quality Semiconductor QS6612 PHYs
sqphy*	at mii? phy ?			# Seeq 80220/80221/80223 PHYs
tlphy*	at mii? phy ?			# ThunderLAN PHYs
ukphy*	at mii? phy ?			# generic unknown PHYs
uhci*	at pci?				# Universal Host Controller (Intel)
ohci*	at pci?				# Open Host Controller
usb*	at uhci?
usb*	at ohci?
uhub*	at usb?
uhub*	at uhub? port ? configuration ? interface ?
ums*	at uhub? port ? configuration ? interface ?
wsmouse*	at ums?
ukbd*	at uhub? port ? configuration ? interface ?
wskbd*	at ukbd? console ?
uhid*	at uhub? port ? configuration ? interface ?
ulpt*	at uhub? port ? configuration ? interface ?
ugen*	at uhub? port ? configuration ? interface ?
sb0	at isa? port 0x220 irq 11 drq 1 drq2 5	# SoundBlaster
wss0	at isa? port 0x530 irq 11 drq 0	drq2 1	# Windows Sound System
opl*	at sb?
audio*	at sb?
midi*	at pcppi?		# MIDI interface to the PC speaker
midi*	at sb?			# SB MPU401 port
midi*	at opl?			# OPL FM synth
spkr0	at pcppi?		# PC speaker
joy0	at isa? port 0x201
include	"arch/i386/conf/GENERIC.local"
pseudo-device	vnd		4	# disk-like interface to files
pseudo-device	bpfilter	8	# Berkeley packet filter
pseudo-device	ipfilter		# IP filter (firewall) and NAT
pseudo-device	loop			# network loopback
pseudo-device	ppp		2	# Point-to-Point Protocol
pseudo-device	tun		2	# network tunneling over tty
pseudo-device	ipip		2	# IP Encapsulation within IP (RFC 2003)
pseudo-device	pty		32	# pseudo-terminals
pseudo-device	tb		1	# tablet line discipline
pseudo-device	sequencer	1	# MIDI sequencer
pseudo-device	rnd			# /dev/random and in-kernel generator
options	PCIC_ISA_ALLOC_IOBASE=0x400
options	PCIC_ISA_ALLOC_IOSIZE=0x100
options	PCIC_ISA_INTR_ALLOC_MASK=0x0210
-----------------------------------
and after booting, I get this from dmesg:
-----------------------------------
NetBSD 1.4 (GENERIC) #0: Wed May 26 15:35:58 PDT 1999
    root@:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: family 6 model 6 step a
cpu0: Intel Pentium II (Celeron) (686-class)
real mem  = 100270080
avail mem = 90804224
using 1249 buffers containing 5115904 bytes of memory
mainbus0 (root)
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o enabled, memory enabled
pchb0 at pci0 dev 0 function 0
pchb0: vendor 0x8086 product 0x7192 (rev. 0x03)
vga1 at pci0 dev 2 function 0: vendor 0x1023 product 0x9397 (rev. 0xf3)
wsdisplay0 at vga1: console (80x25, vt100 emulation)
pcib0 at pci0 dev 7 function 0
pcib0: vendor 0x8086 product 0x7110 (rev. 0x02)
pciide0 at pci0 dev 7 function 1: Intel 82371AB IDE controller (PIIX4)
pciide0: bus-master DMA support present
pciide0: primary channel wired to compatibility mode
wd0 at pciide0 channel 0 drive 0: <TOSHIBA MK6411MAT>
wd0: drive supports 16-sector pio transfers, lba addressing
wd0: 6194MB, 13424 cyl, 15 head, 63 sec, 512 bytes/sect x 12685680 sectors
wd0: 32-bits data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2
pciide0: primary channel interrupting at irq 14
pciide0: secondary channel wired to compatibility mode
atapibus0 at pciide0 channel 1
cd0 at atapibus0 drive 0: <TOSHIBA CD-ROM XM-1802B, , 1119> type 5 cdrom removable
cd0: 32-bits data port
cd0: drive supports PIO mode 4, DMA mode 2
pciide0: secondary channel interrupting at irq 15
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (using DMA data transfers)
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
uhci0 at pci0 dev 7 function 2: vendor 0x8086 product 0x7112 (rev. 0x01)
uhci0: can't map i/o space
vendor 0x8086 product 0x7113 (miscellaneous bridge, revision 0x02) at pci0 dev 7 function 3 not configured
vendor 0x1013 product 0x1110 (CardBus bridge, revision 0xc1) at pci0 dev 10 function 0 not configured
vendor 0x1013 product 0x1110 (CardBus bridge, revision 0xc1) at pci0 dev 10 function 1 not configured
isa0 at pcib0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
lpt0 at isa0 port 0x378-0x37b irq 7
sb: configured irq 11 invalid
wss0 at isa0 port 0x530-0x537 irq 11 drq 0 drq2 1: CS4231 or AD1845
audio at wss0 not configured
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
opms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
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
joy0 at isa0 port 0x201
joy0: joystick not connected
pcic0 at isa0 port 0x3e0-0x3e1 iomem 0xd0000-0xd3fff irq 10
pcic0: controller 0 (Cirrus PD672X) has sockets A and B
pcmcia0 at pcic0 controller 0 socket 0
pcmcia1 at pcic0 controller 0 socket 1
ep0 at pcmcia1 function 0 port 0x400-0x40f: 3Com 3c589 10Mbps Ethernet
ep0: address 00:10:4b:ed:e6:eb, 8KB byte-wide FIFO, 5:3 Rx:Tx split
ep0: 10baseT, 10base5, 10base2 (default 10baseT)
isapnp0: no ISA Plug 'n Play devices found
biomask c040 netmask c040 ttymask d4c2
wscons: wskbd0 glued to wsdisplay0 (console)
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
---------------------------
doing an "ifconfig ep0 up" results in an "pcmcia1: card irq 9" being
displayed before the system hangs when epinit() does:

bus_space_write_2(iot,ioh,ELINK_COMMAND,SET_INTR_MASK|S_CARD_FAILURE|
		  S_RX_COMPLETE|S_TX_COMPLETE|S_TX_AVAIL)

Darren