#include "xdevcfg_hw.h"
#include "xstatus.h"
#include "xil_assert.h"
Classes | |
struct | XDcfg_Config |
struct | XDcfg |
Defines | |
#define | XDCFG_H |
#define | XDCFG_NON_SECURE_PCAP_WRITE 1 |
#define | XDCFG_SECURE_PCAP_WRITE 2 |
#define | XDCFG_PCAP_READBACK 3 |
#define | XDCFG_CONCURRENT_SECURE_READ_WRITE 4 |
#define | XDCFG_CONCURRENT_NONSEC_READ_WRITE 5 |
#define | XDcfg_Unlock(InstancePtr) |
#define | XDcfg_GetPsVersion(InstancePtr) |
#define | XDcfg_ReadMultiBootConfig(InstancePtr) |
#define | XDcfg_SelectIcapInterface(InstancePtr) |
#define | XDcfg_SelectPcapInterface(InstancePtr) |
Typedefs | |
typedef void(* | XDcfg_IntrHandler )(void *CallBackRef, u32 Status) |
Functions | |
XDcfg_Config * | XDcfg_LookupConfig (u16 DeviceId) |
int | XDcfg_SelfTest (XDcfg *InstancePtr) |
int | XDcfg_CfgInitialize (XDcfg *InstancePtr, XDcfg_Config *ConfigPtr, u32 EffectiveAddress) |
void | XDcfg_EnablePCAP (XDcfg *InstancePtr) |
void | XDcfg_DisablePCAP (XDcfg *InstancePtr) |
void | XDcfg_SetControlRegister (XDcfg *InstancePtr, u32 Mask) |
void | XDcfg_ClearControlRegister (XDcfg *InstancePtr, u32 Mask) |
u32 | XDcfg_GetControlRegister (XDcfg *InstancePtr) |
void | XDcfg_SetLockRegister (XDcfg *InstancePtr, u32 Data) |
u32 | XDcfg_GetLockRegister (XDcfg *InstancePtr) |
void | XDcfg_SetConfigRegister (XDcfg *InstancePtr, u32 Data) |
u32 | XDcfg_GetConfigRegister (XDcfg *InstancePtr) |
void | XDcfg_SetStatusRegister (XDcfg *InstancePtr, u32 Data) |
u32 | XDcfg_GetStatusRegister (XDcfg *InstancePtr) |
void | XDcfg_SetRomShadowRegister (XDcfg *InstancePtr, u32 Data) |
u32 | XDcfg_GetSoftwareIdRegister (XDcfg *InstancePtr) |
void | XDcfg_SetMiscControlRegister (XDcfg *InstancePtr, u32 Mask) |
u32 | XDcfg_GetMiscControlRegister (XDcfg *InstancePtr) |
u32 | XDcfg_IsDmaBusy (XDcfg *InstancePtr) |
void | XDcfg_InitiateDma (XDcfg *InstancePtr, u32 SourcePtr, u32 DestPtr, u32 SrcWordLength, u32 DestWordLength) |
u32 | XDcfg_Transfer (XDcfg *InstancePtr, void *SourcePtr, u32 SrcWordLength, void *DestPtr, u32 DestWordLength, u32 TransferType) |
void | XDcfg_IntrEnable (XDcfg *InstancePtr, u32 Mask) |
void | XDcfg_IntrDisable (XDcfg *InstancePtr, u32 Mask) |
u32 | XDcfg_IntrGetEnabled (XDcfg *InstancePtr) |
u32 | XDcfg_IntrGetStatus (XDcfg *InstancePtr) |
void | XDcfg_IntrClear (XDcfg *InstancePtr, u32 Mask) |
void | XDcfg_InterruptHandler (XDcfg *InstancePtr) |
void | XDcfg_SetHandler (XDcfg *InstancePtr, void *CallBackFunc, void *CallBackRef) |
#define XDCFG_CONCURRENT_NONSEC_READ_WRITE 5 |
#define XDCFG_CONCURRENT_SECURE_READ_WRITE 4 |
#define XDcfg_GetPsVersion | ( | InstancePtr | ) |
((XDcfg_ReadReg((InstancePtr)->Config.BaseAddr, \ XDCFG_MCTRL_OFFSET)) & \ XDCFG_MCTRL_PCAP_PS_VERSION_MASK) >> \ XDCFG_MCTRL_PCAP_PS_VERSION_SHIFT
Get the version number of the PS from the Miscellaneous Control Register.
InstancePtr | is a pointer to the instance of XDcfg driver. |
#define XDCFG_H |
#define XDCFG_NON_SECURE_PCAP_WRITE 1 |
#define XDCFG_PCAP_READBACK 3 |
#define XDcfg_ReadMultiBootConfig | ( | InstancePtr | ) |
XDcfg_ReadReg((InstancePtr)->Config.BaseAddr + \ XDCFG_MULTIBOOT_ADDR_OFFSET)
Read the multiboot config register value.
InstancePtr | is a pointer to the instance of XDcfg driver. |
#define XDCFG_SECURE_PCAP_WRITE 2 |
#define XDcfg_SelectIcapInterface | ( | InstancePtr | ) |
XDcfg_WriteReg((InstancePtr)->Config.BaseAddr, XDCFG_CTRL_OFFSET, \ ((XDcfg_ReadReg((InstancePtr)->Config.BaseAddr, XDCFG_CTRL_OFFSET)) \ & ( ~XDCFG_CTRL_PCAP_PR_MASK)))
Selects ICAP interface for reconfiguration after the initial configuration of the PL.
InstancePtr | is a pointer to the instance of XDcfg driver. |
#define XDcfg_SelectPcapInterface | ( | InstancePtr | ) |
XDcfg_WriteReg((InstancePtr)->Config.BaseAddr, XDCFG_CTRL_OFFSET, \ ((XDcfg_ReadReg((InstancePtr)->Config.BaseAddr, XDCFG_CTRL_OFFSET)) \ | XDCFG_CTRL_PCAP_PR_MASK))
Selects PCAP interface for reconfiguration after the initial configuration of the PL.
InstancePtr | is a pointer to the instance of XDcfg driver. |
#define XDcfg_Unlock | ( | InstancePtr | ) |
XDcfg_WriteReg((InstancePtr)->Config.BaseAddr, \ XDCFG_UNLOCK_OFFSET, XDCFG_UNLOCK_DATA)
Unlock the Device Config Interface block.
InstancePtr | is a pointer to the instance of XDcfg driver. |
typedef void(* XDcfg_IntrHandler)(void *CallBackRef, u32 Status) |
The handler data type allows the user to define a callback function to respond to interrupt events in the system. This function is executed in interrupt context, so amount of processing should be minimized.
CallBackRef | is the callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. Its type is unimportant to the driver component, so it is a void pointer. | |
Status | is the Interrupt status of the XDcfg device. |
int XDcfg_CfgInitialize | ( | XDcfg * | InstancePtr, | |
XDcfg_Config * | ConfigPtr, | |||
u32 | EffectiveAddress | |||
) |
Initialize the Device Config Interface driver. This function must be called before other functions of the driver are called.
InstancePtr | is a pointer to the XDcfg instance. | |
ConfigPtr | is the config structure. | |
EffectiveAddress | is the base address for the device. It could be a virtual address if address translation is supported in the system, otherwise it is the physical address. |
void XDcfg_ClearControlRegister | ( | XDcfg * | InstancePtr, | |
u32 | Mask | |||
) |
The function Clears the specified bit positions of the Control Register.
InstancePtr | is a pointer to the XDcfg instance. | |
Mask | is the 32 bit value which holds the bit positions to be cleared. |
void XDcfg_DisablePCAP | ( | XDcfg * | InstancePtr | ) |
The functions disables the PCAP interface by clearing the PCAP mode bit in the control register.
InstancePtr | is a pointer to the XDcfg instance. |
void XDcfg_EnablePCAP | ( | XDcfg * | InstancePtr | ) |
The functions enables the PCAP interface by setting the PCAP mode bit in the control register.
InstancePtr | is a pointer to the XDcfg instance. |
u32 XDcfg_GetConfigRegister | ( | XDcfg * | InstancePtr | ) |
The function reads the contents of the Configuration Register with the given value.
InstancePtr | is a pointer to the XDcfg instance. |
u32 XDcfg_GetControlRegister | ( | XDcfg * | InstancePtr | ) |
The function reads the contents of the Control Register.
InstancePtr | is a pointer to the XDcfg instance. |
u32 XDcfg_GetLockRegister | ( | XDcfg * | InstancePtr | ) |
The function reads the contents of the Lock Register.
InstancePtr | is a pointer to the XDcfg instance. |
u32 XDcfg_GetMiscControlRegister | ( | XDcfg * | InstancePtr | ) |
The function reads the contents of the Miscellaneous Control Register.
InstancePtr | is a pointer to the XDcfg instance. |
u32 XDcfg_GetSoftwareIdRegister | ( | XDcfg * | InstancePtr | ) |
The function reads the contents of the Software ID Register.
InstancePtr | is a pointer to the XDcfg instance. |
u32 XDcfg_GetStatusRegister | ( | XDcfg * | InstancePtr | ) |
The function reads the contents of the Status Register.
InstancePtr | is a pointer to the XDcfg instance. |
void XDcfg_InitiateDma | ( | XDcfg * | InstancePtr, | |
u32 | SourcePtr, | |||
u32 | DestPtr, | |||
u32 | SrcWordLength, | |||
u32 | DestWordLength | |||
) |
This function initiates the DMA transfer.
InstancePtr | is a pointer to the XDcfg instance. | |
SourcePtr | contains a pointer to the source memory where the data is to be transferred from. | |
SrcWordLength | is the number of words (32 bit) to be transferred for the source transfer. | |
DestPtr | contains a pointer to the destination memory where the data is to be transferred to. | |
DestWordLength | is the number of words (32 bit) to be transferred for the Destination transfer. |
The 2 LSBs of the SourcePtr (Source)/ DestPtr (Destination) address when equal to 2’b01 indicates the last DMA command of an overall transfer.
void XDcfg_InterruptHandler | ( | XDcfg * | InstancePtr | ) |
The interrupt handler for the Device Config Interface.
Events are signaled to upper layer for proper handling.
InstancePtr | is a pointer to the XDcfg instance. |
void XDcfg_IntrClear | ( | XDcfg * | InstancePtr, | |
u32 | Mask | |||
) |
This function clears the specified interrupts in the Interrupt Status Register.
InstancePtr | is a pointer to the XDcfg instance. | |
Mask | is the bit-mask of the interrupts to be cleared. Bit positions of 1 will be cleared. Bit positions of 0 will not change the previous interrupt status. This mask is formed by OR'ing XDCFG_INT_* bits which are defined in xdevcfg_hw.h. |
void XDcfg_IntrDisable | ( | XDcfg * | InstancePtr, | |
u32 | Mask | |||
) |
This function disables the specified interrupts in the device.
InstancePtr | is a pointer to the XDcfg instance. | |
Mask | is the bit-mask of the interrupts to be disabled. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XDCFG_INT_* bits defined in xdevcfg_hw.h. |
void XDcfg_IntrEnable | ( | XDcfg * | InstancePtr, | |
u32 | Mask | |||
) |
This function enables the specified interrupts in the device.
InstancePtr | is a pointer to the XDcfg instance. | |
Mask | is the bit-mask of the interrupts to be enabled. Bit positions of 1 will be enabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XDCFG_INT_* bits defined in xdevcfg_hw.h. |
u32 XDcfg_IntrGetEnabled | ( | XDcfg * | InstancePtr | ) |
This function returns the enabled interrupts read from the Interrupt Mask Register. Use the XDCFG_INT_* constants defined in xdevcfg_hw.h to interpret the returned value.
InstancePtr | is a pointer to the XDcfg instance. |
u32 XDcfg_IntrGetStatus | ( | XDcfg * | InstancePtr | ) |
This function returns the interrupt status read from Interrupt Status Register. Use the XDCFG_INT_* constants defined in xdevcfg_hw.h to interpret the returned value.
InstancePtr | is a pointer to the XDcfg instance. |
u32 XDcfg_IsDmaBusy | ( | XDcfg * | InstancePtr | ) |
This function checks if DMA command queue is full.
InstancePtr | is a pointer to the XDcfg instance. |
XDcfg_Config* XDcfg_LookupConfig | ( | u16 | DeviceId | ) |
Lookup the device configuration based on the unique device ID. The table contains the configuration info for each device in the system.
DeviceId | is the unique device ID of the device being looked up. |
int XDcfg_SelfTest | ( | XDcfg * | InstancePtr | ) |
Run a self-test on the Device Configuration Interface. This test does a control register write and reads back the same value.
InstancePtr | is a pointer to the XDcfg instance. |
void XDcfg_SetConfigRegister | ( | XDcfg * | InstancePtr, | |
u32 | Data | |||
) |
The function sets the contents of the Configuration Register with the given value.
InstancePtr | is a pointer to the XDcfg instance. | |
Data | is the 32 bit data to be written to the Register. |
void XDcfg_SetControlRegister | ( | XDcfg * | InstancePtr, | |
u32 | Mask | |||
) |
The function sets the contents of the Control Register.
InstancePtr | is a pointer to the XDcfg instance. | |
Mask | is the 32 bit mask data to be written to the Register. The mask definitions are defined in the xdevcfg_hw.h file. |
void XDcfg_SetHandler | ( | XDcfg * | InstancePtr, | |
void * | CallBackFunc, | |||
void * | CallBackRef | |||
) |
This function sets the handler that will be called when an event (interrupt) occurs that needs application's attention.
InstancePtr | is a pointer to the XDcfg instance | |
CallBackFunc | is the address of the callback function. | |
CallBackRef | is a user data item that will be passed to the callback function when it is invoked. |
void XDcfg_SetLockRegister | ( | XDcfg * | InstancePtr, | |
u32 | Data | |||
) |
The function sets the contents of the Lock Register. These bits can only be set to a 1. They will be cleared after a Power On Reset.
InstancePtr | is a pointer to the XDcfg instance. | |
Data | is the 32 bit data to be written to the Register. |
void XDcfg_SetMiscControlRegister | ( | XDcfg * | InstancePtr, | |
u32 | Mask | |||
) |
The function sets the bit mask for the feature in Miscellaneous Control Register.
InstancePtr | is a pointer to the XDcfg instance. | |
Mask | is the bit-mask of the feature to be set. |
void XDcfg_SetRomShadowRegister | ( | XDcfg * | InstancePtr, | |
u32 | Data | |||
) |
The function sets the contents of the ROM Shadow Control Register.
InstancePtr | is a pointer to the XDcfg instance. | |
Data | is the 32 bit data to be written to the Register. |
void XDcfg_SetStatusRegister | ( | XDcfg * | InstancePtr, | |
u32 | Data | |||
) |
The function sets the contents of the Status Register.
InstancePtr | is a pointer to the XDcfg instance. | |
Data | is the 32 bit data to be written to the Register. |
u32 XDcfg_Transfer | ( | XDcfg * | InstancePtr, | |
void * | SourcePtr, | |||
u32 | SrcWordLength, | |||
void * | DestPtr, | |||
u32 | DestWordLength, | |||
u32 | TransferType | |||
) |
This function starts the DMA transfer. This function only starts the operation and returns before the operation may be completed. If the interrupt is enabled, an interrupt will be generated when the operation is completed, otherwise it is necessary to poll the Status register to determine when it is completed. It is the responsibility of the caller to determine when the operation is completed by handling the generated interrupt or polling the Status Register.
InstancePtr | is a pointer to the XDcfg instance. | |
SourcePtr | contains a pointer to the source memory where the data is to be transferred from. | |
SrcWordLength | is the number of words (32 bit) to be transferred for the source transfer. | |
DestPtr | contains a pointer to the destination memory where the data is to be transferred to. | |
DestWordLength | is the number of words (32 bit) to be transferred for the Destination transfer. | |
TransferType | contains the type of PCAP transfer being requested. The definitions can be found in the xdevcfg.h file. |
The 2 LSBs of the SourcePtr (Source)/ DestPtr (Destination) address when equal to 2’b01 indicates the last DMA command of an overall transfer.
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.