cfupmc: xcfupmc.h File Reference

| cfupmc Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Data Structures | Macros | Functions
xcfupmc.h File Reference

## Overview

This is the file which contains code for CFU block.

    MODIFICATION HISTORY:

    Ver   Who  Date        Changes
    ----- ---- -------- -------------------------------------------------------
    1.00  kc   12/21/2017 Initial release
    2.00  bsv  03/01/2019 Added error handling APIs
    2.01  bsv  11/06/2019 XCfupmc_ClearCfuIsr API added

Note

## Data Structures
struct | XCfupmc_Config
| This typedef contains configuration information for a CFU core. More...
struct | XCfupmc
| The XCfupmc driver instance data structure. More...

## Macros
#define | XCfupmc_ClearIsr(InstancePtr, IsrMask)
| This function clears CFU ISR. More...
#define | XCfupmc_ReadIsr(InstancePtr)
| This function reads CFU ISR. More...
#define | XCfupmc_ReadStatus(InstancePtr)
| This function reads CFU Status. More...

## Functions
XCfupmc_Config * | XCfupmc_LookupConfig (u16 DeviceId)
| XCfupmc_LookupConfig returns a reference to an XCfupmc_Config structure based on the unique device id, DeviceId. More...
s32 | XCfupmc_CfgInitialize (XCfupmc *InstancePtr, XCfupmc_Config *CfgPtr, u32 EffectiveAddr)
| This function initializes an CFU core. More...
s32 | XCfupmc_SelfTest (XCfupmc *InstancePtr)
| This function runs a self-test on the driver and hardware device. More...
void | XCfupmc_MaskRegWrite (XCfupmc *InstancePtr, u32 Addr, u32 Mask, u32 Val)
| This function does CFI register write using MASK register. More...
void | XCfupmc_SetParam (XCfupmc *InstancePtr)
| This function sets the CFU parameters as specified in the Instance Ptr. More...
s32 | XCfupmc_CheckParam (XCfupmc *InstancePtr)
| This function checks CFI data CRC after loading to PL. More...
s32 | XCfupmc_WaitForStreamBusy (XCfupmc *InstancePtr)
| This function waits for CFU stream busy status. More...
void | XCfupmc_SetGlblSigEn (XCfupmc *InstancePtr, u8 Enable)
| This function enables or disables the global signals. More...
void | XCfupmc_GlblSeqInit (XCfupmc *InstancePtr)
| This function inits the global events to needs to be done before loading the CFI data. More...
void | XCfupmc_StartGlblSeq (XCfupmc *InstancePtr)
| This function starts the sequence to enable Global signals. More...
void | XCfupmc_EndGlblSeq (XCfupmc *InstancePtr)
| This function does end of Global sequence. More...
void | XCfupmc_Reset (XCfupmc *InstancePtr)
| This function resets the CFU block. More...
void | XCfupmc_WaitForStreamDone (XCfupmc *InstancePtr)
| This function waits till Fabric is busy. More...
void | XCfupmc_CfuErrHandler (XCfupmc *InstancePtr)
| This function checks and handles CFU errors. More...
void | XCfupmc_CfiErrHandler (XCfupmc *InstancePtr)
| This function handles CFI errors. More...
void | XCfupmc_ExtErrorHandler (XCfupmc *InstancePtr)
| This function is called when bitstream transfer is aborted by user. More...
void | XCfupmc_ClearIgnoreCfiErr (XCfupmc *InstancePtr)
| This function clears Ignore CFI ERROR mask in CFU_APB_CFU_CTL. More...
void | XCfupmc_ClearCfuIsr (XCfupmc *InstancePtr)
| This function clears CFU ISR. More...

## Macro Definition Documentation

#define XCfupmc_ClearIsr | ( |  | InstancePtr,
|  |  | IsrMask
| ) |  |

