Technobox Utilities : Technobox VxWorks Utilities
TboxVxWorksUtil [PCI] - Technobox's VxWorks PCI Utilities
TboxUtilPciAddr( ) - Specifies the PCI I/O and Memory Space Ranges
TboxUtilPciBusShow( ) - Display information for all the PCI Chips
TboxUtilPciBusConfig( ) - Configure all the Technobox Adapters on the PCI Bus
TboxUtilPciBusVerify( ) - Verify correct programming of all the PCI Chips
TboxUtilPciBusMemory( ) - Display a sorted list of memory for all the PCI Chips
TboxUtilPciBusDump( ) - Dump Configuration Space for all the PCI Chips
TboxUtilPciBridgeConfig( ) - Configure a single Bridge on the PCI Bus
TboxUtilPciDeviceMemoryShow( ) - display memory allocation for a single PCI Chip
TboxUtilPciEnableIoAccess( ) - Enables PCI I/O Access to the specified PCI Chip
TboxUtilPciEnableMemAccess( ) - Enables PCI Memory Access to the specified PCI Chip
TboxUtilPciRevision( ) - Print revision of the utilities
The TboxVxWorksUtil utilities provide functions that display PCI Bus information and assist with configuring the PCI Bus. These utilities are broken down into two groups. Those that display information about the PCI Bus and those that assist with configuring the PCI Bus.
These utilities are designed as debugging aids only. They are designed to show the configuration of devices on the PCI Bus, aid in debugging PCI Bus problems, and assist in configuring the PCI Bus. They are not intended to be a run time application. It is recommended to use the output from the utilities to configure the devices in the BSP.
Prior to compiling the utilities, the user must edit the config.h file and change the PCI address definitions and PCI configuration space access macros. You can search for TODO in the config.h file for the sections that must be updated.
The PCI Memory and I/O space starting and ending values must be updated to reflect the actual Base Card values. The utilities use these value when configuring bridge chips and BAR registers to determine valid values. The values that should be programmed are the actual beginning and ending address of the memory region. For instance if you have 0x100000 bytes of memory starting at 0x400000 (0x400000 - 0x4FFFFF) you should program 0x400000 for the starting address and 0x4FFFFF for the ending address. In addition to the address, the user can configure the cache line size and latency timers for all the chips the utilities configures.
The Configuration space macros convert the configuration calls into the functions supported by the user's BSP. Different BSP's use different names for the Configuration Space access functions. These macros allow the user to quickly convert the utilities to the user's BSP. Verify the name and order of the parameters. For Motorola and Force BSP's you should be able to choose appropriate macros.
TboxVxWorksUtil
TboxUtilPciAddr( ) - Specifies the PCI I/O and Memory Space Ranges
STATUS TboxUtilPciAddr ( UINT32 * IoAddrStart, /* returns user defined address from IOADDRSTART */ UINT32 * IoAddrEnd, /* returns user defined address from IOADDREND */ UINT32 * MemAddrStart, /* returns user defined address from MEMADDRSTART */ UINT32 * MemAddrEnd /* returns user defined address from MEMADDREND */ )
This routine allows the user to specify the PCI I/O and Memory Space Ranges of the Base Card to the Technobox Utilities. The utilities use this routine to determine the actual PCI memory ranges. Failure to correctly setup the memory #define will lead to improper use of the tools. Refer to the Base Card and BSP documentation to determine the valid PCI ranges. Technobox
OK Only.
TboxVxWorksUtil
TboxUtilPciBusShow( ) - Display information for all the PCI Chips
STATUS TboxUtilPciBusShow( void )
This function displays the following information about each Device in the system:
- The location of this PCI Chip (Bus, Device, Function)
- Vendor and Device ID
- Command, Status, Class, and Header Type Registers
- All used Base Address Registers showing the full Memory or I/O Space range or requested size
- Interrupt Settings
For Bridge Chips the following Bridge information is also displayed:
- Primary Bus, Secondary Bus, and Subordinate Bus information
- Memory, Prefetch, and I/O Windows
This function is designed as a debugging aid only. It is designed to show the configuration of devices on the PCI Bus and to aid in debugging PCI Bus problems. It is not intended to be a run time application. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
OK.
TboxVxWorksUtil
TboxUtilPciBusConfig( ) - Configure all the Technobox Adapters on the PCI Bus
STATUS TboxUtilPciBusConfig( void )
This function will allocate and program memory for all the Technobox Adapters on the PCI Bus that are requesting memory and have not been programmed yet. It determines the locations of free space and assigns the memory based on the location of the Adapter (primary bus, behind a Bridge). This function will them enable the Memory or I/O Space accesses in the command register. This function uses the Memory Start and End values specified in the TboxUtilPciAddr function.
This function has the following limitations:
- It requires that the TboxUtilPciAddr function located in config.c correctly specify the starting and ending locations in memory and be present.
- It requires that all Bridge chips be configured prior to execution and in a depth first numbering scheme (see TboxUtilPciBridgeConfig to configure Bridge chips).
- It only assigns memory to those regions which have not been assigned previously (i.e. it does not overwrite existing allocations even if they are invalid)
- It does not assign interrupt registers, the user must do this manually based on the architecture of the Base card.
- It does not increase Bridge Chip Memory Windows if it can not find space behind a Bridge
- It will use memory in another Bridge Chips window as a last resource, the output from the utility will indicate this.
- It does not assign Expansion ROM memory if there is a non zero value in the BAR.
- It automatically enables Expansion ROM and configures the FPGA on those Technobox Adapters that require Expansion ROM accesses.
This function is designed as a debugging aid only. It is designed to configure Technobox Adapters on the PCI Bus and to aid in setting up the BSP. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
This function is not intended to be a run time application. During configuration, interrupts and tasks may be locked out preventing real time operation. It is recommended that this function be used to aid in setting up the BSP package. Run this function to get possible memory regions, verify those regions are acceptable, and then use those memory regions to have the BSP package setup the device during initialization.
OK, or ERROR if could not get memory, or the Bus was not configured correctly
TboxVxWorksUtil, TboxUtilPciBusVerify, TboxUtilPciAddr
TboxUtilPciBusVerify( ) - Verify correct programming of all the PCI Chips
STATUS TboxUtilPciBusVerify( void )
This function checks the configuration of all the PCI Chips on the PCI Bus including the Bridge Chips. It checks various settings of the PCI Chips to help locate configuration problems on the PCI Bus. It checks for common problems and is not an exhaustive test. This function uses the Memory Start and End values specified in the TboxUtilPciAddr function.
This function checks for the following:
- It checks the all Bridge chips are configured and the Secondary Bus numbering is in a depth first order.
- It checks that all Bridge chips Memory Windows fall with the PCI Memory ranges.
- For Bridge chips that are not on Bus 0, it checks that all Bridge chips Memory Windows fall within the Parents Bridge Chips Memory Window.
- It checks that the memory ranges assigned to this PCI Chip fall within the PCI Memory ranges.
- For PCI Chips behind a Bridge, it checks that the memory ranges assigned to this PCI Chip fall within the Bridge Chips Memory Window.
- It checks that the memory ranges assigned to this PCI Chip do not conflict with another PCI Chip.
This function does NOT verify the following:
- That all of the Base Address Registers are programmed.
- The Interrupt Configuration
This function is designed as a debugging aid only. It is designed to enable the configuration of devices on the PCI Bus and to aid in installing PCI Devices. It is not intended to be a run time application. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
OK, or ERROR if could not get memory.
TboxVxWorksUtil, TboxUtilPciAddr
TboxUtilPciBusMemory( ) - Display a sorted list of memory for all the PCI Chips
STATUS TboxUtilPciBusMemory( void )
This function displays a sorted list of the allocated PCI Bus memory and the device that is assigned that memory.
This function is designed as a debugging aid only. It is designed to show the configuration of devices on the PCI Bus and to aid in debugging PCI Bus problems. It is not intended to be a run time application. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
OK, or ERROR if could not get memory.
TboxVxWorksUtil
TboxUtilPciBusDump( ) - Dump Configuration Space for all the PCI Chips
STATUS TboxUtilPciBusDump( void )
This function dumps the entire Configuration Space for each PCI Chip
This function is designed as a debugging aid only. It is designed to show the configuration of devices on the PCI Bus and to aid in debugging PCI Bus problems. It is not intended to be a run time application. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
OK.
TboxVxWorksUtil
TboxUtilPciBridgeConfig( ) - Configure a single Bridge on the PCI Bus
STATUS TboxUtilPciBridgeConfig( void )
This function is designed to help install Technobox Adapters that contain a PCI Bridge Chip onto a configured Base Card. For that reason this function only supports a single new PCI Bridge on the PCI Bus.
This function will scan through the PCI Bus checking for PCI Bridge Chips. It will check for any new PCI Bridge Chips, the Secondary Bus numbering, and whether this function can support the given PCI Bus configuration. This function uses the Memory Start and End values specified in the TboxUtilPciAddr function.
This function will insert a single PCI Bridge Chip. It will assign Secondary Bus numbering and assign a Memory Window to this device. If the new Bridge is behind another Bridge it will attempt to place it's Memory Window within the Parents Memory Window. It will correct the Secondary Bus numbering in a depth first scheme after the new device is added.
This function has the following limitations:
- It only handle a single new Bridge Chip on the PCI Bus.
- It does not update the Parent's Bridge Chip Memory Window if it can not fit the requested memory within the existing window. It will indicate a recommended value.
This function is designed as a debugging aid only. It is designed to configure Technobox Adapters on the PCI Bus and to aid in setting up the BSP. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
This function is not intended to be a run time application. During configuration, interrupts and tasks may be locked out preventing real time operation. It is recommended that this function be used to aid in setting up the BSP package. Run this function to get possible memory regions, verify those regions are acceptable, and then use those memory regions to have the BSP package setup the device during initialization.
OK.
TboxVxWorksUtil, TboxUtilPciAddr
TboxUtilPciDeviceMemoryShow( ) - display memory allocation for a single PCI Chip
STATUS TboxUtilPciDeviceMemoryShow ( UINT32 Bus, /* Bus Number for this PCI Chip */ UINT32 Device, /* Device Number for this PCI Chip */ UINT32 Function /* Function Number for this PCI Chip */ )
Get all the memory information about this PCI Device and print it. This includes both allocated and requested memory. If there is no memory associated with this device nothing is displayed. It is not recommended that the user call this function. Instead use the TboxUtilPciBusShow which displays more details about every device.
The Bus parameter specifies the Bus Number for this device.
The Device parameter specifies the Device Number for this device (Valid values are 0 to 31).
The Function parameter specifies the Function Number for this device (Valid values are 0 for non-multifunction devices and 0 to 7 for multifunction devices).
This function is designed as a debugging aid only. It is designed to enable the configuration of devices on the PCI Bus and to aid in installing PCI Devices. It is not intended to be a run time application. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
OK, or ERROR if the specified Device does not exist
TboxVxWorksUtil, TboxUtilPciBusShow
TboxUtilPciEnableIoAccess( ) - Enables PCI I/O Access to the specified PCI Chip
STATUS TboxUtilPciEnableIoAccess ( UINT32 Bus, /* Bus Number for this PCI Chip */ UINT32 Device, /* Device Number for this PCI Chip */ UINT32 Function /* Function Number for this PCI Chip */ )
This function simply sets the I/O Space Enable bit in the Command Register
The Bus parameter specifies the Bus Number for this PCI Chip.
The Device parameter specifies the Device Number for this PCI Chip (Valid values are 0 to 31).
The Function parameter specifies the Function Number for this PCI Chip (Valid values are 0 for non-multifunction devices and 0 to 7 for multifunction devices).
This function is designed as a debugging aid only. It is designed to enable the configuration of devices on the PCI Bus and to aid in installing PCI Devices. It is not intended to be a run time application. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
OK, or ERROR if the specified Device does not exist
TboxVxWorksUtil
TboxUtilPciEnableMemAccess( ) - Enables PCI Memory Access to the specified PCI Chip
STATUS TboxUtilPciEnableMemAccess ( UINT32 Bus, /* Bus Number for this PCI Chip */ UINT32 Device, /* Device Number for this PCI Chip */ UINT32 Function /* Function Number for this PCI Chip */ )
This function simply sets the Memory Space Enable bit in the Command Register
The Bus parameter specifies the Bus Number for this PCI Chip.
The Device parameter specifies the Device Number for this PCI Chip (Valid values are 0 to 31).
The Function parameter specifies the Function Number for this PCI Chip (Valid values are 0 for non-multifunction devices and 0 to 7 for multifunction devices).
This function is designed as a debugging aid only. It is designed to enable the configuration of devices on the PCI Bus and to aid in installing PCI Devices. It is not intended to be a run time application. This function is provided as is. While every effort has been made to ensure the accuracy of this function, Technobox does not guarantee the results.
OK, or ERROR if the specified Device does not exist
TboxVxWorksUtil
TboxUtilPciRevision( ) - Print revision of the utilities
STATUS TboxUtilPciRevision( void )
This function simply prints the revision of the utilities
TboxVxWorksUtil