
Applied Micro Circuits Corporation
6195 Lusk Blvd., San Diego, CA 92121 (619) 450-9333
15-54
S5933
PCI CONTROLLER
There are no inputs to the pci_bios_present() func-
tion.
The first output parameter, hardware_mechanism,
identifies the hardware characteristics supported by
the host computer. Bit 0 indicates if Mechanism #1 is
supported. Bit 1 indicates if Mechanism #2 is sup-
ported. Bit 4 indicates if Special Cycle is supported
via Config Mechanism #1. Bit 5 indicates if generat-
ing Special Cycle is available via Mechanism #2. The
specific mechanism is supported if the respective bit
is set (1), and reset (0) otherwise. Mechanism #1 is
used for multiple PCI buses. (See PCI LOCAL BUS
SPECIFICATION.)
The second output parameter, interface_level_version,
indicates the PCI BIOS version level. The version is
stored in Binary Coded Decimal (BCD). For example,
Version 1.35 would be stored as 0x0135. The current
version of the PCI BIOS is version 2.00, and therefore
the value 0x0200 will be returned.
The final output parameter, last_pci_bus_number, in-
dicates the bus number of the last PCI bus on the
system. The first bus on the system will have a
bus_number of 0, the second a bus_number of 1, etc.
find_pci_device
The purpose of the find_pci_device function is to de-
termine the existence and physical location of a spe-
cific device, given a specific Vendor ID and Device
ID. A C-language prototype for this function is:
int find_pci_device(word device_id,
word vendor_id,
word index,
byte *bus_number,
byte *device_and_function)
The return code from this function indicates whether
the device was found, indicated by the return value of
SUCCESSFUL. The function may also return the
value DEVICE_NOT_FOUND, indicating that the
specific device was not found. If the value
BAD_VENDOR_ID is returned, a vendor ID of 0xffff
was specified, which is invalid. Finally, a return value
of NOT_SUCCESSFUL indicates a PCI BIOS error
has occurred.
The first input parameter, device_id, is a number in
the range 0 to 65535 indicating the specific device ID
the program is to locate. This number is allocated by
the vendor, indicating a specific device in the
vendor’s product line.
The second input parameter, vendor_id, is a number
in the range 0 to 65534 indicating the manufacturer
of the device. Vendor IDs are allocated by the PCI
SIG to ensure uniqueness. The value 0xffff is an in-
valid ID for the Vendor ID.
The final input parameter, index, is a number in the
range 0 to N indicating which device is to be found.
For example, if there are two devices with the same
Device and Vendor IDs, an index value of zero would
locate the first device and an index value of one
would locate the second value. An index value of two
would return a code of DEVICE_NOT_FOUND.
The first output parameter, bus_number, is a number
in the range 0 to 255 indicating which PCI bus the
device is located on.
The second output parameter, device_and_function,
indicates the Device Number in the upper 5 bits and
the Function Number in the lower 3 bits.
The bus_number and device_and_function values re-
turned from this function must be used to access the
PCI device via the PCI BIOS function calls.
find_pci_class_code
The purpose of the find_pci_class_code function is to
determine the existence and physical location of a
specific device, given a specific Class Code. A C-
language prototype for this function is:
int find_pci_class_code(dword class_code,
word index,
byte *bus_number,
byte *device_and_function)
The return code from this function indicates whether
the device was found, indicated by the return value of
SUCCESSFUL. The function may also return the
value DEVICE_NOT_FOUND, indicating that the
specific device was not found. Finally, a return value
of NOT_SUCCESSFUL indicates a PCI BIOS error
has occurred.
The first input parameter, class_code, is a number 0-
4095, which is divided into three bytes. The first byte
specifies the base class, which broadly defines the
type of function of the device. The second byte speci-
fies the sub-class code, which more specifically de-
fines the function of the device. Finally, the third byte
indicates which register-level programming (if any) is
supported by the device. The base class codes are
indicated in Section 3.6 of this manual.