This file containing the GPMC API.
The GPMC header file should be included in an application as follows:
Data Structures | |
struct | GPMC_nandCmdParams |
Data structure to set NAND command parameters. More... | |
struct | GPMC_Transaction |
Data structure to set transaction type parameters. More... | |
struct | GPMC_Params |
GPMC driver instance parameters. More... | |
struct | GPMC_AddrRegion |
GPMC Address Region. More... | |
struct | GPMC_Object |
GPMC driver object. More... | |
struct | GPMC_timingParams |
GPMC timing parameters. More... | |
struct | GPMC_HwAttrs |
GPMC instance attributes. More... | |
struct | GPMC_Config |
GPMC Driver configuration structure. More... | |
Functions | |
static void | GPMC_Params_init (GPMC_Params *params) |
Function to initialize the GPMC_Params struct to its defaults. More... | |
void | GPMC_init (void) |
This function initializes the GPMC module. More... | |
void | GPMC_deinit (void) |
This function de-initializes the GPMC module. More... | |
GPMC_Handle | GPMC_open (uint32_t index, const GPMC_Params *prms) |
This function opens a given GPMC peripheral. More... | |
void | GPMC_close (GPMC_Handle handle) |
Function to close a GPMC peripheral specified by the GPMC handle. More... | |
uint32_t | GPMC_getInputClk (GPMC_Handle handle) |
This function returns the input clk frequency GPMC was programmed at. More... | |
GPMC_Handle | GPMC_getHandle (uint32_t driverInstanceIndex) |
This function returns the handle of an open GPMC Instance from the instance index. More... | |
void | GPMC_writeNandCommandParamsInit (GPMC_nandCmdParams *cmdParams) |
Function to initialise GPMC_nandCmdParams structure to default values. More... | |
int32_t | GPMC_writeNandCommand (GPMC_Handle handle, GPMC_nandCmdParams *cmdParams) |
Function to write NAND command parameters. More... | |
void | GPMC_transactionInit (GPMC_Transaction *trans) |
Function to initialise GPMC_Transaction structure to default values. More... | |
int32_t | GPMC_nandReadData (GPMC_Handle handle, GPMC_Transaction *trans) |
Function to read data from NAND flash using DMA or CPU prefetch/post write engine. More... | |
int32_t | GPMC_nandWriteData (GPMC_Handle handle, GPMC_Transaction *trans) |
Function to write data to NANDflash using CPU prefetch/post write engine. More... | |
int32_t | GPMC_setDeviceSize (GPMC_Handle handle) |
Function to set device width for GPMC instance connected to external device. More... | |
int32_t | GPMC_setDeviceType (GPMC_Handle handle) |
Function to set device type (NANDLIKE OR NORLIKE) for GPMC instance connected to external device. More... | |
int32_t | GPMC_configureTimingParameters (GPMC_Handle handle) |
Function to configure GPMC timing parameters. More... | |
int32_t | GPMC_eccValueSizeSet (GPMC_Handle handle, uint32_t eccSize, uint32_t eccSizeVal) |
Function to set ECC used and unused bytes size in nibbles. More... | |
int32_t | GPMC_eccBchConfigureElm (GPMC_Handle handle, uint8_t numSectors) |
Function to configure ELM module for error correction. More... | |
int32_t | GPMC_eccEngineBCHConfig (GPMC_Handle handle, uint32_t eccSteps) |
Function to configure GPMC ECC engine for BCH algorithm. More... | |
int32_t | GPMC_eccEngineEnable (GPMC_Handle handle) |
Function to enable GPMC ECC engine. More... | |
void | GPMC_eccResultRegisterClear (GPMC_Handle handle) |
Function to clear GPMC ECC result register. More... | |
int32_t | GPMC_eccBchFillSyndromeValue (GPMC_Handle handle, uint32_t sector, uint32_t *bchData) |
Function to fill BCH syndrome value per sector to ELM module. More... | |
int32_t | GPMC_eccBchStartErrorProcessing (GPMC_Handle handle, uint8_t sector) |
Function to start error processing for a sector by ELM module. More... | |
int32_t | GPMC_eccBchCheckErrorProcessingStatus (GPMC_Handle handle, uint32_t sector) |
Function to get error processing status for a sector by ELM module. More... | |
int32_t | GPMC_eccBchSectorGetError (GPMC_Handle handle, uint32_t sector, uint32_t *errCount, uint32_t *errLoc) |
Function to get number of errors per sector by ELM module. More... | |
int32_t | GPMC_eccCalculateBchSyndromePolynomial (GPMC_Handle handle, uint8_t *pEccdata, uint32_t sector) |
Function to compute BCH syndrome polynomial for NAND write operation. More... | |
int32_t | GPMC_eccGetBchSyndromePolynomial (GPMC_Handle handle, uint32_t sector, uint32_t *bchData) |
Function to get BCH syndrome polynomial per sector NAND read operation. More... | |
int32_t | GPMC_configurePrefetchPostWriteEngine (GPMC_Handle handle) |
Function to configure GPMC PREFETCH read and POST write engine. More... | |
int32_t | GPMC_disableFlashWriteProtect (GPMC_Handle handle) |
Function to disable WRITE protect line. More... | |
int32_t | GPMC_enableFlashWriteProtect (GPMC_Handle handle) |
Function to disable WRITE protect line. More... | |
uint8_t * | GPMC_norMakeAddr (uint8_t busWidth, uint32_t blkAddr, uint32_t offset) |
Function to create correct address based on bus width. More... | |
void | GPMC_norMakeCmd (uint8_t busWidth, uint32_t cmd, void *cmdBuf) |
Function to create correct NOR cmd based on bus width. More... | |
int32_t | GPMC_norReadData (GPMC_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len) |
Function to read data from norlike device. More... | |
int32_t | GPMC_norWriteData (GPMC_Handle handle, uint32_t offset, uint8_t *buf, uint32_t len) |
Function to write data to norlike device. More... | |
Typedefs | |
typedef void * | GPMC_Handle |
A handle that is returned from a GPMC_open() call. More... | |
typedef void(* | GPMC_CallbackFxn) (GPMC_Handle handle, GPMC_Transaction *transaction) |
The definition of a callback function used by the GPMC driver when used in GPMC_OPERATING_MODE_CALLBACK mode. More... | |
Enumerations | |
enum | GPMC_nandEccAlgo { GPMC_NAND_ECC_ALGO_NONE = 0x00U, GPMC_NAND_ECC_ALGO_HAMMING_1BIT, GPMC_NAND_ECC_ALGO_BCH_4BIT, GPMC_NAND_ECC_ALGO_BCH_8BIT, GPMC_NAND_ECC_ALGO_BCH_16BIT } |
GPMC ECC engine algoritms. More... | |
enum | GPMC_OperatingMode { GPMC_OPERATING_MODE_BLOCKING = 0, GPMC_OPERATING_MODE_CALLBACK, GPMC_OPERATING_MODE_POLLING } |
GPMC driver operating modes. More... | |
enum | GPMC_TransferMode { GPMC_TRANSFER_MODE_BLOCKING = 0, GPMC_TRANSFER_MODE_CALLBACK } |
GPMC data transfer modes. More... | |
enum | GPMC_TransactionType { GPMC_TRANSACTION_TYPE_READ = 0, GPMC_TRANSACTION_TYPE_WRITE, GPMC_TRANSACTION_TYPE_READ_CMDREG, GPMC_TRANSACTION_TYPE_WRITE_CMDREG } |
Type of the GPMC transaction for read and write. More... | |
enum | GPMC_TransactionStatus { GPMC_TRANSFER_COMPLETED = 0, GPMC_TRANSFER_STARTED, GPMC_TRANSFER_CANCELED, GPMC_TRANSFER_FAILED, GPMC_TRANSFER_CSN_DEASSERT, GPMC_TRANSFER_TIMEOUT } |
Transaction status codes that are set by the GPMC driver. More... | |
Macros | |
#define | GPMC_CS_TIMING_CONFIG(CSWrOffTime, CSRdOffTime, CSExtDelayFlag, CSOnTime) |
This macro used to make the conf value which is used to configure the CS signal timing configuration. More... | |
#define | GPMC_ADV_TIMING_CONFIG(ADVAADMuxWrOffTime, ADVAADMuxRdOffTime, ADVWrOffTime, ADVRdOffTime, ADVExtDelayFlag, ADVAADMuxOnTime, ADVOnTime) |
This macro used to make the conf value which is used to configure the ADV# signal timing configuration. More... | |
#define | GPMC_WE_OE_TIMING_CONFIG(WEOffTime, WEExtDelayFlag, WEOnTime, OEAADMuxOffTime, OEOffTime, OEExtDelayFlag, OEAADMuxOnTime, OEOnTime) |
This macro used to make the conf value which is used to configure the WE# and OE# signal timing configuration. . More... | |
#define | GPMC_RDACCESS_CYCLETIME_TIMING_CONFIG(rdCycleTime, wrCycleTime, rdAccessTime, pageBurstAccessTime) |
This macro used to make the conf value which is used to configure the read access and cycle time timing configuration. . More... | |
#define | GPMC_CYCLE2CYCLE_BUSTURNAROUND_TIMING_CONFIG(cycle2CycleDelay, cycle2CycleDelaySameCSCfg, cycle2CycleDelayDiffCSCfg, busTAtime) |
This macro used to make the conf value which is used to configure the cycle to cycle and bus turn around time timing configuration. . More... | |
#define | GPMC_DMA_COPY_LOWER_LIMIT (512U) |
size in bytes More... | |
#define | GPMC_CS_BASE_ADDR_SHIFT (24U) |
GPMC CHIP select base address shift value. More... | |
#define | GPMC_ECC_WRAP_MODE1 (1) |
GPMC ECC Wrap mode for ECC value computation. More... | |
#define | GPMC_CMD_INVALID (0xFFFFFFFFU) |
Invalid value for params initialisation. More... | |
#define | GPMC_MEM_TYPE_NAND (0) |
#define | GPMC_MEM_TYPE_PSRAM (1) |
#define | GPMC_MEM_TYPE_NORLIKE (1) |
GPMC CHIP select | |
Macros which can be used as to select CHIP select instance for GPMC. | |
#define | GPMC_CHIP_SELECT_CS0 (0U) |
#define | GPMC_CHIP_SELECT_CS1 (1U) |
#define | GPMC_CHIP_SELECT_CS2 (2U) |
#define | GPMC_CHIP_SELECT_CS3 (3U) |
GPMC Interupt status flags | |
Macros which can be used as 'interupt' parameter to GPMC_interuptStatusGet, GPMC_interuptStatusClear APIs. | |
#define | GPMC_FIFOEVENT_STATUS (0U) |
#define | GPMC_TERMINALCOUNT_STATUS (1U) |
#define | GPMC_WAIT0EDGEDETECTION_STATUS (2U) |
#define | GPMC_WAIT1EDGEDETECTION_STATUS (3U) |
GPMC Interupt Flags | |
Macros which can be used as 'mode' parameter to GPMC_prefetchPostWriteConfigEnable API. | |
#define | GPMC_FIFOEVENT_INT (0U) |
#define | GPMC_TERMINALCOUNT_INT (1U) |
#define | GPMC_WAIT0EDGEDETECTION_INT (2U) |
#define | GPMC_WAIT1EDGEDETECTION_INT (3U) |
#define | GPMC_PREFETCH_ACCESSMODE_READ (0U) |
#define | GPMC_PREFETCH_ACCESSMODE_WRITE (1U) |
GPMC ECC algorithm | |
#define | GPMC_ECC_ALGORITHM_HAMMINGCODE (0U) |
#define | GPMC_ECC_ALGORITHM_BCH (1U) |
GPMC ECC error correvel level. | |
Macros which can be used to set GPMC ECC engine error correction level. | |
#define | GPMC_ECC_BCH_ERRCORRCAP_UPTO_4BITS (0U) |
#define | GPMC_ECC_BCH_ERRCORRCAP_UPTO_8BITS (1U) |
#define | GPMC_ECC_BCH_ERRCORRCAP_UPTO_16BITS (2U) |
GPMC ECC Result Register | |
Macros which can be used to select ECC result register for GPMC ECC engine. | |
#define | GPMC_ECCPOINTER_RESULT_1 (1U) |
#define | GPMC_ECCPOINTER_RESULT_2 (2U) |
#define | GPMC_ECCPOINTER_RESULT_3 (3U) |
#define | GPMC_ECCPOINTER_RESULT_4 (4U) |
#define | GPMC_ECCPOINTER_RESULT_5 (5U) |
#define | GPMC_ECCPOINTER_RESULT_6 (6U) |
#define | GPMC_ECCPOINTER_RESULT_7 (7U) |
#define | GPMC_ECCPOINTER_RESULT_8 (8U) |
#define | GPMC_ECCPOINTER_RESULT_9 (9U) |
GPMC ECC Size Config | |
Macros which can be used to set length of used and unsued bytes in the ECC value. | |
#define | GPMC_ECC_SIZE_0 (0U) |
#define | GPMC_ECC_SIZE_1 (1U) |
GPMC ECC Result Register Size | |
Macros which can be used to set ECC size for ECC result register. | |
#define | GPMC_ECC_RESULT_1 (1U) |
#define | GPMC_ECC_RESULT_2 (2U) |
#define | GPMC_ECC_RESULT_3 (3U) |
#define | GPMC_ECC_RESULT_4 (4U) |
#define | GPMC_ECC_RESULT_5 (5U) |
#define | GPMC_ECC_RESULT_6 (6U) |
#define | GPMC_ECC_RESULT_7 (7U) |
#define | GPMC_ECC_RESULT_8 (8U) |
#define | GPMC_ECC_RESULT_9 (9U) |
GPMC BCH RESULT | |
Macros which can be used to get BCH syndrome polynomial in GPMC_eccBchResultGet API. | |
#define | GPMC_BCH_RESULT0 (0U) |
#define | GPMC_BCH_RESULT1 (1U) |
#define | GPMC_BCH_RESULT2 (2U) |
#define | GPMC_BCH_RESULT3 (3U) |
#define | GPMC_BCH_RESULT4 (4U) |
#define | GPMC_BCH_RESULT5 (5U) |
#define | GPMC_BCH_RESULT6 (6U) |
GPMC CHIP Select SIZE | |
#define | GPMC_CS_MASK_ADDR_SIZE_256MB (0x00U) |
#define | GPMC_CS_MASK_ADDR_SIZE_128MB (0x08U) |
#define | GPMC_CS_MASK_ADDR_SIZE_64MB (0x0cU) |
#define | GPMC_CS_MASK_ADDR_SIZE_32MB (0x0eU) |
#define | GPMC_CS_MASK_ADDR_SIZE_16MB (0x0fU) |
#define GPMC_CHIP_SELECT_CS0 (0U) |
#define GPMC_CHIP_SELECT_CS1 (1U) |
#define GPMC_CHIP_SELECT_CS2 (2U) |
#define GPMC_CHIP_SELECT_CS3 (3U) |
#define GPMC_FIFOEVENT_STATUS (0U) |
#define GPMC_TERMINALCOUNT_STATUS (1U) |
#define GPMC_WAIT0EDGEDETECTION_STATUS (2U) |
#define GPMC_WAIT1EDGEDETECTION_STATUS (3U) |
#define GPMC_FIFOEVENT_INT (0U) |
#define GPMC_TERMINALCOUNT_INT (1U) |
#define GPMC_WAIT0EDGEDETECTION_INT (2U) |
#define GPMC_WAIT1EDGEDETECTION_INT (3U) |
#define GPMC_PREFETCH_ACCESSMODE_READ (0U) |
#define GPMC_PREFETCH_ACCESSMODE_WRITE (1U) |
#define GPMC_ECC_ALGORITHM_HAMMINGCODE (0U) |
#define GPMC_ECC_ALGORITHM_BCH (1U) |
#define GPMC_ECC_BCH_ERRCORRCAP_UPTO_4BITS (0U) |
#define GPMC_ECC_BCH_ERRCORRCAP_UPTO_8BITS (1U) |
#define GPMC_ECC_BCH_ERRCORRCAP_UPTO_16BITS (2U) |
#define GPMC_ECCPOINTER_RESULT_1 (1U) |
#define GPMC_ECCPOINTER_RESULT_2 (2U) |
#define GPMC_ECCPOINTER_RESULT_3 (3U) |
#define GPMC_ECCPOINTER_RESULT_4 (4U) |
#define GPMC_ECCPOINTER_RESULT_5 (5U) |
#define GPMC_ECCPOINTER_RESULT_6 (6U) |
#define GPMC_ECCPOINTER_RESULT_7 (7U) |
#define GPMC_ECCPOINTER_RESULT_8 (8U) |
#define GPMC_ECCPOINTER_RESULT_9 (9U) |
#define GPMC_ECC_SIZE_0 (0U) |
#define GPMC_ECC_SIZE_1 (1U) |
#define GPMC_ECC_RESULT_1 (1U) |
#define GPMC_ECC_RESULT_2 (2U) |
#define GPMC_ECC_RESULT_3 (3U) |
#define GPMC_ECC_RESULT_4 (4U) |
#define GPMC_ECC_RESULT_5 (5U) |
#define GPMC_ECC_RESULT_6 (6U) |
#define GPMC_ECC_RESULT_7 (7U) |
#define GPMC_ECC_RESULT_8 (8U) |
#define GPMC_ECC_RESULT_9 (9U) |
#define GPMC_BCH_RESULT0 (0U) |
#define GPMC_BCH_RESULT1 (1U) |
#define GPMC_BCH_RESULT2 (2U) |
#define GPMC_BCH_RESULT3 (3U) |
#define GPMC_BCH_RESULT4 (4U) |
#define GPMC_BCH_RESULT5 (5U) |
#define GPMC_BCH_RESULT6 (6U) |
#define GPMC_CS_MASK_ADDR_SIZE_256MB (0x00U) |
#define GPMC_CS_MASK_ADDR_SIZE_128MB (0x08U) |
#define GPMC_CS_MASK_ADDR_SIZE_64MB (0x0cU) |
#define GPMC_CS_MASK_ADDR_SIZE_32MB (0x0eU) |
#define GPMC_CS_MASK_ADDR_SIZE_16MB (0x0fU) |
#define GPMC_CS_TIMING_CONFIG | ( | CSWrOffTime, | |
CSRdOffTime, | |||
CSExtDelayFlag, | |||
CSOnTime | |||
) |
This macro used to make the conf value which is used to configure the CS signal timing configuration.
CSWrOffTime | CS# de-assertion time from start cycle time for write accesses in GPMC_FCLK cycles. |
CSRdOffTime | CS# de-assertion time from start cycle time for read accesses in GPMC_FCLK cycles |
CSExtDelayFlag | Flag to indicate whether to add half GPMC_FCLK delay to CS or not. This can take one of the following values : CSL_GPMC_CONFIG2_CSEXTRADELAY_DELAYED : CS# Timing control signal is delayed of half GPMC_FCLK cycle. CSL_GPMC_CONFIG2_CSEXTRADELAY_NOTDELAYED : CS# Timing control signal is not delayed. |
CSOnTime | CS# assertion time from start cycle time in GPMC_FCLK cycles. |
#define GPMC_ADV_TIMING_CONFIG | ( | ADVAADMuxWrOffTime, | |
ADVAADMuxRdOffTime, | |||
ADVWrOffTime, | |||
ADVRdOffTime, | |||
ADVExtDelayFlag, | |||
ADVAADMuxOnTime, | |||
ADVOnTime | |||
) |
This macro used to make the conf value which is used to configure the ADV# signal timing configuration.
ADVAADMuxWrOffTime | ADV# de-assertion time in GPMC_FCLK cycles for first address phase when using the AAD-Mux prorocol. |
ADVAADMuxRdOffTime | ADV# de-assertion time in GPMC_FCLK cycles for first address phase when using the AAD-Mux prorocol. |
ADVWrOffTime | ADV# de-assertion time in GPMC_FCLK cycles from start cycle time for write accesses |
ADVRdOffTime | ADV# de-assertion time in GPMC_FCLK cycles from start cycle time for write accesses |
ADVExtDelayFlag | Flag to indicate whether to add half GPMC_FCLK delay to ADV or not. This can take one of the following values : CSL_GPMC_CONFIG3_ADVEXTRADELAY_DELAYED : ADV# Timing control signal is delayed of half GPMC_FCLK cycle. CSL_GPMC_CONFIG3_ADVEXTRADELAY_NOTDELAYED : ADV# Timing control signal is not delayed. |
ADVAADMuxOnTime | ADV# assertion time in GPMC_FCLK cycles for first address phase when using the AAD-Multiplexed protocol. |
ADVOnTime | ADV# assertion time from start cycle time in GPMC_FCLK cycles. |
#define GPMC_WE_OE_TIMING_CONFIG | ( | WEOffTime, | |
WEExtDelayFlag, | |||
WEOnTime, | |||
OEAADMuxOffTime, | |||
OEOffTime, | |||
OEExtDelayFlag, | |||
OEAADMuxOnTime, | |||
OEOnTime | |||
) |
This macro used to make the conf value which is used to configure the WE# and OE# signal timing configuration.
.
WEOffTime | WE# de-assertion time in GPMC_FCLK cycles from start cycle time. |
WEExtDelayFlag | Flag to indicate whether to add half GPMC_FCLK delay to WE or not. This can take one of the following values : CSL_GPMC_CONFIG4_WEEXTRADELAY_DELAYED : WE# Timing control signal is delayed of half GPMC_FCLK cycle. CSL_GPMC_CONFIG4_WEEXTRADELAY_NOTDELAYED : WE# Timing control signal is not delayed. |
WEOnTime | WE# assertion time in GPMC_FCLK cycles from start cycle time. |
OEAADMuxOffTime | OE# de-assertion time in GPMC_FCLK cycles for first address phase when using the AAD-Mux prorocol. |
OEOffTime | OE# de-assertion time in GPMC_FCLK cycles from start cycle time. |
OEExtDelayFlag | Flag to indicate whether to add half GPMC_FCLK delay to OE or not. This can take one of the following values : CSL_GPMC_CONFIG4_OEEXTRADELAY_DELAYED : OE# Timing control signal is delayed of half GPMC_FCLK cycle. CSL_GPMC_CONFIG4_OEEXTRADELAY_NOTDELAYED : OE# Timing control signal is not delayed. |
OEAADMuxOnTime | OE# assertion time in GPMC_FCLK cycles for first address phase when using the AAD-Mux prorocol. |
OEOnTime | OE# assertion time in GPMC_FCLK cycles from start cycle time. |
#define GPMC_RDACCESS_CYCLETIME_TIMING_CONFIG | ( | rdCycleTime, | |
wrCycleTime, | |||
rdAccessTime, | |||
pageBurstAccessTime | |||
) |
This macro used to make the conf value which is used to configure the read access and cycle time timing configuration.
.
rdCycleTime | Total read cycle time in GPMC_FCLK cycles. |
wrCycleTime | Total write cycle time in GPMC_FCLK cycles. |
rdAccessTime | Read access time (Delay between start cycle time and first data valid) in GPMC_FCLK cycles. |
pageBurstAccessTime | Page burest access time (Delay between successive words in a multiple access)in GPMC_FCLK cycles. |
#define GPMC_CYCLE2CYCLE_BUSTURNAROUND_TIMING_CONFIG | ( | cycle2CycleDelay, | |
cycle2CycleDelaySameCSCfg, | |||
cycle2CycleDelayDiffCSCfg, | |||
busTAtime | |||
) |
This macro used to make the conf value which is used to configure the cycle to cycle and bus turn around time timing configuration.
.
cycle2CycleDelay | Cycle to cycle delay (Chip select high pulse delay between two successive accesses)in GPMC_FCLK cycles. |
cycle2CycleDelaySameCSCfg | Specified whether to add the cycle to cycle delay between two successive accesses or not (to the same chip-select). This can take one of the following values : CSL_GPMC_CONFIG6_CYCLE2CYCLESAMECSEN_C2CDELAY : To add the delay. CSL_GPMC_CONFIG6_CYCLE2CYCLESAMECSEN_NOC2CDELAY : Don't add the delay. |
cycle2CycleDelayDiffCSCfg | Specified whether to add the cycle to cycle delay between two successive accesses or not (to the diffrent chip-select). This can take one of the following values : CSL_GPMC_CONFIG6_CYCLE2CYCLEDIFFCSEN_C2CDELAY : To add the delay. CSL_GPMC_CONFIG6_CYCLE2CYCLEDIFFCSEN_NOC2CDELAY : Don't add the delay. |
busTAtime | Bus turn aroung time between two successive accesses to the same chip-select (read to write) or to a diff chip-select in GPMC_FCLK cycles. |
#define GPMC_DMA_COPY_LOWER_LIMIT (512U) |
size in bytes
#define GPMC_CS_BASE_ADDR_SHIFT (24U) |
GPMC CHIP select base address shift value.
#define GPMC_ECC_WRAP_MODE1 (1) |
GPMC ECC Wrap mode for ECC value computation.
#define GPMC_CMD_INVALID (0xFFFFFFFFU) |
Invalid value for params initialisation.
#define GPMC_MEM_TYPE_NAND (0) |
#define GPMC_MEM_TYPE_PSRAM (1) |
#define GPMC_MEM_TYPE_NORLIKE (1) |
typedef void* GPMC_Handle |
A handle that is returned from a GPMC_open() call.
typedef void(* GPMC_CallbackFxn) (GPMC_Handle handle, GPMC_Transaction *transaction) |
The definition of a callback function used by the GPMC driver when used in GPMC_OPERATING_MODE_CALLBACK mode.
GPMC_Handle | GPMC_Handle |
GPMC_Transaction* | GPMC_Transaction* |
enum GPMC_nandEccAlgo |
enum GPMC_OperatingMode |
enum GPMC_TransferMode |
GPMC data transfer modes.
enum GPMC_TransactionType |
|
inlinestatic |
Function to initialize the GPMC_Params struct to its defaults.
params | Pointer to GPMC_Params structure for initialization |
void GPMC_init | ( | void | ) |
This function initializes the GPMC module.
void GPMC_deinit | ( | void | ) |
This function de-initializes the GPMC module.
GPMC_Handle GPMC_open | ( | uint32_t | index, |
const GPMC_Params * | prms | ||
) |
This function opens a given GPMC peripheral.
index | Index of config to use in the GPMC_Config array |
prms | Pointer to parameters GPMC_Params to open the driver instance. |
void GPMC_close | ( | GPMC_Handle | handle | ) |
Function to close a GPMC peripheral specified by the GPMC handle.
handle | GPMC_Handle returned from GPMC_open() |
uint32_t GPMC_getInputClk | ( | GPMC_Handle | handle | ) |
This function returns the input clk frequency GPMC was programmed at.
handle | An GPMC_Handle returned from an GPMC_open() |
GPMC_Handle GPMC_getHandle | ( | uint32_t | driverInstanceIndex | ) |
This function returns the handle of an open GPMC Instance from the instance index.
driverInstanceIndex | Index of config to use in the GPMC_Config array |
void GPMC_writeNandCommandParamsInit | ( | GPMC_nandCmdParams * | cmdParams | ) |
Function to initialise GPMC_nandCmdParams structure to default values.
cmdParams | Pointer to GPMC_nandCmdParams structure |
int32_t GPMC_writeNandCommand | ( | GPMC_Handle | handle, |
GPMC_nandCmdParams * | cmdParams | ||
) |
Function to write NAND command parameters.
handle | An GPMC_Handle returned from an GPMC_open() |
cmdParams | Pointer to GPMC_nandCmdParams structure |
void GPMC_transactionInit | ( | GPMC_Transaction * | trans | ) |
Function to initialise GPMC_Transaction structure to default values.
trans | Pointer to GPMC_Transaction structure |
int32_t GPMC_nandReadData | ( | GPMC_Handle | handle, |
GPMC_Transaction * | trans | ||
) |
Function to read data from NAND flash using DMA or CPU prefetch/post write engine.
handle | An GPMC_Handle returned from an GPMC_open() |
trans | Pointer to GPMC_Transaction structure |
int32_t GPMC_nandWriteData | ( | GPMC_Handle | handle, |
GPMC_Transaction * | trans | ||
) |
Function to write data to NANDflash using CPU prefetch/post write engine.
handle | An GPMC_Handle returned from an GPMC_open() |
trans | Pointer to GPMC_Transaction structure |
int32_t GPMC_setDeviceSize | ( | GPMC_Handle | handle | ) |
Function to set device width for GPMC instance connected to external device.
handle | An GPMC_Handle returned from an GPMC_open() |
int32_t GPMC_setDeviceType | ( | GPMC_Handle | handle | ) |
Function to set device type (NANDLIKE OR NORLIKE) for GPMC instance connected to external device.
handle | An GPMC_Handle returned from an GPMC_open() |
int32_t GPMC_configureTimingParameters | ( | GPMC_Handle | handle | ) |
Function to configure GPMC timing parameters.
handle | An GPMC_Handle returned from an GPMC_open() |
int32_t GPMC_eccValueSizeSet | ( | GPMC_Handle | handle, |
uint32_t | eccSize, | ||
uint32_t | eccSizeVal | ||
) |
Function to set ECC used and unused bytes size in nibbles.
handle | An GPMC_Handle returned from an GPMC_open() |
eccSize | Param to set GPMC_ECC_SIZE_0 (used bytes) or GPMC_ECC_SIZE_1 unused bytes |
eccSizeVal | ECC used or ununsed bytes value in nibbles. |
int32_t GPMC_eccBchConfigureElm | ( | GPMC_Handle | handle, |
uint8_t | numSectors | ||
) |
Function to configure ELM module for error correction.
handle | An GPMC_Handle returned from an GPMC_open() |
numSectors | Number of 512 bytes sector in a NAND page. |
int32_t GPMC_eccEngineBCHConfig | ( | GPMC_Handle | handle, |
uint32_t | eccSteps | ||
) |
Function to configure GPMC ECC engine for BCH algorithm.
handle | An GPMC_Handle returned from an GPMC_open() |
eccSteps | Number of 512 bytes sectors to process BCH syndrome polynomial computation. |
int32_t GPMC_eccEngineEnable | ( | GPMC_Handle | handle | ) |
Function to enable GPMC ECC engine.
handle | An GPMC_Handle returned from an GPMC_open() |
void GPMC_eccResultRegisterClear | ( | GPMC_Handle | handle | ) |
Function to clear GPMC ECC result register.
handle | An GPMC_Handle returned from an GPMC_open() |
int32_t GPMC_eccBchFillSyndromeValue | ( | GPMC_Handle | handle, |
uint32_t | sector, | ||
uint32_t * | bchData | ||
) |
Function to fill BCH syndrome value per sector to ELM module.
handle | An GPMC_Handle returned from an GPMC_open() |
sector | Sector number |
bchData | Pointer to syndrome polynomial value. |
int32_t GPMC_eccBchStartErrorProcessing | ( | GPMC_Handle | handle, |
uint8_t | sector | ||
) |
Function to start error processing for a sector by ELM module.
handle | An GPMC_Handle returned from an GPMC_open() |
sector | Sector number |
int32_t GPMC_eccBchCheckErrorProcessingStatus | ( | GPMC_Handle | handle, |
uint32_t | sector | ||
) |
Function to get error processing status for a sector by ELM module.
handle | An GPMC_Handle returned from an GPMC_open() |
sector | Sector number |
int32_t GPMC_eccBchSectorGetError | ( | GPMC_Handle | handle, |
uint32_t | sector, | ||
uint32_t * | errCount, | ||
uint32_t * | errLoc | ||
) |
Function to get number of errors per sector by ELM module.
handle | An GPMC_Handle returned from an GPMC_open() |
sector | Sector number |
errCount | Pointer to store number of errors in a sector |
errLoc | Pointer to store error locations in a sector |
int32_t GPMC_eccCalculateBchSyndromePolynomial | ( | GPMC_Handle | handle, |
uint8_t * | pEccdata, | ||
uint32_t | sector | ||
) |
Function to compute BCH syndrome polynomial for NAND write operation.
handle | An GPMC_Handle returned from an GPMC_open() |
sector | Sector number |
pEccdata | Pointer to store BCH syndrome polynomial. |
int32_t GPMC_eccGetBchSyndromePolynomial | ( | GPMC_Handle | handle, |
uint32_t | sector, | ||
uint32_t * | bchData | ||
) |
Function to get BCH syndrome polynomial per sector NAND read operation.
handle | An GPMC_Handle returned from an GPMC_open() |
sector | Sector number |
bchData | Pointer to store BCH syndrome polynomial. |
int32_t GPMC_configurePrefetchPostWriteEngine | ( | GPMC_Handle | handle | ) |
Function to configure GPMC PREFETCH read and POST write engine.
handle | An GPMC_Handle returned from an GPMC_open() |
int32_t GPMC_disableFlashWriteProtect | ( | GPMC_Handle | handle | ) |
Function to disable WRITE protect line.
handle | An GPMC_Handle returned from an GPMC_open() |
int32_t GPMC_enableFlashWriteProtect | ( | GPMC_Handle | handle | ) |
Function to disable WRITE protect line.
handle | An GPMC_Handle returned from an GPMC_open() |
uint8_t* GPMC_norMakeAddr | ( | uint8_t | busWidth, |
uint32_t | blkAddr, | ||
uint32_t | offset | ||
) |
Function to create correct address based on bus width.
busWidth | Bus width for the NOR Flash device. |
blkAddr | Base address for NOR Flash. |
offset | Base address for NOR Flash. |
void GPMC_norMakeCmd | ( | uint8_t | busWidth, |
uint32_t | cmd, | ||
void * | cmdBuf | ||
) |
Function to create correct NOR cmd based on bus width.
busWidth | Bus width for the NOR Flash device. |
cmd | Command to be sent on Data Lines. |
cmdBuf | Buffer pointer to store the modified cmd. |
int32_t GPMC_norReadData | ( | GPMC_Handle | handle, |
uint32_t | offset, | ||
uint8_t * | buf, | ||
uint32_t | len | ||
) |
Function to read data from norlike device.
handle | An GPMC_Handle returned from an GPMC_open() |
offset | Offset of read address from GPMC data baseaddress. |
buf | Pointer to buffer for storing read data. |
len | Number of bytes to read. |
int32_t GPMC_norWriteData | ( | GPMC_Handle | handle, |
uint32_t | offset, | ||
uint8_t * | buf, | ||
uint32_t | len | ||
) |
Function to write data to norlike device.
handle | An GPMC_Handle returned from an GPMC_open() |
offset | Offset of write address from GPMC data baseaddress. |
buf | Pointer to buffer for storing read data. |
len | Number of bytes to write. |
|
extern |
Externally defined driver configuration array.
|
extern |
Externally defined driver configuration array size.