| ospipsv Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Functions | Variables
OSPIPSV APIs

## 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 | 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 | XOSPIPSV_TAP_GRAN_SEL_MIN_FREQ 120000000U
| Minimum frequency for Tap grain selection. 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 so that the driver is ready to use. More...
void | XOspiPsv_Reset (XOspiPsv *InstancePtr)
| Resets the configuration register. More...
u32 | XOspiPsv_DeviceReset (u8 Type)
| Reset the OSPI flash device. More...
u32 | XOspiPsv_DeviceResetViaOspi (const XOspiPsv *InstancePtr, u8 Type)
| Resets the OSPI flash device via OSPI controller. More...
u32 | XOspiPsv_PollTransfer (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
| Performs a transfer on the bus in polled mode. More...
u32 | XOspiPsv_StartDmaTransfer (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
| Starts a DMA transfer. More...
u32 | XOspiPsv_CheckDmaDone (XOspiPsv *InstancePtr)
| Checks for DMA transfer complete. More...
u32 | XOspiPsv_IntrTransfer (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
| Performs a transfer on the bus in interrupt mode. More...
u32 | XOspiPsv_IntrHandler (XOspiPsv *InstancePtr)
| 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)
| Configures TX and RX DLL Delay. More...
u32 | XOspiPsv_ConfigDualByteOpcode (XOspiPsv *InstancePtr, u8 Enable)
| 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_Config * | XOspiPsv_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)
| Used to signify the OSPIPSV driver that the Hardware flash configuration being used. More...
u32 | XOspiPsv_SetOptions (XOspiPsv *InstancePtr, u32 Options)
| 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)
| 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)
| Reads the data using DMA. More...
u32 | XOspiPsv_Dac_Read (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
| Reads the data using Linear controller. More...
u32 | XOspiPsv_Dac_Write (XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
| Writes the data Using Linear controller. More...
u32 | XOspiPsv_ExecuteRxTuning (XOspiPsv *InstancePtr, XOspiPsv_Msg *FlashMsg, u32 TXTap)
| Performs 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)
| Checks 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)
| Writes data in Non-DMA Indirect mode. More...
void | XOspiPsv_FifoRead (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
| Reads data from RX FIFO. More...
void | XOspiPsv_FifoWrite (XOspiPsv *InstancePtr, XOspiPsv_Msg *Msg)
| Writes 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)
| Configures the STIG control register (Flash cmd register). More...
void | XOspiPsv_Setup_Dev_Write_Instr_Reg (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
| 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)
| 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)
| Sets the device size config register. More...
void | XOspiPsv_Start_Indr_RdTransfer (const XOspiPsv *InstancePtr)
| Initiates the indirect read transfer. More...
void | XOspiPsv_Config_IndirectAhb (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
| Configures the Indirect controller. More...
void | XOspiPsv_Config_Dma (const XOspiPsv *InstancePtr, const XOspiPsv_Msg *Msg)
| Sets up the Dma configuration. More...
u32 | XOspiPsv_Exec_Dma (const XOspiPsv *InstancePtr)
| Initiates the DMA transfer. More...
u32 | XOspiPsv_Exec_Flash_Cmd (const XOspiPsv *InstancePtr)
| Executes the Flash command configured using Flash Command control register. More...
u32 | XOspiPsv_WaitForLock (const XOspiPsv *InstancePtr, u32 Mask)
| Waits for bit to be set. More...
u32 | XOspiPsv_CalculateRxTap (XOspiPsv *InstancePtr, XOspiPsv_Msg *FlashMsg, u8 *AvgRXTap, u8 *MaxWindowSize, u8 DummyIncr, u32 TXTap)
| Calculates 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_0_1 1U
#define | XOSPIPSV_READ_1_1_2 2U
#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_0 6U
#define | XOSPIPSV_READ_8_8_0 7U
#define | XOSPIPSV_READ_8_0_8 8U
#define | XOSPIPSV_READ_1_1_4 9U
#define | XOSPIPSV_READ_4_4_4 10U
#define | XOSPIPSV_WRITE_1_1_1 0U
#define | XOSPIPSV_WRITE_1_0_1 1U
#define | XOSPIPSV_WRITE_1_1_2 2U
#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
#define | XOSPIPSV_WRITE_1_1_4 9U
#define | XOSPIPSV_WRITE_4_4_4 10U

## 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
#define | XOSPIPSV_DUAL_BYTE_OP_SAME 0x2U

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

User configuration options.

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

#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

Macros to select HWPIN and INBAND resets.

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

#define XOSPIPSV_IDAC_MODE 0x0U

Macros to select INDAC and DAC modes.

Referenced by XOspiPsv_CfgInitialize(), XOspiPsv_Get_Proto(), XOspiPsv_PollTransfer(), XOspiPsv_SetOptions(), and XOspiPsv_StartDmaTransfer().

#define XOSPIPSV_LOWLEVEL_H_

< prevent circular inclusions

by using protection macros

#define XOSPIPSV_MSG_FLAG_RX 0x2U

Macros to select RX and TX transfer flags.

Referenced by BulkErase(), DieErase(), FlashEnterExit4BAddMode(), FlashErase(), FlashIoWrite(), FlashRead(), FlashReadID(), FlashSetSDRDDRMode(), MxConfigDummy(), SetBlockProtect(), SpansionSetEccMode(), XOspiPsv_IntrHandler(), XOspiPsv_IntrTransfer(), XOspiPsv_PollTransfer(), XOspiPsv_SetDllDelay(), and XOspiPsv_StartDmaTransfer().

#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(), XOspiPsv_PollTransfer(), and XOspiPsv_Setup_Dev_Read_Instr_Reg().

#define XOspiPsv_ReadReg | ( |  | BaseAddress,
|  |  | RegOffset
| ) |  | Xil_In32((BaseAddress) + (u32)(RegOffset))

