|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Interfaces for PCIe Controllers. More...
Topics | |
| PCIe Controller Driver Backend API | |
Data Structures | |
| struct | pcie_ctrl_config |
| Structure describing a device that supports the PCI Express Controller API. More... | |
Macros | |
| #define | PCIE_RANGE_FORMAT(node_id, idx) |
Functions | |
| static uint32_t | pcie_ctrl_conf_read (const struct device *dev, pcie_bdf_t bdf, unsigned int reg) |
| Read a 32-bit word from an endpoint's configuration space. | |
| static void | pcie_ctrl_conf_write (const struct device *dev, pcie_bdf_t bdf, unsigned int reg, uint32_t data) |
| Write a 32-bit word to an endpoint's configuration space. | |
| static bool | pcie_ctrl_region_allocate (const struct device *dev, pcie_bdf_t bdf, bool mem, bool mem64, size_t bar_size, uintptr_t *bar_bus_addr) |
| Allocate a memory region subset for an endpoint Base Address Register. | |
| static bool | pcie_ctrl_region_get_allocate_base (const struct device *dev, pcie_bdf_t bdf, bool mem, bool mem64, size_t align, uintptr_t *bar_base_addr) |
| Function called to get the current allocation base of a memory region subset for an endpoint Base Address Register. | |
| static bool | pcie_ctrl_region_translate (const struct device *dev, pcie_bdf_t bdf, bool mem, bool mem64, uintptr_t bar_bus_addr, uintptr_t *bar_addr) |
| Translate an endpoint Base Address Register bus-centric address into Physical address. | |
| static uint8_t | pcie_ctrl_msi_device_setup (const struct device *dev, unsigned int priority, msi_vector_t *vectors, uint8_t n_vector) |
| Configure the given PCI endpoint to generate MSIs. | |
Interfaces for PCIe Controllers.
| #define PCIE_RANGE_FORMAT | ( | node_id, | |
| idx ) |
#include <zephyr/drivers/pcie/controller.h>
|
inlinestatic |
#include <zephyr/drivers/pcie/controller.h>
Read a 32-bit word from an endpoint's configuration space.
Read a 32-bit word from an endpoint's configuration space with the PCI Express Controller configuration space access method (I/O port, memory mapped or custom method)
| dev | PCI Express Controller device pointer |
| bdf | PCI(e) endpoint |
| reg | the configuration word index (not address) |
|
inlinestatic |
#include <zephyr/drivers/pcie/controller.h>
Write a 32-bit word to an endpoint's configuration space.
Write a 32-bit word to an endpoint's configuration space with the PCI Express Controller configuration space access method (I/O port, memory mapped or custom method)
| dev | PCI Express Controller device pointer |
| bdf | PCI(e) endpoint |
| reg | the configuration word index (not address) |
| data | the value to write |
|
inlinestatic |
#include <zephyr/drivers/pcie/controller.h>
Configure the given PCI endpoint to generate MSIs.
CONFIG_PCIE_MSI.| dev | PCI Express Controller device pointer |
| priority | MSI priority |
| vectors | an array of allocated vector(s) |
| n_vector | the size of the vector array |
|
inlinestatic |
#include <zephyr/drivers/pcie/controller.h>
Allocate a memory region subset for an endpoint Base Address Register.
When enumerating PCIe Endpoints, Type0 endpoints can require up to 6 memory zones via the Base Address Registers from I/O or Memory types.
This call allocates such zone in the PCI Express Controller memory regions if such region is available and space is still available.
| dev | PCI Express Controller device pointer |
| bdf | PCI(e) endpoint |
| mem | True if the BAR is of memory type |
| mem64 | True if the BAR is of 64bit memory type |
| bar_size | Size in bytes of the Base Address Register as returned by HW |
| bar_bus_addr | bus-centric address allocated to be written in the BAR register |
|
inlinestatic |
#include <zephyr/drivers/pcie/controller.h>
Function called to get the current allocation base of a memory region subset for an endpoint Base Address Register.
When enumerating PCIe Endpoints, Type1 bridge endpoints requires a range of memory allocated by all endpoints in the bridged bus.
| dev | PCI Express Controller device pointer |
| bdf | PCI(e) endpoint |
| mem | True if the BAR is of memory type |
| mem64 | True if the BAR is of 64bit memory type |
| align | size to take in account for alignment |
| bar_base_addr | bus-centric address allocation base |
|
inlinestatic |
#include <zephyr/drivers/pcie/controller.h>
Translate an endpoint Base Address Register bus-centric address into Physical address.
When enumerating PCIe Endpoints, Type0 endpoints can require up to 6 memory zones via the Base Address Registers from I/O or Memory types.
The bus-centric address set in this BAR register is not necessarily accessible from the CPU, thus must be translated by using the PCI Express Controller memory regions translation ranges to permit mapping from the CPU.
| dev | PCI Express Controller device pointer |
| bdf | PCI(e) endpoint |
| mem | True if the BAR is of memory type |
| mem64 | True if the BAR is of 64bit memory type |
| bar_bus_addr | bus-centric address written in the BAR register |
| bar_addr | CPU-centric address translated from the bus-centric address |