
Applied Micro Circuits Corporation
6195 Lusk Blvd., San Diego, CA 92121 (619) 450-9333
15-18
BUS MASTERING WITH THE S5933 PCI MATCHMAKER
5.0 DMA SOFTWARE SUPPORT
DMA transfers with the S5933 depend mostly on
hardware. Most of the design is the interface on the
add-on card which fills and empties the FIFO. There
is some software support required for DMA transfers.
Address and transfer count registers must be
loaded, the FIFOs must be configured, and inter-
rupts (if used) must be enabled and serviced. The
following sections provide an overview of what ac-
tions are required by software for S5933 DMA opera-
tions.
5.1
PCI Initiated DMA Transfers
For PCI initiated DMA transfers, the PCI host CPU
(PentiumTM, AlphaTM, etc.) sets up the S5933 to per-
form bus master transfers. The following tasks must
be completed to setup FIFO bus mastering:
1) Define interrupt capabilities. The PCI to
add-on and/or add-on to PCI FIFO can
generate a PCI interrupt to the host when
the transfer count reaches zero.
INTCSR
Bit 15
Enable Interrupt on read
transfer count equal
zero
INTCSR
Bit 14
Enable Interrupt on write
transfer count equal
zero
2) Reset FIFO flags. This may not be neces-
sary, but if the state of the FIFO flags is not
known, they should be initialized.
MCSR
Bit 26
Reset add-on to PCI
FIFO flags
MCSR
Bit 25
Reset PCI to add-on
FIFO flags
3) Define FIFO management scheme. These
bits define what FIFO condition must exist
for the PCI bus request (REQ#) to be
asserted by the S5933.
MCSR
Bit 13
PCI to add-on FIFO
management scheme
MCSR
Bit 9
Add-on to PCI FIFO
management scheme
4) Define FIFO priority scheme. These bits
determine which FIFO has priority if both
meet the defined condition to request the
PCI bus. If these bits are the same, priority
alternates, with read accesses occurring
first.
MCSR
Bit 12
Read vs. write priority
MCSR
Bit 8
Write vs. read priority
5) Define transfer source/destination ad-
dress. These registers are written with the
first address that is to be accessed by the
S5933. These address registers are updated
after each access to indicate the next
address to be accessed. Transfers must
start on DWORD boundaries.
MWAR
All Bus master write address
MRAR
All Bus master read address
6) Define transfer byte counts. These regis-
ters are written with the number of bytes to
be transferred. The transfer count does not
have to be a multiple of four bytes. These
registers are updated after each transfer to
reflect the number of bytes remaining to be
transferred.
MWTC
All Write transfer byte count
MRTC
All Read transfer byte count
7) Enable Bus Mastering. Once steps 1-6 are
completed, the FIFO may operate as a PCI
bus master. Read and write bus master
operations may be independently enabled or
disabled.
MCSR
Bit 14
Enable PCI to add-on
FIFO bus mastering
MCSR
Bit 10
Enable add-on to PCI
FIFO bus mastering
It is recommended that bus mastering be enabled as
the last step. Some applications may choose to
leave bus mastering enabled and start transfers by
writing a non-zero value to the transfer count regis-
ters. This also works, provided the entire 26-bit
transfer count is written at once. If transfer count
interrupts are enabled, they must be enabled after
the transfer count(s) are written. If interrupts are en-
abled and the transfer count is zero, an interrupt
occurs immediately.