Subject: need pcmcia i/o mapping quirk table?
To: None <port-i386@netbsd.org>
From: Jun-ichiro itojun Hagino <itojun@iijlab.net>
List: port-i386
Date: 02/13/2000 14:58:59
	I'm not sure if port-i386 is the best place to send it out.

	With my TP570, I experienced a bit strange symptom with devices
	disabled by BIOS setting.  This is not a problem for TP570 in
	particular, it can happen under wonderful PC hardware world.
	In summary, to make pcmcia supprort work better, we may need to:
	- suggest everyone to enable every devices in BIOS setting, or
	- have sort of quirk table somewhere in pcic code


	I inserted ne(4) ethernet card and wi(4) wireless card, and saw wi(4)
	failed to properly attach itself like below:

>ne2 at pcmcia1 function 0 port 0x340-0x34f port 0x350-0x35f
>ne2: National Semiconductor InfoMover Ethernet
>ne2: supplying EUI64: 08:00:5a:ff:fe:38:6f:86
>ne2: Ethernet address 08:00:5a:38:6f:86
>wi0 at pcmcia0 function 0 port 0x380-0x3bf
>wi0: address 00:00:00:00:00:00
>wi0: timeout in wi_seek to 0/0; last status 4000
>wi0: seek failed in alloc
>wi0: tx buffer allocation failed
>wi0: timeout in wi_seek to 0/0; last status 4000
>wi0: seek failed in alloc
>wi0: mgmt. buffer allocation failed

	If I inesrt wi(4) card then ne(4), the card probes okay.

>wi0 at pcmcia0 function 0 port 0x340-0x37f
>wi0: address 00:60:1d:f1:86:61
>wi0: supplying EUI64: 00:60:1d:ff:fe:f1:86:61
>ne2 at pcmcia1 function 0 port 0x380-0x38f port 0x390-0x39f
>ne2: National Semiconductor InfoMover Ethernet
>ne2: Ethernet address 08:00:5a:38:6f:86

	Hmm, I thought, and I remembered that 0x3bc-0x3bf is usually for
	printer port, and my BIOS configuration disables printer port and
	infrared port in BIOS setting (almost all ISA devices are disabled
	under default setting).

	I enabled them in BIOS setting, and now I got stable behavior
	regardless from card insertion order.
>com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
>lpt2 at isa0 port 0x3bc-0x3bf: polled
>ne2 at pcmcia1 function 0 port 0x340-0x34f port 0x350-0x35f
>ne2: National Semiconductor InfoMover Ethernet
>ne2: supplying EUI64: 08:00:5a:ff:fe:38:6f:86
>ne2: Ethernet address 08:00:5a:38:6f:86
>wi0 at pcmcia0 function 0 port 0x400-0x43f
>wi0: address 00:60:1d:f1:86:61


	The similar simptom happens in following situations:
	- you have a kernel configured without sound devices
	- and you have sound devices on the computer
	- irq 5 (for soundblaster) is allocated for pcmcia card
	and I'm thinking of having "quirk table" for pcmcia resource
	allocation.  Quirk table would prevent pcic from allocating "popular"
	io/irq range in conflicting range.

	About the particular case shown in above, I think I can add a check in
	if_wi.c to see if mac address is read properly or not (0:0:0:0:0:0
	then attach fail).

itojun