Low level macros to read/write memory.

Referenced by XOspiPsv_CalculateRxTap(), XOspiPsv_CheckDmaDone(), XOspiPsv_ConfigDualByteOpcode(), XOspiPsv_ConfigureAutoPolling(), XOspiPsv_DeviceReset(), XOspiPsv_DeviceResetViaOspi(), XOspiPsv_Exec_Dma(), XOspiPsv_Exec_Flash_Cmd(), XOspiPsv_FifoRead(), XOspiPsv_GetOptions(), XOspiPsv_IDac_Write(), XOspiPsv_Idle(), XOspiPsv_IntrHandler(), XOspiPsv_IntrTransfer(), XOspiPsv_PollTransfer(), XOspiPsv_SetClkPrescaler(), XOspiPsv_SetOptions(), XOspiPsv_SetSdrDdrMode(), XOspiPsv_Setup_Dev_Read_Instr_Reg(), XOspiPsv_Setup_Dev_Write_Instr_Reg(), XOspiPsv_Setup_Devsize(), XOspiPsv_Start_Indr_RdTransfer(), XOspiPsv_StartDmaTransfer(), XOspiPsv_Stig_Read(), and XOspiPsv_Stig_Write().

#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

Macros to select CS0 and CS1.

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

#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

  CallBackRef | 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.
  StatusEvent | Holds 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
| ) |  |

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

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  FlashMsg | Pointer to XOspiPsv_Msg instance.
  AvgRXTap | Pointer to median Rx Tap.
  MaxWindowSize | Pointer to maximum window size.
  DummyIncr | Flag to indicate additional dummy.
  TXTap | 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 so that the driver is ready to use.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  ConfigPtr | 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::BusWidth, 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 | ) |

Checks for DMA transfer complete.

Parameters

  InstancePtr | 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 | ) |

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

Parameters

  InstancePtr | 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
| ) |  |

Sets up the Dma configuration.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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
| ) |  |

Configures the Indirect controller.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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
| ) |  |

