Subject: DVMA on VME under NetBSD-current
To: None <pk@cs.few.eur.nl>
From: Rob Ginn <rob@olg.com>
List: port-sparc
Date: 10/04/1998 15:55:56
Paul,
we've been testing a number of SunOS tools under NetBSD and as part
of that, have had to port a couple of VME device drivers.  I just
finished a driver port and when it didn't work traced the problem to the
allocation of DVMA addresses.  There is a "todo" comment in the
code which alludes to this.  In my particular  case, the VME board is
only A24 capable, and the DVMA address I was given was $fc000000, above
the capability of the board.  I'm on a Sun4m (among others) and, as you
probably know, there is hardware to automatically shift addresses in the
lowest 1MB to the top 1MB (A32 range), thus the bus_dmamap_load() function
needs to allocate the DVMA address to the top (A32) megabyte and then mask
off the high bits to yield a low-megabyte value I can program into the
DMA registers on the board.

I'm unclear as to how the VME code should determine that the card is
A16,A24, or A32 as the VMEMOD_A* parameters are not passed into
the bus_dmamap_create() function.  With this exception, I'm happy
with the way things work.  Perhaps a set of flags on the configuration
line which specify special capabilities/limitations of the specific
VME card could be used?  Something such as "addr16", "addr24", or
"addr32" insteafd of just "addr".  Even better, perhaps a format such
as "a24d16" instead of "addr"?  This would also clean up the vme_bus_map()
code since card configuration would be outside of the driver completely
(now both the config file and the driver must sometimes be changed when
the card jumpers are changed).  Short of something like this, there
would need to be a way to get the parameter into the bus_dmamap_create()
function and I don't see and easy/clean way to do it.

At any rate, I don't want to push, but: do you plan to extend the current
VME support in the very near future to include support for A16/A24 DMA
capable cards?  I kind-of need it now, so if not, I may take a stab at it.
I suppose I could do a quick hack and just limit DVMA to the top 1MB and
subtract DVMA_BASE4M from the returned value in the driver, but I'd really
like something cleaner.

BTW, I've looked at the code for the xd.c and xy.c drivers and these
appear to be A16 cards which do DMA, so they won't work under the current
system.  I may be able to test these later, but although I have the cards,
I don't have any working disk drives to connect them to at the moment.

- Rob
- Rob
rob@olg.com