cfupmc: xcfupmc.c File Reference

| cfupmc Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Functions
xcfupmc.c File Reference

## Overview

This file which contains the code related to 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

## Functions
s32 | XCfupmc_CfgInitialize (XCfupmc *InstancePtr, XCfupmc_Config *CfgPtr, u32 EffectiveAddr)
| This function initializes an CFU core. 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_WaitForStreamBusy (XCfupmc *InstancePtr)
| This function waits for CFU stream busy status. More...
s32 | XCfupmc_CheckParam (XCfupmc *InstancePtr)
| This function checks CFI data CRC after loading to PL. 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_ClearCfuIsr (XCfupmc *InstancePtr)
| This function clears CFU ISR. More...
void | XCfupmc_ClearIgnoreCfiErr (XCfupmc *InstancePtr)
| This function clears Ignore CFI ERROR mask in CFU_APB_CFU_CTL. More...
void | XCfupmc_ExtErrorHandler (XCfupmc *InstancePtr)
| This function is called when bitstream transfer is aborted by user. More...

## 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.