AM243x MCU+ SDK  09.02.00
gpmc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
53 #ifndef _GPMC__H_
54 #define _GPMC__H_
55 
56 
57 /* ========================================================================== */
58 /* Include Files */
59 /* ========================================================================== */
60 
61 #include <stdint.h>
62 #include <kernel/dpl/SystemP.h>
63 #include <kernel/dpl/SemaphoreP.h>
64 #include <kernel/dpl/HwiP.h>
65 #include <drivers/hw_include/csl_types.h>
66 #include <drivers/hw_include/cslr_gpmc.h>
67 #include <kernel/dpl/CacheP.h>
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
73 /* ========================================================================== */
74 /* Macros & Typedefs */
75 /* ========================================================================== */
83 #define GPMC_CHIP_SELECT_CS0 (0U)
84 #define GPMC_CHIP_SELECT_CS1 (1U)
85 #define GPMC_CHIP_SELECT_CS2 (2U)
86 #define GPMC_CHIP_SELECT_CS3 (3U)
87 
97 #define GPMC_FIFOEVENT_STATUS (0U)
98 #define GPMC_TERMINALCOUNT_STATUS (1U)
99 #define GPMC_WAIT0EDGEDETECTION_STATUS (2U)
100 #define GPMC_WAIT1EDGEDETECTION_STATUS (3U)
101 
111 #define GPMC_FIFOEVENT_INT (0U)
112 #define GPMC_TERMINALCOUNT_INT (1U)
113 #define GPMC_WAIT0EDGEDETECTION_INT (2U)
114 #define GPMC_WAIT1EDGEDETECTION_INT (3U)
115 
125 #define GPMC_PREFETCH_ACCESSMODE_READ (0U)
126 #define GPMC_PREFETCH_ACCESSMODE_WRITE (1U)
127 
137 #define GPMC_ECC_ALGORITHM_HAMMINGCODE (0U)
138 #define GPMC_ECC_ALGORITHM_BCH (1U)
139 
148 #define GPMC_ECC_BCH_ERRCORRCAP_UPTO_4BITS (0U)
149 #define GPMC_ECC_BCH_ERRCORRCAP_UPTO_8BITS (1U)
150 #define GPMC_ECC_BCH_ERRCORRCAP_UPTO_16BITS (2U)
151 
161 #define GPMC_ECCPOINTER_RESULT_1 (1U)
162 #define GPMC_ECCPOINTER_RESULT_2 (2U)
163 #define GPMC_ECCPOINTER_RESULT_3 (3U)
164 #define GPMC_ECCPOINTER_RESULT_4 (4U)
165 #define GPMC_ECCPOINTER_RESULT_5 (5U)
166 #define GPMC_ECCPOINTER_RESULT_6 (6U)
167 #define GPMC_ECCPOINTER_RESULT_7 (7U)
168 #define GPMC_ECCPOINTER_RESULT_8 (8U)
169 #define GPMC_ECCPOINTER_RESULT_9 (9U)
170 
178 #define GPMC_ECC_SIZE_0 (0U)
179 #define GPMC_ECC_SIZE_1 (1U)
180 
188 #define GPMC_ECC_RESULT_1 (1U)
189 #define GPMC_ECC_RESULT_2 (2U)
190 #define GPMC_ECC_RESULT_3 (3U)
191 #define GPMC_ECC_RESULT_4 (4U)
192 #define GPMC_ECC_RESULT_5 (5U)
193 #define GPMC_ECC_RESULT_6 (6U)
194 #define GPMC_ECC_RESULT_7 (7U)
195 #define GPMC_ECC_RESULT_8 (8U)
196 #define GPMC_ECC_RESULT_9 (9U)
197 
205 #define GPMC_BCH_RESULT0 (0U)
206 #define GPMC_BCH_RESULT1 (1U)
207 #define GPMC_BCH_RESULT2 (2U)
208 #define GPMC_BCH_RESULT3 (3U)
209 #define GPMC_BCH_RESULT4 (4U)
210 #define GPMC_BCH_RESULT5 (5U)
211 #define GPMC_BCH_RESULT6 (6U)
212 
220 #define GPMC_CS_MASK_ADDR_SIZE_256MB (0x00U)
221 #define GPMC_CS_MASK_ADDR_SIZE_128MB (0x08U)
222 #define GPMC_CS_MASK_ADDR_SIZE_64MB (0x0cU)
223 #define GPMC_CS_MASK_ADDR_SIZE_32MB (0x0eU)
224 #define GPMC_CS_MASK_ADDR_SIZE_16MB (0x0fU)
225 
250 #define GPMC_CS_TIMING_CONFIG(CSWrOffTime, CSRdOffTime, CSExtDelayFlag, \
251  CSOnTime) \
252  ((uint32_t) (((CSWrOffTime) << CSL_GPMC_CONFIG2_CSWROFFTIME_SHIFT) \
253  & CSL_GPMC_CONFIG2_CSWROFFTIME_MASK) | \
254  (((CSRdOffTime) << CSL_GPMC_CONFIG2_CSRDOFFTIME_SHIFT) \
255  & CSL_GPMC_CONFIG2_CSRDOFFTIME_MASK) | \
256  (((CSExtDelayFlag) << CSL_GPMC_CONFIG2_CSEXTRADELAY_SHIFT) \
257  & CSL_GPMC_CONFIG2_CSEXTRADELAY_MASK) | \
258  (((CSOnTime) << CSL_GPMC_CONFIG2_CSONTIME_SHIFT) \
259  & CSL_GPMC_CONFIG2_CSONTIME_MASK))
260 
261 
297 #define GPMC_ADV_TIMING_CONFIG(ADVAADMuxWrOffTime, ADVAADMuxRdOffTime, \
298  ADVWrOffTime, ADVRdOffTime, ADVExtDelayFlag, \
299  ADVAADMuxOnTime, \
300  ADVOnTime) \
301  ((uint32_t) (((ADVAADMuxWrOffTime) << \
302  CSL_GPMC_CONFIG3_ADVAADMUXWROFFTIME_SHIFT) & \
303  CSL_GPMC_CONFIG3_ADVAADMUXWROFFTIME_MASK) | \
304  (((ADVAADMuxRdOffTime) << CSL_GPMC_CONFIG3_ADVAADMUXRDOFFTIME_SHIFT) & \
305  CSL_GPMC_CONFIG3_ADVAADMUXRDOFFTIME_MASK) | \
306  (((ADVWrOffTime) << CSL_GPMC_CONFIG3_ADVWROFFTIME_SHIFT) & \
307  CSL_GPMC_CONFIG3_ADVWROFFTIME_MASK) | \
308  (((ADVRdOffTime) << CSL_GPMC_CONFIG3_ADVRDOFFTIME_SHIFT) & \
309  CSL_GPMC_CONFIG3_ADVRDOFFTIME_MASK) | \
310  (((ADVExtDelayFlag) << CSL_GPMC_CONFIG3_ADVEXTRADELAY_SHIFT) & \
311  CSL_GPMC_CONFIG3_ADVEXTRADELAY_MASK) | \
312  (((ADVAADMuxOnTime) << CSL_GPMC_CONFIG3_ADVAADMUXONTIME_SHIFT) & \
313  CSL_GPMC_CONFIG3_ADVAADMUXONTIME_MASK) | \
314  (((ADVOnTime) << CSL_GPMC_CONFIG3_ADVONTIME_SHIFT) & \
315  CSL_GPMC_CONFIG3_ADVONTIME_MASK))
316 
317 
361 #define GPMC_WE_OE_TIMING_CONFIG(WEOffTime, WEExtDelayFlag, WEOnTime, \
362  OEAADMuxOffTime, OEOffTime, OEExtDelayFlag, \
363  OEAADMuxOnTime, OEOnTime) \
364  ((uint32_t) (((WEOffTime) << \
365  CSL_GPMC_CONFIG4_WEOFFTIME_SHIFT) & \
366  CSL_GPMC_CONFIG4_WEOFFTIME_MASK) | \
367  (((WEExtDelayFlag) << \
368  CSL_GPMC_CONFIG4_WEEXTRADELAY_SHIFT) & CSL_GPMC_CONFIG4_WEEXTRADELAY_MASK) | \
369  (((WEOnTime) << \
370  CSL_GPMC_CONFIG4_WEONTIME_SHIFT) & CSL_GPMC_CONFIG4_WEONTIME_MASK) | \
371  (((OEAADMuxOffTime) << \
372  CSL_GPMC_CONFIG4_OEAADMUXOFFTIME_SHIFT) & \
373  CSL_GPMC_CONFIG4_OEAADMUXOFFTIME_MASK) | \
374  (((OEOffTime) << \
375  CSL_GPMC_CONFIG4_OEOFFTIME_SHIFT) & CSL_GPMC_CONFIG4_OEOFFTIME_MASK) | \
376  (((OEExtDelayFlag) << \
377  CSL_GPMC_CONFIG4_OEEXTRADELAY_SHIFT) & CSL_GPMC_CONFIG4_OEEXTRADELAY_MASK) | \
378  (((OEAADMuxOnTime) << \
379  CSL_GPMC_CONFIG4_OEAADMUXONTIME_SHIFT) & \
380  CSL_GPMC_CONFIG4_OEAADMUXONTIME_MASK) | \
381  (((OEOnTime) << \
382  CSL_GPMC_CONFIG4_OEONTIME_SHIFT) & CSL_GPMC_CONFIG4_OEONTIME_MASK))
383 
384 
385 
402 #define GPMC_RDACCESS_CYCLETIME_TIMING_CONFIG(rdCycleTime, wrCycleTime, \
403  rdAccessTime, \
404  pageBurstAccessTime) \
405  ((uint32_t) (((rdCycleTime) << \
406  CSL_GPMC_CONFIG5_RDCYCLETIME_SHIFT) & \
407  CSL_GPMC_CONFIG5_RDCYCLETIME_MASK) | \
408  (((wrCycleTime) << \
409  CSL_GPMC_CONFIG5_WRCYCLETIME_SHIFT) & CSL_GPMC_CONFIG5_WRCYCLETIME_MASK) | \
410  (((rdAccessTime) << \
411  CSL_GPMC_CONFIG5_RDACCESSTIME_SHIFT) & CSL_GPMC_CONFIG5_RDACCESSTIME_MASK) | \
412  (((pageBurstAccessTime) << \
413  CSL_GPMC_CONFIG5_PAGEBURSTACCESSTIME_SHIFT) & \
414  CSL_GPMC_CONFIG5_PAGEBURSTACCESSTIME_MASK))
415 
416 
417 
447 #define GPMC_CYCLE2CYCLE_BUSTURNAROUND_TIMING_CONFIG(cycle2CycleDelay, \
448  cycle2CycleDelaySameCSCfg, \
449  cycle2CycleDelayDiffCSCfg, \
450  busTAtime) \
451  ((uint32_t) (((cycle2CycleDelay) << \
452  CSL_GPMC_CONFIG6_CYCLE2CYCLEDELAY_SHIFT) & \
453  CSL_GPMC_CONFIG6_CYCLE2CYCLEDELAY_MASK) | \
454  (((cycle2CycleDelaySameCSCfg) << \
455  CSL_GPMC_CONFIG6_CYCLE2CYCLESAMECSEN_SHIFT) & \
456  CSL_GPMC_CONFIG6_CYCLE2CYCLESAMECSEN_MASK) | \
457  (((cycle2CycleDelayDiffCSCfg) << \
458  CSL_GPMC_CONFIG6_CYCLE2CYCLEDIFFCSEN_SHIFT) & \
459  CSL_GPMC_CONFIG6_CYCLE2CYCLEDIFFCSEN_MASK) | \
460  (((busTAtime) << \
461  CSL_GPMC_CONFIG6_BUSTURNAROUND_SHIFT) & CSL_GPMC_CONFIG6_BUSTURNAROUND_MASK))
462 
463 
464 
474 #define GPMC_NAND_CS_ON_TIME 0U
475 
476 #define GPMC_NAND_WE_ON_TIME 0U
477 
478 #define GPMC_NAND_ADV_ON_TIME 0U
479 
480 #define GPMC_NAND_CS_WR_OFF_TIME 6U
481 
482 #define GPMC_NAND_WR_CYCLE_TIME 6U
483 
484 #define GPMC_NAND_ADV_WR_OFF_TIME 4U
485 
486 #define GPMC_NAND_CS_RD_OFF_TIME 6U
487 
488 #define GPMC_NAND_RD_CYCLE_TIME 6U
489 
490 #define GPMC_NAND_ADV_AADMUX_ON_TIME 0U
491 
492 #define GPMC_NAND_ADV_AADMUX_RD_OFF_TIME 0U
493 
494 #define GPMC_NAND_ADV_AADMUX_WR_OFF_TIME 0U
495 
496 #define GPMC_NAND_PAGEBURST_ACCESS_TIME 0U
497 
498 #define GPMC_NAND_OE_ON_TIME 1U
499 
500 #define GPMC_NAND_OE_OFF_TIME 4U
501 
502 #define GPMC_NAND_OE_AADMUX_ON_TIME 0U
503 
504 #define GPMC_NAND_OE_AADMUX_OFF_TIME 0U
505 
506 #define GPMC_NAND_ADV_RD_OFF_TIME 4U
507 
508 #define GPMC_NAND_WE_OFF_TIME 3U
509 
510 #define GPMC_NAND_RD_ACCESS_TIME 4U
511 
512 #define GPMC_NAND_C2C_DELAY 0U
513 
514 #define GPMC_NAND_ADMUX_DATA_VALID 0U
515 
516 #define GPMC_NAND_WR_ACCESS_TIME 6U
517 
518 #define GPMC_NAND_BRST_TAROUND_TIME 0U
519 
530 #define GPMC_PSRAM_CS_ON_TIME 3U
531 
532 #define GPMC_PSRAM_WE_ON_TIME 10U
533 
534 #define GPMC_PSRAM_ADV_ON_TIME 1U
535 
536 #define GPMC_PSRAM_CS_WR_OFF_TIME 21U
537 
538 #define GPMC_PSRAM_WR_CYCLE_TIME 23U
539 
540 #define GPMC_PSRAM_ADV_WR_OFF_TIME 3U
541 
542 #define GPMC_PSRAM_CS_RD_OFF_TIME 21U
543 
544 #define GPMC_PSRAM_RD_CYCLE_TIME 23U
545 
546 #define GPMC_PSRAM_ADV_AADMUX_ON_TIME 1U
547 
548 #define GPMC_PSRAM_ADV_AADMUX_RD_OFF_TIME 2U
549 
550 #define GPMC_PSRAM_ADV_AADMUX_WR_OFF_TIME 2U
551 
552 #define GPMC_PSRAM_PAGEBURST_ACCESS_TIME 3U
553 
554 #define GPMC_PSRAM_OE_ON_TIME 10U
555 
556 #define GPMC_PSRAM_OE_OFF_TIME 1U
557 
558 #define GPMC_PSRAM_OE_AADMUX_ON_TIME 1U
559 
560 #define GPMC_PSRAM_OE_AADMUX_OFF_TIME 15U
561 
562 #define GPMC_PSRAM_ADV_RD_OFF_TIME 3U
563 
564 #define GPMC_PSRAM_WE_OFF_TIME 16U
565 
566 #define GPMC_PSRAM_RD_ACCESS_TIME 16U
567 
568 #define GPMC_PSRAM_C2C_DELAY 0U
569 
570 #define GPMC_PSRAM_ADMUX_DATA_VALID 0U
571 
572 #define GPMC_PSRAM_WR_ACCESS_TIME 8U
573 
574 #define GPMC_PSRAM_BRST_TAROUND_TIME 1U
575 
580 #define GPMC_DMA_COPY_LOWER_LIMIT (512U)
581 
582 #define GPMC_CS_BASE_ADDR_SHIFT (24U)
583 
584 #define GPMC_ECC_WRAP_MODE1 (1)
585 
586 #define GPMC_CMD_INVALID (0xFFFFFFFFU)
587 
588 #define GPMC_MEM_TYPE_NAND (0)
589 #define GPMC_MEM_TYPE_PSRAM (1)
590 
592 typedef void* GPMC_Handle;
593 
594 /* ========================================================================== */
595 /* Structure Declarations */
596 /* ========================================================================== */
602 typedef enum GPMC_v1_nandEccAlgo_s
603 {
609 
611 
617 typedef enum GPMC_OperatingMode_s {
618 
627 
633 typedef enum GPMC_TransferMode_s {
634 
646 
651 typedef enum GPMC_TransactionType_e {
661 
666 typedef enum GPMC_TransactionStatus_s {
674 
675 
680 typedef struct
681 {
682  uint32_t cmdCycle1;
684  uint32_t cmdCycle2;
686  uint32_t rowAddress;
690  uint32_t colAddress;
694  uint32_t waitTimeout;
696  uint32_t checkReadypin;
699 
700 
705 typedef struct GPMC_Transaction_s {
706 
709  uint32_t count;
711  void *Buf;
713  void *arg;
715  uint32_t transferTimeout;
720 
728 typedef void (*GPMC_CallbackFxn)(GPMC_Handle handle,
729  GPMC_Transaction * transaction);
730 
731 
741 typedef struct GPMC_Params_s
742 {
746  int32_t gpmcDmaChIndex;
748  uint32_t devType;
750  uint32_t devSize;
752  uint32_t chipSel;
754  uint32_t intrEnable;
755 
756  uint32_t dmaEnable;
762  uint32_t memDevice;
764 } GPMC_Params;
765 
774 typedef struct
775 {
776  uint32_t regionStartAddr;
778  uint32_t regionSize;
782 
787 typedef struct GPMC_Object_s {
788 
797  /*
798  * State variables
799  */
800  uint32_t isOpen;
812 } GPMC_Object;
813 
817 typedef struct GPMC_timingParams_s
818 {
819  uint32_t csOnTime;
820  /* Chip Select assertion time. */
821  uint32_t csRdOffTime;
823  uint32_t csWrOffTime;
825  uint32_t advOnTime;
827  uint32_t advRdOffTime;
829  uint32_t advWrOffTime;
831  uint32_t advAadMuxOnTime;
837  uint32_t weOnTtime;
839  uint32_t weOffTime;
841  uint32_t oeOnTime;
843  uint32_t oeOffTime;
845  uint32_t oeAadMuxOnTime;
847  uint32_t oeAadMuxOffTime;
849  uint32_t pageBurstAccess;
851  uint32_t rdAccessTime;
853  uint32_t wrAcessTime;
855  uint32_t rdCycleTime;
857  uint32_t wrCycleTime;
875 
879 typedef struct GPMC_HwAttrs_s
880 {
881 
882  uint32_t gpmcBaseAddr;
884  uint32_t dataBaseAddr;
886  uint32_t elmBaseAddr;
888  uint32_t inputClkFreq;
890  uint32_t intrNum;
892  uint32_t intrPriority;
894  uint32_t clkDivider;
896  uint32_t addrDataMux;
898  uint32_t timeLatency;
900  uint32_t chipSelBaseAddr;
902  uint32_t chipSelAddrSize;
904  uint32_t waitPinNum;
906  uint32_t waitPinPol;
912  uint32_t readType;
914  uint32_t writeType;
916  uint32_t csExDelay;
918  uint32_t accessType;
926 } GPMC_HwAttrs;
927 
931 typedef struct GPMC_Config_s {
932 
938 } GPMC_Config;
939 
940 
942 extern GPMC_Config gGpmcConfig[];
944 extern uint32_t gGpmcConfigNum;
945 
946 /* ========================================================================== */
947 /* Function Declarations */
948 /* ========================================================================== */
954 static inline void GPMC_Params_init(GPMC_Params *params);
955 
959 void GPMC_init(void);
963 void GPMC_deinit(void);
964 
979 GPMC_Handle GPMC_open(uint32_t index, const GPMC_Params *prms);
980 
990 void GPMC_close(GPMC_Handle handle);
991 
1002 
1015 GPMC_Handle GPMC_getHandle(uint32_t driverInstanceIndex);
1016 
1025 
1037 
1046 
1058 
1069 
1080 
1091 
1101 
1111 
1124 int32_t GPMC_eccValueSizeSet(GPMC_Handle handle, uint32_t eccSize, uint32_t eccSizeVal);
1125 
1136 int32_t GPMC_eccBchConfigureElm(GPMC_Handle handle, uint8_t numSectors);
1137 
1148 int32_t GPMC_eccEngineBCHConfig (GPMC_Handle handle, uint32_t eccSteps);
1149 
1158 
1166 
1179 int32_t GPMC_eccBchFillSyndromeValue(GPMC_Handle handle, uint32_t sector, uint32_t *bchData);
1180 
1192 int32_t GPMC_eccBchStartErrorProcessing(GPMC_Handle handle, uint8_t sector);
1193 
1203 int32_t GPMC_eccBchCheckErrorProcessingStatus(GPMC_Handle handle, uint32_t sector);
1204 
1218 int32_t GPMC_eccBchSectorGetError(GPMC_Handle handle, uint32_t sector, uint32_t *errCount, uint32_t *errLoc);
1219 
1231 int32_t GPMC_eccCalculateBchSyndromePolynomial(GPMC_Handle handle, uint8_t *pEccdata, uint32_t sector);
1232 
1244 int32_t GPMC_eccGetBchSyndromePolynomial(GPMC_Handle handle, uint32_t sector, uint32_t *bchData);
1245 
1255 
1265 
1275 /* ========================================================================== */
1276 /* Static Function Definitions */
1277 /* ========================================================================== */
1278 static inline void GPMC_Params_init(GPMC_Params *params)
1279 {
1280  if (params != NULL)
1281  {
1282  params->dmaEnable = FALSE;
1283  params->intrEnable = FALSE;
1284  params->chipSel = 0;
1285  params->devType = CSL_GPMC_CONFIG1_DEVICETYPE_NANDLIKE;
1286  params->devType = CSL_GPMC_CONFIG1_DEVICESIZE_EIGHTBITS;
1287  params->gpmcDmaChIndex = -1;
1289  params->transferCallBckFunc = NULL;
1290  }
1291 }
1292 
1293 #ifdef __cplusplus
1294 }
1295 #endif
1296 
1297 #endif /* _GPMC__H_ */
1298 
GPMC_Object::transferCallbackFxn
GPMC_CallbackFxn transferCallbackFxn
Definition: gpmc.h:791
GPMC_Object
GPMC driver object.
Definition: gpmc.h:787
GPMC_writeNandCommand
int32_t GPMC_writeNandCommand(GPMC_Handle handle, GPMC_nandCmdParams *cmdParams)
Function to write NAND command parameters.
GPMC_HwAttrs::waitPinPol
uint32_t waitPinPol
Definition: gpmc.h:906
GPMC_configureTimingParameters
int32_t GPMC_configureTimingParameters(GPMC_Handle handle)
Function to configure GPMC timing parameters.
GPMC_HwAttrs::waitPinNum
uint32_t waitPinNum
Definition: gpmc.h:904
GPMC_eccBchConfigureElm
int32_t GPMC_eccBchConfigureElm(GPMC_Handle handle, uint8_t numSectors)
Function to configure ELM module for error correction.
GPMC_configurePrefetchPostWriteEngine
int32_t GPMC_configurePrefetchPostWriteEngine(GPMC_Handle handle)
Function to configure GPMC PREFETCH read and POST write engine.
GPMC_timingParams::cycleDelaySameChipSel
uint32_t cycleDelaySameChipSel
Definition: gpmc.h:863
GPMC_TRANSACTION_TYPE_WRITE_CMDREG
@ GPMC_TRANSACTION_TYPE_WRITE_CMDREG
Definition: gpmc.h:658
GPMC_Object::isOpen
uint32_t isOpen
Definition: gpmc.h:800
GPMC_HwAttrs::intrPriority
uint32_t intrPriority
Definition: gpmc.h:892
GPMC_HwAttrs::dataBaseAddr
uint32_t dataBaseAddr
Definition: gpmc.h:884
GPMC_TRANSFER_CSN_DEASSERT
@ GPMC_TRANSFER_CSN_DEASSERT
Definition: gpmc.h:671
GPMC_Params::transferCallBckFunc
GPMC_CallbackFxn transferCallBckFunc
Definition: gpmc.h:760
GPMC_HwAttrs::writeType
uint32_t writeType
Definition: gpmc.h:914
GPMC_init
void GPMC_init(void)
This function initializes the GPMC module.
GPMC_timingParams::csOnTime
uint32_t csOnTime
Definition: gpmc.h:819
GPMC_HwAttrs::intrNum
uint32_t intrNum
Definition: gpmc.h:890
GPMC_timingParams::rdCycleTime
uint32_t rdCycleTime
Definition: gpmc.h:855
GPMC_TRANSACTION_TYPE_READ_CMDREG
@ GPMC_TRANSACTION_TYPE_READ_CMDREG
Definition: gpmc.h:656
GPMC_timingParams::rdAccessTime
uint32_t rdAccessTime
Definition: gpmc.h:851
GPMC_Handle
void * GPMC_Handle
A handle that is returned from a GPMC_open() call.
Definition: gpmc.h:592
GPMC_nandWriteData
int32_t GPMC_nandWriteData(GPMC_Handle handle, GPMC_Transaction *trans)
Function to write data to NANDflash using CPU prefetch/post write engine.
GPMC_nandReadData
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.
index
uint16_t index
Definition: tisci_rm_proxy.h:3
GPMC_timingParams::oeOffTime
uint32_t oeOffTime
Definition: gpmc.h:843
GPMC_TRANSFER_FAILED
@ GPMC_TRANSFER_FAILED
Definition: gpmc.h:670
SystemP.h
GPMC_timingParams::busTurnAroundTime
uint32_t busTurnAroundTime
Definition: gpmc.h:869
GPMC_timingParams::advAadMuxOnTime
uint32_t advAadMuxOnTime
Definition: gpmc.h:831
GPMC_Config
GPMC Driver configuration structure.
Definition: gpmc.h:931
GPMC_Config::attrs
const GPMC_HwAttrs * attrs
Definition: gpmc.h:933
GPMC_HwAttrs::gpmcBaseAddr
uint32_t gpmcBaseAddr
Definition: gpmc.h:882
GPMC_Config::object
GPMC_Object * object
Definition: gpmc.h:935
GPMC_AddrRegion::regionSize
uint32_t regionSize
Definition: gpmc.h:778
GPMC_HwAttrs::csExDelay
uint32_t csExDelay
Definition: gpmc.h:916
GPMC_Params::transferMode
GPMC_TransferMode transferMode
Definition: gpmc.h:758
GPMC_Transaction
Data structure to set transaction type parameters.
Definition: gpmc.h:705
GPMC_transactionInit
void GPMC_transactionInit(GPMC_Transaction *trans)
Function to initialise GPMC_Transaction structure to default values.
GPMC_HwAttrs
GPMC instance attributes.
Definition: gpmc.h:880
GPMC_HwAttrs::inputClkFreq
uint32_t inputClkFreq
Definition: gpmc.h:888
GPMC_Transaction::Buf
void * Buf
Definition: gpmc.h:711
GPMC_timingParams::cycle2CycleDelay
uint32_t cycle2CycleDelay
Definition: gpmc.h:861
GPMC_setDeviceType
int32_t GPMC_setDeviceType(GPMC_Handle handle)
Function to set device type (NANDLIKE OR NORLIKE) for GPMC instance connected to external device.
GPMC_NAND_ECC_ALGO_HAMMING_1BIT
@ GPMC_NAND_ECC_ALGO_HAMMING_1BIT
Definition: gpmc.h:605
GPMC_Transaction::transferTimeout
uint32_t transferTimeout
Definition: gpmc.h:715
GPMC_eccCalculateBchSyndromePolynomial
int32_t GPMC_eccCalculateBchSyndromePolynomial(GPMC_Handle handle, uint8_t *pEccdata, uint32_t sector)
Function to compute BCH syndrome polynomial for NAND write operation.
GPMC_HwAttrs::timeLatency
uint32_t timeLatency
Definition: gpmc.h:898
GPMC_eccResultRegisterClear
void GPMC_eccResultRegisterClear(GPMC_Handle handle)
Function to clear GPMC ECC result register.
GPMC_OperatingMode
GPMC_OperatingMode
GPMC driver operating modes.
Definition: gpmc.h:617
GPMC_OPERATING_MODE_POLLING
@ GPMC_OPERATING_MODE_POLLING
Definition: gpmc.h:623
GPMC_HwAttrs::chipSelAddrSize
uint32_t chipSelAddrSize
Definition: gpmc.h:902
SemaphoreP.h
GPMC_Params::devType
uint32_t devType
Definition: gpmc.h:748
GPMC_Transaction::transType
GPMC_TransactionType transType
Definition: gpmc.h:707
GPMC_enableFlashWriteProtect
int32_t GPMC_enableFlashWriteProtect(GPMC_Handle handle)
Function to disable WRITE protect line.
GPMC_nandCmdParams::numRowAddrCycles
uint32_t numRowAddrCycles
Definition: gpmc.h:688
GPMC_NAND_ECC_ALGO_BCH_8BIT
@ GPMC_NAND_ECC_ALGO_BCH_8BIT
Definition: gpmc.h:607
GPMC_Object::mutex
SemaphoreP_Object mutex
Definition: gpmc.h:804
GPMC_nandCmdParams::cmdCycle2
uint32_t cmdCycle2
Definition: gpmc.h:684
GPMC_NAND_ECC_ALGO_BCH_16BIT
@ GPMC_NAND_ECC_ALGO_BCH_16BIT
Definition: gpmc.h:608
GPMC_timingParams::wrCycleTime
uint32_t wrCycleTime
Definition: gpmc.h:857
GPMC_TRANSACTION_TYPE_READ
@ GPMC_TRANSACTION_TYPE_READ
Definition: gpmc.h:652
GPMC_Object::hwi
HwiP_Object hwi
Definition: gpmc.h:802
GPMC_OPERATING_MODE_BLOCKING
@ GPMC_OPERATING_MODE_BLOCKING
Definition: gpmc.h:619
GPMC_Params_init
static void GPMC_Params_init(GPMC_Params *params)
Function to initialize the GPMC_Params struct to its defaults.
Definition: gpmc.h:1278
GPMC_setDeviceSize
int32_t GPMC_setDeviceSize(GPMC_Handle handle)
Function to set device width for GPMC instance connected to external device.
GPMC_timingParams::oeOnTime
uint32_t oeOnTime
Definition: gpmc.h:841
GPMC_timingParams::oeAadMuxOffTime
uint32_t oeAadMuxOffTime
Definition: gpmc.h:847
CacheP.h
GPMC_TransferMode
GPMC_TransferMode
GPMC data transfer modes.
Definition: gpmc.h:633
GPMC_eccGetBchSyndromePolynomial
int32_t GPMC_eccGetBchSyndromePolynomial(GPMC_Handle handle, uint32_t sector, uint32_t *bchData)
Function to get BCH syndrome polynomial per sector NAND read operation.
GPMC_close
void GPMC_close(GPMC_Handle handle)
Function to close a GPMC peripheral specified by the GPMC handle.
GPMC_HwAttrs::timingParams
GPMC_timingParams timingParams
Definition: gpmc.h:908
GPMC_timingParams::weOffTime
uint32_t weOffTime
Definition: gpmc.h:839
GPMC_nandCmdParams::waitTimeout
uint32_t waitTimeout
Definition: gpmc.h:694
GPMC_Params::intrEnable
uint32_t intrEnable
Definition: gpmc.h:754
GPMC_Object::params
GPMC_Params params
Definition: gpmc.h:793
GPMC_timingParams::advOnTime
uint32_t advOnTime
Definition: gpmc.h:825
GPMC_nandCmdParams::colAddress
uint32_t colAddress
Definition: gpmc.h:690
GPMC_timingParams::weOnTtime
uint32_t weOnTtime
Definition: gpmc.h:837
GPMC_disableFlashWriteProtect
int32_t GPMC_disableFlashWriteProtect(GPMC_Handle handle)
Function to disable WRITE protect line.
GPMC_TRANSFER_MODE_BLOCKING
@ GPMC_TRANSFER_MODE_BLOCKING
Definition: gpmc.h:635
GPMC_NAND_ECC_ALGO_BCH_4BIT
@ GPMC_NAND_ECC_ALGO_BCH_4BIT
Definition: gpmc.h:606
GPMC_open
GPMC_Handle GPMC_open(uint32_t index, const GPMC_Params *prms)
This function opens a given GPMC peripheral.
GPMC_eccValueSizeSet
int32_t GPMC_eccValueSizeSet(GPMC_Handle handle, uint32_t eccSize, uint32_t eccSizeVal)
Function to set ECC used and unused bytes size in nibbles.
GPMC_timingParams::oeAadMuxOnTime
uint32_t oeAadMuxOnTime
Definition: gpmc.h:845
GPMC_HwAttrs::elmBaseAddr
uint32_t elmBaseAddr
Definition: gpmc.h:886
GPMC_NAND_ECC_ALGO_NONE
@ GPMC_NAND_ECC_ALGO_NONE
Definition: gpmc.h:604
GPMC_timingParams::csWrOffTime
uint32_t csWrOffTime
Definition: gpmc.h:823
HwiP.h
GPMC_HwAttrs::eccAlgo
GPMC_nandEccAlgo eccAlgo
Definition: gpmc.h:910
GPMC_timingParams::advAadMuxRdOffTime
uint32_t advAadMuxRdOffTime
Definition: gpmc.h:833
GPMC_TRANSFER_CANCELED
@ GPMC_TRANSFER_CANCELED
Definition: gpmc.h:669
GPMC_AddrRegion::regionStartAddr
uint32_t regionStartAddr
Definition: gpmc.h:776
GPMC_timingParams::cycleDelayDiffChipSel
uint32_t cycleDelayDiffChipSel
Definition: gpmc.h:866
GPMC_timingParams::advWrOffTime
uint32_t advWrOffTime
Definition: gpmc.h:829
GPMC_timingParams
GPMC timing parameters.
Definition: gpmc.h:818
GPMC_TRANSFER_TIMEOUT
@ GPMC_TRANSFER_TIMEOUT
Definition: gpmc.h:672
GPMC_nandCmdParams::numColAddrCycles
uint32_t numColAddrCycles
Definition: gpmc.h:692
GPMC_TRANSFER_STARTED
@ GPMC_TRANSFER_STARTED
Definition: gpmc.h:668
GPMC_Object::transferComplete
SemaphoreP_Object transferComplete
Definition: gpmc.h:806
gGpmcConfigNum
uint32_t gGpmcConfigNum
Externally defined driver configuration array size.
GPMC_eccBchFillSyndromeValue
int32_t GPMC_eccBchFillSyndromeValue(GPMC_Handle handle, uint32_t sector, uint32_t *bchData)
Function to fill BCH syndrome value per sector to ELM module.
GPMC_timingParams::advAadMuxWrOffTime
uint32_t advAadMuxWrOffTime
Definition: gpmc.h:835
GPMC_OPERATING_MODE_CALLBACK
@ GPMC_OPERATING_MODE_CALLBACK
Definition: gpmc.h:621
GPMC_eccBchSectorGetError
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.
GPMC_HwAttrs::dmaRestrictedRegions
const GPMC_AddrRegion * dmaRestrictedRegions
Definition: gpmc.h:920
GPMC_Object::handle
GPMC_Handle handle
Definition: gpmc.h:789
GPMC_nandCmdParams::cmdCycle1
uint32_t cmdCycle1
Definition: gpmc.h:682
GPMC_timingParams::csRdOffTime
uint32_t csRdOffTime
Definition: gpmc.h:821
GPMC_nandCmdParams::rowAddress
uint32_t rowAddress
Definition: gpmc.h:686
GPMC_eccEngineEnable
int32_t GPMC_eccEngineEnable(GPMC_Handle handle)
Function to enable GPMC ECC engine.
GPMC_Transaction::arg
void * arg
Definition: gpmc.h:713
GPMC_configureTimingParametersPsram
int32_t GPMC_configureTimingParametersPsram(GPMC_Handle handle)
Function to configure GPMC timing parameters for PSRAM/NOR Devices.
GPMC_Params
GPMC driver instance parameters.
Definition: gpmc.h:742
GPMC_TRANSFER_MODE_CALLBACK
@ GPMC_TRANSFER_MODE_CALLBACK
Definition: gpmc.h:640
GPMC_HwAttrs::accessType
uint32_t accessType
Definition: gpmc.h:918
GPMC_eccBchCheckErrorProcessingStatus
int32_t GPMC_eccBchCheckErrorProcessingStatus(GPMC_Handle handle, uint32_t sector)
Function to get error processing status for a sector by ELM module.
GPMC_Transaction::count
uint32_t count
Definition: gpmc.h:709
GPMC_HwAttrs::readType
uint32_t readType
Definition: gpmc.h:912
GPMC_getHandle
GPMC_Handle GPMC_getHandle(uint32_t driverInstanceIndex)
This function returns the handle of an open GPMC Instance from the instance index.
GPMC_Object::gpmcDmaHandle
void * gpmcDmaHandle
Definition: gpmc.h:810
GPMC_getInputClk
uint32_t GPMC_getInputClk(GPMC_Handle handle)
This function returns the input clk frequency GPMC was programmed at.
HwiP_Object
Opaque Hwi object used with the Hwi APIs.
Definition: HwiP.h:93
GPMC_HwAttrs::chipSelBaseAddr
uint32_t chipSelBaseAddr
Definition: gpmc.h:900
GPMC_timingParams::wrAcessTime
uint32_t wrAcessTime
Definition: gpmc.h:853
GPMC_TRANSFER_COMPLETED
@ GPMC_TRANSFER_COMPLETED
Definition: gpmc.h:667
SemaphoreP_Object
Opaque semaphore object used with the semaphore APIs.
Definition: SemaphoreP.h:59
GPMC_Object::operMode
GPMC_OperatingMode operMode
Definition: gpmc.h:795
GPMC_nandCmdParams
Data structure to set NAND command parameters.
Definition: gpmc.h:681
GPMC_Params::gpmcDmaChIndex
int32_t gpmcDmaChIndex
Definition: gpmc.h:746
GPMC_HwAttrs::clkDivider
uint32_t clkDivider
Definition: gpmc.h:894
GPMC_Params::chipSel
uint32_t chipSel
Definition: gpmc.h:752
GPMC_timingParams::pageBurstAccess
uint32_t pageBurstAccess
Definition: gpmc.h:849
GPMC_Params::dmaEnable
uint32_t dmaEnable
Definition: gpmc.h:756
GPMC_Transaction::status
GPMC_TransactionStatus status
Definition: gpmc.h:717
GPMC_nandCmdParams::checkReadypin
uint32_t checkReadypin
Definition: gpmc.h:696
GPMC_TransactionType
GPMC_TransactionType
Type of the GPMC transaction for read and write.
Definition: gpmc.h:651
GPMC_nandEccAlgo
GPMC_nandEccAlgo
GPMC ECC engine algoritms.
Definition: gpmc.h:603
GPMC_timingParams::advRdOffTime
uint32_t advRdOffTime
Definition: gpmc.h:827
GPMC_AddrRegion
GPMC Address Region.
Definition: gpmc.h:775
GPMC_Object::transaction
GPMC_Transaction * transaction
Definition: gpmc.h:808
GPMC_writeNandCommandParamsInit
void GPMC_writeNandCommandParamsInit(GPMC_nandCmdParams *cmdParams)
Function to initialise GPMC_nandCmdParams structure to default values.
GPMC_CallbackFxn
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_CALLBA...
Definition: gpmc.h:728
GPMC_TRANSACTION_TYPE_WRITE
@ GPMC_TRANSACTION_TYPE_WRITE
Definition: gpmc.h:654
GPMC_timingParams::wrDataOnMuxBusTime
uint32_t wrDataOnMuxBusTime
Definition: gpmc.h:859
GPMC_HwAttrs::addrDataMux
uint32_t addrDataMux
Definition: gpmc.h:896
gGpmcConfig
GPMC_Config gGpmcConfig[]
Externally defined driver configuration array.
GPMC_deinit
void GPMC_deinit(void)
This function de-initializes the GPMC module.
GPMC_Params::memDevice
uint32_t memDevice
Definition: gpmc.h:762
GPMC_eccBchStartErrorProcessing
int32_t GPMC_eccBchStartErrorProcessing(GPMC_Handle handle, uint8_t sector)
Function to start error processing for a sector by ELM module.
GPMC_eccEngineBCHConfig
int32_t GPMC_eccEngineBCHConfig(GPMC_Handle handle, uint32_t eccSteps)
Function to configure GPMC ECC engine for BCH algorithm.
GPMC_TransactionStatus
GPMC_TransactionStatus
Transaction status codes that are set by the GPMC driver.
Definition: gpmc.h:666
GPMC_Params::devSize
uint32_t devSize
Definition: gpmc.h:750