Specifications
PCI Bus Support
13.10 PCI Configuration Space Base Address Register Format
31 210
+----------------------------------+
| Base Address |0|1|
+----------------------------------+
Bit 1 Reserved.
Bit 0 Set to one to indicate I/O format Base Adddress
register.
Your device specification should state which Base Address registers are
implemented and which PCI address space (memory or I/O) they describe.
In general, if your device requires an address region in PCI I/O space, there will
be a Base Address register that contains the starting address of the PCI I/O
space assigned to your device. You can read this Base Address register using the
IOC$READ_PCI_CONFIG routine. However, before you call the IOC$MAP_IO
routine to map the PCI physical I/O address, you should clear bit 0 in the data
returned from the read of an I/O format Base Address register before passing
the address to IOC$MAP_IO. For a PCI I/O address, you should specify the
IOC$K_BUS_IO_BYTE_GRAN attribute in the call to IOC$MAP_IO.
Likewise, if your device requires an address region in PCI memory space, there
will be a Base Address register that contains the starting address of the PCI
memory space assigned to your device. You can read the Base Address register
using the IOC$READ_PCI_CONFIG routine. You should clear bits 3:0 of the data
returned from the read of a memory format Base Address register before passing
the PCI physical address as an argument to the IOC$MAP_IO routine. For a PCI
memory address, you can specify either the IOC$K_BUS_MEM_BYTE_GRAN
attribute (to map device registers) or the IOC$K_BUS_MEM_DENSE attribute
(for on-board device memory buffers). You should check the return status on calls
to IOC$MAP_IO, as not all attributes are supported on all platforms. If a call
using one of the attributes fails, then try the other one. If they both fail, you are
out of luck. File a QAR. Either the console mistakenly assigned an un-mappable
address to your device, or there is a bug in the OpenVMS AXP IOC$MAP_IO
routine.
If your device requires multiple address regions in PCI memory or I/O space, you
should call IOC$READ_PCI_CONFIG and IOC$MAP_IO to map each region.
13.11 When to Call IOC$MAP_IO and Where to Keep IOHANDLES
OpenVMS AXP Version 6.1 offers a new driver support feature for drivers that
need to call IOC$MAP_IO and need to save IOHANDLEs. There is a new
IOHANDLES parameter for the DPTAB macro, which allows a driver to specify
the number of IOHANDLEs required by the driver. There is also a new CSR_
MAPPING parameter for the DDTAB macro, which allows the driver to name a
routine that will be called by the driver loading program. This routine will be
called in an environment from which calls to IOC$MAP_IO can be made.
13.12 Direct Memory Access (DMA) on the PCI Bus
Direct Memory Access (DMA) refers to PCI devices reading or writing system
memory. The PCI bus places no restrictions on DMA. From the point of view of a
PCI device, system memory can be viewed as another device on the PCI with an
assigned address space. A PCI device does DMA by issuing reads or writes to the
address space assigned to system memory.
However, AXP platform implementations may place some restrictions on how
a PCI device must perform DMA. There are a number of reasons for these
restrictions, mostly related to EISA and ISA compatibility.
13–9