
Applied Micro Circuits Corporation
6195 Lusk Blvd., San Diego, CA 92121 (619) 450-9333
15-59
PCI CONTROLLER
S5933
S5933 PCI Controller Special Features
The S5933 PCI Controller contains a number of spe-
cial features to assist the PCI device developer.
These features include mailboxes, FIFO (First-In-
First-Out) under program control, and FIFO under
bus master control. These features are accessed via
the Operation Registers. By default, the Operation
Registers are mapped in I/O space. The base ad-
dress of the Operation Registers may be determined
as described in the Obtaining Base Addresses sec-
tion.
I/O space can be accessed via the Borland C/C++
functions outp(), inp(), outpw() and inpw() for byte
and word access respectively. Unfortunately, Borland
C/C++ does not have double-word I/O functions;
therefore, the following C functions are contained in
the AMCC PCI Library: inpd() and outpd(). The C-
language prototypes for these functions are:
void outpd(word port, dword value);
dword inpd(word port);
The first input parameter to both of these functions,
port, is the hardware port to be read/written. The
outpd() function has an additional parameter that is
the double-word value to be written to the hardware
port. The inpd() function will return the double-word
value read from the hardware port.
The offsets of each of the Operation Registers are
shown in the table below:
Incoming/Outgoing Mailbox Registers
The Incoming/Outgoing mailbox registers provide a
method for sending command or parameter data to/
from the PCI device. The Outgoing Mailbox Registers
are double-word registers that may be used for send-
ing a command and parameters to the device. The
Incoming Mailbox Registers are read-only registers
that may be used to return limited data back to the
host computer. An AMCC-suggested command to
make use of the Incoming/Outgoing Mailbox Regis-
ters would be a command to return a Company and
device name. This could be used to ensure that the
Vendor ID/Device ID combination is truly the ex-
pected device.
The status of each of the Incoming/Outgoing Mailbox
Registers may be determined by examining the Mail-
box Empty-Full Status register (MBEF). Each nibble
(4 bits) indicates the status of each byte of each In-
coming/Outgoing Mailbox Register. A bit set in the
Incoming Mailbox Register Status register indicates
that a byte has been sent from the PCI device that
has not yet been read. A bit set in the Outgoing Mail-
box Register Status Register indicates that a byte
has been sent and the PCI device has not yet read
that byte. The following table indicates the status bits
corresponding to each Incoming/Outgoing Mailbox
Register.
MBEF
Bits
Description
0-3
Outgoing Mailbox #1
4-7
Outgoing Mailbox #2
8-11
Outgoing Mailbox #3
12-15
Outgoing Mailbox #4
16-19
Incoming Mailbox #1
20-23
Incoming Mailbox #2
24-27
Incoming Mailbox #3
28-31
Incoming Mailbox #4
Each bit within each nibble indicates the status of the
corresponding byte of the Incoming/Outgoing Mailbox
Register (Bit 0=Byte 0, Bit 1=Byte 1, Bit 2=Byte 2, Bit
3=Byte 3).
Code Segment 5 demonstrates sending a command
to a PCI device and waiting for the response via poll-
ing.
Offset
Abbreviation
Register Name
00h
OMB1
Outgoing Mailbox Register #1
04h
OMB2
Outgoing Mailbox Register #2
08h
OMB3
Outgoing Mailbox Register #3
0ch
OMB4
Outgoing Mailbox Register #4
10h
IMB1
Incoming Mailbox Register #1
14h
IMB2
Incoming Mailbox Register #2
18h
IMB3
Incoming Mailbox Register #3
1Ch
IMB4
Incoming Mailbox Register #4
20h
FIFO
Bidirectional FIFO Register
24h
MWAR
Master Write Address Register
28h
MWTC
Master Write Transfer Count
2ch
MRAR
Master Read Address Register
30h
MRTC
Master Read Transfer Count Register
34h
MBEF
Mailbox Empty/Full Status Register
38h
INTCSR
Interrupt Control/Status Register
3Ch
MCSR
Bus Master Control/Status Register