Configures the dual-byte opcode mode.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Enable | 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

  InstancePtr | Pointer to the XOspiPsv instance.
  FlashMode | 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

  InstancePtr | Pointer to the XOspiPsv instance.
  RxTap | Rx tap value.
  TxTap | 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
| ) |  |

Reads the data using Linear controller.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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
| ) |  |

Writes the data Using Linear controller.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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 | ) |

Reset the OSPI flash device.

Parameters

  Type | 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_DeviceResetViaOspi | ( | const XOspiPsv * | InstancePtr,
|  | u8 | Type
| ) |  |

Resets the OSPI flash device via OSPI controller.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Type | Resets type.

Returns
  - XST_SUCCESS if successful.

- XST_FAILURE for invalid Reset Type.

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

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

u32 XOspiPsv_Dma_Read | ( | XOspiPsv * | InstancePtr,
|  | XOspiPsv_Msg * | Msg
| ) |  |

Reads the data using DMA.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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 | ) |

Initiates the DMA transfer.

Parameters

  InstancePtr | 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 | ) |

Executes the Flash command configured using Flash Command control register.

Parameters

  InstancePtr | 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
| ) |  |

Performs RX Tuning for SDR/DDR mode to calculate RX DLL Delay.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  FlashMsg | Pointer to the XOspiPsv_Msg structure.
  TXTap | 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
| ) |  |

Reads data from RX FIFO.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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
| ) |  |

Writes data to TX FIFO.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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 | ) |

Gets the options for the OSPIPSV device.

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

Parameters

  InstancePtr | 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
| ) |  |

Writes data in Non-DMA Indirect mode.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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

  InstancePtr | Pointer to the XOspiPsv instance.

Returns
  None.

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

u32 XOspiPsv_IntrHandler | ( | XOspiPsv * | InstancePtr | ) |

Handles interrupt based transfers.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.

Returns
  - XST_SUCCESS if successful.
  - XST_DEVICE_BUSY if a transfer is already in progress.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::Addrvalid, XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv_Msg::Flags, XOspiPsv::IsBusy, XOspiPsv_Config::IsCacheCoherent, XOspiPsv::IsUnaligned, XOspiPsv::Msg, XOspiPsv::RecvBufferPtr, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::RxBytes, XOspiPsv::StatusHandler, XOspiPsv::StatusRef, XOspiPsv_Msg::Xfer64bit, XOspiPsv_CheckOspiIdle(), XOspiPsv_Config_Dma(), XOspiPsv_Config_IndirectAhb(), XOspiPsv_FifoRead(), XOSPIPSV_MSG_FLAG_RX, XOspiPsv_ReadReg, and XOspiPsv_Start_Indr_RdTransfer().

Referenced by OspiPsvInterruptFlashExample().

u32 XOspiPsv_IntrTransfer | ( | XOspiPsv * | InstancePtr,
|  | XOspiPsv_Msg * | Msg
| ) |  |

Performs a transfer on the bus in interrupt mode.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | Pointer to the structure containing transfer data.

Returns
  - XST_SUCCESS if successful.
  - XST_DEVICE_BUSY if a transfer is already in progress.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::Addrsize, XOspiPsv_Msg::Addrvalid, XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv_Msg::Dummy, XOspiPsv_Msg::Flags, XOspiPsv::IsBusy, XOspiPsv::IsReady, XOspiPsv::IsUnaligned, XOspiPsv::Msg, XOspiPsv_Msg::Opcode, XOspiPsv::OpMode, XOspiPsv::RecvBufferPtr, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::RxBytes, XOspiPsv::SendBufferPtr, XOspiPsv_Msg::TxBfrPtr, XOspiPsv::TxBytes, XOspiPsv_CheckOspiIdle(), XOspiPsv_Config_Dma(), XOspiPsv_Config_IndirectAhb(), XOspiPsv_FifoWrite(), XOSPIPSV_MSG_FLAG_RX, XOspiPsv_ReadReg, XOspiPsv_Setup_Dev_Read_Instr_Reg(), XOspiPsv_Setup_Dev_Write_Instr_Reg(), XOspiPsv_Setup_Devsize(), XOspiPsv_Setup_Stig_Ctrl(), and XOspiPsv_Start_Indr_RdTransfer().

