|
AM62Ax MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
43 #include <drivers/hw_include/soc_config.h>
44 #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)
61 #define FLASH_NOR_UPDATE_RD_DUMMY_VALUE (1U)
62 #define FLASH_NAND_UPDATE_RD_DUMMY_VALUE (0U)
95 typedef struct Flash_DevConfig_s {
195 uint8_t *buf, uint32_t len) ;
211 uint8_t *buf, uint32_t len) ;
303 typedef struct Flash_Params_s {
313 typedef struct Flash_Fxns_s
330 typedef struct Flash_Attrs_s {
351 typedef struct Flash_Config_s
362 #if defined (DRV_VERSION_SERIAL_FLASH_V0)
363 #include <board/flash/ospi/flash_nor_ospi.h>
364 #include <board/flash/ospi/flash_nand_ospi.h>
367 #if defined (DRV_VERSION_SERIAL_FLASH_V1)
368 #include <board/flash/qspi/flash_nor_qspi.h>
371 #if defined (DRV_VERSION_PARALLEL_FLASH_V0)
372 #include <board/flash/gpmc/flash_nand_gpmc.h>
uint8_t cmdPageLoadCyc1
Definition: flash.h:110
uint32_t flashType
Definition: flash.h:332
uint8_t cmdPageProgCyc1
Definition: flash.h:115
void Flash_close(Flash_Handle handle)
Close flash driver.
uint8_t cmdReadStatus
Definition: flash.h:119
SemaphoreP_Object lockSem
Definition: flash.h:357
uint32_t xspiRdsrDummy
Definition: flash.h:131
Flash_Attrs * attrs
Definition: flash.h:353
uint32_t flashSize
Definition: flash.h:337
uint32_t progStatusReg
Definition: flash.h:139
Flash_OpenFxn openFxn
Definition: flash.h:315
int32_t(* Flash_DisablePhyPipelineFxn)(Flash_Config *config)
Driver implementation to disable PHY pipeline mode in Flash.
Definition: flash.h:274
void Flash_deinit(void)
This function de-initializes the Flash module.
FlashCfg_EraseConfig eraseCfg
Definition: flash.h:135
uint8_t cmdWrsr
Definition: flash.h:105
uint32_t blockCount
Definition: flash.h:338
FlashCfg_ProtoEnConfig protocolCfg
Definition: flash.h:137
uint8_t cmdExtType
Definition: flash.h:97
void(* Flash_CloseFxn)(Flash_Config *config)
Driver implementation to close a specific flash driver.
Definition: flash.h:179
uint8_t cmdWren
Definition: flash.h:103
Flash_DevConfig * devConfig
Definition: flash.h:355
uint32_t driverInstance
Definition: flash.h:336
Flash driver configuration, these are filled by SysCfg based on the flash device that is selected.
Definition: flash.h:352
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)
uint8_t cmdPageProg
Definition: flash.h:107
uint32_t srWipReg
Definition: flash.h:128
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:125
uint8_t cmdRdsr
Definition: flash.h:104
uint32_t xspiWipReg
Definition: flash.h:129
uint8_t cmdPageProgCyc2
Definition: flash.h:116
Flash_EraseSectorFxn eraseSectorFxn
Definition: flash.h:320
uint32_t flashBusyTimeout
Definition: flash.h:133
uint32_t sectorSize
Definition: flash.h:343
Flash_Fxns * fxns
Definition: flash.h:354
uint32_t pageSize
Definition: flash.h:341
uint8_t addrByteSupport
Definition: flash.h:100
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:194
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:330
char * flashName
Definition: flash.h:333
uint8_t cmdRandomReadCyc2
Definition: flash.h:113
uint32_t xspiWipBit
Definition: flash.h:130
Flash_EraseFxn eraseFxn
Definition: flash.h:319
Flash_Handle Flash_getHandle(uint32_t instanceId)
Get handle to flash driver.
Driver implementation callbacks.
Definition: flash.h:314
int32_t(* Flash_EraseFxn)(Flash_Config *config, uint32_t blockNum)
Driver implementation to erase a block using a specific flash driver.
Definition: flash.h:224
uint32_t Flash_getPhyTuningOffset(Flash_Handle handle)
Return flash offset to write PHY tuning data.
uint8_t fourByteAddrEnSeq
Definition: flash.h:102
uint8_t srWip
Definition: flash.h:108
uint8_t srWel
Definition: flash.h:123
struct Flash_Config_s Flash_Config
Forward declaration of Flash_Config.
Definition: flash.h:83
uint8_t resetType
Definition: flash.h:124
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:210
Flash_CloseFxn closeFxn
Definition: flash.h:316
uint8_t cmdPageLoadCyc2
Definition: flash.h:111
uint32_t flashWriteTimeout
Definition: flash.h:132
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:250
uint32_t pageCount
Definition: flash.h:340
struct Flash_Params_s Flash_Params
Forward declaration of Flash_Params.
Definition: flash.h:88
uint32_t spareAreaSize
Definition: flash.h:344
uint8_t pageRowAddrCyc
Definition: flash.h:118
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:295
int32_t(* Flash_EnablePhyPipelineFxn)(Flash_Config *config)
Driver implementation to enable PHY pipeline mode in Flash.
Definition: flash.h:262
Flash_EnablePhyPipelineFxn enablePhyPipelineFxn
Definition: flash.h:322
Flash_Attrs * Flash_getAttrs(uint32_t instanceId)
Return flash attributes.
uint8_t xspiWipRdCmd
Definition: flash.h:126
uint32_t blockSize
Definition: flash.h:339
FlashCfg_ReadIDConfig idCfg
Definition: flash.h:136
int32_t Flash_disablePhyPipeline(Flash_Handle handle)
Disable PHY mode in flash.
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)
uint32_t xspiEraseStatusReg
Definition: flash.h:142
int32_t Flash_enablePhyPipeline(Flash_Handle handle)
Enables PHY mode in flash.
uint8_t srWriteProtectMask
Definition: flash.h:146
Flash_DisablePhyPipelineFxn disablePhyPipelineFxn
Definition: flash.h:323
int32_t Flash_eraseSector(Flash_Handle handle, uint32_t sectorNum)
Erase a sector from flash.
uint32_t deviceId
Definition: flash.h:334
Flash_ReadFxn readFxn
Definition: flash.h:317
uint8_t enable4BAddr
Definition: flash.h:99
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:237
Flash_WriteFxn writeFxn
Definition: flash.h:318
int32_t(* Flash_OpenFxn)(Flash_Config *config, Flash_Params *params)
Driver implementation to open a specific flash driver.
Definition: flash.h:167
uint8_t cmdReset
Definition: flash.h:120
Flash_Handle Flash_open(uint32_t instanceId, Flash_Params *params)
Open flash driver.
uint8_t cmdRandomInput
Definition: flash.h:114
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
uint8_t cmdRandomReadCyc1
Definition: flash.h:112
void Flash_init(void)
This function initializes the Flash module.
uint8_t byteOrder
Definition: flash.h:98
uint8_t srWriteProtectReg
Definition: flash.h:145
uint32_t manufacturerId
Definition: flash.h:335
uint8_t cmdPageLoad
Definition: flash.h:106
Flash_ResetFxn resetFxn
Definition: flash.h:321
uint8_t pageColAddrCyc
Definition: flash.h:117
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 srEraseStatus
Definition: flash.h:144
uint32_t eraseStatusReg
Definition: flash.h:141
int32_t(* Flash_quirksFxn)(Flash_Config *config)
User implementation of a custom function to handle vendor specific quirks.
Definition: flash.h:286
uint32_t sectorCount
Definition: flash.h:342
uint32_t xspiProgStatusReg
Definition: flash.h:140
Parameters passed during Flash_open()
Definition: flash.h:303
void * Flash_Handle
Handle to the FLash driver returned by Flash_opem()
Definition: flash.h:78
uint8_t srProgStatus
Definition: flash.h:143
uint32_t Flash_getFlashInterfaceIndex(uint32_t flashType)
Return flash index based on type of flash.
Flash_quirksFxn quirksFxn
Definition: flash.h:305
Flash_custProtocolFxn custProtoFxn
Definition: flash.h:306
Flash device config. This will be part of the flash config, so has to be filled by sysconfig or other...
Definition: flash.h:95
int32_t Flash_read(Flash_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len)
Read data from flash.
void * object
Definition: flash.h:356