Value:
XCfupmc_WriteReg(InstancePtr->Config.BaseAddress, \
CFU_APB_CFU_ISR, IsrMask)
CFU_APB_CFU_ISR
#define CFU_APB_CFU_ISR
Register: CFU_APB_CFU_ISR.
Definition: cfu_apb.h:82
XCfupmc_WriteReg
#define XCfupmc_WriteReg(BaseAddress, RegOffset, Data)
This macro writes the value into the given register.
Definition: xcfupmc_hw.h:99

This function clears CFU ISR.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

Note
  None. C-style signature: XStatus XCfupmc_ClearIsr(XCfupmc *InstancePtr, IsrMask)

Referenced by XCfupmc_ClearCfuIsr().

#define XCfupmc_ReadIsr | ( |  | InstancePtr | ) |

Value:
XCfupmc_ReadReg(InstancePtr->Config.BaseAddress, \
CFU_APB_CFU_ISR)
CFU_APB_CFU_ISR
#define CFU_APB_CFU_ISR
Register: CFU_APB_CFU_ISR.
Definition: cfu_apb.h:82
XCfupmc_ReadReg
#define XCfupmc_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xcfupmc_hw.h:80

This function reads CFU ISR.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

Note
  None. C-style signature: XStatus XCfupmc_ReadIsr(XCfupmc *InstancePtr)

#define XCfupmc_ReadStatus | ( |  | InstancePtr | ) |

Value:
XCfupmc_ReadReg(InstancePtr->Config.BaseAddress, \
CFU_APB_CFU_STATUS)
CFU_APB_CFU_STATUS
#define CFU_APB_CFU_STATUS
Register: CFU_APB_CFU_STATUS.
Definition: cfu_apb.h:529
XCfupmc_ReadReg
#define XCfupmc_ReadReg(BaseAddress, RegOffset)
This macro reads the given register.
Definition: xcfupmc_hw.h:80

This function reads CFU Status.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

Note
  None. C-style signature: XStatus XCfupmc_ReadStatus(XCfupmc *InstancePtr)

Referenced by XCfupmc_WaitForStreamDone().

## Function Documentation

s32 XCfupmc_CfgInitialize | ( | XCfupmc * | InstancePtr,
|  | XCfupmc_Config * | CfgPtr,
|  | u32 | EffectiveAddr
| ) |  |

This function initializes an CFU core.

This function must be called prior to using an CFU driver.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.
  CfgPtr | is a reference to a structure containing information about a specific XCfupmc instance.
  EffectiveAddr | is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, pass in the physical address instead.

Returns
  - XST_SUCCESS if initialization was successful.

Note
  None.

References XCfupmc_Config::BaseAddress, XCfupmc::Config, and XCfupmc::IsReady.

void XCfupmc_CfiErrHandler | ( | XCfupmc * | InstancePtr | ) |

This function handles CFI errors.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References CFU_APB_CFU_CTL, XCfupmc_MaskRegWrite(), and XCfupmc_Reset().

void XCfupmc_CfuErrHandler | ( | XCfupmc * | InstancePtr | ) |

This function checks and handles CFU errors.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

MISRA-C compliance

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_ISR, XCfupmc::Config, XCfupmc_ClearCfuIsr(), XCfupmc_ReadReg, and XCfupmc_Reset().

s32 XCfupmc_CheckParam | ( | XCfupmc * | InstancePtr | ) |

This function checks CFI data CRC after loading to PL.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  - XST_SUCCESS if there is no CRC failure

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_CRC_EXPECT, CFU_APB_CFU_CTL, CFU_APB_CFU_ISR, CFU_APB_CFU_PROTECT, XCfupmc::Config, XCfupmc_MaskRegWrite(), XCfupmc_ReadReg, and XCfupmc_WriteReg.

void XCfupmc_ClearCfuIsr | ( | XCfupmc * | InstancePtr | ) |

This function clears CFU ISR.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References XCfupmc_ClearIsr.

Referenced by XCfupmc_CfuErrHandler().

void XCfupmc_ClearIgnoreCfiErr | ( | XCfupmc * | InstancePtr | ) |