Referenced by BulkErase(), DieErase(), FlashEnterExit4BAddMode(), FlashErase(), FlashIoWrite(), FlashRead(), FlashReadID(), FlashSetSDRDDRMode(), MxConfigDummy(), and SpansionSetEccMode().

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

  DeviceId | Contains 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
| ) |  |

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

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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_Msg::Proto, 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_READ_1_1_1, 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 | ) |

Resets the configuration register.

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

Parameters

  InstancePtr | 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
| ) |  |

Used to signify the OSPIPSV driver that the Hardware 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 configuration.

Parameters

  InstancePtr | 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

  InstancePtr | 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 | ) |

Configures TX and RX DLL Delay.

Based on the mode and reference clock this API calculates the RX delay and configure them in PHY configuration register.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.

Returns
  - XST_SUCCESS if successful.
  - XST_FAILURE if fails.

References XOspiPsv_Msg::Addr, XOspiPsv_Msg::Addrsize, XOspiPsv_Msg::Addrvalid, XOspiPsv_Config::BaseAddress, XOspiPsv_Msg::ByteCount, XOspiPsv::Config, XOspiPsv::DllMode, XOspiPsv::DualByteOpcodeEn, XOspiPsv_Msg::Dummy, XOspiPsv_Msg::ExtendedOpcode, XOspiPsv::Extra_DummyCycle, XOspiPsv_Msg::Flags, XOspiPsv_Msg::IsDDROpCode, XOspiPsv_Msg::Opcode, XOspiPsv_Msg::Proto, READ_ID, XOspiPsv_Msg::RxBfrPtr, XOspiPsv::SdrDdrMode, XOspiPsv_Msg::TxBfrPtr, XOspiPsv_CheckOspiIdle(), XOspiPsv_ExecuteRxTuning(), XOSPIPSV_MSG_FLAG_RX, XOSPIPSV_SDR_TX_VAL, and XOspiPsv_WaitForLock().

Referenced by XOspiPsv_SetClkPrescaler(), and XOspiPsv_SetSdrDdrMode().

u32 XOspiPsv_SetOptions | ( | XOspiPsv * | InstancePtr,
|  | u32 | Options
| ) |  |

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

  InstancePtr | Pointer to the XOspiPsv instance.
  Options | Contains 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

  InstancePtr | Pointer to the XOspiPsv instance.
  Mode | 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

  InstancePtr | Pointer to the XOspiPsv instance.
  CallBackRef | Upper layer callback reference passed back when the callback function is invoked.
  FuncPointer | 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
| ) |  |

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

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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
| ) |  |

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

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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
| ) |  |

Sets the device size config register.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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
| ) |  |

Configures the STIG control register (Flash cmd register).

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Cmd_op | Command opcode.
  Rd_data_en | Specifies whether cmd_op requires data to read or not.
  Num_rd_data_bytes | Number of bytes to read.
  Cmd_addr_en | Specifies whether cmd_op requires addr or not.
  Mode_bit_en | Represents mode bit configuration register.
  Num_addr_bytes | Represents addr bytes (4/3 etc).
  Wr_data_en | Specifies whether cmd_op requires write enable or not.
  Num_wr_data_bytes | Number of bytes to write.
  Dummy | Number of bytes to write.
  Membank_en | Enables 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 | ) |

Initiates the indirect read transfer.

Parameters

  InstancePtr | 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
| ) |  |

Starts a DMA transfer.

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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

  InstancePtr | Pointer to the XOspiPsv instance.
  Msg | 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
| ) |  |

Waits for bit to be set.

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

Parameters

  InstancePtr | Pointer to the XOspiPsv instance.
  Mask | 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().