]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/performance-audio-sr.git/blob - psdk_cust/pdk_k2g_1_0_1_1_eng/packages/ti/board/src/flash/platform_flash/evmc66x_gpmc.h
PASDK-319:Update PDK eng to 1.0.1.2.
[processor-sdk/performance-audio-sr.git] / psdk_cust / pdk_k2g_1_0_1_1_eng / packages / ti / board / src / flash / platform_flash / evmc66x_gpmc.h
1 /*
2  * Copyright (c) 2015, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * *  Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  *
12  * *  Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the 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 "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
34  /**
35  *
36  * \file evmc66x_gpmc.h
37  *
38  * \brief This file is the header file for GPMC module
39  *
40  ******************************************************************************/
42 #ifndef _EVMC66X_GPMC_H_
43 #define _EVMC66X_GPMC_H_
45 /************************
46  * Defines and Macros
47  ************************/
49 /**
50   *  Handle to access GPMC registers.
51   */
52 #define hGpmcCfg  ((CSL_GpmcRegs *)CSL_GPMC_0_CFG_REGS)
53 typedef CSL_GpmcRegs * gpmcHandle;
55 #define GPMC_CMD_REG(cs)      (&hGpmcCfg->NAND_COMMAND_0 + (cs * (0x30)))
56 #define GPMC_ADDR_REG(cs)     (&hGpmcCfg->NAND_ADDR_0 + (cs * (0x30)))
57 #define GPMC_DATA_REG(cs)     (&hGpmcCfg->NAND_DATA_0 + (cs * (0x30)))
59 #define GPMC_BIT_SET_HIGH        (1)
60 #define GPMC_BIT_SET_LOW         (0)
62 #define GPMC_BIT_ENABLE          (1)
63 #define GPMC_BIT_DISABLE         (0)
65 /*****************************************************************************/
66 /*
67 ** Macros which can be used as 'mode' parameter to GPMCIdleModeSelect API.
68 **
69 */
70 #define GPMC_IDLEMODE_FORCEIDLE                       (0)
71 #define GPMC_IDLEMODE_NOIDLE                          (1)
72 #define GPMC_IDLEMODE_SMARTIDLE                       (2)
74 /*****************************************************************************/
75 /*
76 ** Macros which can be used as 'configVal' parameter to GPMCAutoIdleConfig API.
77 **
78 */
79 #define GPMC_AUTOIDLE_FREERUN                         (0)
80 #define GPMC_AUTOIDLE_AUTORUN                         (1)
82 /*****************************************************************************/
83 /*
84 ** Macros which can be used as 'flag' parameter to GPMCIntStatusGet,
85 ** GPMCIntStatusClear APIs.
86 **
87 */
88 #define GPMC_FIFOEVENT_STATUS                         (0)
89 #define GPMC_TERMINALCOUNT_STATUS                     (1)
90 #define GPMC_WAIT0EDGEDETECTION_STATUS                (2)
91 #define GPMC_WAIT1EDGEDETECTION_STATUS                (3)
93 /*****************************************************************************/
94 /*
95 ** Macros which can be used as 'flag' parameter to GPMCIntEnable, GPMCIntDisable
96 ** APIs.
97 **
98 */
99 #define GPMC_FIFOEVENT_INT                            (0)
100 #define GPMC_TERMINALCOUNT_INT                        (1)
101 #define GPMC_WAIT0EDGEDETECTION_INT                   (2)
102 #define GPMC_WAIT1EDGEDETECTION_INT                   (3)
104 /*****************************************************************************/
105 /*
106 ** Macros which can be used as 'flag' parameter to GPMCTimeOutFeatureConfig API.
107 **
108 */
109 #define GPMC_TIMEOUTFEATURE_ENABLE                    (1)
110 #define GPMC_TIMEOUTFEATURE_DISABLE                   (0)
112 /*****************************************************************************/
113 /*
114 ** Macros which can be used as 'err' parameter to GPMCErrStatusGet API.
115 **
116 */
117 #define GPMC_TIMEOUT_ERROR                            (0)
118 #define GPMC_NOTSUPPMCMD_ERROR                        (1)
119 #define GPMC_NOTSUPPADD_ERROR                         (2)
121 /*****************************************************************************/
122 /*
123 ** Macros which can be used as 'pin' parameter to GPMCWaitPinPolaritySelect,
124 ** GPMCWaitPinStatusGet APIs.
125 **
126 */
127 #define GPMC_WAIT_PIN0                                (0)
128 #define GPMC_WAIT_PIN1                                (1)
130 /*****************************************************************************/
131 /*
132 ** Macros which can be used as 'polarity' parameter to GPMCWaitPinPolaritySelect
133 ** API.
134 **
135 */
136 #define GPMC_WAIT_PIN_POLARITY_LOW                    (0)
137 #define GPMC_WAIT_PIN_POLARITY_HIGH                   (1)
139 /*****************************************************************************/
140 /*
141 ** Macros which can be used as 'pinLevel' parameter to
142 ** GPMCWriteProtectPinLevelCntrl API.
143 */
144 #define GPMC_WP_PIN_LEVEL_LOW                         (0)
145 #define GPMC_WP_PIN_LEVEL_HIGH                        (1)
147 /*****************************************************************************/
148 /*
149 ** Macros which can be used as 'flag' parameter to
150 ** GPMCNANDForcePostedWriteFeatureConfig API.
151 */
152 #define GPMC_FORCEPOSTEDWRITE_ENABLE                  (1)
153 #define GPMC_FORCEPOSTEDWRITE_DISABLE                 (0)
155 /*****************************************************************************/
156 /*
157 ** Macros which can be used as 'flag' parameter to
158 ** GPMCLimitedAddrDevSupportConfig API.
159 */
160 #define GPMC_LIMITEDADDRESS_SUPPORT_ENABLE            (1)
161 #define GPMC_LIMITEDADDRESS_SUPPORT_DISABLE           (0)
163 /*****************************************************************************/
164 /*
165 ** Macros which can be used as 'csNum' parameter to GPMCFclkDividerSelect,
166 ** GPMCTimeParaGranularitySelect, GPMCAddrDataMuxProtocolSelect,
167 ** GPMCDevTypeSelect, GPMCDevSizeSelect, GPMCWaitPinSelect,
168 ** GPMCWaitMonitoringTimeSelect, GPMCWaitPinMonitoringConfig,
169 ** GPMCClkActivationTimeConfig, GPMCDevPageLenSet, GPMCWriteTypeSelect,
170 ** GPMCReadTypeSelect, GPMCAccessTypeSelect, GPMCSyncWrapBurstConfig,
171 ** GPMCCSTimingConfig, GPMCADVTimingConfig, GPMCWEAndOETimingConfig,
172 ** GPMCRdAccessAndCycleTimeTimingConfig, GPMCCSConfig, GPMCBaseAddrSet,
173 ** GPMCWrAccessAndWrDataOnADMUXBusTimingConfig, GPMCMaskAddrSet,
174 ** GPMCycle2CycleAndTurnArndTimeTimingConfig, GPMCSNANDCmdWrite,
175 ** GPMCNANDAddrWrite, GPMCNANDDataWrite, GPMCNANDDataRead, GPMCPrefetchCSSelect,
176 ** GPMCECCCSSelect, GPMCECCBCHResultGet APIs.
177 **
178 */
179 #define GPMC_CHIP_SELECT_0                            (0)
180 #define GPMC_CHIP_SELECT_1                            (1)
181 #define GPMC_CHIP_SELECT_2                            (2)
182 #define GPMC_CHIP_SELECT_3                            (3)
183 #define GPMC_CHIP_SELECT_4                            (4)
184 #define GPMC_CHIP_SELECT_5                            (5)
185 #define GPMC_CHIP_SELECT_6                            (6)
186 #define GPMC_CHIP_SELECT_7                            (7)
188 /*****************************************************************************/
189 /*
190 ** Macros which can be used as 'divideVal' parameter to GPMCFclkDividerSelect
191 ** API.
192 **
193 */
194 #define GPMC_FCLK_DIV_BY_1                            (0)
195 #define GPMC_FCLK_DIV_BY_2                            (1)
196 #define GPMC_FCLK_DIV_BY_3                            (2)
197 #define GPMC_FCLK_DIV_BY_4                            (3)
199 /*****************************************************************************/
200 /*
201 ** Macros which can be used as 'scaleftr' parameter to
202 ** GPMCTimeparaGranularitySelect API.
203 **
204 */
205 #define GPMC_TIMEPARAGRANULARITY_X1                   (0)
206 #define GPMC_TIMEPARAGRANULARITY_X2                   (1)
208 /*****************************************************************************/
209 /*
210 ** Macros which can be used as 'protocol' parameter to
211 ** GPMCAddrDataMuxProtocolSelect API.
212 **
213 */
214 #define GPMC_MUXADDDATA_NOMUX                         (0)
215 #define GPMC_MUXADDDATA_AADMUX                        (1)
216 #define GPMC_MUXADDDATA_ADMUX                         (2)
218 /*****************************************************************************/
219 /*
220 ** Macros which can be used as 'devType' parameter to GPMCDevTypeSelect API.
221 **
222 */
223 #define GPMC_DEVICETYPE_NORLIKE                       (0)
224 #define GPMC_DEVICETYPE_NANDLIKE                      (2)
226 /*****************************************************************************/
227 /*
228 ** Macros which can be used as 'devSize' parameter to GPMCDevSizeSelect API.
229 **
230 */
231 #define GPMC_DEVICESIZE_8BITS                         (0)
232 #define GPMC_DEVICESIZE_16BITS                        (1)
234 /*****************************************************************************/
235 /*
236 ** Macros which can be used as 'flag' parameter to GPMCWaitMonitoringTimeSelect
237 ** API.
238 **
239 */
240 #define GPMC_WAITMONITORINGTIME_WITH_VALIDDATA        (0)
241 #define GPMC_WAITMONITORINGTIME_ONECLKB4_VALIDDATA    (1)
242 #define GPMC_WAITMONITORINGTIME_TWOCLKB4_VALIDDATA    (2)
244 /*****************************************************************************/
245 /*
246 ** Macros which can be used as 'mode' parameter to GPMCWaitPinMonitoringConfig
247 ** API.
248 **
249 */
250 #define GPMC_MODE_READ                                (0)
251 #define GPMC_MODE_WRITE                               (1)
253 /*****************************************************************************/
254 /*
255 ** Macros which can be used as 'flag' parameter to GPMCWaitMonitoringTimeConfig
256 ** API.
257 **
258 */
259 #define GPMC_WAITMONITORING_ENABLE                    (1)
260 #define GPMC_WAITMONITORING_DISABLE                   (0)
262 /*****************************************************************************/
263 /*
264 ** Macros which can be used as 'flag' parameter to GPMCClkActivationTimeConfig
265 ** API.
266 **
267 */
268 #define GPMC_CLKACTIVATIONTIME_ATSTART                (0)
269 #define GPMC_CLKACTIVATIONTIME_ONECLK_AFTR            (1)
270 #define GPMC_CLKACTIVATIONTIME_TWOCLK_AFTR            (2)
272 /*****************************************************************************/
273 /*
274 ** Macros which can be used as 'pageLen' parameter to GPMCDevPageLenSet API.
275 **
276 */
277 #define GPMC_DEV_PAGELENGTH_FOUR                      (0)
278 #define GPMC_DEV_PAGELENGTH_EIGHT                     (1)
279 #define GPMC_DEV_PAGELENGTH_SIXTEEN                   (2)
281 /*****************************************************************************/
282 /*
283 ** Macros which can be used as 'writeType' parameter to GPMCWriteTypeSelect API.
284 **
285 */
286 #define GPMC_WRITETYPE_ASYNC                          (0)
287 #define GPMC_WRITETYPE_SYNC                           (1)
289 /*****************************************************************************/
290 /*
291 ** Macros which can be used as 'readType' parameter to GPMCReadTypeSelect API.
292 **
293 */
294 #define GPMC_READTYPE_ASYNC                           (0)
295 #define GPMC_READTYPE_SYNC                            (1)
297 /*****************************************************************************/
298 /*
299 ** Macros which can be used as 'AccessType' parameter to GPMCAccessTypeSelect
300 ** API.
301 **
302 */
303 #define GPMC_ACCESSTYPE_SINGLE                        (0)
304 #define GPMC_ACCESSTYPE_MULTIPLE                      (1)
306 /*****************************************************************************/
307 /*
308 ** Macros which can be used as 'flag' parameter to GPMCSyncWrapBurstConfig API.
309 **
310 */
311 #define GPMC_WRAPBURST_ENABLE                         (1)
312 #define GPMC_WRAPBURST_DISABLE                        (0)
314 /*****************************************************************************/
315 /*
316 ** Macros which can be used as 'CSExtDelayFlag' parameter to
317 ** GPMC_CS_TIMING_CONFIG macro
318 */
319 #define GPMC_CS_EXTRA_DELAY                           (1)
320 #define GPMC_CS_EXTRA_NODELAY                         (0)
322 /*
323 * \brief  This macro used to make the conf value which is used to configure the
324 *         CS signal timing configuration.\n
326 * \param  CSWrOffTime    CS# de-assertion time from start cycle time for write
327 *                        accesses in GPMC_FCLK cycles.
329 *         CSRdOffTime    CS# de-assertion time from start cycle time for read
330 *                        accesses in GPMC_FCLK cycles
332 *         CSExtDelayFlag Flag to indicate whether to add half GPMC_FCLK delay to
333 *                        CS or not.
334 *                        This can take one of the following values :
335 *                        GPMC_CS_EXTRA_DELAY --   CS# Timing control
336 *                                                 signal is delayed of
337 *                                                 half GPMC_FCLK cycle.
338 *                        GPMC_CS_EXTRA_NODELAY -- CS# Timing control
339 *                                                 signal is not delayed
341 *         CSOnTime       CS# assertion time from start cycle time in GPMC_FCLK
342 *                        cycles.
343 */
345 #define GPMC_CS_TIMING_CONFIG(CSWrOffTime, CSRdOffTime, CSExtDelayFlag, CSOnTime )   ((Uint32) \
346                                                                                                 (CSL_FMK(GPMC_CONFIG2_0_CSWROFFTIME, CSWrOffTime)) | \
347                                                                                                 (CSL_FMK(GPMC_CONFIG2_0_CSRDOFFTIME, CSRdOffTime)) | \
348                                                                                                 (CSL_FMK(GPMC_CONFIG2_0_CSEXTRADELAY, CSExtDelayFlag)) | \
349                                                                                                 (CSL_FMK(GPMC_CONFIG2_0_CSONTIME, CSOnTime)))
351 /*****************************************************************************/
352 /*
353 ** Macros which can be used as 'ADVExtDelayFlag' parameter to
354 ** GPMC_ADV_TIMING_CONFIG macro
355 */
356 #define GPMC_ADV_EXTRA_DELAY                          (1)
357 #define GPMC_ADV_EXTRA_NODELAY                        (0)
359 /*
360 * \brief  This macro used to make the conf value which is used to configure the
361 *         ADV# signal timing configuration.\n
363 * \param  ADVAADMuxWrOffTime    ADV# de-assertion time in GPMC_FCLK cycles for
364 *                               first address phase when using the AAD-Mux
365 *                               prorocol.
367 *         ADVAADMuxRdOffTime    ADV# de-assertion time in GPMC_FCLK cycles for
368 *                               first address phase when using the AAD-Mux
369 *                               prorocol.
371 *         ADVWrOffTime          ADV# de-assertion time in GPMC_FCLK cycles from
372 *                               start cycle time for write accesses
374 *         ADVRdOffTime          ADV# de-assertion time in GPMC_FCLK cycles from
375 *                               start cycle time for write accesses
377 *         ADVExtDelayFlag       Flag to indicate whether to add half GPMC_FCLK
378 *                               delay to ADV or not.
379 *                               This can take one of the following values :
380 *                               GPMC_ADV_EXTRA_DELAY --   ADV# Timing control
381 *                                                         signal is delayed of
382 *                                                         half GPMC_FCLK cycle.
383 *                               GPMC_ADV_EXTRA_NODELAY -- ADV# Timing control
384 *                                                         signal is not delayed.
386 *         ADVAADMuxOnTime       ADV# assertion time in GPMC_FCLK cycles for
387 *                               first address phase when using the
388 *                               AAD-Multiplexed protocol.
390 *         ADVOnTime             ADV# assertion time from start cycle time in
391 *                               GPMC_FCLK cycles.
392 */
394 #define GPMC_ADV_TIMING_CONFIG(ADVAADMuxWrOffTime, ADVAADMuxRdOffTime, ADVWrOffTime, ADVRdOffTime, ADVExtDelayFlag, ADVAADMuxOnTime, ADVOnTime)   ((Uint32) \
395                                                   (CSL_FMK(GPMC_CONFIG3_0_ADVAADMUXWROFFTIME, ADVAADMuxWrOffTime)) | \
396                                                   (CSL_FMK(GPMC_CONFIG3_0_ADVAADMUXRDOFFTIME, ADVAADMuxRdOffTime)) | \
397                                                   (CSL_FMK(GPMC_CONFIG3_0_ADVWROFFTIME, ADVWrOffTime)) | \
398                                                   (CSL_FMK(GPMC_CONFIG3_0_ADVRDOFFTIME, ADVRdOffTime)) | \
399                                                   (CSL_FMK(GPMC_CONFIG3_0_ADVEXTRADELAY, ADVExtDelayFlag)) | \
400                                                   (CSL_FMK(GPMC_CONFIG3_0_ADVAADMUXONTIME, ADVAADMuxOnTime)) | \
401                                                   (CSL_FMK(GPMC_CONFIG3_0_ADVONTIME, ADVOnTime)))
403 /*****************************************************************************/
404 /*
405 ** Macros which can be used as 'OEExtDelayFlag' parameter to
406 ** GPMC_WE_OE_TIMING_CONFIG macro
407 */
408 #define GPMC_OE_EXTRA_DELAY                           (1)
409 #define GPMC_OE_EXTRA_NODELAY                         (0)
411 /*****************************************************************************/
412 /*
413 ** Macros which can be used as 'WEExtDelayFlag' parameter to
414 ** GPMC_WE_OE_TIMING_CONFIG macro
415 */
416 #define GPMC_WE_EXTRA_DELAY                           (1)
417 #define GPMC_WE_EXTRA_NODELAY                         (0)
420 /*
421 * \brief  This macro used to make the conf value which is used to configure the
422 *         WE# and OE# signal timing configuration.\n
424 * \param  WEOffTime             WE# de-assertion time in GPMC_FCLK cycles from
425 *                               start cycle time.
427 *         WEExtDelayFlag        Flag to indicate whether to add half GPMC_FCLK
428 *                               delay to WE or not.
429 *                               This can take one of the following values :
430 *                               GPMC_WE_EXTRA_DELAY --   WE# Timing control
431 *                                                        signal is delayed of
432 *                                                        half GPMC_FCLK cycle.
433 *                               GPMC_WE_EXTRA_NODELAY -- WE# Timing control
434 *                                                        signal is not delayed
435 *         WEOnTime              WE# assertion time in GPMC_FCLK cycles from
436 *                               start cycle time.
438 *         OEAADMuxOffTime       OE# de-assertion time in GPMC_FCLK cycles for
439 *                               first address phase when using the AAD-Mux
440 *                               prorocol.
442 *         OEOffTime             OE# de-assertion time in GPMC_FCLK cycles from
443 *                               start cycle time.
445 *         OEExtDelayFlag        Flag to indicate whether to add half GPMC_FCLK
446 *                               delay to OE or not.
447 *                               This can take one of the following values :
448 *                               GPMC_OE_EXTRA_DELAY --   OE# Timing control
449 *                                                        signal is delayed of
450 *                                                        half GPMC_FCLK cycle.
451 *                               GPMC_OE_EXTRA_NODELAY -- OE# Timing control
452 *                                                        signal is not delayed
454 *         OEAADMuxOnTime        OE# assertion time in GPMC_FCLK cycles for
455 *                               first address phase when using the AAD-Mux
456 *                               prorocol.
458 *         OEOnTime              OE# assertion time in GPMC_FCLK cycles from
459 *                               start cycle time.
461 */
463 #define GPMC_WE_OE_TIMING_CONFIG(WEOffTime, WEExtDelayFlag, WEOnTime, OEAADMuxOffTime, OEOffTime, OEExtDelayFlag, OEAADMuxOnTime,OEOnTime )   ((Uint32) \
464                                                              (CSL_FMK(GPMC_CONFIG4_0_WEOFFTIME, WEOffTime)) | \
465                                                              (CSL_FMK(GPMC_CONFIG4_0_WEEXTRADELAY, WEExtDelayFlag)) | \
466                                                              (CSL_FMK(GPMC_CONFIG4_0_WEONTIME, WEOnTime)) | \
467                                                              (CSL_FMK(GPMC_CONFIG4_0_OEAADMUXOFFTIME, OEAADMuxOffTime)) | \
468                                                              (CSL_FMK(GPMC_CONFIG4_0_OEOFFTIME, OEOffTime)) | \
469                                                              (CSL_FMK(GPMC_CONFIG4_0_OEEXTRADELAY, OEExtDelayFlag)) | \
470                                                              (CSL_FMK(GPMC_CONFIG4_0_OEAADMUXONTIME, OEAADMuxOnTime)) | \
471                                                              (CSL_FMK(GPMC_CONFIG4_0_OEONTIME, OEOnTime)))
473 /*
474 * \brief  This macro used to make the conf value which is used to configure the
475 *         read access and cycle time timing configuration.\n
477 * \param  rdCycleTime           Total read cycle time in GPMC_FCLK cycles.
479 *         wrCycleTime           Total write cycle time in GPMC_FCLK cycles.
481 *         rdAccessTime          Read access time (Delay between start cycle time
482 *                               and first data valid) in GPMC_FCLK cycles.
484 *         pageBurstAccessTime   Page burest access time (Delay between
485 *                               successive words in a multiple access)in
486 *                               GPMC_FCLK cycles.
488 */
490 #define GPMC_RDACCESS_CYCLETIME_TIMING_CONFIG(rdCycleTime, wrCycleTime, rdAccessTime, pageBurstAccessTime )   ((Uint32) \
491                                                     (CSL_FMK(GPMC_CONFIG5_0_RDCYCLETIME, rdCycleTime)) | \
492                                                     (CSL_FMK(GPMC_CONFIG5_0_WRCYCLETIME, wrCycleTime)) | \
493                                                     (CSL_FMK(GPMC_CONFIG5_0_RDACCESSTIME, rdAccessTime)) | \
494                                                     (CSL_FMK(GPMC_CONFIG5_0_PAGEBURSTACCESSTIME, pageBurstAccessTime)))
496 /*****************************************************************************/
497 /*
498 ** Macros which can be used as 'cycle2CycleDelaySameCSCfg' parameter to
499 ** GPMC_CYCLE2CYCLE_BUSTURNAROUND_TIMING_CONFIG macro
500 */
501 #define GPMC_CYCLE2CYCLESAMECSEN_C2CDELAY             (1)
502 #define GPMC_CYCLE2CYCLESAMECSEN_NOC2CDELAY           (0)
504 /*****************************************************************************/
505 /*
506 ** Macros which can be used as 'cycle2CycleDelayDiffCSCfg' parameter to
507 ** GPMC_CYCLE2CYCLE_BUSTURNAROUND_TIMING_CONFIG macro
508 */
509 #define GPMC_CYCLE2CYCLEDIFFCSEN_C2CDELAY             (1)
510 #define GPMC_CYCLE2CYCLEDIFFCSEN_NOC2CDELAY           (0)
512 /*
513 * \brief  This macro used to make the conf value which is used to configure the
514 *         cycle to cycle and bus turn around time timing configuration.\n
516 * \param  cycle2CycleDelay       Cycle to cycle delay (Chip select high pulse
517 *                                delay between two successive accesses)in
518 *                                GPMC_FCLK cycles.
520 *      cycle2CycleDelaySameCSCfg Specified whether to add the cycle to cycle
521 *                                delay between two successive accesses or not
522 *                                (to the same chip-select).
523 *                                This can take one of the following values :
524 *                                GPMC_CYCLE2CYCLESAMECSEN_C2CDELAY   -- To add
525 *                                                                     the delay.
526 *                                GPMC_CYCLE2CYCLESAMECSEN_NOC2CDELAY -- Don't
527 *                                                                 add the delay.
529 *      cycle2CycleDelayDiffCSCfg Specified whether to add the cycle to cycle
530 *                                delay between two successive accesses or not
531 *                                (to the diffrent chip-select).
532 *                                This can take one of the following values :
533 *                                GPMC_CYCLE2CYCLEDIFFCSEN_C2CDELAY   -- To add
534 *                                                                     the delay.
535 *                                GPMC_CYCLE2CYCLEDIFFCSEN_NOC2CDELAY -- Don't
536 *                                                                 add the delay.
538 *         busTAtime             Bus turn aroung time between two successive
539 *                               accesses to the same chip-select (read to write)
540 *                               or to a diff chip-select in GPMC_FCLK cycles.
543 */
545 #define GPMC_CYCLE2CYCLE_BUSTURNAROUND_TIMING_CONFIG(cycle2CycleDelay, cycle2CycleDelaySameCSCfg, cycle2CycleDelayDiffCSCfg, busTAtime )   ((Uint32) \
546                                           (CSL_FMK(GPMC_CONFIG6_0_CYCLE2CYCLEDELAY, cycle2CycleDelay)) | \
547                                           (CSL_FMK(GPMC_CONFIG6_0_CYCLE2CYCLESAMECSEN, cycle2CycleDelaySameCSCfg)) | \
548                                           (CSL_FMK(GPMC_CONFIG6_0_CYCLE2CYCLEDIFFCSEN, cycle2CycleDelayDiffCSCfg)) | \
549                                           (CSL_FMK(GPMC_CONFIG6_0_BUSTURNAROUND, busTAtime)))
551 /*****************************************************************************/
552 /*
553 ** Macros which can be used as 'conf' parameter to GPMCCSConfig API.
554 **
555 */
556 #define GPMC_CS_ENABLE                                (1)
557 #define GPMC_CS_DISABLE                               (0)
559 /*****************************************************************************/
560 /*
561 ** Macros which can be used as 'addrMask' parameter to GPMCSMaskAddrSet API.
562 **
563 */
564 #define GPMC_CS_SIZE_256MB                            (0x00)
565 #define GPMC_CS_SIZE_128MB                            (0x08)
566 #define GPMC_CS_SIZE_64MB                             (0x0c)
567 #define GPMC_CS_SIZE_32MB                             (0x0e)
568 #define GPMC_CS_SIZE_16MB                             (0x0f)
570 /*****************************************************************************/
571 /*
572 ** Macros which can be used as 'accessMode' parameter to
573 ** GPMCPREFETCHAccessModeSelect API.
574 */
575 #define GPMC_PREFETCH_ACCESSMODE_READ                 (0)
576 #define GPMC_PREFETCH_ACCESSMODE_WRITE                (1)
578 /*****************************************************************************/
579 /*
580 ** Macros which can be used as 'syncType' parameter to
581 ** GPMCPREFETCHSyncTypeSelect API.
582 **
583 */
584 #define GPMC_PREFETCH_SYNCTYPE_DMA                    (1)
585 #define GPMC_PREFETCH_SYNCTYPE_INT                    (0)
587 /*****************************************************************************/
588 /*
589 ** Macros which can be used as 'flag' parameter to GPMCPrefetchSyncModeConfig
590 ** API.
591 **
592 */
593 #define GPMC_PREFETCH_ACCESSCS_AT_START               (0)
594 #define GPMC_PREFETCH_ACCESSCS_AT_STARTANDWAIT        (1)
596 /*****************************************************************************/
597 /*
598 ** Macros which can be used as 'waitPin' parameter to GPMCPrefetchWaitPinSelect
599 ** API.
600 **
601 */
602 #define GPMC_PREFETCH_WAITPINSELECTOR_W0              (0)
603 #define GPMC_PREFETCH_WAITPINSELECTOR_W1              (1)
605 /*****************************************************************************/
606 /*
607 ** Macros which can be used as 'configVal' GPMCPrefetchAccessCycleOptConfig API.
608 **
609 */
610 #define GPMC_PREFETCH_OPTIMIZED_ACCESS_ENABLE         (1)
611 #define GPMC_PREFETCH_OPTIMIZED_ACCESS_DISABLE        (0)
613 /*****************************************************************************/
614 /*
615 ** Macros which can be used as 'configVal' parameter to
616 ** GPMCPrefetchRRArbitrationConfig API.
617 */
618 #define GPMC_PREFETCH_RR_ARBITRATION_ENABLE           (1)
619 #define GPMC_PREFETCH_RR_ARBITRATION_DISABLE          (0)
621 /*****************************************************************************/
622 /*
623 ** Macros which can be used as 'algo' parameter to GPMCECCAlgoSelect API.
624 **
625 */
626 #define GPMC_ECC_ALGORITHM_HAMMINGCODE                (0)
627 #define GPMC_ECC_ALGORITHM_BCH                        (1)
629 /*****************************************************************************/
630 /*
631 ** Macros which can be used as 'errCorrCapVal' parameter to
632 ** GPMCECCBCHErrCorrectionCapSelect API.
633 **
634 */
635 #define GPMC_ECC_BCH_ERRCORRCAP_UPTO_4BITS            (0)
636 #define GPMC_ECC_BCH_ERRCORRCAP_UPTO_8BITS            (1)
637 #define GPMC_ECC_BCH_ERRCORRCAP_UPTO_16BITS           (2)
639 /*****************************************************************************/
640 /*
641 ** Macros which can be used as 'eccColVal' parameter to GPMCECCColumnSelect API.
642 **
643 */
644 #define GPMC_ECC_COLUMNS_8                            (0)
645 #define GPMC_ECC_COLUMNS_16                           (1)
647 /*****************************************************************************/
648 /*
649 ** Macros which can be used as 'numOfSects' parameter to
650 ** GPMCECCBCHNumOfSectorsSelect API.
651 ** Here 1 SECTOR = 512 bytes.
652 **
653 */
654 #define GPMC_ECC_BCH_NUMOFSECTS_1                     (0)
655 #define GPMC_ECC_BCH_NUMOFSECTS_2                     (1)
656 #define GPMC_ECC_BCH_NUMOFSECTS_3                     (2)
657 #define GPMC_ECC_BCH_NUMOFSECTS_4                     (3)
658 #define GPMC_ECC_BCH_NUMOFSECTS_5                     (4)
659 #define GPMC_ECC_BCH_NUMOFSECTS_6                     (5)
660 #define GPMC_ECC_BCH_NUMOFSECTS_7                     (6)
661 #define GPMC_ECC_BCH_NUMOFSECTS_8                     (7)
663 /*****************************************************************************/
664 /*
665 ** Macros which can be used as 'eccResReg' parameter to GPMCECCResultRegSelect
666 ** API.
667 **
668 */
669 #define GPMC_ECCPOINTER_RESULT_1                      (1)
670 #define GPMC_ECCPOINTER_RESULT_2                      (2)
671 #define GPMC_ECCPOINTER_RESULT_3                      (3)
672 #define GPMC_ECCPOINTER_RESULT_4                      (4)
673 #define GPMC_ECCPOINTER_RESULT_5                      (5)
674 #define GPMC_ECCPOINTER_RESULT_6                      (6)
675 #define GPMC_ECCPOINTER_RESULT_7                      (7)
676 #define GPMC_ECCPOINTER_RESULT_8                      (8)
677 #define GPMC_ECCPOINTER_RESULT_9                      (9)
679 /*****************************************************************************/
680 /*
681 ** Macros which can be used as 'eccSize' parameter to GPMCECCSizeValSet API.
682 **
683 */
684 #define GPMC_ECC_SIZE_0                               (0)
685 #define GPMC_ECC_SIZE_1                               (1)
687 /*****************************************************************************/
688 /*
689 ** Macros which can be used as 'eccResReg' parameter to GPMCECCResultSizeSelect
690 ** API.
691 **
692 */
693 #define GPMC_ECC_RESULT_1                             (1)
694 #define GPMC_ECC_RESULT_2                             (2)
695 #define GPMC_ECC_RESULT_3                             (3)
696 #define GPMC_ECC_RESULT_4                             (4)
697 #define GPMC_ECC_RESULT_5                             (5)
698 #define GPMC_ECC_RESULT_6                             (6)
699 #define GPMC_ECC_RESULT_7                             (7)
700 #define GPMC_ECC_RESULT_8                             (8)
701 #define GPMC_ECC_RESULT_9                             (9)
703 /*****************************************************************************/
704 /*
705 ** Macros which can be used as 'resIndex' parameter to GPMCECCBCHResultGet API.
706 **
707 */
708 #define GPMC_BCH_RESULT_0                             (0)
709 #define GPMC_BCH_RESULT_1                             (1)
710 #define GPMC_BCH_RESULT_2                             (2)
711 #define GPMC_BCH_RESULT_3                             (3)
712 #define GPMC_BCH_RESULT_4                             (4)
713 #define GPMC_BCH_RESULT_5                             (5)
714 #define GPMC_BCH_RESULT_6                             (6)
716 /*
717 ** Macros which defines the ECC size values.
718 */
719 #define GPMC_ECC_SIZE0_VAL                      (0xFF)
720 #define GPMC_ECC_SIZE1_VAL                      (0xFF)
722 /***************************************************************************/
723 /*
724 ** Function Prototypes
725 */
726 extern void GPMCECCEnable(gpmcHandle hGpmc);
727 extern void GPMCECCDisable(gpmcHandle hGpmc);
728 extern void  GPMCModuleSoftReset(gpmcHandle hGpmc);
729 extern void GPMCECCResultRegClear(gpmcHandle hGpmc);
730 extern void GPMCPrefetchEngineStop(gpmcHandle hGpmc);
731 extern void GPMCPrefetchEngineStart(gpmcHandle hGpmc);
732 extern Uint32  GPMCErrAddrGet(gpmcHandle hGpmc);
733 extern void GPMCPrefetchEngineEnable(gpmcHandle hGpmc);
734 extern Uint32  GPMCRevisionGet(gpmcHandle hGpmc);
735 extern void GPMCPrefetchEngineDisable(gpmcHandle hGpmc);
736 extern Uint32  GPMCErrSysCmdGet(gpmcHandle hGpmc);
737 extern Uint32 GPMCECCBCHSWDataRead(gpmcHandle hGpmc);
738 extern Uint32  GPMCErrValStatusGet(gpmcHandle hGpmc);
739 extern Uint32  GPMCPREFETCHCountValGet(gpmcHandle hGpmc);
740 extern void  GPMCIntEnable(gpmcHandle hGpmc, Uint32 flag);
741 extern Uint32  GPMCModuleResetStatusGet(gpmcHandle hGpmc);
742 extern Uint32 GPMCPrefetchFIFOPtrValGet(gpmcHandle hGpmc);
743 extern void  GPMCIntDisable(gpmcHandle hGpmc, Uint32 flag);
744 extern void GPMCECCCSSelect(gpmcHandle hGpmc, Uint32 csNum);
745 extern Uint32  GPMCPrefetchEngineStatusGet(gpmcHandle hGpmc);
746 extern void GPMCECCAlgoSelect(gpmcHandle hGpmc, Uint32 algo);
747 extern void  GPMCIntStatusClear(gpmcHandle hGpmc, Uint32 flag);
748 extern void  GPMCIdleModeSelect(gpmcHandle hGpmc, Uint32 mode);
749 extern Uint32  GPMCPrefetchFIFOThrldStatusGet(gpmcHandle hGpmc);
750 extern void GPMCPrefetchCSSelect(gpmcHandle hGpmc, Uint32 csNum);
751 extern void GPMCECCBCHSWDataWrite(gpmcHandle hGpmc,Uint32 bchData);
752 extern Uint32  GPMCErrStatusGet(gpmcHandle hGpmc, Uint32 err);
753 extern void  GPMCAutoIdleConfig(gpmcHandle hGpmc, Uint32 configVal);
754 extern void GPMCECCColumnSelect(gpmcHandle hGpmc, Uint32 eccColVal);
755 extern Uint32  GPMCIntStatusGet(gpmcHandle hGpmc, Uint32 flag);
756 extern void  GPMCTimeOutFeatureConfig(gpmcHandle hGpmc, Uint32 flag);
757 extern void GPMCPrefetchSyncModeConfig(gpmcHandle hGpmc,Uint32 flag);
758 extern void GPMCECCResultRegSelect(gpmcHandle hGpmc,
759                                    Uint32 eccResReg);
760 extern Uint32  GPMCSNANDDataRead(gpmcHandle hGpmc,
761                                        Uint32 csNum);
762 extern Uint32 GPMCECCResultGet(gpmcHandle hGpmc,
763                                      Uint32 eccResReg);
764 extern void GPMCPrefetchWaitPinSelect(gpmcHandle hGpmc,
765                                       Uint32 waitPin);
766 extern Uint32  GPMCWaitPinStatusGet(gpmcHandle hGpmc,
767                                           Uint32 pin);
768 extern void GPMCPrefetchSyncTypeSelect(gpmcHandle hGpmc,
769                                        Uint32 syncType);
770 extern void  GPMCTimeOutStartValSet(gpmcHandle hGpmc,
771                                     Uint32 timeoutVal);
772 extern void GPMCPrefetchCycleOptValSet(gpmcHandle hGpmc,
773                                        Uint32 cleOptVal);
774 extern void GPMCECCBCHWrapModeValSet(gpmcHandle hGpmc,
775                                      Uint32 wrapModeVal);
776 extern void GPMCPrefetchTrnsCntValSet(gpmcHandle hGpmc,
777                                       Uint32 trnsCntVal);
778 extern void GPMCPrefetchWeightedPrioSet(gpmcHandle hGpmc,
779                                         Uint32 accessVal);
780 extern void  GPMCLimitedAddrDevSupportConfig(gpmcHandle hGpmc,
781                                              Uint32 flag);
782 extern void GPMCPrefetchAccessCycleOptConfig(gpmcHandle hGpmc,
783                                              Uint32 configVal);
784 extern void GPMCECCBCHNumOfSectorsSelect(gpmcHandle hGpmc,
785                                          Uint32 numOfSects);
786 extern void GPMCPrefetchAccessModeSelect(gpmcHandle hGpmc,
787                                          Uint32 accessMode);
788 extern void GPMCPrefetchFifoThrldValSet(gpmcHandle hGpmc,
789                                         Uint32 fifoThrsld);
790 extern void GPMCECCBCHErrCorrectionCapSelect(gpmcHandle hGpmc,
791                                              Uint32 errCorrCapVal);
792 extern void  GPMCWriteProtectPinLevelCtrl(gpmcHandle hGpmc,
793                                           Uint32 pinLevel);
794 extern Uint32  GPMCEmptyWriteBuffStatusGet(gpmcHandle hGpmc);
795 extern void  GPMCNANDForcePostedWriteFeatureConfig(gpmcHandle hGpmc,
796                                                    Uint32 flag);
797 extern void GPMCECCSizeValSet(gpmcHandle hGpmc,Uint32 eccSize,
798                               Uint32 eccSizeVal);
799 extern void  GPMCCSConfig(gpmcHandle hGpmc, Uint32 csNum,
800                           Uint32 conf);
801 extern void  GPMCBaseAddrSet(gpmcHandle hGpmc, Uint32 csNum,
802                              Uint32 addr);
803 extern void  GPMCMaskAddrSet(gpmcHandle hGpmc, Uint32 csNum,
804                              Uint32 maskaddr);
805 extern void  GPMNANDCmdWrite(gpmcHandle hGpmc, Uint32 csNum,
806                              Uint32 cmd);
807 extern void  GPMCDevTypeSelect(gpmcHandle hGpmc, Uint32 csNum,
808                                Uint32 devType);
809 extern void  GPMCDevSizeSelect(gpmcHandle hGpmc, Uint32 csNum,
810                                Uint32 devSize);
811 extern void  GPMCWaitPinSelect(gpmcHandle hGpmc, Uint32 csNum,
812                                Uint32 waitPin);
813 extern void  GPMCCSTimingConfig(gpmcHandle hGpmc, Uint32 csNum,
814                                 Uint32 conf);
815 extern void  GPMCNANDAddrWrite(gpmcHandle hGpmc, Uint32 csNum,
816                                Uint32 addr);
817 extern void  GPMCNANDDataWrite(gpmcHandle hGpmc, Uint32 csNum,
818                                Uint32 data);
819 extern void  GPMCReadTypeSelect(gpmcHandle hGpmc, Uint32 csNum,
820                                 Uint32 readType);
821 extern void  GPMCADVTimingConfig(gpmcHandle hGpmc, Uint32 csNum,
822                                  Uint32 conf);
823 extern void  GPMCWriteTypeSelect(gpmcHandle hGpmc, Uint32 csNum,
824                                  Uint32 writeType);
825 extern void  GPMCDevPageLenSet(gpmcHandle hGpmc, Uint32 csNum,
826                                Uint32 pageLen);
827 extern void  GPMCFclkDividerSelect(gpmcHandle hGpmc, Uint32 csNum,
828                                    Uint32 divideVal);
829 extern void  GPMCWaitPinPolaritySelect(gpmcHandle hGpmc, Uint32 pin,
830                                        Uint32 polarity);
831 extern void GPMCECCResultSizeSelect(gpmcHandle hGpmc,Uint32 eccResReg,
832                                     Uint32 eccSize);
833 extern void  GPMCWEAndOETimingConfig(gpmcHandle hGpmc, Uint32 csNum,
834                                      Uint32 conf);
835 extern void  GPMCSyncWrapBurstConfig(gpmcHandle hGpmc, Uint32 csNum,
836                                      Uint32 flag);
837 extern Uint32 GPMCECCBCHResultGet(gpmcHandle hGpmc,
838                                         Uint32 resIndex,
839                                         Uint32 csNum);
840 extern void  GPMCClkActivationTimeConfig(gpmcHandle hGpmc,
841                                          Uint32 csNum,
842                                          Uint32 flag);
843 extern void  GPMCWaitMonitoringTimeSelect(gpmcHandle hGpmc,
844                                           Uint32 csNum,
845                                           Uint32 flag);
846 extern void  GPMCAddrDataMuxProtocolSelect(gpmcHandle hGpmc,
847                                            Uint32 csNum,
848                                            Uint32 protocol);
849 extern void  GPMCTimeParaGranularitySelect(gpmcHandle hGpmc,
850                                            Uint32 csNum,
851                                            Uint32 scaleftr);
852 extern void  GPMCRdAccessAndCycleTimeTimingConfig(gpmcHandle hGpmc,
853                                                   Uint32 csNum,
854                                                   Uint32 conf);
855 extern void  GPMCycle2CycleAndTurnArndTimeTimingConfig(gpmcHandle hGpmc,
856                                                        Uint32 csNum,
857                                                        Uint32 conf);
858 extern void  GPMCAccessTypeSelect(gpmcHandle hGpmc, Uint32 csNum,
859                                   Uint32 mode, Uint32 accessType);
860 extern void  GPMCWaitPinMonitoringConfig(gpmcHandle hGpmc, Uint32 csNum,
861                                          Uint32 mode, Uint32 flag);
862 extern void  GPMCWrAccessAndWrDataOnADMUXBusTimingConfig(gpmcHandle hGpmc,
863                                                          Uint32 csNum,
864                                                          Uint32 wrAccessTime,
865                                                          Uint32 wrDataOnADmuxBus);
866 extern Uint32 GPMCPrefetchFifoPtrValGet(gpmcHandle hGpmc);
868 #endif /* _EVMC66X_GPMC_H_ */