ospipsv
Vitis Drivers API Documentation
Overview

Data Structures

struct  XOspiPsv_Msg
 This typedef contains configuration information for a flash message. More...
 
struct  XOspiPsv_Config
 This typedef contains configuration information for the device. More...
 
struct  XOspiPsv
 The XOspiPsv driver instance data. More...
 

Macros

#define SILICON_VERSION_1   0x10U
 Silicon version. More...
 
#define XOSPIPSV_TAP_GRAN_SEL_MIN_FREQ   120000000U
 Minimum frequency for Tap grain selection. More...
 
#define READ_ID   0x9FU
 Read Id opcode. More...
 
#define XOSPIPSV_H_
 < prevent circular inclusions More...
 
#define XOSPIPSV_RXADDR_OVER_32BIT   0x100000000U
 < Macro used for more than 32-bit address More...
 
#define MAX_DELAY_CNT   10000U
 < Maximum delay count More...
 
#define MAX_IDAC_DELAY_CNT   10000000U
 Max INDAC delay count. More...
 
#define XOSPIPSV_LOWLEVEL_H_
 < prevent circular inclusions More...
 
#define MAX_STIG_DELAY_CNT   50000U
 Max STIG delay count. More...
 
#define MAX_DMA_DELAY_CNT   10000000U
 Max DMA delay count. More...
 
#define LOCK_MAX_DELAY_CNT   10000000U
 Max LOCK delay count. More...
 
#define TERA_MACRO   1000000000000U
 Macro for 10^12. More...
 
#define XOSPIPSV_NUM_OPTIONS   (sizeof(OptionsTable) / sizeof(OptionsMap))
 Total number of configuration options. More...
 

Typedefs

typedef void(* XOspiPsv_StatusHandler )(void *CallBackRef, u32 StatusEvent)
 The handler data type allows the user to define a callback function to handle the asynchronous processing for the OSPIPSV device. More...
 

Functions

u32 XOspiPsv_CfgInitialize (XOspiPsv *InstancePtr, const XOspiPsv_Config *ConfigPtr)
 Initializes a specific XOspiPsv instance such that the driver is ready to use. More...
 
void XOspiPsv_Reset (XOspiPsv *InstancePtr)
 This function reset the configuration register. More...
 
u32 XOspiPsv_DeviceReset (u8 Type)
 This function reset the OSPI flash device. More...
 
