You can still write an IRIS-portable device driver if the dma_mapalloc() function does not return -1 and if the device driver can take advantage of the DMA mapping functions described in Chapter 5, "Writing a SCSI Device Driver." Otherwise, you must use one of the other DMA methods.
Table A-6 describes the mapping between the address generated by a VME device and physical memory. You can perform A32 master addressing on the IP5, IP7, IP9, and IP17 in either mapped or unmapped mode.
On POWER Series workstations, ranges of VME-bus address space were mapped one-to-one with K2 segment addresses. This made accessing the VME bus easy but was also limiting. Only a small amount of K2 space is available for use by VME, so very little of the VME address space was made available. Even worse, for dual VME-bus systems, the space previously available was now cut in half as it was shared between the two buses.
The CHALLENGE series supports up to five VME buses. Since K2 space is a limited resource, and dividing up what is available by five would make the extra VME buses next to useless, a new approach was tried. The CHALLENGE series does not have a direct K2 address map into VME-bus space. Each VME bus adapter has the ability to map fifteen 8 MB windows of VME-bus space into K2 space. These windows can be slid around at will to give the illusion of a much larger address space.
To access a VME space, a user must allocate a PIO map, which provides a translation between a kernel address and VME space. These mappings can be "FIXED" or "UNFIXED." As on POWER Series platforms, a FIXED mapping is a one-to-one mapping of a range of VME-bus space into the driver's address space. An UNFIXED window takes advantage of the sliding window ability on the CHALLENGE series, which supports both FIXED and UNFIXED mappings.
In an UNFIXED map, VME-bus space cannot be accessed directly; instead, access is provided through special bcopy() routines used to move data between VME space and kernel buffers. While it is not always possible to get a FIXED mapping, an UNFIXED mapping is always available. The special bcopy() routines work for both FIXED and UNFIXED mappings. On POWER Series and earlier workstations, UNFIXED mappings are treated as FIXED mappings.
The PIO mapping routines also have a general interface that allows them to be used for mapping in bus spaces other than VME.
The support routines for PIO mapping are:
pio_mapalloc | Allocate a PIO map. |
pio_mapaddr | Map bus space to a driver accessible address (FIXED maps only). |
pio_mapfree | Free a previously allocated PIO map. |
pio_badaddr | Check to see whether a bus address is equipped. |
pio_wbadaddr | Check to see whether a bus address is equipped. |
pio_bcopyin | Copy data from bus space to kernel buffer. |
pio_bcopyout | Copy data from kernel buffer to bus space. |
These PIO maps are normally set up in the driver's drvedtinit() routine.