 |
AM64x MCU+ SDK
07.03.00
|
|
Go to the documentation of this file.
61 #include <drivers/hw_include/csl_types.h>
62 #include <drivers/hw_include/cslr_ospi.h>
83 #define OSPI_TRANSFER_COMPLETED (0U)
84 #define OSPI_TRANSFER_STARTED (1U)
85 #define OSPI_TRANSFER_CANCELLED (2U)
86 #define OSPI_TRANSFER_FAILED (3U)
87 #define OSPI_TRANSFER_CSN_DEASSERT (4U)
88 #define OSPI_TRANSFER_TIMEOUT (5U)
110 #define OSPI_TRANSFER_MODE_BLOCKING (0U)
115 #define OSPI_TRANSFER_MODE_CALLBACK (1U)
120 #define OSPI_TRANSFER_MODE_POLLING (2U)
137 #define OSPI_FF_POL0_PHA0 (0U)
138 #define OSPI_FF_POL0_PHA1 (CSL_OSPI_FLASH_CFG_CONFIG_REG_SEL_CLK_PHASE_FLD_MASK | 0U)
139 #define OSPI_FF_POL1_PHA0 (0U | CSL_OSPI_FLASH_CFG_CONFIG_REG_SEL_CLK_POL_FLD_MASK)
140 #define OSPI_FF_POL1_PHA1 (CSL_OSPI_FLASH_CFG_CONFIG_REG_SEL_CLK_PHASE_FLD_MASK | \
141 CSL_OSPI_FLASH_CFG_CONFIG_REG_SEL_CLK_POL_FLD_MASK)
152 #define OSPI_XFER_LINES_SINGLE (0U)
153 #define OSPI_XFER_LINES_DUAL (1U)
154 #define OSPI_XFER_LINES_QUAD (2U)
155 #define OSPI_XFER_LINES_OCTAL (3U)
166 #define OSPI_CS0 (0U)
167 #define OSPI_CS1 (1U)
168 #define OSPI_CS2 (2U)
169 #define OSPI_CS3 (3U)
171 #define OSPI_CHIP_SELECT(x) ((~((1U) << (x))) & 0xFU)
182 #define OSPI_DECODER_SELECT4 ((uint32_t) 0U)
183 #define OSPI_DECODER_SELECT16 ((uint32_t) 1U)
292 uint32_t devDelays[4];
uint32_t OSPI_isDacEnable(OSPI_Handle handle)
This function checks if the Direct Access Controller is enabled.
uint32_t pageSize
Definition: ospi/v0/ospi.h:284
uint32_t status
Definition: ospi/v0/ospi.h:204
Definition: ospi/v0/ospi.h:223
int32_t OSPI_enableModeSDR(OSPI_Handle handle, uint32_t cmd, uint32_t addr, uint32_t data)
This function enables the Single Data Rate (DDR)
void OSPI_Transaction_init(OSPI_Transaction *trans)
Function to initialize the OSPI_Transaction structure.
Definition: ospi/v0/ospi.h:211
void OSPI_ReadCmdParams_init(OSPI_ReadCmdParams *rdParams)
Function to initialize the OSPI_Transaction structure.
uint32_t xipEnable
Definition: ospi/v0/ospi.h:274
uint32_t transferTimeout
Definition: ospi/v0/ospi.h:206
uint32_t dacEnable
Definition: ospi/v0/ospi.h:282
uint32_t xferLines
Definition: ospi/v0/ospi.h:288
Data structure used with OSPI_Transfers - OSPI_readDirect, OSPI_writeDirect, OSPI_readIndirect,...
Definition: ospi/v0/ospi.h:197
uint8_t intrPriority
Definition: ospi/v0/ospi.h:272
uint16_t index
Definition: tisci_rm_proxy.h:3
void OSPI_init(void)
This function initializes the OSPI module.
void OSPI_setXferLines(OSPI_Handle handle, uint32_t xferLines)
This function sets the number of transfer lines to the flash device configuration registers.
void OSPI_deinit(void)
This function de-initializes the OSPI module.
uint32_t rdStatusCmd
Definition: ospi/v0/ospi.h:339
void OSPI_Params_init(OSPI_Params *ospiParams)
Initialize data structure with defaults.
uint32_t OSPI_getXferLines(OSPI_Handle handle)
This function returns the number of transfer lines enabled for the OSPI communication.
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...
OSPI_Handle handle
Definition: ospi/v0/ospi.h:315
uint32_t dataBaseAddr
Definition: ospi/v0/ospi.h:260
uint32_t count
Definition: ospi/v0/ospi.h:198
uint32_t dtrEnable
Definition: ospi/v0/ospi.h:276
uint32_t OSPI_isXipEnable(OSPI_Handle handle)
This function checks if the eXecute In Place (XIP) mode is enabled.
uint32_t baudRateDiv
Definition: ospi/v0/ospi.h:302
OSPI Parameters.
Definition: ospi/v0/ospi.h:245
uint32_t data
Definition: tisci_rm_psil.h:1
OSPI_Handle OSPI_getHandle(uint32_t index)
This function returns the handle of an open OSPI Instance from the instance index.
uint32_t transferMode
Definition: ospi/v0/ospi.h:317
uint32_t txDataLen
Definition: ospi/v0/ospi.h:218
void * txDataBuf
Definition: ospi/v0/ospi.h:216
uint64_t addr
Definition: csl_udmap_tr.h:3
int32_t OSPI_disableDacMode(OSPI_Handle handle)
This function disables the Direct Access Mode.
uint32_t inputClkFreq
Definition: ospi/v0/ospi.h:262
void OSPI_setExtReadDummyCycles(OSPI_Handle handle, uint32_t dummyCycles)
This function sets appropriate dummy cycles to the OSPI object to be used for flash extended read.
OSPI instance attributes - used during init time.
Definition: ospi/v0/ospi.h:254
uint32_t OSPI_getFlashDataBaseAddr(OSPI_Handle handle)
This function gets the SOC mapped data base address of the flash.
OSPI driver object.
Definition: ospi/v0/ospi.h:311
int32_t OSPI_readDirect(OSPI_Handle handle, OSPI_Transaction *trans)
Function to perform direct reads from the flash using DAC controller.
uint32_t chipSelect
Definition: ospi/v0/ospi.h:298
uint32_t isOpen
Definition: ospi/v0/ospi.h:328
void * rxDataBuf
Definition: ospi/v0/ospi.h:228
int32_t OSPI_writeIndirect(OSPI_Handle handle, OSPI_Transaction *trans)
Function to perform indirect writes to the flash using INDAC controller.
uint32_t blkSize
Definition: ospi/v0/ospi.h:286
uint32_t OSPI_isPhyEnable(OSPI_Handle handle)
This function checks if the OSPI PHY controller is enabled.
uint32_t extRdDummyClks
Definition: ospi/v0/ospi.h:296
uint32_t extRdDummyClks
Definition: ospi/v0/ospi.h:323
int32_t OSPI_writeCmd(OSPI_Handle handle, OSPI_WriteCmdParams *wrParams)
Function to send specific commands and related data to flash.
int32_t OSPI_setDummyCycle(OSPI_Handle handle, uint32_t cmd, uint32_t addr, uint32_t data)
This function sets appropriate dummy cycles to the flash controller.
int32_t ospiDmaChIndex
Definition: ospi/v0/ospi.h:246
void * buf
Definition: ospi/v0/ospi.h:200
void OSPI_setXferOpCode(OSPI_Handle handle, uint32_t readCmd, uint32_t pageProgCmd, uint32_t readStatusCmd)
This function sets the transfer opcodes required for correct read and write operations to the flash.
Definition: ospi/v0/ospi.h:345
uint32_t cmdLen
Definition: ospi/v0/ospi.h:226
uint32_t intrNum
Definition: ospi/v0/ospi.h:268
void OSPI_close(OSPI_Handle handle)
Function to close a OSPI peripheral specified by the OSPI handle.
SemaphoreP_Object lockObj
Definition: ospi/v0/ospi.h:330
void OSPI_setXferOpCodeExt(OSPI_Handle handle, uint32_t *cmd, uint32_t cmdLen)
This function sets the transfer opcodes required for correct read and write operations to the flash f...
int32_t OSPI_enableModeXIP(OSPI_Handle handle, uint32_t cmd, uint32_t addr, uint32_t data)
This function enables the eXecute In Place (XIP) mode.
uint32_t xferLines
Definition: ospi/v0/ospi.h:319
uint32_t OSPI_isDmaEnable(OSPI_Handle handle)
This function checks if DMA is enabled for reads.
uint32_t rdDummyClks
Definition: ospi/v0/ospi.h:294
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:91
HwiP_Object hwiObj
Definition: ospi/v0/ospi.h:334
uint32_t rdDummyClks
Definition: ospi/v0/ospi.h:321
void OSPI_setReadDummyCycles(OSPI_Handle handle, uint32_t dummyCycles)
This function sets appropriate dummy cycles to the OSPI object to be used for flash read.
void * ospiDmaHandle
Definition: ospi/v0/ospi.h:341
OSPI_Config gOspiConfig[]
Externally defined driver configuration array.
uint32_t OSPI_isIntrEnable(OSPI_Handle handle)
This function checks if interrupts are enabled.
uint32_t addrOffset
Definition: ospi/v0/ospi.h:202
uint32_t dmaEnable
Definition: ospi/v0/ospi.h:278
uint32_t phyEnable
Definition: ospi/v0/ospi.h:280
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
uint32_t rxDataLen
Definition: ospi/v0/ospi.h:230
int32_t OSPI_enableModeDDR(OSPI_Handle handle, uint32_t cmd, uint32_t addr, uint32_t data)
This function enables the Dual Data Rate (DDR)
void * cmd
Definition: ospi/v0/ospi.h:224
void OSPI_WriteCmdParams_init(OSPI_WriteCmdParams *wrParams)
Function to initialize the OSPI_Transaction structure.
OSPI_Handle OSPI_open(uint32_t index, const OSPI_Params *openParams)
This function opens a given OSPI peripheral.
OSPI_Transaction * currTrans
Definition: ospi/v0/ospi.h:337
uint32_t intrEnable
Definition: ospi/v0/ospi.h:270
int32_t OSPI_enableDacMode(OSPI_Handle handle)
This function enables the Direct Access Mode.
void * OSPI_Handle
A handle that is returned from a OSPI_open() call.
Definition: ospi/v0/ospi.h:73
uint32_t baseAddr
Definition: ospi/v0/ospi.h:258
uint32_t frmFmt
Definition: ospi/v0/ospi.h:290
uint32_t gOspiConfigNum
Externally defined driver configuration array size.
void * cmd
Definition: ospi/v0/ospi.h:212
int32_t OSPI_writeDirect(OSPI_Handle handle, OSPI_Transaction *trans)
Function to perform direct writes to the flash using DAC controller.
const OSPI_Attrs * attrs
Definition: ospi/v0/ospi.h:346
uint32_t cmdLen
Definition: ospi/v0/ospi.h:214
int32_t OSPI_readCmd(OSPI_Handle handle, OSPI_ReadCmdParams *rdParams)
Function to send specific commands and receive related data from flash.
OSPI_Object * object
Definition: ospi/v0/ospi.h:348
int32_t OSPI_readIndirect(OSPI_Handle handle, OSPI_Transaction *trans)
Function to perform indirect reads from the flash using INDAC controller.
uint32_t decChipSelect
Definition: ospi/v0/ospi.h:300
SemaphoreP_Object transferSemObj
Definition: ospi/v0/ospi.h:332