u32 XOspiPsv_PollTransfer (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 This function performs a transfer on the bus in polled mode. More...
 
u32 XOspiPsv_StartDmaTransfer (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 This function start a DMA transfer. More...
 
u32 XOspiPsv_CheckDmaDone (XOspiPsv *InstancePtr)
 This function check for DMA transfer complete. More...
 
u32 XOspiPsv_IntrTransfer (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 This function performs a transfer on the bus in interrupt mode. More...
 
u32 XOspiPsv_IntrHandler (XOspiPsv *InstancePtr)
 This function handles interrupt based transfers. More...
 
void XOspiPsv_Idle (const XOspiPsv *InstancePtr)
 Stops the transfer of data to internal DST FIFO from stream interface and also stops the issuing of new write commands to memory. More...
 
u32 XOspiPsv_SetDllDelay (XOspiPsv *InstancePtr)
 Configure TX and RX DLL Delay. More...
 
u32 XOspiPsv_ConfigDualByteOpcode (XOspiPsv *InstancePtr, u8 Enable)
 This function configures the dual-byte opcode mode. More...
 
void XOspiPsv_SetStatusHandler (XOspiPsv *InstancePtr, void *CallBackRef, XOspiPsv_StatusHandler FuncPointer)
 Sets the status callback function, the status handler, which the driver calls when it encounters conditions that should be reported to upper layer software. More...
 
XOspiPsv_ConfigXOspiPsv_LookupConfig (u16 DeviceId)
 Looks up the device configuration based on the unique device ID. More...
 
u32 XOspiPsv_SetClkPrescaler (XOspiPsv *InstancePtr, u8 Prescaler)
 Configures the clock according to the prescaler passed. More...
 
u32 XOspiPsv_SelectFlash (XOspiPsv *InstancePtr, u8 chip_select)
 This function should be used to tell the OSPIPSV driver the HW flash configuration being used. More...
 
u32 XOspiPsv_SetOptions (XOspiPsv *InstancePtr, u32 Options)
 This function sets the options for the OSPIPSV device driver.The options control how the device behaves relative to the OSPIPSV bus. More...
 
u32 XOspiPsv_GetOptions (const XOspiPsv *InstancePtr)
 This function gets the options for the OSPIPSV device. More...
 
u32 XOspiPsv_SetSdrDdrMode (XOspiPsv *InstancePtr, u32 Mode)
 Configures the edge mode (SDR or DDR) More...
 
void XOspiPsv_ConfigureAutoPolling (const XOspiPsv *InstancePtr, u32 FlashMode)
 Configures how the controller will poll the device following a write transfer in DAC mode. More...
 
u32 XOspiPsv_Stig_Read (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 Flash command based data reading using flash command control registers. More...
 
u32 XOspiPsv_Stig_Write (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 Flash command based data write using flash command control registers. More...
 
u32 XOspiPsv_Dma_Read (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 This function Read the data using DMA. More...
 
u32 XOspiPsv_Dac_Read (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 This function reads the data using Linear controller. More...
 
u32 XOspiPsv_Dac_Write (XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
 This function writes the data Using Linear controller. More...
 
u32 XOspiPsv_ExecuteRxTuning (XOspiPsv *InstancePtr, XOspiPsv_Msg *FlashMsg, u32 TXTap)
 This API perform RX Tuning for SDR/DDR mode to calculate RX DLL Delay. More...
 
u32 XOspiPsv_ConfigureTaps (const XOspiPsv *InstancePtr, u32 RxTap, u32 TxTap)
 Configures the Rx and Tx taps in Phy Configuration register. More...
 
u32 XOspiPsv_CheckOspiIdle (const XOspiPsv *InstancePtr)
 Check for OSPI idle which means Serial interface and low level SPI pipeline is IDLE. More...
 
u32 XOspiPsv_IDac_Write (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
 This function Write the data in Non-DMA Indirect mode. More...
 
void XOspiPsv_FifoRead (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 Read the data from RX FIFO. More...
 
void XOspiPsv_FifoWrite (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
 Write data to TX FIFO. More...
 
void XOspiPsv_Setup_Stig_Ctrl (const XOspiPsv *InstancePtr, u32 Cmd_op, u32 Rd_data_en, u32 Num_rd_data_bytes, u32 Cmd_addr_en, u32 Mode_bit_en, u32 Num_addr_bytes, u32 Wr_data_en, u32 Num_wr_data_bytes, u32 Dummy, u32 Membank_en)
 This function configures the STIG control register (Flash cmd register) More...
 
void XOspiPsv_Setup_Dev_Write_Instr_Reg (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
 This function configures the below info to write instruction register DataXfertype - SPI/Dual/Quad/Octal AddrXfertype - 3 or 4B. More...
 
void XOspiPsv_Setup_Dev_Read_Instr_Reg (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
 This function configures the below info to read instruction register DataXfertype - SPI/Dual/Quad/Octal AddrXfertype - 3 or 4B. More...
 
void XOspiPsv_Setup_Devsize (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
 This function sets the device size config register. More...
 
void XOspiPsv_Start_Indr_RdTransfer (const XOspiPsv *InstancePtr)
 This function initiates the indirect read transfer. More...
 
void XOspiPsv_Config_IndirectAhb (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
 This function configures the Indirect controller. More...
 
void XOspiPsv_Config_Dma (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
 This function setup the Dma configuration. More...
 
u32 XOspiPsv_Exec_Dma (const XOspiPsv *InstancePtr)
 This function Initiates the DMA transfer. More...
 
u32 XOspiPsv_Exec_Flash_Cmd (const XOspiPsv *InstancePtr)
 This function executes the Flash command configured using Flash Command control register. More...
 
u32 XOspiPsv_WaitForLock (const XOspiPsv *InstancePtr, u32 Mask)
 Wait for bit to be set. More...
 
u32 XOspiPsv_CalculateRxTap (XOspiPsv *InstancePtr, XOspiPsv_Msg *FlashMsg, u8 *AvgRXTap, u8 *MaxWindowSize, u8 DummyIncr, u32 TXTap)
 Calculate the Max window size and the corresponding Average Rx Tap. More...
 

Variables

XOspiPsv_Config XOspiPsv_ConfigTable []
 The configuration table for devices. More...
 
XOspiPsv_Config XOspiPsv_ConfigTable [XPAR_XOSPIPSV_NUM_INSTANCES]
 The configuration table for devices. More...
 

Configuration options

#define XOSPIPSV_DAC_EN_OPTION   0x1U
 User configuration options. More...
 
#define XOSPIPSV_IDAC_EN_OPTION   0x2U
 
#define XOSPIPSV_STIG_EN_OPTION   0x4U
 
#define XOSPIPSV_CLK_POL_OPTION   0x8U
 
#define XOSPIPSV_CLK_PHASE_OPTION   0x10U
 
#define XOSPIPSV_PHY_EN_OPTION   0x20U
 
#define XOSPIPSV_LEGIP_EN_OPTION   0x40U
 
#define XOSPIPSV_DTR_EN_OPTION   0x80U
 
#define XOSPIPSV_CRC_EN_OPTION   0x100U
 
#define XOSPIPSV_DB_OP_EN_OPTION   0x200U
 

Low-level memory read/write

#define XOspiPsv_ReadReg(BaseAddress, RegOffset)   Xil_In32((BaseAddress) + (u32)(RegOffset))
 Low level macros to read/write memory. More...
 
#define XOspiPsv_WriteReg(BaseAddress, RegOffset, RegisterValue)   Xil_Out32((BaseAddress) + (u32)(RegOffset), (u32)(RegisterValue))
 

Modes of operation selection

#define XOSPIPSV_IDAC_MODE   0x0U
 Macros to select INDAC and DAC modes. More...
 
#define XOSPIPSV_DAC_MODE   0x1U
 

Transfer type selection

#define XOSPIPSV_MSG_FLAG_RX   0x2U
 Macros to select RX and TX transfer flags. More...
 
#define XOSPIPSV_MSG_FLAG_TX   0x4U
 

Prototype(Bus width: Cmd_Addr_Data) selection

#define XOSPIPSV_READ_1_1_1   0U
 Macros to select Read and Write prototype. More...
 
#define XOSPIPSV_READ_1_1_8   3U
 
#define XOSPIPSV_READ_1_8_8   4U
 
#define XOSPIPSV_READ_8_8_8   5U
 
#define XOSPIPSV_READ_8_0_8   6U
 
#define XOSPIPSV_WRITE_1_1_1   0U
 
#define XOSPIPSV_WRITE_1_0_1   1U
 
#define XOSPIPSV_WRITE_1_1_8   3U
 
#define XOSPIPSV_WRITE_1_8_8   4U
 
#define XOSPIPSV_WRITE_8_8_8   5U
 
#define XOSPIPSV_WRITE_8_0_0   6U
 
#define XOSPIPSV_WRITE_8_8_0   7U
 
#define XOSPIPSV_WRITE_8_0_8   8U
 

Chip Select selection

#define XOSPIPSV_SELECT_FLASH_CS0   0
 Macros to select CS0 and CS1. More...
 
#define XOSPIPSV_SELECT_FLASH_CS1   1
 

Prescaler selection

#define XOSPIPSV_CLK_PRESCALE_2   0U
 Macros to select different baud rate divisors. More...
 
#define XOSPIPSV_CLK_PRESCALE_4   1U
 
#define XOSPIPSV_CLK_PRESCALE_6   2U
 
#define XOSPIPSV_CLK_PRESCALE_8   3U
 
#define XOSPIPSV_CLK_PRESCALE_10   4U
 
#define XOSPIPSV_CLK_PRESCALE_12   5U
 
#define XOSPIPSV_CLK_PRESCALE_14   6U
 
#define XOSPIPSV_CLK_PRESCALE_16   7U
 
#define XOSPIPSV_CLK_PRESCALE_18   8U
 
#define XOSPIPSV_CLK_PRESCALE_20   9U
 
#define XOSPIPSV_CLK_PRESCALE_22   10U
 
#define XOSPIPSV_CLK_PRESCALE_24   11U
 
#define XOSPIPSV_CLK_PRESCALE_26   12U
 
#define XOSPIPSV_CLK_PRESCALE_28   13U
 
#define XOSPIPSV_CLK_PRESCALE_30   14U
 
#define XOSPIPSV_CLK_PRESCALE_32   15U
 
#define XOSPIPSV_CR_PRESC_MAXIMUM   15U
 

Default configuration selection

#define XOSPIPSV_NO_SLAVE_SELCT_VALUE   0xFU
 Macros to select default OSPI configuration. More...
 
#define XOSPIPSV_DISABLE_DAC_VALUE   0x0U
 
#define XOSPIPSV_SPI_DISABLE_VALUE   0x0U
 
#define XOSPIPSV_CONFIG_INIT_VALUE
 
#define XOSPIPSV_POLL_CNT_FLD_PHY   0x3U
 
#define XOSPIPSV_POLL_CNT_FLD_NON_PHY   0x1U
 
#define XOSPIPSV_MIN_PHY_FREQ   50000000
 
#define XOSPIPSV_DDR_STATS_REG_DUMMY   0x8U
 
#define XOSPIPSV_REMAP_ADDR_VAL   0x40000000U
 
#define XOSPIPSV_NON_PHY_RD_DLY   0x1U
 

Edge mode selection

#define XOSPIPSV_EDGE_MODE_SDR_PHY   0x0U
 Macros to select different edge modes like SDR+NON-PHY, SDR+PHY and DDR+PHY. More...
 
#define XOSPIPSV_EDGE_MODE_SDR_NON_PHY   0x1U
 
#define XOSPIPSV_EDGE_MODE_DDR_PHY   0x2U
 

DLL delay selection

#define XOSPIPSV_SDR_TX_VAL   0x5U
 Macros to select TX DLL delays. More...
 
#define XOSPIPSV_DDR_TX_VAL   0x0U
 
#define XOSPIPSV_DDR_TX_VAL_MASTER   0x1EU
 
#define XOSPIPSV_SDR_TX_VAL_MASTER   0x3CU
 
#define XOSPIPSV_DLL_MAX_TAPS   0x7FU
 

OSPI Device reset selection

#define XOSPIPSV_HWPIN_RESET   0x0U
 Macros to select HWPIN and INBAND resets. More...
 
#define XOSPIPSV_INBAND_RESET   0x1U
 

DLL mode selection

#define XOSPIPSV_DLL_BYPASS_MODE   0x0U
 Macros to select DLL BYPASS and MASTER modes. More...
 
#define XOSPIPSV_DLL_MASTER_MODE   0x1U
 

Connection mode selection

#define XOSPIPSV_CONNECTION_MODE_SINGLE   0x0U
 Macros to select SINGLE and STACKED connection modes. More...
 
#define XOSPIPSV_CONNECTION_MODE_STACKED   0x1U
 

Dual Byte opcode selection

#define XOSPIPSV_DUAL_BYTE_OP_DISABLE   0x0U
 Macros to enable/disable Dual Byte opcode. More...
 
#define XOSPIPSV_DUAL_BYTE_OP_ENABLE   0x1U
 

Macro Definition Documentation

#define LOCK_MAX_DELAY_CNT   10000000U

Max LOCK delay count.

Referenced by XOspiPsv_WaitForLock().

#define MAX_DELAY_CNT   10000U

< Maximum delay count

Referenced by XOspiPsv_CheckOspiIdle().

#define MAX_DMA_DELAY_CNT   10000000U

Max DMA delay count.

Referenced by XOspiPsv_Exec_Dma().

#define MAX_IDAC_DELAY_CNT   10000000U

Max INDAC delay count.

Referenced by XOspiPsv_IDac_Write().

#define MAX_STIG_DELAY_CNT   50000U

Max STIG delay count.

Referenced by XOspiPsv_Exec_Flash_Cmd().

#define READ_ID   0x9FU

Read Id opcode.

Referenced by FlashReadID(), and XOspiPsv_SetDllDelay().

#define SILICON_VERSION_1   0x10U

Silicon version.

Referenced by XOspiPsv_CfgInitialize().

#define TERA_MACRO   1000000000000U

Macro for 10^12.

Referenced by XOspiPsv_CalculateRxTap().

#define XOSPIPSV_CLK_PRESCALE_2   0U

Macros to select different baud rate divisors.

Referenced by XOspiPsv_SetClkPrescaler().

#define XOSPIPSV_CONNECTION_MODE_SINGLE   0x0U

Macros to select SINGLE and STACKED connection modes.

#define XOSPIPSV_DAC_EN_OPTION   0x1U
#define XOSPIPSV_DLL_BYPASS_MODE   0x0U

Macros to select DLL BYPASS and MASTER modes.

Referenced by XOspiPsv_CfgInitialize().

#define XOSPIPSV_DUAL_BYTE_OP_DISABLE   0x0U

Macros to enable/disable Dual Byte opcode.

Referenced by FlashSetSDRDDRMode().

#define XOSPIPSV_EDGE_MODE_SDR_PHY   0x0U

Macros to select different edge modes like SDR+NON-PHY, SDR+PHY and DDR+PHY.

Referenced by XOspiPsv_SetSdrDdrMode().

#define XOSPIPSV_H_

< prevent circular inclusions

by using protection macros

#define XOSPIPSV_HWPIN_RESET   0x0U
#define XOSPIPSV_IDAC_MODE   0x0U
#define XOSPIPSV_LOWLEVEL_H_

< prevent circular inclusions

by using protection macros

#define XOSPIPSV_NO_SLAVE_SELCT_VALUE   0xFU

Macros to select default OSPI configuration.

#define XOSPIPSV_NUM_OPTIONS   (sizeof(OptionsTable) / sizeof(OptionsMap))

Total number of configuration options.

Referenced by XOspiPsv_GetOptions(), and XOspiPsv_SetOptions().

#define XOSPIPSV_READ_1_1_1   0U

Macros to select Read and Write prototype.

Referenced by XOspiPsv_Get_Proto(), and XOspiPsv_Setup_Dev_Read_Instr_Reg().

#define XOSPIPSV_RXADDR_OVER_32BIT   0x100000000U

< Macro used for more than 32-bit address

Referenced by XOspiPsv_Config_Dma().

#define XOSPIPSV_SDR_TX_VAL   0x5U

Macros to select TX DLL delays.

Referenced by XOspiPsv_SetDllDelay().

#define XOSPIPSV_SELECT_FLASH_CS0   0
#define XOSPIPSV_TAP_GRAN_SEL_MIN_FREQ   120000000U

Minimum frequency for Tap grain selection.

Referenced by XOspiPsv_CfgInitialize().

Typedef Documentation

typedef void(* XOspiPsv_StatusHandler)(void *CallBackRef, u32 StatusEvent)

The handler data type allows the user to define a callback function to handle the asynchronous processing for the OSPIPSV device.

The application using this driver is expected to define a handler of this type to support interrupt driven mode. The handler executes in an interrupt context, so only minimal processing should be performed.

Parameters
CallBackRefis 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 not important to the driver, so it is a void pointer.
StatusEventholds one or more status events that have occurred. See the XOspiPsv_SetStatusHandler() for details on the status events that can be passed in the callback.

Function Documentation

u32 XOspiPsv_CalculateRxTap ( XOspiPsv InstancePtr,
XOspiPsv_Msg FlashMsg,
u8 *  AvgRXTap,
u8 *  MaxWindowSize,
u8  DummyIncr,
u32  TXTap 
)

Calculate the Max window size and the corresponding Average Rx Tap.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
FlashMsgis a pointer to XOspiPsv_Msg instance.
AvgRXTapis a pointer to median Rx Tap.
MaxWindowSizeis a pointer to maximum window size.
DummyIncris a flag to indicate additional dummy.
TXTapis a Tx tap value used while doing Rx tuning.
Returns
  • XST_SUCCESS if lock bit is set.
  • XST_FAILURE if fails.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::DeviceIdData, XOspiPsv::DllMode, XOspiPsv::Extra_DummyCycle, XOspiPsv_Config::InputClockHz, XOspiPsv_Msg::RxBfrPtr, TERA_MACRO, XOspiPsv_ConfigureTaps(), XOspiPsv_PollTransfer(), and XOspiPsv_ReadReg.

Referenced by XOspiPsv_ExecuteRxTuning().

u32 XOspiPsv_CfgInitialize ( XOspiPsv InstancePtr,
const XOspiPsv_Config ConfigPtr 
)

Initializes a specific XOspiPsv instance such that the driver is ready to use.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
ConfigPtris a reference to a structure containing information about a specific OSPIPSV device. This function initializes an InstancePtr object for a specific device specified by the contents of Config.
Returns
  • XST_SUCCESS if successful.
  • XST_DEVICE_IS_STARTED if the device is already started. It must be stopped to re-initialize.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv_Config::ConnectionMode, XOspiPsv::DeviceIdData, XOspiPsv::DllMode, XOspiPsv::DualByteOpcodeEn, XOspiPsv::Extra_DummyCycle, XOspiPsv_Config::InputClockHz, XOspiPsv::IsBusy, XOspiPsv_Config::IsCacheCoherent, XOspiPsv::IsReady, XOspiPsv::IsUnaligned, XOspiPsv::OpMode, XOspiPsv::RecvBufferPtr, XOspiPsv::RxBytes, XOspiPsv::SdrDdrMode, XOspiPsv::SendBufferPtr, SILICON_VERSION_1, XOspiPsv::StatusHandler, XOspiPsv::TxBytes, XOSPIPSV_DLL_BYPASS_MODE, XOSPIPSV_IDAC_MODE, XOspiPsv_Reset(), XOspiPsv_SetSdrDdrMode(), and XOSPIPSV_TAP_GRAN_SEL_MIN_FREQ.

Referenced by OspiPsvFlashNonBlockingReadExample(), OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_CheckDmaDone ( XOspiPsv InstancePtr)

This function check for DMA transfer complete.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
  • XST_SUCCESS if DMA transfer complete.
  • XST_FAILURE if DMA transfer is not completed.

References XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv::IsBusy, XOspiPsv_Config::IsCacheCoherent, XOspiPsv::Msg, XOspiPsv_Msg::RxBfrPtr, XOspiPsv_Msg::Xfer64bit, XOspiPsv_CheckOspiIdle(), and XOspiPsv_ReadReg.

u32 XOspiPsv_CheckOspiIdle ( const XOspiPsv InstancePtr)

Check for OSPI idle which means Serial interface and low level SPI pipeline is IDLE.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if fails.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, and MAX_DELAY_CNT.

Referenced by XOspiPsv_CheckDmaDone(), XOspiPsv_IntrHandler(), XOspiPsv_IntrTransfer(), XOspiPsv_PollTransfer(), XOspiPsv_SetDllDelay(), and XOspiPsv_StartDmaTransfer().

void XOspiPsv_Config_Dma ( const XOspiPsv InstancePtr,
const XOspiPsv_Msg Msg 
)

This function setup the Dma configuration.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
None

References XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv_Config::IsCacheCoherent, XOspiPsv_Msg::RxAddr64bit, XOspiPsv_Msg::RxBfrPtr, XOspiPsv_Msg::Xfer64bit, and XOSPIPSV_RXADDR_OVER_32BIT.

Referenced by XOspiPsv_Dma_Read(), XOspiPsv_IntrHandler(), XOspiPsv_IntrTransfer(), and XOspiPsv_StartDmaTransfer().

void XOspiPsv_Config_IndirectAhb ( const XOspiPsv InstancePtr,
const XOspiPsv_Msg Msg 
)

This function configures the Indirect controller.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
None

References XOspiPsv_Msg::Addr, XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, and XOspiPsv::Config.

Referenced by XOspiPsv_Dma_Read(), XOspiPsv_IntrHandler(), XOspiPsv_IntrTransfer(), and XOspiPsv_StartDmaTransfer().

u32 XOspiPsv_ConfigDualByteOpcode ( XOspiPsv InstancePtr,
u8  Enable 
)

This function configures the dual-byte opcode mode.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Enableis 1 to enable dual-byte opcode, 0 to disable.
Returns
None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::DualByteOpcodeEn, XOspiPsv::IsReady, and XOspiPsv_ReadReg.

Referenced by FlashSetSDRDDRMode().

void XOspiPsv_ConfigureAutoPolling ( const XOspiPsv InstancePtr,
u32  FlashMode 
)

Configures how the controller will poll the device following a write transfer in DAC mode.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
FlashModeis Edge mode. XOSPIPSV_EDGE_MODE_* represents valid values.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if fail to set.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::Extra_DummyCycle, and XOspiPsv_ReadReg.

Referenced by FlashSetSDRDDRMode().

u32 XOspiPsv_ConfigureTaps ( const XOspiPsv InstancePtr,
u32  RxTap,
u32  TxTap 
)

Configures the Rx and Tx taps in Phy Configuration register.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
RxTapis the Rx tap value.
TxTapis the Tx tap value.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if fails.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::DllMode, and XOspiPsv_WaitForLock().

Referenced by XOspiPsv_CalculateRxTap().

u32 XOspiPsv_Dac_Read ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

This function reads the data using Linear controller.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE for invalid address.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::RxBfrPtr, and XOspiPsv::RxBytes.

Referenced by XOspiPsv_PollTransfer().

u32 XOspiPsv_Dac_Write ( XOspiPsv InstancePtr,
const XOspiPsv_Msg Msg 
)

This function writes the data Using Linear controller.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE for invalid address.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::TxBfrPtr, and XOspiPsv::TxBytes.

Referenced by XOspiPsv_PollTransfer().

u32 XOspiPsv_DeviceReset ( u8  Type)

This function reset the OSPI flash device.

Parameters
Typeis Reset type.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE for invalid Reset Type.

References XOSPIPSV_HWPIN_RESET, and XOspiPsv_ReadReg.

Referenced by OspiPsvFlashNonBlockingReadExample(), OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_Dma_Read ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

This function Read the data using DMA.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if transfer fails.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv_Config::IsCacheCoherent, XOspiPsv::IsUnaligned, XOspiPsv::RecvBufferPtr, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::RxBytes, XOspiPsv_Msg::Xfer64bit, XOspiPsv_Config_Dma(), XOspiPsv_Config_IndirectAhb(), and XOspiPsv_Exec_Dma().

Referenced by XOspiPsv_PollTransfer().

u32 XOspiPsv_Exec_Dma ( const XOspiPsv InstancePtr)

This function Initiates the DMA transfer.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if transfer fails.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, MAX_DMA_DELAY_CNT, and XOspiPsv_ReadReg.

Referenced by XOspiPsv_Dma_Read().

u32 XOspiPsv_Exec_Flash_Cmd ( const XOspiPsv InstancePtr)

This function executes the Flash command configured using Flash Command control register.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if transfer fails.
Note
Wait till the command is executed.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, MAX_STIG_DELAY_CNT, and XOspiPsv_ReadReg.

Referenced by XOspiPsv_Stig_Read(), and XOspiPsv_Stig_Write().

u32 XOspiPsv_ExecuteRxTuning ( XOspiPsv InstancePtr,
XOspiPsv_Msg FlashMsg,
u32  TXTap 
)

This API perform RX Tuning for SDR/DDR mode to calculate RX DLL Delay.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
FlashMsgis a pointer to the XOspiPsv_Msg structure.
TXTapis TX DLL Delay value.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if fails.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::DllMode, XOspiPsv_Msg::Dummy, XOspiPsv_CalculateRxTap(), and XOspiPsv_WaitForLock().

Referenced by XOspiPsv_SetDllDelay().

void XOspiPsv_FifoRead ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

Read the data from RX FIFO.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
None
Note
This operation is in IO mode of reading.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::RxBytes, and XOspiPsv_ReadReg.

Referenced by XOspiPsv_IntrHandler(), and XOspiPsv_Stig_Read().

void XOspiPsv_FifoWrite ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

Write data to TX FIFO.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if transfer fails.
Note
This operation is in IO mode of writing.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv_Msg::TxBfrPtr, and XOspiPsv::TxBytes.

Referenced by XOspiPsv_IntrTransfer(), and XOspiPsv_Stig_Write().

u32 XOspiPsv_GetOptions ( const XOspiPsv InstancePtr)

This function gets the options for the OSPIPSV device.

The options control how the device behaves relative to the OSPIPSV bus.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
Options contains the specified options currently set. This is a bit Value where a 1 means the option is on, and a 0 means the option is off. See the bit definitions named XOSPIPSV_*_OPTIONS in file xospipsv.h.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::IsReady, XOSPIPSV_NUM_OPTIONS, and XOspiPsv_ReadReg.

Referenced by MicronBlockProtectTest(), OspiPsvFlashNonBlockingReadExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_IDac_Write ( const XOspiPsv InstancePtr,
const XOspiPsv_Msg Msg 
)

This function Write the data in Non-DMA Indirect mode.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
- XST_SUCCESS if successful.
  • XST_FAILURE if fails.

References XOspiPsv_Msg::Addr, XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, MAX_IDAC_DELAY_CNT, XOspiPsv_Msg::TxBfrPtr, and XOspiPsv_ReadReg.

Referenced by XOspiPsv_PollTransfer().

void XOspiPsv_Idle ( const XOspiPsv InstancePtr)

Stops the transfer of data to internal DST FIFO from stream interface and also stops the issuing of new write commands to memory.

By calling this API, any ongoing Dma transfers will be paused and DMA will not issue AXI write commands to memory

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, and XOspiPsv_ReadReg.

XOspiPsv_Config * XOspiPsv_LookupConfig ( u16  DeviceId)

Looks up the device configuration based on the unique device ID.

A table contains the configuration info for each device in the system.

Parameters
DeviceIdcontains the ID of the device to look up the configuration for.
Returns
A pointer to the configuration found or NULL if the specified device ID was not found. See XOspiPsv.h for the definition of XOspiPsv_Config.

References XOspiPsv_ConfigTable.

Referenced by OspiPsvFlashNonBlockingReadExample(), OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_PollTransfer ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

This function performs a transfer on the bus in polled mode.

The messages passed are all transferred on the bus between one CS assert and de-assert.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if transfer fails.
  • XST_DEVICE_BUSY if a transfer is already in progress.

References XOspiPsv_Msg::Addrvalid, XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv_Msg::Flags, XOspiPsv::IsBusy, XOspiPsv::IsReady, XOspiPsv::Msg, XOspiPsv::OpMode, XOspiPsv::RecvBufferPtr, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::RxBytes, XOspiPsv::SendBufferPtr, XOspiPsv_Msg::TxBfrPtr, XOspiPsv::TxBytes, XOspiPsv_CheckOspiIdle(), XOspiPsv_Dac_Read(), XOspiPsv_Dac_Write(), XOspiPsv_Dma_Read(), XOSPIPSV_IDAC_MODE, XOspiPsv_IDac_Write(), XOSPIPSV_MSG_FLAG_RX, XOspiPsv_ReadReg, XOspiPsv_Setup_Dev_Read_Instr_Reg(), XOspiPsv_Setup_Dev_Write_Instr_Reg(), XOspiPsv_Setup_Devsize(), XOspiPsv_Stig_Read(), and XOspiPsv_Stig_Write().

Referenced by FlashLinearWrite(), SetBlockProtect(), and XOspiPsv_CalculateRxTap().

void XOspiPsv_Reset ( XOspiPsv InstancePtr)

This function reset the configuration register.

The Upper layer software is responsible for re-configuring (if necessary) and restarting the OSPIPSV device after the reset.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
None.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, and XOspiPsv::IsBusy.

Referenced by XOspiPsv_CfgInitialize().

u32 XOspiPsv_SelectFlash ( XOspiPsv InstancePtr,
u8  chip_select 
)

This function should be used to tell the OSPIPSV driver the HW flash configuration being used.

This API should be called at least once in the application. If desired, it can be called multiple times when switching between communicating to different flash devices/using different configs.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
chip_select- Flash Chip Select.
Returns
  • XST_SUCCESS if successful.
  • XST_DEVICE_IS_STARTED if the device is already started. It must be stopped to re-initialize.
Note
If this function is not called at least once in the application, the driver assumes there is a single flash connected to the lower bus and CS line.

References XOspiPsv::ChipSelect.

Referenced by FlashErase(), GetRealAddr(), OspiPsvFlashNonBlockingReadExample(), OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_SetClkPrescaler ( XOspiPsv InstancePtr,
u8  Prescaler 
)

Configures the clock according to the prescaler passed.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Prescaler- clock prescaler to be set.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if failed to set prescaler.
    • XST_DEVICE_IS_STARTED if the device is already started.
    • XST_DEVICE_BUSY if the device is currently transferring data. It must be stopped to re-initialize.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::IsBusy, XOspiPsv::IsReady, XOspiPsv::SdrDdrMode, XOSPIPSV_CLK_PRESCALE_2, XOspiPsv_ReadReg, and XOspiPsv_SetDllDelay().

Referenced by OspiPsvFlashNonBlockingReadExample(), OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_SetDllDelay ( XOspiPsv InstancePtr)
u32 XOspiPsv_SetOptions ( XOspiPsv InstancePtr,
u32  Options 
)

This function sets the options for the OSPIPSV device driver.The options control how the device behaves relative to the OSPIPSV bus.

The device must be idle rather than busy transferring data before setting these device options.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Optionscontains the specified options to be set. This is a bit mask where a 1 indicates the option should be turned ON and a 0 indicates no action. One or more bit Values may be contained in the mask. See the bit definitions named XOSPIPSV_*_OPTIONS in the file xospipsv.h.
Returns
  • XST_SUCCESS if options are successfully set.
  • XST_DEVICE_BUSY if the device is currently transferring data. The transfer must complete or be aborted before setting options.
Note
This function is not thread-safe.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::IsBusy, XOspiPsv::IsReady, XOspiPsv::OpMode, XOSPIPSV_DAC_EN_OPTION, XOSPIPSV_IDAC_MODE, XOSPIPSV_NUM_OPTIONS, and XOspiPsv_ReadReg.

Referenced by OspiPsvFlashNonBlockingReadExample(), OspiPsvInterruptFlashExample(), and OspiPsvPolledFlashExample().

u32 XOspiPsv_SetSdrDdrMode ( XOspiPsv InstancePtr,
u32  Mode 
)

Configures the edge mode (SDR or DDR)

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Modeis Edge mode. XOSPIPSV_EDGE_MODE_* represents valid values.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if fail to set.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::SdrDdrMode, XOSPIPSV_EDGE_MODE_SDR_PHY, XOspiPsv_ReadReg, and XOspiPsv_SetDllDelay().

Referenced by FlashSetSDRDDRMode(), OspiPsvFlashNonBlockingReadExample(), OspiPsvInterruptFlashExample(), OspiPsvPolledFlashExample(), and XOspiPsv_CfgInitialize().

void XOspiPsv_SetStatusHandler ( XOspiPsv InstancePtr,
void *  CallBackRef,
XOspiPsv_StatusHandler  FuncPointer 
)

Sets the status callback function, the status handler, which the driver calls when it encounters conditions that should be reported to upper layer software.

The handler executes in an interrupt context, so it must minimize the amount of processing performed. One of the following status events is passed to the status handler.

XST_SPI_TRANSFER_DONE           The requested data transfer is done
 
Parameters
InstancePtris a pointer to the XOspiPsv instance.
CallBackRefis the upper layer callback reference passed back when the callback function is invoked.
FuncPointeris the pointer to the callback function.
Returns
None.
Note

The handler is called within interrupt context, so it should do its work quickly and queue potentially time-consuming work to a task-level thread.

References XOspiPsv::IsReady, XOspiPsv::StatusHandler, and XOspiPsv::StatusRef.

Referenced by OspiPsvInterruptFlashExample().

void XOspiPsv_Setup_Dev_Read_Instr_Reg ( const XOspiPsv InstancePtr,
const XOspiPsv_Msg Msg 
)

This function configures the below info to read instruction register DataXfertype - SPI/Dual/Quad/Octal AddrXfertype - 3 or 4B.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
None
Note
Used in DMA or Linear operations

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::DualByteOpcodeEn, XOspiPsv_Msg::Dummy, XOspiPsv_Msg::ExtendedOpcode, XOspiPsv_Msg::IsDDROpCode, XOspiPsv_Msg::Opcode, XOspiPsv_Msg::Proto, XOspiPsv::SdrDdrMode, XOSPIPSV_READ_1_1_1, and XOspiPsv_ReadReg.

Referenced by XOspiPsv_IntrTransfer(), XOspiPsv_PollTransfer(), and XOspiPsv_StartDmaTransfer().

void XOspiPsv_Setup_Dev_Write_Instr_Reg ( const XOspiPsv InstancePtr,
const XOspiPsv_Msg Msg 
)

This function configures the below info to write instruction register DataXfertype - SPI/Dual/Quad/Octal AddrXfertype - 3 or 4B.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
None
Note
Used in DMA or Linear operations.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::DualByteOpcodeEn, XOspiPsv_Msg::ExtendedOpcode, XOspiPsv_Msg::Opcode, XOspiPsv_Msg::Proto, and XOspiPsv_ReadReg.

Referenced by XOspiPsv_IntrTransfer(), and XOspiPsv_PollTransfer().

void XOspiPsv_Setup_Devsize ( const XOspiPsv InstancePtr,
const XOspiPsv_Msg Msg 
)

This function sets the device size config register.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
None

References XOspiPsv_Msg::Addrsize, XOspiPsv_Config::BaseAddress, XOspiPsv::Config, and XOspiPsv_ReadReg.

Referenced by XOspiPsv_IntrTransfer(), XOspiPsv_PollTransfer(), and XOspiPsv_StartDmaTransfer().

void XOspiPsv_Setup_Stig_Ctrl ( const XOspiPsv InstancePtr,
u32  Cmd_op,
u32  Rd_data_en,
u32  Num_rd_data_bytes,
u32  Cmd_addr_en,
u32  Mode_bit_en,
u32  Num_addr_bytes,
u32  Wr_data_en,
u32  Num_wr_data_bytes,
u32  Dummy,
u32  Membank_en 
)

This function configures the STIG control register (Flash cmd register)

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Cmd_opis command opcode.
Rd_data_enspecifies whether cmd_op requires data to read or not.
Num_rd_data_bytesis number of bytes to read.
Cmd_addr_enspecifies whether cmd_op requires addr or not.
Mode_bit_enis used to represent mode bit configuration reg.
Num_addr_bytesis used to represent addr bytes (4/3 etc).
Wr_data_enspecifies whether cmd_op requires write enable or not.
Num_wr_data_bytesis number of bytes to write.
Dummyis number of bytes to write.
Membank_enis used to enable STIG memory bank.
Returns
None.

References XOspiPsv_Config::BaseAddress, and XOspiPsv::Config.

Referenced by XOspiPsv_IntrTransfer(), XOspiPsv_Stig_Read(), and XOspiPsv_Stig_Write().

void XOspiPsv_Start_Indr_RdTransfer ( const XOspiPsv InstancePtr)

This function initiates the indirect read transfer.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Returns
None

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, and XOspiPsv_ReadReg.

Referenced by XOspiPsv_IntrHandler(), and XOspiPsv_IntrTransfer().

u32 XOspiPsv_StartDmaTransfer ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

This function start a DMA transfer.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if transfer fails.
  • XST_DEVICE_BUSY if a transfer is already in progress.

References XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv_Msg::Flags, XOspiPsv::IsBusy, XOspiPsv::IsReady, XOspiPsv::Msg, XOspiPsv::OpMode, XOspiPsv::RecvBufferPtr, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::RxBytes, XOspiPsv::SendBufferPtr, XOspiPsv_CheckOspiIdle(), XOspiPsv_Config_Dma(), XOspiPsv_Config_IndirectAhb(), XOSPIPSV_IDAC_MODE, XOSPIPSV_MSG_FLAG_RX, XOspiPsv_ReadReg, XOspiPsv_Setup_Dev_Read_Instr_Reg(), and XOspiPsv_Setup_Devsize().

u32 XOspiPsv_Stig_Read ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

Flash command based data reading using flash command control registers.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if transfer fails.
Note
This operation is in IO mode of reading.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::Addrsize, XOspiPsv_Msg::Addrvalid, XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::DualByteOpcodeEn, XOspiPsv_Msg::Dummy, XOspiPsv_Msg::ExtendedOpcode, XOspiPsv_Msg::Opcode, XOspiPsv::RxBytes, XOspiPsv_Exec_Flash_Cmd(), XOspiPsv_FifoRead(), XOspiPsv_ReadReg, and XOspiPsv_Setup_Stig_Ctrl().

Referenced by XOspiPsv_PollTransfer().

u32 XOspiPsv_Stig_Write ( XOspiPsv InstancePtr,
XOspiPsv_Msg Msg 
)

Flash command based data write using flash command control registers.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Msgis a pointer to the structure containing transfer data.
Returns
  • XST_SUCCESS if successful.
  • XST_FAILURE if fails.
Note
This operation is in IO mode of writing.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::Addrsize, XOspiPsv_Msg::Addrvalid, XOspiPsv_Config::BaseAddress, XOspiPsv::Config, XOspiPsv::DualByteOpcodeEn, XOspiPsv_Msg::ExtendedOpcode, XOspiPsv_Msg::Opcode, XOspiPsv::TxBytes, XOspiPsv_Exec_Flash_Cmd(), XOspiPsv_FifoWrite(), XOspiPsv_ReadReg, and XOspiPsv_Setup_Stig_Ctrl().

Referenced by XOspiPsv_PollTransfer().

u32 XOspiPsv_WaitForLock ( const XOspiPsv InstancePtr,
u32  Mask 
)

Wait for bit to be set.

This API polls for the required bit for 10sec, if not set then timeout occurs.

Parameters
InstancePtris a pointer to the XOspiPsv instance.
Maskis a bit mask to check for lock.
Returns
  • XST_SUCCESS if lock bit is set.
  • XST_FAILURE if fails.

References XOspiPsv_Config::BaseAddress, XOspiPsv::Config, and LOCK_MAX_DELAY_CNT.

Referenced by XOspiPsv_ConfigureTaps(), XOspiPsv_ExecuteRxTuning(), and XOspiPsv_SetDllDelay().

Variable Documentation

XOspiPsv_Config XOspiPsv_ConfigTable[XPAR_XOSPIPSV_NUM_INSTANCES]
Initial value:
=
{
{
XPAR_XOSPIPSV_0_DEVICE_ID,
XPAR_XOSPIPSV_0_BASEADDR,
XPAR_XOSPIPSV_0_OSPI_CLK_FREQ_HZ,
XPAR_XOSPIPSV_0_IS_CACHE_COHERENT,
XPAR_XOSPIPSV_0_OSPI_MODE
}
}

The configuration table for devices.

Referenced by XOspiPsv_LookupConfig().

XOspiPsv_Config XOspiPsv_ConfigTable[]

The configuration table for devices.

Referenced by XOspiPsv_LookupConfig().