![]() |
aiengine
Xilinx SDK Drivers API Documentation
|
This file contains the low level layer IO interface.
MODIFICATION HISTORY:
Ver Who Date Changes
1.0 Hyun 07/12/2018 Initial creation 1.1 Hyun 10/11/2018 Initialize the IO device for mem instance 1.2 Nishad 12/05/2018 Renamed ME attributes to AIE
#define | SHM_NUM_ULONG 8 |
number of ulong for bitmap More... | |
#define | SHM_MAX_IDS (sizeof(unsigned long) * SHM_NUM_ULONG) |
max number of IDs = 64 * 16 = 512 More... | |
void | XAieIO_Finish (void) |
This is the memory IO function to free the global IO instance. More... | |
void | XAieIO_Init (void) |
This is the memory IO function to initialize the global IO instance. More... | |
void * | _XAieIO_GetIO (void) |
This is the memory IO function to get a low level IO instance. More... | |
void | XAieIO_IntrUnregisterIsr (int Offset) |
This function unregisters the interrupt handler for given irq offset. More... | |
int | XAieIO_IntrRegisterIsr (int Offset, int(*Handler)(void *Data), void *Data) |
This function registers the interrupt handler for given irq offset. More... | |
u32 | XAieIO_Read32 (u64 Addr) |
This is the memory IO function to read 32bit data from the specified address. More... | |
void | XAieIO_Read128 (u64 Addr, u32 *Data) |
This is the memory IO function to read 128b data from the specified address. More... | |
void | XAieIO_Write32 (u64 Addr, u32 Data) |
This is the memory IO function to write 32bit data to the specified address. More... | |
void | XAieIO_Write128 (u64 Addr, u32 *Data) |
This is the memory IO function to write 128bit data to the specified address. More... | |
void | XAieIO_MemFinish (XAieIO_Mem *IO_MemInstPtr) |
This is the IO memory function to free the memory instance. More... | |
XAieIO_Mem * | XAieIO_MemInit (u8 idx) |
This is the IO memory function to initialize the IO memory instance. More... | |
void | XAieIO_MemDetach (XAieIO_Mem *IO_MemInstPtr) |
This is the IO memory function to detach the memory from device. More... | |
XAieIO_Mem * | XAieIO_MemAttach (uint64_t Vaddr, uint64_t Paddr, uint64_t Size, uint64_t MemHandle) |
This is the IO memory function to attach the external memory to device. More... | |
void | XAieIO_MemFree (XAieIO_Mem *IO_MemInstPtr) |
This is the IO memory function to free the memory. More... | |
XAieIO_Mem * | XAieIO_MemAllocate (uint64_t Size, u32 Attr) |
This is the IO memory function to allocate a memory. More... | |
u8 | XAieIO_MemSyncForCPU (XAieIO_Mem *IO_MemInstPtr) |
This is the IO memory function to sync the memory for CPU. More... | |
u8 | XAieIO_MemSyncForDev (XAieIO_Mem *IO_MemInstPtr) |
This is the IO memory function to sync the memory for device. More... | |
uint64_t | XAieIO_MemGetSize (XAieIO_Mem *IO_MemInstPtr) |
This is the IO memory function to return the size of the memory instance. More... | |
uint64_t | XAieIO_MemGetVaddr (XAieIO_Mem *IO_MemInstPtr) |
This is the IO memory function to return the mapped virtual address of the memory instance. More... | |
uint64_t | XAieIO_MemGetPaddr (XAieIO_Mem *IO_MemInstPtr) |
This is the IO memory function to return the physical address of the memory instance. More... | |
void | XAieIO_MemWrite32 (XAieIO_Mem *IO_MemInstPtr, uint64_t Addr, u32 Data) |
This is the IO memory function to write to the physical address. More... | |
u32 | XAieIO_MemRead32 (XAieIO_Mem *IO_MemInstPtr, uint64_t Addr) |
This is the IO memory function to read from the physical address. More... | |
u32 | XAieIO_NPIRead32 (u64 Addr) |
This is the NPI IO function to read 32bit data from the specified address. More... | |
void | XAieIO_NPIWrite32 (u64 Addr, u32 Data) |
This is the NPI IO function to write 32bit data to the specified address. More... | |
#define SHM_MAX_IDS (sizeof(unsigned long) * SHM_NUM_ULONG) |
max number of IDs = 64 * 16 = 512
Referenced by XAieIO_MemAllocate().
#define SHM_NUM_ULONG 8 |
number of ulong for bitmap
void* _XAieIO_GetIO | ( | void | ) |
This is the memory IO function to get a low level IO instance.
None. |
void XAieIO_Finish | ( | void | ) |
This is the memory IO function to free the global IO instance.
None. |
Referenced by XAieIO_IntrRegisterIsr(), XAieIO_IntrUnregisterIsr(), XAieIO_MemAllocate(), XAieIO_MemAttach(), XAieIO_MemDetach(), XAieIO_MemFinish(), and XAieIO_MemFree().
void XAieIO_Init | ( | void | ) |
This is the memory IO function to initialize the global IO instance.
None. |
Referenced by XAieIO_IntrRegisterIsr(), XAieIO_MemAllocate(), XAieIO_MemAttach(), XAieIO_MemInit(), and XAieLib_InitDev().
int XAieIO_IntrRegisterIsr | ( | int | Offset, |
int(*)(void *Data) | Handler, | ||
void * | Data | ||
) |
This function registers the interrupt handler for given irq offset.
Offset,: | The value should one of 1 - 3. Current it's not used. |
Handler,: | the callback to be called upon interrupt. |
Data,: | the data to be used with the handler. |
References XAieIO_Finish(), and XAieIO_Init().
Referenced by XAieLib_InterruptRegisterIsr().
void XAieIO_IntrUnregisterIsr | ( | int | Offset | ) |
This function unregisters the interrupt handler for given irq offset.
Offset,: | The value should one of 1 - 3. Current it's not used. |
References XAieIO_Finish().
Referenced by XAieLib_InterruptUnregisterIsr().
XAieIO_Mem* XAieIO_MemAllocate | ( | uint64_t | Size, |
u32 | Attr | ||
) |
This is the IO memory function to allocate a memory.
Size,: | Size of the memory |
Attr,: | Any of XAIELIB_MEM_ATTR_* |
References SHM_MAX_IDS, XAieIO_Finish(), and XAieIO_Init().
Referenced by XAieLib_MemAllocate().
XAieIO_Mem* XAieIO_MemAttach | ( | uint64_t | Vaddr, |
uint64_t | Paddr, | ||
uint64_t | Size, | ||
uint64_t | MemHandle | ||
) |
This is the IO memory function to attach the external memory to device.
Vaddr,: | Optional. Vaddr of the memory |
Paddr,: | Optional. Paddr of the memory |
Size,: | Required. Size of the memory |
MemHandle,: | Required. Handle of the memory. For linux, dmabuf fd |
References XAieIO_Finish(), and XAieIO_Init().
Referenced by XAieLib_MemAttach().
void XAieIO_MemDetach | ( | XAieIO_Mem * | IO_MemInstPtr | ) |
This is the IO memory function to detach the memory from device.
IO_MemInstPtr,: | IO Memory instance pointer. |
References XAieIO_Finish().
Referenced by XAieLib_MemDetach().
void XAieIO_MemFinish | ( | XAieIO_Mem * | IO_MemInstPtr | ) |
This is the IO memory function to free the memory instance.
IO_MemInstPtr,: | IO Memory instance pointer. |
References XAieIO_Finish().
Referenced by XAieLib_MemFinish().
void XAieIO_MemFree | ( | XAieIO_Mem * | IO_MemInstPtr | ) |
This is the IO memory function to free the memory.
IO_MemInstPtr,: | IO Memory instance pointer. |
References XAieIO_Finish().
Referenced by XAieLib_MemFree().
uint64_t XAieIO_MemGetPaddr | ( | XAieIO_Mem * | IO_MemInstPtr | ) |
This is the IO memory function to return the physical address of the memory instance.
IO_MemInstPtr,: | IO Memory instance pointer. |
Referenced by XAieLib_MemGetPaddr().
uint64_t XAieIO_MemGetSize | ( | XAieIO_Mem * | IO_MemInstPtr | ) |
This is the IO memory function to return the size of the memory instance.
IO_MemInstPtr,: | IO Memory instance pointer. |
Referenced by XAieLib_MemGetSize().
uint64_t XAieIO_MemGetVaddr | ( | XAieIO_Mem * | IO_MemInstPtr | ) |
This is the IO memory function to return the mapped virtual address of the memory instance.
IO_MemInstPtr,: | IO Memory instance pointer. |
Referenced by XAieLib_MemGetVaddr().
XAieIO_Mem* XAieIO_MemInit | ( | u8 | idx | ) |
This is the IO memory function to initialize the IO memory instance.
idx,: | Index of the memory to initialize. |
References XAieIO_Init().
Referenced by XAieLib_MemInit().
u32 XAieIO_MemRead32 | ( | XAieIO_Mem * | IO_MemInstPtr, |
uint64_t | Addr | ||
) |
This is the IO memory function to read from the physical address.
IO_MemInstPtr,: | IO Memory instance pointer. |
Addr,: | Absolute physical address to read from. |
Referenced by XAieLib_MemRead32().
u8 XAieIO_MemSyncForCPU | ( | XAieIO_Mem * | IO_MemInstPtr | ) |
This is the IO memory function to sync the memory for CPU.
IO_MemInstPtr,: | IO Memory instance pointer. |
Referenced by XAieLib_MemSyncForCPU().
u8 XAieIO_MemSyncForDev | ( | XAieIO_Mem * | IO_MemInstPtr | ) |
This is the IO memory function to sync the memory for device.
IO_MemInstPtr,: | IO Memory instance pointer. |
Referenced by XAieLib_MemSyncForDev().
void XAieIO_MemWrite32 | ( | XAieIO_Mem * | IO_MemInstPtr, |
uint64_t | Addr, | ||
u32 | Data | ||
) |
This is the IO memory function to write to the physical address.
IO_MemInstPtr,: | IO Memory instance pointer. |
Addr,: | Absolute physical address to write. |
Data,: | A 32 bit data to write. |
Referenced by XAieLib_MemWrite32().
u32 XAieIO_NPIRead32 | ( | u64 | Addr | ) |
This is the NPI IO function to read 32bit data from the specified address.
Addr,: | Address to read from. |
Referenced by XAieLib_NPIMaskWrite32(), and XAieLib_NPIRead32().
void XAieIO_NPIWrite32 | ( | u64 | Addr, |
u32 | Data | ||
) |
This is the NPI IO function to write 32bit data to the specified address.
Addr,: | Address to write to. |
Data,: | 32-bit data to be written. |
Referenced by XAieLib_NPIMaskWrite32(), and XAieLib_NPIWrite32().
void XAieIO_Read128 | ( | u64 | Addr, |
u32 * | Data | ||
) |
This is the memory IO function to read 128b data from the specified address.
Addr,: | Address to read from. |
Data,: | Pointer to the 128-bit buffer to store the read data. |
References XAieIO_Read32().
u32 XAieIO_Read32 | ( | u64 | Addr | ) |
This is the memory IO function to read 32bit data from the specified address.
Addr,: | Address to read from. |
Referenced by XAieIO_Read128(), XAieLib_MaskWrite32(), XAieLib_Read128(), and XAieLib_Read32().
void XAieIO_Write128 | ( | u64 | Addr, |
u32 * | Data | ||
) |
This is the memory IO function to write 128bit data to the specified address.
Addr,: | Address to write to. |
Data,: | Pointer to the 128-bit data buffer. |
References XAieIO_Write32().
Referenced by XAieLib_Write128().
void XAieIO_Write32 | ( | u64 | Addr, |
u32 | Data | ||
) |
This is the memory IO function to write 32bit data to the specified address.
Addr,: | Address to write to. |
Data,: | 32-bit data to be written. |
Referenced by XAieIO_Write128(), XAieLib_MaskWrite32(), and XAieLib_Write32().