This function clears Ignore CFI ERROR mask in CFU_APB_CFU_CTL.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References CFU_APB_CFU_CTL, and XCfupmc_MaskRegWrite().

void XCfupmc_EndGlblSeq | ( | XCfupmc * | InstancePtr | ) |

This function does end of Global sequence.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_FGCR, CFU_APB_CFU_PROTECT, XCfupmc::Config, XCfupmc_MaskRegWrite(), and XCfupmc_WriteReg.

void XCfupmc_ExtErrorHandler | ( | XCfupmc * | InstancePtr | ) |

This function is called when bitstream transfer is aborted by user.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

                                         ?

References CFU_APB_CFU_CTL, and XCfupmc_MaskRegWrite().

void XCfupmc_GlblSeqInit | ( | XCfupmc * | InstancePtr | ) |

This function inits the global events to needs to be done before loading the CFI data.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_FGCR, CFU_APB_CFU_PROTECT, XCfupmc::Config, XCfupmc_MaskRegWrite(), and XCfupmc_WriteReg.

void XCfupmc_MaskRegWrite | ( | XCfupmc * | InstancePtr,
|  | u32 | Addr,
|  | u32 | Mask,
|  | u32 | Val
| ) |  |

This function does CFI register write using MASK register.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.
  Addr | Address of the regiser to be written
  Mask | Mask of the bit field to be written
  Val | Value of bit field

Returns
  None

Note
  None.

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_MASK, XCfupmc::Config, XCfupmc_ReadReg, and XCfupmc_WriteReg.

Referenced by XCfupmc_CfiErrHandler(), XCfupmc_CheckParam(), XCfupmc_ClearIgnoreCfiErr(), XCfupmc_EndGlblSeq(), XCfupmc_ExtErrorHandler(), XCfupmc_GlblSeqInit(), XCfupmc_Reset(), XCfupmc_SetGlblSigEn(), XCfupmc_SetParam(), and XCfupmc_StartGlblSeq().

void XCfupmc_Reset | ( | XCfupmc * | InstancePtr | ) |

This function resets the CFU block.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References CFU_APB_CFU_CTL, and XCfupmc_MaskRegWrite().

Referenced by XCfupmc_CfiErrHandler(), and XCfupmc_CfuErrHandler().

void XCfupmc_SetGlblSigEn | ( | XCfupmc * | InstancePtr,
|  | u8 | Enable
| ) |  |

This function enables or disables the global signals.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_FGCR, CFU_APB_CFU_PROTECT, XCfupmc::Config, XCfupmc_MaskRegWrite(), and XCfupmc_WriteReg.

void XCfupmc_SetParam | ( | XCfupmc * | InstancePtr | ) |

This function sets the CFU parameters as specified in the Instance Ptr.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

Note
  None.

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_CTL, CFU_APB_CFU_FGCR, CFU_APB_CFU_ITR, CFU_APB_CFU_PROTECT, XCfupmc::Config, XCfupmc_MaskRegWrite(), and XCfupmc_WriteReg.

void XCfupmc_StartGlblSeq | ( | XCfupmc * | InstancePtr | ) |

This function starts the sequence to enable Global signals.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_FGCR, CFU_APB_CFU_PROTECT, XCfupmc::Config, XCfupmc_MaskRegWrite(), and XCfupmc_WriteReg.

s32 XCfupmc_WaitForStreamBusy | ( | XCfupmc * | InstancePtr | ) |

This function waits for CFU stream busy status.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  - XST_SUCCESS if there is no CRC failure

References XCfupmc_Config::BaseAddress, CFU_APB_CFU_STATUS, XCfupmc::Config, and XCfupmc_ReadReg.

void XCfupmc_WaitForStreamDone | ( | XCfupmc * | InstancePtr | ) |

This function waits till Fabric is busy.

Parameters

  InstancePtr | is a pointer to the XCfupmc instance.

Returns
  None

References XCfupmc_ReadStatus.