![]() |
RZN Flexible Software Package Documentation
Release v3.0.0
|
|
Interface for PCI communications.
The PCI interface provides common APIs for PCI HAL drivers. The PCI interface supports the following features:
Data Structures | |
| struct | pci_configuration_register_init_t |
| struct | pci_configuration_register_transfer_t |
| struct | pci_io_register_transfer_t |
| struct | pci_status_t |
| struct | pci_callback_args_t |
| struct | pci_cfg_t |
| struct | pci_api_t |
| struct | pci_instance_t |
Typedefs | |
| typedef void | pci_ctrl_t |
Enumerations | |
| enum | pci_event_t |
| enum | pci_configuration_write_type_t |
| enum | pci_configuration_read_type_t |
| enum | pci_link_speed_t |
| enum | pci_ltssm_state_t |
| struct pci_configuration_register_init_t |
| struct pci_configuration_register_transfer_t |
Structure to define a CfgRd/CfgWr request transfer.
| struct pci_io_register_transfer_t |
| struct pci_message_transfer_t |
Structure to define a PCI Express Msg/MsgD request transfer.
| Data Fields | ||
|---|---|---|
| union pci_message_transfer_t | __unnamed__ | |
| union pci_message_transfer_t | __unnamed__ | |
| uint32_t | header_3rd | Message 3rd header. |
| uint32_t | header_4th | Message 4th header. |
| uint32_t | data | Message data for MsgD request. |
| struct pci_status_t |
PCI Express status
| Data Fields | ||
|---|---|---|
| bool | is_link_up | Current link up state. |
| pci_ltssm_state_t | ltssm_state | Current LTSSM state. |
| struct pci_callback_args_t |
Common callback parameter definition
| Data Fields | ||
|---|---|---|
| pci_event_t | event | Event code. |
| uint32_t | dma_channel | Channel of DMA (valid only for DMA-related events) |
| uint32_t | data1 | Data when event interrupt occurred. |
| uint32_t | data2 | Data when event interrupt occurred. |
| uint32_t | data3 | Data when event interrupt occurred. |
| void const * | p_context | Context provided to user during callback. |
| struct pci_cfg_t |
User configuration structure, used in open function
Data Fields | |
| uint8_t | channel |
| Channel number to be used. | |
| uint8_t | function |
| PCI function number to be used. | |
| void const * | p_configuration_register_header |
| PCI configuration register. | |
| pci_configuration_register_init_t const * | p_configuration_register_init_list |
| uint32_t | configuration_register_init_list_length |
| Length of configuration register list initialized in pci_api_t::open. | |
| IRQn_Type | inta_irq |
| INTA interrupt number. | |
| uint8_t | inta_ipl |
| INTA interrupt priority. | |
| IRQn_Type | intb_irq |
| INTB interrupt number. | |
| uint8_t | intb_ipl |
| INTB interrupt priority. | |
| IRQn_Type | intc_irq |
| INTC interrupt number. | |
| uint8_t | intc_ipl |
| INTC interrupt priority. | |
| IRQn_Type | intd_irq |
| INTD interrupt number. | |
| uint8_t | intd_ipl |
| INTD interrupt priority. | |
| IRQn_Type | msi_irq |
| MSI interrupt number. | |
| uint8_t | msi_ipl |
| MSI interrupt priority. | |
| void const * | p_context |
| User defined context passed to callback function. | |
| void const * | p_extend |
| Extended PCI hardware dependent configuration. | |
| void(* | p_callback )(pci_callback_args_t *p_args) |
| pci_configuration_register_init_t const* pci_cfg_t::p_configuration_register_init_list |
List of configuration registers initialized in pci_api_t::open.
| void(* pci_cfg_t::p_callback) (pci_callback_args_t *p_args) |
Callback provided when a PCI ISR occurs. Set to NULL for no CPU interrupt.
| struct pci_api_t |
PCI driver structure. General PCI functions implemented at the HAL layer will follow this API.
| fsp_err_t(* pci_api_t::open) (pci_ctrl_t *const p_ctrl, pci_cfg_t const *const p_cfg) |
Open function for PCI device.
| [in,out] | p_ctrl | Pointer to the PCI control block. Must be declared by user. Value set here. |
| [in] | p_cfg | Pointer to PCI configuration structure. All elements of this structure must be set by user. |
| fsp_err_t(* pci_api_t::selfConfigurationRegisterGet) (pci_ctrl_t *const p_ctrl, uint32_t register_number, uint32_t *p_data) |
Get the self PCI configuration register value.
| [in,out] | p_ctrl | Pointer to the PCI control block. |
| [in] | register_number | Register number of the configuration register. |
| [out] | p_data | Memory address to return data. |
| fsp_err_t(* pci_api_t::selfConfigurationRegisterSet) (pci_ctrl_t *const p_ctrl, uint32_t register_number, uint32_t data) |
Set the self PCI configuration register value.
| [in,out] | p_ctrl | Pointer to the PCI control block. |
| [in] | register_number | Register number of the configuration register. |
| [in] | data | Value to set. |
| fsp_err_t(* pci_api_t::configurationRegisterWrite) (pci_ctrl_t *const p_ctrl, pci_configuration_write_type_t transaction_type, pci_configuration_register_transfer_t *const p_transfer) |
Issue Configuration Write Type 0/1 Request (CfgWr 0/1).
| [in] | p_ctrl | Pointer to the PCI control block. |
| [in] | transaction_type | Whether issue CfgWr0 or CfgWr1 |
| [in] | p_transfer | Pointer for data to send. |
| fsp_err_t(* pci_api_t::configurationRegisterRead) (pci_ctrl_t *const p_ctrl, pci_configuration_read_type_t transaction_type, pci_configuration_register_transfer_t *const p_transfer) |
Issue Configuration Read Type 0/1 Request (CfgRd 0/1).
| [in] | p_ctrl | Pointer to the PCI control block. |
| [in] | transaction_type | Whether issue CfgRd0 or CfgRd1 |
| [in] | p_transfer | Pointer for store receive data. |
| fsp_err_t(* pci_api_t::iORegisterWrite) (pci_ctrl_t *const p_ctrl, pci_io_register_transfer_t *const p_transfer) |
Issue I/O Write Request (IOWr).
| [in] | p_ctrl | Pointer to the PCI control block. |
| [in] | p_transfer | Pointer for data to send. |
| fsp_err_t(* pci_api_t::iORegisterRead) (pci_ctrl_t *const p_ctrl, pci_io_register_transfer_t *const p_transfer) |
Issue I/O Read Request (IORd).
| [in] | p_ctrl | Pointer to the PCI control block. |
| [in] | p_transfer | Pointer for store receive I/O data. |
| fsp_err_t(* pci_api_t::messageWrite) (pci_ctrl_t *const p_ctrl, pci_message_transfer_t *const p_transfer, bool with_data) |
PCI Express issue Message Request (Msg) / Message Request with data payload (MsgD).
| [in] | p_ctrl | Pointer to the PCI control block. |
| [in] | p_transfer | Pointer for message data to send. |
| [in] | with_data | Weather issue Meg or MsgD request. |
| fsp_err_t(* pci_api_t::messageRead) (pci_ctrl_t *const p_ctrl, pci_message_transfer_t *const p_transfer) |
PCI Express read Message Request.
| [in] | p_ctrl | Pointer to the PCI control block. |
| [in] | p_transfer | Pointer for store receive message data. |
| fsp_err_t(* pci_api_t::intxAssert) (pci_ctrl_t *const p_ctrl) |
Assert INTx interrupt.
| [in] | p_ctrl | Pointer to the PCI control block. |
| fsp_err_t(* pci_api_t::intxDeassert) (pci_ctrl_t *const p_ctrl) |
Deassert INTx interrupt.
| [in] | p_ctrl | Pointer to the PCI control block. |
| fsp_err_t(* pci_api_t::linkStatusGet) (pci_ctrl_t *const p_ctrl, pci_status_t *const p_status) |
Get PCI Express link information.
| [in,out] | p_ctrl | Pointer to the PCI control block. |
| [out] | p_status | Memory address to return data. |
| fsp_err_t(* pci_api_t::linkWidthChange) (pci_ctrl_t *const p_ctrl, uint32_t link_width, uint32_t option) |
PCI Express link width change.
| [in] | p_ctrl | Pointer to the PCI control block. |
| [in] | link_width | Link width to change. |
| [in] | option | Option when link width to change. |
| fsp_err_t(* pci_api_t::linkSpeedChange) (pci_ctrl_t *const p_ctrl, pci_link_speed_t link_speed, uint32_t option) |
PCI Express link speed change.
| [in] | p_ctrl | Pointer to the PCI control block. |
| [in] | link_speed | Link speed to change. |
| [in] | option | Option when link speed to change. |
| fsp_err_t(* pci_api_t::linkEqualizationRequest) (pci_ctrl_t *const p_ctrl) |
PCI Express send link equalization.
| [in] | p_ctrl | Pointer to the PCI control block. |
| fsp_err_t(* pci_api_t::callbackSet) (pci_ctrl_t *const p_ctrl, void(*p_callback)(pci_callback_args_t *), void const *const p_context, pci_callback_args_t *const p_callback_memory) |
Specify callback function and optional context pointer and working memory pointer.
| [in] | p_ctrl | Control block set in pci_api_t::open call. |
| [in] | p_callback | Callback function to register |
| [in] | p_context | Pointer to send to callback function |
| [in] | p_working_memory | Pointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback. |
| fsp_err_t(* pci_api_t::close) (pci_ctrl_t *const p_ctrl) |
Close function for PCI device.
| [in] | p_ctrl | Pointer to the PCI control block. |
| struct pci_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
| Data Fields | ||
|---|---|---|
| pci_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
| pci_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
| pci_api_t const * | p_api | Pointer to the API structure for this instance. |
| typedef void pci_ctrl_t |
PCI control block. Allocate an instance specific control block to pass into the PCI API calls.
| enum pci_event_t |
PCI events.
| enum pci_link_speed_t |
| enum pci_ltssm_state_t |
PCI Express LTSSM state.