
3 Porting a BSP to Custom Hardware
3.3 Finalizing Your BSP
79
3
In addition, PCI support requires routines for low-level reads and writes to the PCI
configuration space. These routines are referenced from the PCI configuration files
through macros. The required macros are:
Typically, these macros refer to the following routines:
In addition to the PCI configuration space manipulation, you may also want to
provide routines to access device registers in PCI memory or I/O space, and do
appropriate byte swapping. For example, you may choose to include the following
routines:
The use of such routines makes it easier for variants of the BSP to support both big-
and little-endian configurations.
PCI_IN_BYTE read a byte from PCI I/O space
PCI_IN_WORD read a word from PCI I/O space
PCI_IN_LONG read a longword from PCI I/O space
PCI_OUT_BYTE write a byte from PCI I/O space
PCI_OUT_WORD write a word from PCI I/O space
PCI_OUT_LONG write a longword from PCI I/O space
sysPciInByte( ) reads a byte from PCI configuration space
sysPciInWord( ) reads a word (16-bit) from PCI configuration space
sysPciInLong( ) reads a long (32-bit) from PCI configuration space
sysPciOutByte( ) writes a byte to PCI configuration space
sysPciOutWord( ) writes a word (16-bit) to PCI configuration space
sysPciOutLong( ) writes a long (32-bit) to PCI configuration space
NOTE: Each of these routines returns the data in the same format used by the
processor. Because PCI is defined as little-endian, BSPs for processors that are big
endian must do byte-swapping in these sysPci*() routines.
sysPciRead32( ) read 32-bit PCI (I/O or memory) data
sysPciWrite32( ) write a 32-bit data item to PCI space
sysPciRead16( ) read 16-bit PCI (I/O or memory) data
sysPciWrite16( ) write a 16-bit data item to PCI space
Comentarios a estos manuales