DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
TOC PREV NEXT INDEX

PCI Bus Bindings

2

Some of the UDI services interfaces defined in the UDI Physical I/O Specification require bus binding information to appropriately use the interface and set parameter values. This chapter specifies the bus bindings for the PCI bus.

2.1 PIO Bindings

2.1.1 udi_pio_map

The following regset_idx values are defined for PCI:

#define  UDI_PCI_CONFIG_SPACE				255
 
#define  UDI_PCI_BAR_0				0
 
#define  UDI_PCI_BAR_1				1
 
#define  UDI_PCI_BAR_2				2
 
#define  UDI_PCI_BAR_3				3
 
#define  UDI_PCI_BAR_4				4
 
#define  UDI_PCI_BAR_5				5
 

Any 64-bit BARs must be accessed by the lowest of the two BAR numbers used to hold the 64-bit value.

Any other values passed to udi_pio_map in the regset_idx argument are illegal.

2.2 Interrupt Bindings

2.2.1 Interrupt Index Values

Since PCI allows only one interrupt pin per PCI function, only one interrupt_idx value, zero, is used for PCI devices.

2.2.2 Event Info

There is no event info for PCI bus interrupts. Event info size must always be zero.

2.3 Instance Attribute Bindings

2.3.1 Enumeration Attributes

The following enumeration attributes are defined for PCI devices. All numeric attributes are stored as UDI_ATTR_UBIT32 type attributes, which are automatically converted to/from each driver's endianness. Since PCI configuration space values are little-endian, the bus bridge driver must combine individual bytes into a numeric value (e.g. "attr_value = lo_byte + (hi_byte << 8)"), or store the little-endian values directly in attr_value of the udi_instance_attr_list_t rather than using UDI_ATTR32_SET().
Table 2-1 PCI Enumeration Attributes
ATTRIBUTE NAME TYPE SIZE Description
bus_type
UDI_ATTR_STRING
4
"pci"
pci_vendor_id
UDI_ATTR_UBIT32
4
16-bit numeric PCI Vendor ID
pci_device_id
UDI_ATTR_UBIT32
4
16-bit numeric PCI Device ID
pci_revision_id
UDI_ATTR_UBIT32
4
8-bit numeric PCI Revision ID
pci_baseclass
UDI_ATTR_UBIT32
4
8-bit numeric PCI Base Class Code
pci_sub_class
UDI_ATTR_UBIT32
4
8-bit numeric PCI Sub-Class Code
pci_prog_if
UDI_ATTR_UBIT32
4
8-bit numeric PCI Programming Interface
pci_subsystem_vendor_id
UDI_ATTR_UBIT32
4
16-bit numeric PCI Subsystem Vendor ID
pci_subsystem_id
UDI_ATTR_UBIT32
4
16-bit numeric PCI Subsystem ID
pci_unit_address
UDI_ATTR_UBIT32
4
low-order 3 bits: PCI Function Numbernext 5 bits: PCI Device Numbernext 8 bits: PCI Bus Number
pci_slot
UDI_ATTR_UBIT32
4
8-bit physical slot number, if known

2.3.2 Filter Attributes

Of the above listed enumeration attributes, the following are valid filter attributes for enumeration filtering. For both of these, stride is interpreted linearly; that is, the stride value is simply added to the numeric value of these attributes.


pci_unit_address
pci_slot

2.3.3 Generic Enumeration Attributes

2.3.3.1 identifier attribute

For PCI devices, the "identifier" attribute encodes a combination of the pci_vendor_id, pci_device_id, pci_revision_id, pci_subsystem_vendor_id, and pci_subsystem_id attributes, as follows:


identifier = VVVVDDDDRRvvvvdddd

where VVVV is a four-digit upper-case hexidecimal-encoded ASCII representation of the PCI Vendor ID, DDDD is a four-digit upper-case hexidecimal-encoded ASCII representation of the PCI Device ID, RR is a two-digit upper-case hexidecimal-encoded ASCII representation of the PCI Revision ID, vvvv is a four-digit upper-case hexidecimal-encoded ASCII representation of the PCI Subsystem Vendor ID, and dddd is a four-digit upper-case hexidecimal-encoded ASCII representation of the PCI Subsystem ID.

2.3.3.2 address_locator attribute

For PCI devices, the "address_locator" attribute encodes the pci_unit_address attribute using the following syntax:


address_locator = BBDDF

where BB is a two-digit upper-case hexidecimal-encoded ASCII representation of the PCI Bus Number, DD is a two-digit upper-case hexidecimal-encoded ASCII representation of the PCI Device Number, and F is a one-digit upper-case hexidecimal-encoded ASCII representation of the PCI Function Number.

2.3.3.3 physical_locator attribute

For PCI devices, the "physical_locator" attribute encodes the pci_slot attribute using the following syntax:


physical_locator = SS

where SS is a two-digit upper-case hexidecimal-encoded ASCII representation of the physical slot number, if known. The physical_locator attribute is present if and only if pci_slot is provided for this device.

2.3.3.4 physical_label attribute

No "physical_label" attribute is defined generically for PCI. Platforms that have access to such information may set physical_label attributes.

2.3.4 Enumeration Attribute Ranking

To support the ranking of enumerated devices against available drivers for the udi_mei_enumerate_rank_func_t, the following combinations of enumeration attribute matches yield the corresponding ranking values. Attribute combinations not specified return a relative rank of 0 (the lowest possible rank). The combinations are unchanged by matches against non-rankable attributes.
Table 2-2 PCI Enumeration Attribute Ranking

Rank Value
Rankable Attributes1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
identifier













Y
pci_subsystem_id











Y Y
pci_revision_id








Y
Y
Y
pci_device_id







Y Y Y Y


pci_subsystem_vendor_id




Y Y Y

Y Y Y Y
pci_vendor_id

Y Y Y


Y Y




pci_sub_class
Y

Y

Y






pci_baseclass Y Y
Y Y
Y Y






1Y indicates a valid match of the attribute. Only the attributes listed are rankable; all other enumeration attributes have no effect on the ranking value.

2.3.5 Parent-Visible Attributes

No parent-visible attributes are defined for PCI bus bridge drivers.


TOC PREV NEXT INDEX