ADuCM302x Device Drivers API Reference Manual  Release 3.1.2.0
adi_flash_data.c
1 /*
2  *****************************************************************************
3  * @file: adi_flash_data.c
4  * @brief: Data declaration for Flash Device Driver
5  * @date: $Date$
6  *****************************************************************************
7 
8 Copyright (c) 2016-2017 Analog Devices, Inc.
9 
10 All rights reserved.
11 
12 Redistribution and use in source and binary forms, with or without modification,
13 are permitted provided that the following conditions are met:
14  - Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  - Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  - Modified versions of the software must be consciously marked as such.
20  - This software is licensed solely and exclusively for use with processors
21  manufactured by or for Analog Devices, Inc.
22  - This software may not be combined or merged with other code in any manner
23  that would cause the software to become subject to terms and conditions
24  which differ from those listed here.
25  - Neither the name of Analog Devices, Inc. nor the names of its
26  contributors may be used to endorse or promote products derived
27  from this software without specific prior written permission.
28  - The use of this software may or may not infringe the patent rights of one
29  or more patent holders. This license does not release you from the
30  requirement that you obtain separate licenses from these patent holders
31  to use this software.
32 
33 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. AND CONTRIBUTORS "AS IS"
34 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-
35 INFRINGEMENT, TITLE, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
36 DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. OR CONTRIBUTORS BE LIABLE
37 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE OR
38 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, DAMAGES ARISING OUT OF
39 CLAIMS OF INTELLECTUAL PROPERTY RIGHTS INFRINGEMENT; PROCUREMENT OF
40 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
41 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
42 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
43 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44 POSSIBILITY OF SUCH DAMAGE.
45 
46 *****************************************************************************/
47 
48 #ifndef ADI_FEE_DATA_C
49 #define ADI_FEE_DATA_C
50 
53 #include "adi_flash_def.h"
54 #include "adi_flash_config.h"
55 
56 
57 /* Stores the information about the specific device */
58 static ADI_FEE_DEVICE_INFO fee_device_info [ADI_FEE_NUM_INSTANCES] =
59 {
60  /* only one flash instance at this time */
61  { pADI_FLCC0, /* Flash controller pointer */
62  FLCC_EVT_IRQn, /* Flash PIO interrupt number */
63  DMA0_CH15_DONE_IRQn, /* Flash DMA interrupt number */
64  FLASH_CHANn, /* Flash DMA channel (15) number */
65  NULL, /* Flash static config info */
66  NULL /* Flash driver handle */
67  },
68 };
69 
70 
71 /* build Flash Application configuration array */
72 static ADI_FEE_CONFIG gConfigInfo[ADI_FEE_NUM_INSTANCES] =
73 {
74  /* the one-and-only (so far) instance data for FEE0... */
75  {
76 #if defined (__ADUCM4x50__)
77  /* ECC interrupt enable settings (IEN register) */
78  ( (ADI_FEE_CFG_ECC_ERROR_RESPONSE << BITP_FLCC_IEN_ECC_ERROR)
79  | (ADI_FEE_CFG_ECC_CORRECTION_RESPONSE << BITP_FLCC_IEN_ECC_CORRECT)
80  ),
81 
82 #elif defined (__ADUCM302x__)
83 
84  /* ECC interrupt enable settings (IEN register) */
85  ( (ADI_FEE_CFG_ECC_ERROR_RESPONSE << BITP_FLCC_IEN_ECC_ERROR)),
86 
87 #endif
88  /* timing parameter settings (TIME_PARAM0 register) */
89  ( (ADI_FEE_CFG_PARAM0_TNVH1 << BITP_FLCC_TIME_PARAM0_TNVH1)
90  | (ADI_FEE_CFG_PARAM0_TERASE << BITP_FLCC_TIME_PARAM0_TERASE)
91  | (ADI_FEE_CFG_PARAM0_TRCV << BITP_FLCC_TIME_PARAM0_TRCV)
92  | (ADI_FEE_CFG_PARAM0_TNVH << BITP_FLCC_TIME_PARAM0_TNVH)
93  | (ADI_FEE_CFG_PARAM0_TPROG << BITP_FLCC_TIME_PARAM0_TPROG)
94  | (ADI_FEE_CFG_PARAM0_TPGS << BITP_FLCC_TIME_PARAM0_TPGS)
95  | (ADI_FEE_CFG_PARAM0_TNVS << BITP_FLCC_TIME_PARAM0_TNVS)
96  | (ADI_FEE_CFG_PARAM0_CLKDIV << BITP_FLCC_TIME_PARAM0_DIVREFCLK)
97  ),
98 #if defined (__ADUCM4x50__)
99  /* more timing parameter settings (TIME_PARAM1 register) */
100  ( (ADI_FEE_CFG_PARAM1_WAITESTATES << BITP_FLCC_TIME_PARAM1_WAITSTATES)
101  | (ADI_FEE_CFG_PARAM1_TWK << BITP_FLCC_TIME_PARAM1_TWK)
102  ),
103 
104 #elif defined (__ADUCM302x__)
105  /* more timing parameter settings (TIME_PARAM1 register) */
106  ((ADI_FEE_CFG_PARAM1_TWK << BITP_FLCC_TIME_PARAM1_TWK)),
107 
108 #endif
109  /* system interrupt abort enables (ABORT_EN_XX registers) */
112 
113  /* ECC configuration register settings (ECC_CFG register) */
114  (((ADI_FEE_CFG_ECC_START_PAGE << FEE_PAGE_SHIFT) & BITM_FLCC_ECC_CFG_PTR)
115 #if (ADI_FEE_CFG_ENABLE_ECC_FOR_INFO_SPACE == 1u)
116  | (BITM_FLCC_ECC_CFG_INFOEN)
117 #endif
118 #if (ADI_FEE_CFG_ENABLE_ECC == 1u)
119  | (BITM_FLCC_ECC_CFG_EN)
120 #endif
121  )
122  } /* end device 0 settings */
123 };
124 
128 #endif /* ADI_FEE_DATA_C */
#define ADI_FEE_CFG_ECC_START_PAGE
#define ADI_FEE_CFG_ABORT_EN_LO
#define ADI_FEE_CFG_PARAM0_CLKDIV
#define ADI_FEE_CFG_ENABLE_ECC
#define ADI_FEE_CFG_PARAM0_TNVH
#define ADI_FEE_CFG_ABORT_EN_HI
#define ADI_FEE_CFG_PARAM0_TRCV
#define ADI_FEE_CFG_PARAM0_TPGS
#define ADI_FEE_CFG_ECC_ERROR_RESPONSE
#define ADI_FEE_CFG_PARAM0_TERASE
#define ADI_FEE_CFG_PARAM0_TNVH1
#define ADI_FEE_CFG_PARAM0_TPROG
#define ADI_FEE_CFG_PARAM1_TWK
#define ADI_FEE_CFG_PARAM0_TNVS