13#ifndef ZEPHYR_INCLUDE_DRIVERS_PCIE_EP_H_
14#define ZEPHYR_INCLUDE_DRIVERS_PCIE_EP_H_
152 return api->
map_addr(dev, pcie_addr, mapped_addr, size, ob_mem_type);
193 return api->
raise_irq(dev, irq_type, irq_num);
255 return api->
dma_xfer(dev, mapped_addr, local_addr, size, dir);
#define ENOTSUP
Unsupported value.
Definition: errno.h:115
static void pcie_ep_unmap_addr(const struct device *dev, uint64_t mapped_addr)
Remove mapping to PCIe outbound region.
Definition: pcie_ep.h:166
static int pcie_ep_register_reset_cb(const struct device *dev, enum pcie_reset reset, pcie_ep_reset_callback_t cb, void *arg)
Register callback function for reset interrupts.
Definition: pcie_ep.h:211
pcie_reset
Definition: pcie_ep.h:38
@ PCIE_RESET_MAX
Definition: pcie_ep.h:42
@ PCIE_PERST
Cold reset.
Definition: pcie_ep.h:39
@ PCIE_FLR
Functional Level Reset.
Definition: pcie_ep.h:41
@ PCIE_PERST_INB
Inband hot reset.
Definition: pcie_ep.h:40
static int pcie_ep_map_addr(const struct device *dev, uint64_t pcie_addr, uint64_t *mapped_addr, uint32_t size, enum pcie_ob_mem_type ob_mem_type)
Map a host memory buffer to PCIe outbound region.
Definition: pcie_ep.h:144
static int pcie_ep_dma_xfer(const struct device *dev, uint64_t mapped_addr, uintptr_t local_addr, uint32_t size, const enum xfer_direction dir)
Data transfer between mapped Host memory and device memory with "System DMA".
Definition: pcie_ep.h:246
static void pcie_ep_conf_write(const struct device *dev, uint32_t offset, uint32_t data)
Write PCIe EP configuration space.
Definition: pcie_ep.h:110
pcie_ob_mem_type
Definition: pcie_ep.h:21
@ PCIE_OB_HIGHMEM
PCIe OB window above 32-bit address range.
Definition: pcie_ep.h:24
@ PCIE_OB_ANYMEM
PCIe OB window within any address range.
Definition: pcie_ep.h:22
@ PCIE_OB_LOWMEM
PCIe OB window within 32-bit address range.
Definition: pcie_ep.h:23
pci_ep_irq_type
Definition: pcie_ep.h:27
@ PCIE_EP_IRQ_MSI
Raise MSI interrupt.
Definition: pcie_ep.h:29
@ PCIE_EP_IRQ_MSIX
Raise MSIX interrupt.
Definition: pcie_ep.h:30
@ PCIE_EP_IRQ_LEGACY
Raise Legacy interrupt.
Definition: pcie_ep.h:28
int pcie_ep_xfer_data_memcpy(const struct device *dev, uint64_t pcie_addr, uintptr_t *local_addr, uint32_t size, enum pcie_ob_mem_type ob_mem_type, enum xfer_direction dir)
Data transfer using memcpy.
xfer_direction
Definition: pcie_ep.h:33
@ DEVICE_TO_HOST
Write to Host.
Definition: pcie_ep.h:35
@ HOST_TO_DEVICE
Read from Host.
Definition: pcie_ep.h:34
int pcie_ep_xfer_data_dma(const struct device *dev, uint64_t pcie_addr, uintptr_t *local_addr, uint32_t size, enum pcie_ob_mem_type ob_mem_type, enum xfer_direction dir)
Data transfer using system DMA.
static int pcie_ep_conf_read(const struct device *dev, uint32_t offset, uint32_t *data)
Read PCIe EP configuration space.
Definition: pcie_ep.h:91
static int pcie_ep_raise_irq(const struct device *dev, enum pci_ep_irq_type irq_type, uint32_t irq_num)
Raise interrupt to Host.
Definition: pcie_ep.h:187
void(* pcie_ep_reset_callback_t)(void *arg)
Callback API for PCIe reset interrupts.
Definition: pcie_ep.h:57
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT64_TYPE__ uint64_t
Definition: stdint.h:91
__UINTPTR_TYPE__ uintptr_t
Definition: stdint.h:105
Runtime device structure (in ROM) per driver instance.
Definition: device.h:399
void * data
Address of the device instance private data.
Definition: device.h:409
const void * api
Address of the API structure exposed by the device instance.
Definition: device.h:405
int(* map_addr)(const struct device *dev, uint64_t pcie_addr, uint64_t *mapped_addr, uint32_t size, enum pcie_ob_mem_type ob_mem_type)
Definition: pcie_ep.h:64
void(* unmap_addr)(const struct device *dev, uint64_t mapped_addr)
Definition: pcie_ep.h:67
int(* raise_irq)(const struct device *dev, enum pci_ep_irq_type irq_type, uint32_t irq_num)
Definition: pcie_ep.h:68
int(* conf_read)(const struct device *dev, uint32_t offset, uint32_t *data)
Definition: pcie_ep.h:60
int(* dma_xfer)(const struct device *dev, uint64_t mapped_addr, uintptr_t local_addr, uint32_t size, enum xfer_direction dir)
Definition: pcie_ep.h:74
void(* conf_write)(const struct device *dev, uint32_t offset, uint32_t data)
Definition: pcie_ep.h:62
int(* register_reset_cb)(const struct device *dev, enum pcie_reset reset, pcie_ep_reset_callback_t cb, void *arg)
Definition: pcie_ep.h:71