
Applied Micro Circuits Corporation
6195 Lusk Blvd., San Diego, CA 92121 (619) 450-9333
15-19
BUS MASTERING WITH THE S5933 PCI MATCHMAKER
5.2
Servicing a PCI Initiated DMA
Transfer Interrupt
If interrupts are enabled, a host interrupt service rou-
tine is also required. The service routine determines
the source of the interrupt and resets the interrupt.
The source of the interrupt is indicated in the PCI
Interrupt Control/Status Register (INTCSR). Typi-
cally, the interrupt service routine is used to set up
the next transfer by writing a new address and trans-
fer count value, but some applications may also re-
quire other actions. If read transfer or write transfer
complete interrupts are enabled, master and target
abort interrupts are automatically enabled. Writing a
one to these bits clears the corresponding interrupt.
INTCSR
Bit 21
Target abort caused
interrupt
INTCSR
Bit 20
Master abort caused
interrupt
INTCSR
Bit 19
Read transfer complete
caused interrupt
INTCSR
Bit 18
Write transfer complete
caused interrupt
5.3
Add-on Initiated DMA Transfers
For add-on initiated DMA transfers, the add-on sets
up the S5933 to perform bus master transfers. The
following tasks must be completed to setup FIFO
bus mastering:
1) Define transfer count abilities. For add-on
initiated bus mastering, transfer counts may
be either enabled or disabled. Transfer
counts for read and write operations cannot
be individually enabled.
AGCSTS
Bit 28
Enable transfer count for
read and write bus
master transfers
2) Define interrupt capabilities. The PCI to
add-on and/or add-on to PCI FIFO can
generate an interrupt to the add-on when
the transfer count reaches zero (if transfer
counts are enabled).
AINT
Bit 15
Enable interrupt on read
transfer count equal zero
AINT
Bit 14
Enable interrupt on write
transfer count equal zero
3) Reset FIFO flags. This may not be neces-
sary, but if the state of the FIFO flags is not
known, they should be initialized.
AGCSTS
Bit 26
Reset add-on to PCI
FIFO flags
AGCSTS
Bit 25
Reset PCI to add-on
FIFO flags
4) Define FIFO management scheme. These
bits define what FIFO condition must exist
for the PCI bus request (REQ#) to be
asserted by the S5933. This must be pro-
grammed through the PCI interface.
MCSR Bit 13
PCI to add-on FIFO
management scheme
MCSR Bit 9
Add-on to PCI FIFO
management scheme
5) 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. This must be programmed through the
PCI interface.
MCSR Bit 12
Read vs. write priority
MCSR Bit 8
Write vs. read priority
6) Define transfer source/destination
address. 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
7) 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. If transfer counts are disabled,
these registers do not need to be pro-
grammed.
MWTC
All Write transfer byte count
MRTC
All Read transfer byte count