Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
PCIe Host MSI Interface. More...
Data Structures | |
struct | msix_vector |
struct | msi_vector |
Macros | |
#define | PCIE_MSI_MCR 0U |
#define | PCIE_MSI_MCR_EN 0x00010000U /* enable MSI */ |
#define | PCIE_MSI_MCR_MMC 0x000E0000U /* Multi Messages Capable mask */ |
#define | PCIE_MSI_MCR_MMC_SHIFT 17 |
#define | PCIE_MSI_MCR_MME 0x00700000U /* mask of # of enabled IRQs */ |
#define | PCIE_MSI_MCR_MME_SHIFT 20 |
#define | PCIE_MSI_MCR_64 0x00800000U /* 64-bit MSI */ |
#define | PCIE_MSI_MAP0 1U |
#define | PCIE_MSI_MAP1_64 2U |
#define | PCIE_MSI_MDR_32 2U |
#define | PCIE_MSI_MDR_64 3U |
#define | PCIE_MSIX_MCR 0U |
#define | PCIE_MSIX_MCR_EN 0x80000000U /* Enable MSI-X */ |
#define | PCIE_MSIX_MCR_FMASK 0x40000000U /* Function Mask */ |
#define | PCIE_MSIX_MCR_TSIZE 0x07FF0000U /* Table size mask */ |
#define | PCIE_MSIX_MCR_TSIZE_SHIFT 16 |
#define | PCIE_MSIR_TABLE_ENTRY_SIZE 16 |
#define | PCIE_MSIX_TR 1U |
#define | PCIE_MSIX_TR_BIR 0x00000007U /* Table BIR mask */ |
#define | PCIE_MSIX_TR_OFFSET 0xFFFFFFF8U /* Offset mask */ |
#define | PCIE_MSIX_PBA 2U |
#define | PCIE_MSIX_PBA_BIR 0x00000007U /* PBA BIR mask */ |
#define | PCIE_MSIX_PBA_OFFSET 0xFFFFFFF8U /* Offset mask */ |
#define | PCIE_VTBL_MA 0U /* Msg Address offset */ |
#define | PCIE_VTBL_MUA 4U /* Msg Upper Address offset */ |
#define | PCIE_VTBL_MD 8U /* Msg Data offset */ |
#define | PCIE_VTBL_VCTRL 12U /* Vector control offset */ |
Typedefs | |
typedef struct msi_vector | msi_vector_t |
Functions | |
uint32_t | pcie_msi_map (unsigned int irq, msi_vector_t *vector, uint8_t n_vector) |
Compute the target address for an MSI posted write. | |
uint16_t | pcie_msi_mdr (unsigned int irq, msi_vector_t *vector) |
Compute the data for an MSI posted write. | |
bool | pcie_msi_enable (pcie_bdf_t bdf, msi_vector_t *vectors, uint8_t n_vector, unsigned int irq) |
Configure the given PCI endpoint to generate MSIs. | |
bool | pcie_is_msi (pcie_bdf_t bdf) |
Check if the given PCI endpoint supports MSI/MSI-X. | |
PCIe Host MSI Interface.
#define PCIE_MSI_MAP0 1U |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MAP1_64 2U |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MCR 0U |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MCR_64 0x00800000U /* 64-bit MSI */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MCR_EN 0x00010000U /* enable MSI */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MCR_MMC 0x000E0000U /* Multi Messages Capable mask */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MCR_MMC_SHIFT 17 |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MCR_MME 0x00700000U /* mask of # of enabled IRQs */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MCR_MME_SHIFT 20 |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MDR_32 2U |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSI_MDR_64 3U |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIR_TABLE_ENTRY_SIZE 16 |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_MCR 0U |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_MCR_EN 0x80000000U /* Enable MSI-X */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_MCR_FMASK 0x40000000U /* Function Mask */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_MCR_TSIZE 0x07FF0000U /* Table size mask */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_MCR_TSIZE_SHIFT 16 |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_PBA 2U |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_PBA_BIR 0x00000007U /* PBA BIR mask */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_PBA_OFFSET 0xFFFFFFF8U /* Offset mask */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_TR 1U |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_TR_BIR 0x00000007U /* Table BIR mask */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_MSIX_TR_OFFSET 0xFFFFFFF8U /* Offset mask */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_VTBL_MA 0U /* Msg Address offset */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_VTBL_MD 8U /* Msg Data offset */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_VTBL_MUA 4U /* Msg Upper Address offset */ |
#include <zephyr/drivers/pcie/msi.h>
#define PCIE_VTBL_VCTRL 12U /* Vector control offset */ |
#include <zephyr/drivers/pcie/msi.h>
typedef struct msi_vector msi_vector_t |
#include <zephyr/drivers/pcie/msi.h>
bool pcie_is_msi | ( | pcie_bdf_t | bdf | ) |
#include <zephyr/drivers/pcie/msi.h>
Check if the given PCI endpoint supports MSI/MSI-X.
bdf | the target PCI endpoint |
bool pcie_msi_enable | ( | pcie_bdf_t | bdf, |
msi_vector_t * | vectors, | ||
uint8_t | n_vector, | ||
unsigned int | irq | ||
) |
#include <zephyr/drivers/pcie/msi.h>
Configure the given PCI endpoint to generate MSIs.
bdf | the target PCI endpoint |
vectors | an array of allocated vector(s) |
n_vector | the size of the vector array |
irq | The IRQ we wish to trigger via MSI. |
uint32_t pcie_msi_map | ( | unsigned int | irq, |
msi_vector_t * | vector, | ||
uint8_t | n_vector | ||
) |
#include <zephyr/drivers/pcie/msi.h>
Compute the target address for an MSI posted write.
This function is exported by the arch, board or SoC code.
irq | The IRQ we wish to trigger via MSI. |
vector | The vector for which you want the address (or NULL) |
n_vector | the size of the vector array |
uint16_t pcie_msi_mdr | ( | unsigned int | irq, |
msi_vector_t * | vector | ||
) |
#include <zephyr/drivers/pcie/msi.h>
Compute the data for an MSI posted write.
This function is exported by the arch, board or SoC code.
irq | The IRQ we wish to trigger via MSI. |
vector | The vector for which you want the data (or NULL) |