|
AM64x MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
44 #include <drivers/hw_include/soc_config.h>
45 #include <board/flash/flash_config.h>
47 #define FLASH_INVALID_VALUE (0xFFFFFFFFU)
49 #define CONFIG_FLASH_TYPE_SERIAL ((uint32_t)0x1)
50 #define CONFIG_FLASH_TYPE_PARALLEL ((uint32_t)0x2)
55 #define CONFIG_FLASH_TYPE_SERIAL_NOR (0x00U)
56 #define CONFIG_FLASH_TYPE_SERIAL_NAND (0x01U)
57 #define CONFIG_FLASH_TYPE_PARALLEL_NOR (0x02U)
58 #define CONFIG_FLASH_TYPE_PARALLEL_NAND (0x03U)
59 #define CONFIG_FLASH_TYPE_INVALID (0xFFU)
112 typedef struct Flash_DevConfig_s {
199 uint8_t *buf, uint32_t len) ;
215 uint8_t *buf, uint32_t len) ;
307 typedef struct Flash_Params_s {
317 typedef struct Flash_Fxns_s
334 typedef struct Flash_Attrs_s {
355 typedef struct Flash_Config_s
366 #if defined (DRV_VERSION_FLASH_V0)
367 #include <board/flash/ospi/flash_nor_ospi.h>
370 #if defined (DRV_VERSION_FLASH_V1)
371 #include <board/flash/qspi/flash_nor_qspi.h>
374 #if defined (DRV_VERSION_FLASH_V2)
375 #include <board/flash/ospi/flash_nor_ospi.h>
376 #include <board/flash/ospi/flash_nand_ospi.h>
379 #if defined (DRV_VERSION_GPMC_V0)
380 #include <board/flash/gpmc/flash_nand_gpmc.h>
uint8_t cmdPageLoadCyc1
Definition: flash.h:124
uint32_t flashType
Definition: flash.h:336
uint8_t cmdPageProgCyc1
Definition: flash.h:129
void Flash_close(Flash_Handle handle)
Close flash driver.
uint8_t cmdReadStatus
Definition: flash.h:133
Flash_Attrs * attrs
Definition: flash.h:357
uint32_t flashSize
Definition: flash.h:341
uint8_t srEraseStatus
Definition: flash.h:105
Flash_OpenFxn openFxn
Definition: flash.h:319
FlashCfg_EraseConfig eraseCfg
Definition: flash.h:147
uint32_t srWipReg
Definition: flash.h:98
Flash_EnableDacModeFxn enableDacModeFxn
Definition: flash.h:326
uint32_t blockCount
Definition: flash.h:342
FlashCfg_ProtoEnConfig protocolCfg
Definition: flash.h:149
uint8_t cmdExtType
Definition: flash.h:114
void(* Flash_CloseFxn)(Flash_Config *config)
Driver implementation to close a specific flash driver.
Definition: flash.h:183
uint8_t cmdWren
Definition: flash.h:120
Flash_DevConfig * devConfig
Definition: flash.h:359
uint32_t driverInstance
Definition: flash.h:340
Flash driver configuration, these are filled by SysCfg based on the flash device that is selected.
Definition: flash.h:356
int32_t Flash_offsetToBlkPage(Flash_Handle handle, uint32_t offset, uint32_t *block, uint32_t *page)
Utility API to convert offset in bytes to (Block Num, Page Num)
int32_t Flash_SectorPageToOffset(Flash_Handle handle, uint32_t *offset, uint32_t sector, uint32_t page)
Utility API to convert (Sector Num, Page Num) to offset in bytes.
uint8_t deviceBusyType
Definition: flash.h:139
uint8_t cmdRdsr
Definition: flash.h:121
uint32_t xspiWipReg
Definition: flash.h:142
uint8_t cmdPageProgCyc2
Definition: flash.h:130
Flash_EraseSectorFxn eraseSectorFxn
Definition: flash.h:324
uint32_t progStatusReg
Definition: flash.h:100
uint32_t flashBusyTimeout
Definition: flash.h:145
uint32_t sectorSize
Definition: flash.h:347
Flash_Fxns * fxns
Definition: flash.h:358
uint8_t srWriteProtectMask
Definition: flash.h:107
int32_t(* Flash_EnableDacModeFxn)(Flash_Config *config)
Driver implementation to enable DAC mode in Flash.
Definition: flash.h:266
uint32_t pageSize
Definition: flash.h:345
uint8_t addrByteSupport
Definition: flash.h:117
int32_t(* Flash_ReadFxn)(Flash_Config *config, uint32_t offset, uint8_t *buf, uint32_t len)
Driver implementation to read from flash using a specific flash driver.
Definition: flash.h:198
int32_t Flash_blkPageToOffset(Flash_Handle handle, uint32_t *offset, uint32_t block, uint32_t page)
Utility API to convert (Block Num, Page Num) to offset in bytes.
Flash device attributes, these are filled by SysCfg based on the flash device that is selected.
Definition: flash.h:334
char * flashName
Definition: flash.h:337
uint8_t cmdRandomReadCyc2
Definition: flash.h:127
uint32_t xspiWipBit
Definition: flash.h:143
Flash_EraseFxn eraseFxn
Definition: flash.h:323
Flash_Handle Flash_getHandle(uint32_t instanceId)
Get handle to flash driver.
Driver implementation callbacks.
Definition: flash.h:318
int32_t(* Flash_EraseFxn)(Flash_Config *config, uint32_t blockNum)
Driver implementation to erase a block using a specific flash driver.
Definition: flash.h:228
uint8_t cmdWrsr
Definition: flash.h:95
uint32_t xspiEraseStatusReg
Definition: flash.h:103
uint32_t Flash_getPhyTuningOffset(Flash_Handle handle)
Return flash offset to write PHY tuning data.
uint8_t cmdPageLoad
Definition: flash.h:96
Flash_NandConfig * nandCfg
Definition: flash.h:150
uint8_t fourByteAddrEnSeq
Definition: flash.h:119
uint8_t srProgStatus
Definition: flash.h:104
uint32_t rwOffset
Definition: flash.h:362
uint8_t srWip
Definition: flash.h:122
uint8_t srWel
Definition: flash.h:137
struct Flash_Config_s Flash_Config
Forward declaration of Flash_Config.
Definition: flash.h:80
uint8_t resetType
Definition: flash.h:138
int32_t(* Flash_WriteFxn)(Flash_Config *config, uint32_t offset, uint8_t *buf, uint32_t len)
Driver implementation to write to flash using specific flash driver.
Definition: flash.h:214
Flash_CloseFxn closeFxn
Definition: flash.h:320
uint8_t cmdPageLoadCyc2
Definition: flash.h:125
uint32_t flashWriteTimeout
Definition: flash.h:144
void Flash_Params_init(Flash_Params *params)
Set default parameters in the Flash_Params structure.
int32_t(* Flash_ResetFxn)(Flash_Config *config)
Driver implementation to soft reset the flash.
Definition: flash.h:254
uint8_t srWriteProtectReg
Definition: flash.h:106
uint32_t pageCount
Definition: flash.h:344
Flash_DisableDacModeFxn disableDacModeFxn
Definition: flash.h:327
struct Flash_Params_s Flash_Params
Forward declaration of Flash_Params.
Definition: flash.h:85
uint32_t spareAreaSize
Definition: flash.h:348
uint8_t pageRowAddrCyc
Definition: flash.h:132
int32_t(* Flash_custProtocolFxn)(Flash_Config *config)
User implementation of a custom function to configure flash to operate in a specific protocol.
Definition: flash.h:299
uint32_t skipHwInit
Definition: flash.h:361
Flash_Attrs * Flash_getAttrs(uint32_t instanceId)
Return flash attributes.
uint8_t xspiWipRdCmd
Definition: flash.h:140
Flash device config. This will be part of the flash config, so has to be filled by sysconfig or other...
Definition: flash.h:93
int32_t(* Flash_DisableDacModeFxn)(Flash_Config *config)
Driver implementation to enable DAC mode in Flash.
Definition: flash.h:278
uint32_t blockSize
Definition: flash.h:343
FlashCfg_ReadIDConfig idCfg
Definition: flash.h:148
uint32_t eraseStatusReg
Definition: flash.h:102
int32_t Flash_offsetToSectorPage(Flash_Handle handle, uint32_t offset, uint32_t *sector, uint32_t *page)
Utility API to convert offset in bytes to (Sector Num, Page Num)
int32_t Flash_eraseSector(Flash_Handle handle, uint32_t sectorNum)
Erase a sector from flash.
uint32_t deviceId
Definition: flash.h:338
Flash_ReadFxn readFxn
Definition: flash.h:321
uint8_t enable4BAddr
Definition: flash.h:116
uint32_t phyTuningOffset
Definition: flash.h:349
int32_t Flash_reset(Flash_Handle handle)
Do a soft reset of the flash.
int32_t(* Flash_EraseSectorFxn)(Flash_Config *config, uint32_t sectorNum)
Driver implementation to erase a sector using a specific flash driver.
Definition: flash.h:241
Flash_WriteFxn writeFxn
Definition: flash.h:322
int32_t(* Flash_OpenFxn)(Flash_Config *config, Flash_Params *params)
Driver implementation to open a specific flash driver.
Definition: flash.h:171
uint8_t cmdReset
Definition: flash.h:134
Flash_Handle Flash_open(uint32_t instanceId, Flash_Params *params)
Open flash driver.
uint8_t cmdRandomInput
Definition: flash.h:128
uint8_t cmdRandomReadCyc1
Definition: flash.h:126
uint32_t xspiRdsrDummy
Definition: flash.h:99
uint8_t byteOrder
Definition: flash.h:115
uint32_t manufacturerId
Definition: flash.h:339
int32_t Flash_disableDacMode(Flash_Handle handle)
Disable DAC mode in flash.
Flash_ResetFxn resetFxn
Definition: flash.h:325
uint8_t pageColAddrCyc
Definition: flash.h:131
int32_t Flash_eraseBlk(Flash_Handle handle, uint32_t blockNum)
Erase a block from flash.
int32_t Flash_write(Flash_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len)
Write to flash.
uint8_t cmdPageProg
Definition: flash.h:97
int32_t(* Flash_quirksFxn)(Flash_Config *config)
User implementation of a custom function to handle vendor specific quirks.
Definition: flash.h:290
uint32_t sectorCount
Definition: flash.h:346
Parameters passed during Flash_open()
Definition: flash.h:307
void * Flash_Handle
Handle to the FLash driver returned by Flash_opem()
Definition: flash.h:75
int32_t Flash_enableDacMode(Flash_Handle handle)
Enables DAC mode in flash.
Flash_quirksFxn quirksFxn
Definition: flash.h:309
Flash_custProtocolFxn custProtoFxn
Definition: flash.h:310
int32_t Flash_read(Flash_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len)
Read data from flash.
uint32_t xspiProgStatusReg
Definition: flash.h:101
void * object
Definition: flash.h:360