This module contains APIs to program and use the OSPI module. The APIs can be used by other drivers to get access to OSPI and also by application to initiate data transfer operation.
Sub Modules | |
APIs to get temperature from VTM Module | |
Generic NOR Flash API for single pin mode | |
Files | |
file | ospi/v0/ospi.h |
OSPI Driver API/interface file. | |
Data Structures | |
struct | OSPI_Transaction |
Data structure used with OSPI_Transfers - OSPI_readDirect, OSPI_writeDirect, OSPI_readIndirect, OSPI_writeIndirect. More... | |
struct | OSPI_WriteCmdParams |
struct | OSPI_ReadCmdParams |
struct | OSPI_AddrRegion |
OSPI Address Region. More... | |
struct | OSPI_PhyTuneWindowParams |
OSPI PHY Tuning Window Parameters. More... | |
struct | OSPI_PhyConfiguration |
OSPI PHY Configuration. More... | |
struct | OSPI_Params |
OSPI Parameters. More... | |
struct | OSPI_Attrs |
OSPI instance attributes - used during init time. More... | |
struct | OSPI_Object |
OSPI driver object. More... | |
struct | OSPI_Config |
Functions | |
void | OSPI_init (void) |
This function initializes the OSPI module. More... | |
void | OSPI_deinit (void) |
This function de-initializes the OSPI module. More... | |
void | OSPI_Params_init (OSPI_Params *ospiParams) |
Initialize data structure with defaults. More... | |
OSPI_Handle | OSPI_open (uint32_t index, const OSPI_Params *openParams) |
This function opens a given OSPI peripheral. More... | |
void | OSPI_close (OSPI_Handle handle) |
Function to close a OSPI peripheral specified by the OSPI handle. More... | |
OSPI_Handle | OSPI_getHandle (uint32_t index) |
This function returns the handle of an open OSPI Instance from the instance index. More... | |
int32_t | OSPI_readCmd (OSPI_Handle handle, OSPI_ReadCmdParams *rdParams) |
Function to send specific commands and receive related data from flash. More... | |
int32_t | OSPI_writeCmd (OSPI_Handle handle, OSPI_WriteCmdParams *wrParams) |
Function to send specific commands and related data to flash. More... | |
void | OSPI_Transaction_init (OSPI_Transaction *trans) |
Function to initialize the OSPI_Transaction structure. More... | |
void | OSPI_ReadCmdParams_init (OSPI_ReadCmdParams *rdParams) |
Function to initialize the OSPI_ReadCmdParams structure. More... | |
void | OSPI_WriteCmdParams_init (OSPI_WriteCmdParams *wrParams) |
Function to initialize the OSPI_WriteCmdParams structure. More... | |
uint32_t | OSPI_getInputClk (OSPI_Handle handle) |
This function returns the input clk frequency OSPI was programmed at. More... | |
uint32_t | OSPI_isDacEnable (OSPI_Handle handle) |
This function checks if the Direct Access Controller is enabled. More... | |
uint32_t | OSPI_isDmaEnable (OSPI_Handle handle) |
This function checks if DMA is enabled for reads. More... | |
uint32_t | OSPI_isIntrEnable (OSPI_Handle handle) |
This function checks if interrupts are enabled. More... | |
uint32_t | OSPI_isPhyEnable (OSPI_Handle handle) |
This function checks if the OSPI PHY controller is enabled. More... | |
uint32_t | OSPI_isDtrEnable (OSPI_Handle handle) |
This function checks if the Dual Transfer Rate (Sampling on both rising and falling edge of the clock) is enabled. More... | |
int32_t | OSPI_enableDDR (OSPI_Handle handle) |
This function enables the Dual Data Rate (DDR) More... | |
int32_t | OSPI_enableSDR (OSPI_Handle handle) |
This function enables the Single Data Rate (SDR) More... | |
int32_t | OSPI_enableDdrRdCmds (OSPI_Handle handle) |
This function sets DDR bit in INSTR_RD register for RD commands. More... | |
int32_t | OSPI_setRdDataCaptureDelay (OSPI_Handle handle, uint32_t rdDataCapDelay, uint32_t updatePhyRdDelay) |
This function sets read data capture cycles in the OSPI controller. More... | |
void | OSPI_setNumAddrBytes (OSPI_Handle handle, uint32_t numAddrBytes) |
This function set the number of bytes used to send address while reading or writing to flash memory. More... | |
void | OSPI_setDeviceSize (OSPI_Handle handle, uint32_t pageSize, uint32_t blkSize) |
This function sets the block size and page size of the flash to the device size register in OSPI. More... | |
void | OSPI_setCmdDummyCycles (OSPI_Handle handle, uint32_t cmdDummyCycles) |
This function sets appropriate dummy cycles to be used while sending STIG commands to flash. More... | |
void | OSPI_setReadDummyCycles (OSPI_Handle handle, uint32_t dummyCycles) |
This function sets appropriate dummy cycles for flash read. More... | |
void | OSPI_setRdDummyValPhyMode (OSPI_Handle handle, uint32_t rdDummyValPhyMode) |
This function sets value by which read dummy cycles need to be updated for OSPI read in Phy Mode. More... | |
void | OSPI_setPhyEnableSuccess (OSPI_Handle handle, uint32_t success) |
This function sets the phyEnableSuccess field in OSPI_Object. Has to be called from flash driver. More... | |
void | OSPI_setModeBits (OSPI_Handle handle, uint32_t modeBits) |
This function sets mode bits in the mode bit field of OSPI config register. More... | |
void | OSPI_enableModeBitsCmd (OSPI_Handle handle) |
This function enables mode bits transmission while sending CMDs. More... | |
void | OSPI_enableModeBitsRead (OSPI_Handle handle) |
This function enables mode bits transmission while reading. More... | |
uint32_t | OSPI_getPhyEnableSuccess (OSPI_Handle handle) |
This function fetches the phyEnableSuccess field in OSPI_Object. More... | |
void | OSPI_cmdModeBitSet (OSPI_Handle handle, uint32_t enable) |
This function sets command mode bit. More... | |
void | OSPI_rdModeBitSet (OSPI_Handle handle, uint32_t enable) |
This function sets Read mode bit. More... | |
uint32_t | OSPI_getProtocol (OSPI_Handle handle) |
This function returns the current protocol for which the transfer lines in OSPI driver is configured for. More... | |
void | OSPI_setProtocol (OSPI_Handle handle, uint32_t protocol) |
This function sets the number of transfer lines in the OSPI driver to set the requested protocol. More... | |
void | OSPI_setDualOpCodeMode (OSPI_Handle handle) |
This function sets OSPI controller to use dual byte opcodes. More... | |
void | OSPI_clearDualOpCodeMode (OSPI_Handle handle) |
This function sets OSPI controller to not use dual byte opcodes. More... | |
void | OSPI_setXferOpCodes (OSPI_Handle handle, uint8_t readCmd, uint8_t pageProgCmd) |
This function sets the opcodes for reading and page programming the flash. More... | |
void | OSPI_setCmdExtType (OSPI_Handle handle, uint32_t cmdExtType) |
This function sets the type of command extension used in dual byte opcode mode. More... | |
int32_t | OSPI_enableDacMode (OSPI_Handle handle) |
This function enables the Direct Access Mode. More... | |
int32_t | OSPI_disableDacMode (OSPI_Handle handle) |
This function disables the Direct Access Mode. More... | |
uint32_t | OSPI_getFlashDataBaseAddr (OSPI_Handle handle) |
This function gets the SOC mapped data base address of the flash. More... | |
int32_t | OSPI_phyTuneDDR (OSPI_Handle handle, uint32_t flashOffset) |
This function tunes the OSPI PHY for DDR mode to set optimal PHY parameters. More... | |
int32_t | OSPI_phyTuneSDR (OSPI_Handle handle, uint32_t flashOffset) |
This function tunes the OSPI PHY for SDR mode to set optimal PHY parameters. More... | |
int32_t | OSPI_phyTuneGrapher (OSPI_Handle handle, uint32_t flashOffset, uint8_t arrays[4][128][128]) |
This function takes a 4x128x128 array and fills it with TX RX DLL data for graphing purpose. More... | |
void | OSPI_phyGetTuningData (uint32_t *tuningData, uint32_t *tuningDataSize) |
This function returns the address to the attack vector buf required for tuning the PHY. More... | |
int32_t | OSPI_phyReadAttackVector (OSPI_Handle handle, uint32_t offset) |
This function checks if the attack vector, or the data used for tuning the PHY is present at an offset in the flash. More... | |
void | OSPI_phyReadTunedVal (OSPI_Handle handle) |
This function reads OSPI PHY values if the previous stage has already configured it. More... | |
void | OSPI_phyWriteTunedVal (OSPI_Handle handle) |
This function writes OSPI PHY DLL values if the previous stage has already configured it. More... | |
void | OSPI_phyResyncDLL (OSPI_Handle handle) |
This function resyncs the DLL values. More... | |
int32_t | OSPI_enablePhy (OSPI_Handle handle) |
This function enables the PHY. More... | |
int32_t | OSPI_disablePhy (OSPI_Handle handle) |
This function disables the PHY. More... | |
int32_t | OSPI_enablePhyPipeline (OSPI_Handle handle) |
This function enables the PHY Pipeline. More... | |
int32_t | OSPI_disablePhyPipeline (OSPI_Handle handle) |
This function disables the PHY Pipeline. More... | |
int32_t | OSPI_skipTuning (OSPI_Handle handle) |
This function checks if OSPI tuning should be skipped based on user input and if phy bit is set. More... | |
Typedefs | |
typedef void * | OSPI_Handle |
A handle that is returned from a OSPI_open() call. More... | |
Transfer Status Code | |
Status codes that are set by the OSPI driver | |
#define | OSPI_TRANSFER_COMPLETED (0U) |
#define | OSPI_TRANSFER_STARTED (1U) |
#define | OSPI_TRANSFER_CANCELLED (2U) |
#define | OSPI_TRANSFER_FAILED (3U) |
#define | OSPI_TRANSFER_CSN_DEASSERT (4U) |
#define | OSPI_TRANSFER_TIMEOUT (5U) |
Transfer Mode | |
This determines whether the driver operates synchronously or asynchronously In OSPI_TRANSFER_MODE_BLOCKING OSPI_Transfers block code execution until the transaction has completed In OSPI_TRANSFER_MODE_CALLBACK OSPI_Transfers does not block code execution and instead calls a callback function when the transaction has completed | |
#define | OSPI_TRANSFER_MODE_BLOCKING (0U) |
OSPI_Transfers blocks execution. This mode can only be used when called within a Task context and is interrupt based More... | |
#define | OSPI_TRANSFER_MODE_CALLBACK (1U) |
OSPI_Transfers does not block code execution and will call a callback function. This mode can be used in a Task, Swi, or Hwi context More... | |
#define | OSPI_TRANSFER_MODE_POLLING (2U) |
OSPI_Transfers blocks execution. This mode can only be used when called within a Task context and is polling based. More... | |
Frame Format | |
Definitions for various SPI data frame formats POL0 = OSPICLK is held low during the INACTIVE state POL1 = OSPICLK is held high during the INACTIVE state PHA0 = Data launch is on the falling edge of OSPICLK PHA1 = Data launch is on the rising edge of OSPICLK | |
#define | OSPI_FF_POL0_PHA0 (0U) |
#define | OSPI_FF_POL0_PHA1 (CSL_OSPI_FLASH_CFG_CONFIG_REG_SEL_CLK_PHASE_FLD_MASK | 0U) |
#define | OSPI_FF_POL1_PHA0 (0U | CSL_OSPI_FLASH_CFG_CONFIG_REG_SEL_CLK_POL_FLD_MASK) |
#define | OSPI_FF_POL1_PHA1 |
Macros for invalid commands | |
Macros for invalid commands | |
#define | OSPI_CMD_INVALID_OPCODE (0xFFU) |
#define | OSPI_CMD_INVALID_DUMMY (0xFFU) |
#define | OSPI_CMD_INVALID_ADDR (0xFFFFFFFFU) |
Macros for command extension types | |
Macros for command extension types | |
#define | OSPI_CMD_EXT_TYPE_REPEAT (0x00U) |
#define | OSPI_CMD_EXT_TYPE_INVERSE (0x01U) |
#define | OSPI_CMD_EXT_TYPE_NONE (0x02U) |
Macros for OSPI protocol types | |
Macros for protocol types | |
#define | OSPI_FLASH_PROTOCOL(cmd, addr, data, dtr) |
#define | OSPI_FLASH_PROTOCOL_INVALID (uint32_t)(0xFFFFFFFF) |
Chip Selects | |
Chip selects | |
#define | OSPI_CS0 (0U) |
#define | OSPI_CS1 (1U) |
#define | OSPI_CS2 (2U) |
#define | OSPI_CS3 (3U) |
#define | OSPI_CHIP_SELECT(x) ((~((1U) << (x))) & 0xFU) |
Decoder Chip Selects | |
Decoder Chip selects | |
#define | OSPI_DECODER_SELECT4 ((uint32_t) 0U) |
#define | OSPI_DECODER_SELECT16 ((uint32_t) 1U) |
OSPI Dma Copy Lower Limit | |
Minimum bytes of data for which DMA copy takes lesser time than pointer copy for each flash topology | |
#define | OSPI_NOR_DMA_COPY_LOWER_LIMIT (1024U) |
#define | OSPI_NAND_DMA_COPY_LOWER_LIMIT (256U) |
OSPI PHY Control Mode | |
Controls the bypass mode of the master and slave DLLs. If this bit is set, the bypass mode is intended to be used only for debug. 0h = Master operational mode DLL works in normal mode of operation where the slave delay line settings are used as fractional delay of the master delay line encoder reading of the number of delays in one cycle. 1h = Bypass mode Master DLL is disabled with only 1 delay element in its delay line. The slave delay lines decode delays in absolute delay elements rather than as fractional delays. | |
#define | OSPI_FLASH_CFG_PHY_MASTER_CONTROL_REG_PHY_MASTER_MODE (0U) |
#define | OSPI_FLASH_CFG_PHY_MASTER_CONTROL_REG_PHY_BYPASS_MODE (1U) |
OSPI PHY DLL Lock | |
Determines if the master delay line locks on a full cycle or half cycle of delay. This bit need not be written by software. Force DLL lock mode with this setting. | |
#define | OSPI_PHY_DLL_FULL_CYCLE_LOCK ((uint16_t) 0U) |
#define | OSPI_PHY_DLL_HALF_CYCLE_LOCK ((uint16_t) 1U) |
Different OSPI Transfer functions | |
int32_t | OSPI_readDirect (OSPI_Handle handle, OSPI_Transaction *trans) |
Function to perform direct reads from the flash using DAC controller. More... | |
int32_t | OSPI_readIndirect (OSPI_Handle handle, OSPI_Transaction *trans) |
Function to perform indirect reads from the flash using INDAC controller. More... | |
int32_t | OSPI_writeDirect (OSPI_Handle handle, OSPI_Transaction *trans) |
Function to perform direct writes to the flash using DAC controller. More... | |
int32_t | OSPI_writeIndirect (OSPI_Handle handle, OSPI_Transaction *trans) |
Function to perform indirect writes to the flash using INDAC controller. More... | |
#define OSPI_TRANSFER_COMPLETED (0U) |
#define OSPI_TRANSFER_STARTED (1U) |
#define OSPI_TRANSFER_CANCELLED (2U) |
#define OSPI_TRANSFER_FAILED (3U) |
#define OSPI_TRANSFER_CSN_DEASSERT (4U) |
#define OSPI_TRANSFER_TIMEOUT (5U) |
#define OSPI_TRANSFER_MODE_BLOCKING (0U) |
OSPI_Transfers blocks execution. This mode can only be used when called within a Task context and is interrupt based
#define OSPI_TRANSFER_MODE_CALLBACK (1U) |
OSPI_Transfers does not block code execution and will call a callback function. This mode can be used in a Task, Swi, or Hwi context
#define OSPI_TRANSFER_MODE_POLLING (2U) |
OSPI_Transfers blocks execution. This mode can only be used when called within a Task context and is polling based.
#define OSPI_FF_POL0_PHA0 (0U) |
#define OSPI_FF_POL0_PHA1 (CSL_OSPI_FLASH_CFG_CONFIG_REG_SEL_CLK_PHASE_FLD_MASK | 0U) |
#define OSPI_FF_POL1_PHA0 (0U | CSL_OSPI_FLASH_CFG_CONFIG_REG_SEL_CLK_POL_FLD_MASK) |
#define OSPI_FF_POL1_PHA1 |
#define OSPI_CMD_INVALID_OPCODE (0xFFU) |
#define OSPI_CMD_INVALID_DUMMY (0xFFU) |
#define OSPI_CMD_INVALID_ADDR (0xFFFFFFFFU) |
#define OSPI_CMD_EXT_TYPE_REPEAT (0x00U) |
#define OSPI_CMD_EXT_TYPE_INVERSE (0x01U) |
#define OSPI_CMD_EXT_TYPE_NONE (0x02U) |
#define OSPI_FLASH_PROTOCOL_INVALID (uint32_t)(0xFFFFFFFF) |
#define OSPI_CS0 (0U) |
#define OSPI_CS1 (1U) |
#define OSPI_CS2 (2U) |
#define OSPI_CS3 (3U) |
#define OSPI_CHIP_SELECT | ( | x | ) | ((~((1U) << (x))) & 0xFU) |
#define OSPI_DECODER_SELECT4 ((uint32_t) 0U) |
#define OSPI_DECODER_SELECT16 ((uint32_t) 1U) |
#define OSPI_NOR_DMA_COPY_LOWER_LIMIT (1024U) |
#define OSPI_NAND_DMA_COPY_LOWER_LIMIT (256U) |
#define OSPI_FLASH_CFG_PHY_MASTER_CONTROL_REG_PHY_MASTER_MODE (0U) |
#define OSPI_FLASH_CFG_PHY_MASTER_CONTROL_REG_PHY_BYPASS_MODE (1U) |
#define OSPI_PHY_DLL_FULL_CYCLE_LOCK ((uint16_t) 0U) |
#define OSPI_PHY_DLL_HALF_CYCLE_LOCK ((uint16_t) 1U) |
typedef void* OSPI_Handle |
A handle that is returned from a OSPI_open() call.
void OSPI_init | ( | void | ) |
This function initializes the OSPI module.
void OSPI_deinit | ( | void | ) |
This function de-initializes the OSPI module.
void OSPI_Params_init | ( | OSPI_Params * | ospiParams | ) |
Initialize data structure with defaults.
ospiParams | [out] Initialized parameters |
OSPI_Handle OSPI_open | ( | uint32_t | index, |
const OSPI_Params * | openParams | ||
) |
This function opens a given OSPI peripheral.
index | Index of config to use in the OSPI_Config array |
openParams | Pointer to parameters to open the driver with |
void OSPI_close | ( | OSPI_Handle | handle | ) |
Function to close a OSPI peripheral specified by the OSPI handle.
handle | OSPI_Handle returned from OSPI_open() |
OSPI_Handle OSPI_getHandle | ( | uint32_t | index | ) |
This function returns the handle of an open OSPI Instance from the instance index.
index | Index of config to use in the OSPI_Config array |
int32_t OSPI_readDirect | ( | OSPI_Handle | handle, |
OSPI_Transaction * | trans | ||
) |
Function to perform direct reads from the flash using DAC controller.
handle | OSPI_Handle returned from OSPI_open() |
trans | Pointer to a OSPI_Transaction |
int32_t OSPI_readIndirect | ( | OSPI_Handle | handle, |
OSPI_Transaction * | trans | ||
) |
Function to perform indirect reads from the flash using INDAC controller.
handle | OSPI_Handle returned from OSPI_open() |
trans | Pointer to a OSPI_Transaction |
int32_t OSPI_writeDirect | ( | OSPI_Handle | handle, |
OSPI_Transaction * | trans | ||
) |
Function to perform direct writes to the flash using DAC controller.
handle | OSPI_Handle returned from OSPI_open() |
trans | Pointer to a OSPI_Transaction |
int32_t OSPI_writeIndirect | ( | OSPI_Handle | handle, |
OSPI_Transaction * | trans | ||
) |
Function to perform indirect writes to the flash using INDAC controller.
handle | OSPI_Handle returned from OSPI_open() |
trans | Pointer to a OSPI_Transaction |
int32_t OSPI_readCmd | ( | OSPI_Handle | handle, |
OSPI_ReadCmdParams * | rdParams | ||
) |
Function to send specific commands and receive related data from flash.
handle | OSPI_Handle returned from OSPI_open() |
rdParams | Pointer to a OSPI_ReadCmdParams |
int32_t OSPI_writeCmd | ( | OSPI_Handle | handle, |
OSPI_WriteCmdParams * | wrParams | ||
) |
Function to send specific commands and related data to flash.
handle | OSPI_Handle returned from OSPI_open() |
wrParams | Pointer to a OSPI_WriteCmdParams |
void OSPI_Transaction_init | ( | OSPI_Transaction * | trans | ) |
Function to initialize the OSPI_Transaction structure.
trans | Pointer to a OSPI_Transaction |
void OSPI_ReadCmdParams_init | ( | OSPI_ReadCmdParams * | rdParams | ) |
Function to initialize the OSPI_ReadCmdParams structure.
rdParams | Pointer to a OSPI_ReadCmdParams |
void OSPI_WriteCmdParams_init | ( | OSPI_WriteCmdParams * | wrParams | ) |
Function to initialize the OSPI_WriteCmdParams structure.
wrParams | Pointer to a OSPI_WriteCmdParams |
uint32_t OSPI_getInputClk | ( | OSPI_Handle | handle | ) |
This function returns the input clk frequency OSPI was programmed at.
handle | An OSPI_Handle returned from an OSPI_open() |
uint32_t OSPI_isDacEnable | ( | OSPI_Handle | handle | ) |
This function checks if the Direct Access Controller is enabled.
handle | An OSPI_Handle returned from an OSPI_open() |
uint32_t OSPI_isDmaEnable | ( | OSPI_Handle | handle | ) |
This function checks if DMA is enabled for reads.
handle | An OSPI_Handle returned from an OSPI_open() |
uint32_t OSPI_isIntrEnable | ( | OSPI_Handle | handle | ) |
This function checks if interrupts are enabled.
handle | An OSPI_Handle returned from an OSPI_open() |
uint32_t OSPI_isPhyEnable | ( | OSPI_Handle | handle | ) |
This function checks if the OSPI PHY controller is enabled.
handle | An OSPI_Handle returned from an OSPI_open() |
uint32_t OSPI_isDtrEnable | ( | OSPI_Handle | handle | ) |
This function checks if the Dual Transfer Rate (Sampling on both rising and falling edge of the clock) is enabled.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_enableDDR | ( | OSPI_Handle | handle | ) |
This function enables the Dual Data Rate (DDR)
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_enableSDR | ( | OSPI_Handle | handle | ) |
This function enables the Single Data Rate (SDR)
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_enableDdrRdCmds | ( | OSPI_Handle | handle | ) |
This function sets DDR bit in INSTR_RD register for RD commands.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_setRdDataCaptureDelay | ( | OSPI_Handle | handle, |
uint32_t | rdDataCapDelay, | ||
uint32_t | updatePhyRdDelay | ||
) |
This function sets read data capture cycles in the OSPI controller.
handle | An OSPI_Handle returned from an OSPI_open() |
rdDataCapDelay | Number of read data capture cycles to be programmed |
updatePhyRdDelay | Set to TRUE to update bookkeeping of PHY Read Data Capture |
void OSPI_setNumAddrBytes | ( | OSPI_Handle | handle, |
uint32_t | numAddrBytes | ||
) |
This function set the number of bytes used to send address while reading or writing to flash memory.
handle | An OSPI_Handle returned from an OSPI_open() |
numAddrBytes | Number of address bytes to be used while sending addresses. |
void OSPI_setDeviceSize | ( | OSPI_Handle | handle, |
uint32_t | pageSize, | ||
uint32_t | blkSize | ||
) |
This function sets the block size and page size of the flash to the device size register in OSPI.
handle | An OSPI_Handle returned from an OSPI_open() |
pageSize | Page size of the flash in bytes |
blkSize | Block size of the flash in bytes |
void OSPI_setCmdDummyCycles | ( | OSPI_Handle | handle, |
uint32_t | cmdDummyCycles | ||
) |
This function sets appropriate dummy cycles to be used while sending STIG commands to flash.
handle | An OSPI_Handle returned from an OSPI_open() |
cmdDummyCycles | Dummy cycles to be used for STIG cmd |
void OSPI_setReadDummyCycles | ( | OSPI_Handle | handle, |
uint32_t | dummyCycles | ||
) |
This function sets appropriate dummy cycles for flash read.
handle | An OSPI_Handle returned from an OSPI_open() |
dummyCycles | Number of dummy cycles |
void OSPI_setRdDummyValPhyMode | ( | OSPI_Handle | handle, |
uint32_t | rdDummyValPhyMode | ||
) |
This function sets value by which read dummy cycles need to be updated for OSPI read in Phy Mode.
handle | An OSPI_Handle returned from an OSPI_open() |
rdDummyValPhyMode | Value by which read dummy cycles need to be updated |
void OSPI_setPhyEnableSuccess | ( | OSPI_Handle | handle, |
uint32_t | success | ||
) |
This function sets the phyEnableSuccess field in OSPI_Object. Has to be called from flash driver.
handle | An OSPI_Handle returned from an OSPI_open() |
success | Set this to 1 if phy enable was successful. 0 otherwise |
void OSPI_setModeBits | ( | OSPI_Handle | handle, |
uint32_t | modeBits | ||
) |
This function sets mode bits in the mode bit field of OSPI config register.
handle | An OSPI_Handle returned from an OSPI_open() |
modeBits | Number of mode bits to be set |
void OSPI_enableModeBitsCmd | ( | OSPI_Handle | handle | ) |
This function enables mode bits transmission while sending CMDs.
handle | An OSPI_Handle returned from an OSPI_open() |
void OSPI_enableModeBitsRead | ( | OSPI_Handle | handle | ) |
This function enables mode bits transmission while reading.
handle | An OSPI_Handle returned from an OSPI_open() |
uint32_t OSPI_getPhyEnableSuccess | ( | OSPI_Handle | handle | ) |
This function fetches the phyEnableSuccess field in OSPI_Object.
handle | An OSPI_Handle returned from an OSPI_open() |
void OSPI_cmdModeBitSet | ( | OSPI_Handle | handle, |
uint32_t | enable | ||
) |
This function sets command mode bit.
handle | An OSPI_Handle returned from an OSPI_open() |
enable | command mode bit enable/disable |
void OSPI_rdModeBitSet | ( | OSPI_Handle | handle, |
uint32_t | enable | ||
) |
This function sets Read mode bit.
handle | An OSPI_Handle returned from an OSPI_open() |
enable | Read mode bit enable/disable |
uint32_t OSPI_getProtocol | ( | OSPI_Handle | handle | ) |
This function returns the current protocol for which the transfer lines in OSPI driver is configured for.
handle | An OSPI_Handle returned from an OSPI_open() |
void OSPI_setProtocol | ( | OSPI_Handle | handle, |
uint32_t | protocol | ||
) |
This function sets the number of transfer lines in the OSPI driver to set the requested protocol.
handle | An OSPI_Handle returned from an OSPI_open() |
protocol | Protocol to be used |
void OSPI_setDualOpCodeMode | ( | OSPI_Handle | handle | ) |
This function sets OSPI controller to use dual byte opcodes.
handle | An OSPI_Handle returned from an OSPI_open() |
void OSPI_clearDualOpCodeMode | ( | OSPI_Handle | handle | ) |
This function sets OSPI controller to not use dual byte opcodes.
handle | An OSPI_Handle returned from an OSPI_open() |
void OSPI_setXferOpCodes | ( | OSPI_Handle | handle, |
uint8_t | readCmd, | ||
uint8_t | pageProgCmd | ||
) |
This function sets the opcodes for reading and page programming the flash.
handle | An OSPI_Handle returned from an OSPI_open() |
readCmd | Command opcode to be used for reading from the flash |
pageProgCmd | Command opcode to be used for writing to / programming the flash |
void OSPI_setCmdExtType | ( | OSPI_Handle | handle, |
uint32_t | cmdExtType | ||
) |
This function sets the type of command extension used in dual byte opcode mode.
handle | An OSPI_Handle returned from an OSPI_open() |
cmdExtType | Type of command extension used. As of now only two types are supported - REPEAT and INVERSE |
int32_t OSPI_enableDacMode | ( | OSPI_Handle | handle | ) |
This function enables the Direct Access Mode.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_disableDacMode | ( | OSPI_Handle | handle | ) |
This function disables the Direct Access Mode.
handle | An OSPI_Handle returned from an OSPI_open() |
uint32_t OSPI_getFlashDataBaseAddr | ( | OSPI_Handle | handle | ) |
This function gets the SOC mapped data base address of the flash.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_phyTuneDDR | ( | OSPI_Handle | handle, |
uint32_t | flashOffset | ||
) |
This function tunes the OSPI PHY for DDR mode to set optimal PHY parameters.
handle | An OSPI_Handle returned from an OSPI_open() |
flashOffset | Offset of the flash at which the PHY tuning data is present |
int32_t OSPI_phyTuneSDR | ( | OSPI_Handle | handle, |
uint32_t | flashOffset | ||
) |
This function tunes the OSPI PHY for SDR mode to set optimal PHY parameters.
handle | An OSPI_Handle returned from an OSPI_open() |
flashOffset | Offset of the flash at which the PHY tuning data is present |
int32_t OSPI_phyTuneGrapher | ( | OSPI_Handle | handle, |
uint32_t | flashOffset, | ||
uint8_t | arrays[4][128][128] | ||
) |
This function takes a 4x128x128 array and fills it with TX RX DLL data for graphing purpose.
handle | An OSPI_Handle returned from an OSPI_open() |
flashOffset | Offset of the flash at which the PHY tuning data is present |
arrays | A 4x128x128 array. In this, the tx rx dll data for 4 different read delay values will be stored. This can be later used for graphing |
void OSPI_phyGetTuningData | ( | uint32_t * | tuningData, |
uint32_t * | tuningDataSize | ||
) |
This function returns the address to the attack vector buf required for tuning the PHY.
tuningData | Address of the tuningData array |
tuningDataSize | Size of the tuningData array |
int32_t OSPI_phyReadAttackVector | ( | OSPI_Handle | handle, |
uint32_t | offset | ||
) |
This function checks if the attack vector, or the data used for tuning the PHY is present at an offset in the flash.
handle | An OSPI_Handle returned from an OSPI_open() |
offset | Offset in flash to check for tuningData |
void OSPI_phyReadTunedVal | ( | OSPI_Handle | handle | ) |
This function reads OSPI PHY values if the previous stage has already configured it.
handle | An OSPI_Handle returned from an OSPI_open() |
void OSPI_phyWriteTunedVal | ( | OSPI_Handle | handle | ) |
This function writes OSPI PHY DLL values if the previous stage has already configured it.
handle | An OSPI_Handle returned from an OSPI_open() |
void OSPI_phyResyncDLL | ( | OSPI_Handle | handle | ) |
This function resyncs the DLL values.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_enablePhy | ( | OSPI_Handle | handle | ) |
This function enables the PHY.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_disablePhy | ( | OSPI_Handle | handle | ) |
This function disables the PHY.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_enablePhyPipeline | ( | OSPI_Handle | handle | ) |
This function enables the PHY Pipeline.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_disablePhyPipeline | ( | OSPI_Handle | handle | ) |
This function disables the PHY Pipeline.
handle | An OSPI_Handle returned from an OSPI_open() |
int32_t OSPI_skipTuning | ( | OSPI_Handle | handle | ) |
This function checks if OSPI tuning should be skipped based on user input and if phy bit is set.
handle | An OSPI_Handle returned from an OSPI_open() |
|
extern |
Externally defined driver configuration array.
|
extern |
Externally defined driver configuration array size.