Subject: io-space mappings
To: None <tech-kern@NetBSD.ORG>
From: Martin Husemann <martin@rumolt.teuto.de>
List: tech-kern
Date: 10/03/1997 10:53:16
I think we have a problem with the way our bus-space stuff is handled.

There is an increasing number of cards (all I've seen where ISA ISDN cards)
whith brain-dead register mappings. Worst example of the week: the USR
Sporster internal ISDN TA. Hellmuth Michaelis added support for it in FreeBSD
within a  few hours, but I didn't dare to write the NetBSD low-level routines
for it:

It uses 4 io-regions, one realy small just for configuration and three important
ones. Inside the important ones an address is calculated by:

#define ADDR(reg)	\
	(((reg/4) * 1024) + ((reg%4) * 2))

where reg is in the 0x00 to 0x40 range. All access is to io-space. The four
regions are at base+0, base+0x4000, base+0x8000, base+0xc000, where base
is typicaly something like 0x280.

This is an ISA card.

Disclaimer: I don't own such a card, neither would I buy or recommend one.
I don't have any relations to the manufacturer of that card either.

So my question: while this sure is brain-dead design, how should we cope
with it. I rely love our bus.h framework and think it's a great abstraction.
As it is now I would not support that card on NetBSD, stating in the README
why this is the case. This will urge owners of this card to use FreeBSD (which
I don't mind) and/or start flame wars against the brain-dead NetBSD io-space
concept (which I would hate).

So any chance to extend the io-space stuff to handle spare spaces efficiently?

Of course I could do one mapping for each 6 address block (and I'm probably
going this way), but this would bloat the machine and bus independend part
of my driver a lot...


Martin