Subject: Re: Socket PCMCIA Card -> kern/32938 diffs -> com0 + com1 configured
To: Joerg Niendorf <joerg.bsd@internode.net.au>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: current-users
Date: 11/16/2006 18:32:28
On Wed, Nov 15, 2006 at 09:00:19PM +1000, Joerg Niendorf wrote:
> On Sun, 12 Nov 2006 20:04:38 -0700
> Sverre Froyen <sverre@viewmark.com> wrote:
> 
> > While trying to get my PCMCIA modem to work (see kern/32938), I found
> > that the code that results in "com2: ns16550a, working fifo" would
> > produce that message even if the IO space setup was not working.  It
> > is possible that the IO-space for this card suffers the same problem
> > as described in the PR.  I am not sure, however, if the code in
> > com_pcmcia.c supports cards with two interfaces.
> 
> 
> Hi Sverre,
> 
> Thanks for the pointer to kern/32938.
> 
> Yesterday I applied the diffs from your PR to the current sources and
> this had the positive effect that there are now 2 serial ports:

Just to confirm, pcmcia in current tries to align i/o mapped cards, which
is bound to fail, e.g.:

rbus_space_alloc: addr 0, size 1000, mask fff, align 1000
pccbb_pcmcia_alloc_mem: addr 0x40001000 size 0x400, realsize 0x1000
pccbb_pcmcia_mem_map window 0 bus 40001000+0+400 at card addr 0
pccbb_pcmcia_do_mem_map: start 0x40001000 end 0x400013ff off 0xbffff000
pccbb_pcmcia_do_mem_map window 0: 0100 0180 ff7f 40
pcmcia0: CIS version PCMCIA 2.0 or 2.1
pcmcia0: CIS info:  , NinjaATA-, V1.0, AP00 
pcmcia0: Manufacturer code 0xffffffff, product 0xffffffff
pcmcia0: function 0: unspecified, ccr addr 200 mask 3
pcmcia0: function 0, config table entry 33: I/O card; irq mask d068; iomask 10, 
iospace 180-187 386-387; memspace 0-fff; io8 io16 irqlevel
pcmcia0: function 0, config table entry 34: I/O card; irq mask d068; iomask 10, 
iospace 190-197 396-397; memspace 0-fff; io8 io16 irqlevel
pcmcia0: function 0, config table entry 35: I/O card; irq mask d068; iomask 10, 
iospace 1a0-1a7 3a6-3a7; memspace 0-fff; io8 io16 irqlevel
wdc0 at pcmcia0 function 0: < , NinjaATA-, V1.0, AP00 >
rbus_space_alloc: addr 180, size 8, mask 3ff, align 10000
rbus_space_alloc_subregion, line 143: search_addr = 0x180, boundary = 0x10000
rbus_space_alloc_subregion, line 147: search_addr = 0x10180, size = 0x8, search_
addr + size = 0x10188, substart = 0x4000, subend = 0x6000, boundary = 0x10000
extent rbt->rb_ext before extent_alloc_subregion
extent `ioport' (0x0 - 0xffff), flags = 0x3
     0x0 - 0xf
     0x40 - 0x43
     0x60 - 0x60
     0x61 - 0x61
     0x64 - 0x64
     0x80 - 0x8e
     0xc0 - 0xdf
     0xf0 - 0xff
     0x1f0 - 0x1f7
     0x3c0 - 0x3cf
     0x3d0 - 0x3df
     0x3f6 - 0x3f6
     0xa950 - 0xa95f
     0xaf40 - 0xaf5f
     0xaf60 - 0xaf7f
     0xaf80 - 0xaf9f
     0xafe0 - 0xafff
     0xd800 - 0xd87f
rbus: no space found

Sverre's kern/32938 patch at least addresses that - just align when mem mapped:

wdc0 at pcmcia0 function 0: < , NinjaATA-, V1.0, AP00 >
rbus_space_alloc: addr 180, size 8, mask 7, align 8
pccbb_pcmcia_io_alloc alloc port 0x4000+0x8
rbus_space_alloc: addr 386, size 2, mask 1, align 2
pccbb_pcmcia_io_alloc alloc port 0x4008+0x2
pccbb_pcmcia_io_map window 0 dynamic port 4000+8
pccbb_pcmcia_do_io_map win 0 addr 0x4000 size 0x8 width 0
pccbb_pcmcia_do_io_map start 00 40, stop 07 40, ioctl 02 enable 40
pccbb_pcmcia_do_io_map: PCIC_SIA_OFFSET = ffffc180
pccbb_pcmcia_io_map window 1 dynamic port 4008+2
pccbb_pcmcia_do_io_map win 1 addr 0x4008 size 0x2 width 0
pccbb_pcmcia_do_io_map start 08 40, stop 09 40, ioctl 22 enable c0
pccbb_pcmcia_do_io_map: PCIC_SIA_OFFSET = ffffc37e
wdc0: i/o mapped mode

Cheers,

Patrick