49 #ifndef FLASH_DRIVER_H
50 #define FLASH_DRIVER_H
71 #define FTFx_BASE FTFE_BASE
72 #define FTFx_FSTAT FTFE->FSTAT
73 #define FTFx_FCNFG FTFE->FCNFG
74 #define FTFx_FSEC FTFE->FSEC
75 #define FTFx_FOPT FTFE->FOPT
76 #define FTFx_FCCOB3 FTFE->FCCOB[0]
77 #define FTFx_FCCOB2 FTFE->FCCOB[1]
78 #define FTFx_FCCOB1 FTFE->FCCOB[2]
79 #define FTFx_FCCOB0 FTFE->FCCOB[3]
80 #define FTFx_FCCOB7 FTFE->FCCOB[4]
81 #define FTFx_FCCOB6 FTFE->FCCOB[5]
82 #define FTFx_FCCOB5 FTFE->FCCOB[6]
83 #define FTFx_FCCOB4 FTFE->FCCOB[7]
84 #define FTFx_FCCOBB FTFE->FCCOB[8]
85 #define FTFx_FCCOBA FTFE->FCCOB[9]
86 #define FTFx_FCCOB9 FTFE->FCCOB[10]
87 #define FTFx_FCCOB8 FTFE->FCCOB[11]
88 #define FTFx_FPROT3 FTFE->FPROT[0]
89 #define FTFx_FPROT2 FTFE->FPROT[1]
90 #define FTFx_FPROT1 FTFE->FPROT[2]
91 #define FTFx_FPROT0 FTFE->FPROT[3]
92 #define FTFx_FEPROT FTFE->FEPROT
93 #define FTFx_FDPROT FTFE->FDPROT
94 #if FEATURE_FLS_HAS_DETECT_ECC_ERROR
95 #define FTFx_FERSTAT FTFE->FERSTAT
96 #define FTFx_FERCNFG FTFE->FERCNFG
99 #define FTFx_FSTAT_MGSTAT0_MASK FTFE_FSTAT_MGSTAT0_MASK
100 #define FTFx_FSTAT_MGSTAT0_SHIFT FTFE_FSTAT_MGSTAT0_SHIFT
101 #define FTFx_FSTAT_MGSTAT0_WIDTH FTFE_FSTAT_MGSTAT0_WIDTH
102 #define FTFx_FSTAT_MGSTAT0(x) FTFE_FSTAT_MGSTAT0(x)
103 #define FTFx_FSTAT_FPVIOL_MASK FTFE_FSTAT_FPVIOL_MASK
104 #define FTFx_FSTAT_FPVIOL_SHIFT FTFE_FSTAT_FPVIOL_SHIFT
105 #define FTFx_FSTAT_FPVIOL_WIDTH FTFE_FSTAT_FPVIOL_WIDTH
106 #define FTFx_FSTAT_FPVIOL(x) FTFE_FSTAT_FPVIOL(x)
107 #define FTFx_FSTAT_ACCERR_MASK FTFE_FSTAT_ACCERR_MASK
108 #define FTFx_FSTAT_ACCERR_SHIFT FTFE_FSTAT_ACCERR_SHIFT
109 #define FTFx_FSTAT_ACCERR_WIDTH FTFE_FSTAT_ACCERR_WIDTH
110 #define FTFx_FSTAT_ACCERR(x) FTFE_FSTAT_ACCERR(x)
111 #define FTFx_FSTAT_RDCOLERR_MASK FTFE_FSTAT_RDCOLERR_MASK
112 #define FTFx_FSTAT_RDCOLERR_SHIFT FTFE_FSTAT_RDCOLERR_SHIFT
113 #define FTFx_FSTAT_RDCOLERR_WIDTH FTFE_FSTAT_RDCOLERR_WIDTH
114 #define FTFx_FSTAT_RDCOLERR(x) FTFE_FSTAT_RDCOLERR(x)
115 #define FTFx_FSTAT_CCIF_MASK FTFE_FSTAT_CCIF_MASK
116 #define FTFx_FSTAT_CCIF_SHIFT FTFE_FSTAT_CCIF_SHIFT
117 #define FTFx_FSTAT_CCIF_WIDTH FTFE_FSTAT_CCIF_WIDTH
118 #define FTFx_FSTAT_CCIF(x) FTFE_FSTAT_CCIF(x)
120 #define FTFx_FCNFG_EEERDY_MASK FTFE_FCNFG_EEERDY_MASK
121 #define FTFx_FCNFG_EEERDY_SHIFT FTFE_FCNFG_EEERDY_SHIFT
122 #define FTFx_FCNFG_EEERDY_WIDTH FTFE_FCNFG_EEERDY_WIDTH
123 #define FTFx_FCNFG_EEERDY(x) FTFE_FCNFG_EEERDY(x)
124 #define FTFx_FCNFG_RAMRDY_MASK FTFE_FCNFG_RAMRDY_MASK
125 #define FTFx_FCNFG_RAMRDY_SHIFT FTFE_FCNFG_RAMRDY_SHIFT
126 #define FTFx_FCNFG_RAMRDY_WIDTH FTFE_FCNFG_RAMRDY_WIDTH
127 #define FTFx_FCNFG_RAMRDY(x) FTFE_FCNFG_RAMRDY(x)
128 #define FTFx_FCNFG_PFLSH_MASK FTFE_FCNFG_PFLSH_MASK
129 #define FTFx_FCNFG_PFLSH_SHIFT FTFE_FCNFG_PFLSH_SHIFT
130 #define FTFx_FCNFG_PFLSH_WIDTH FTFE_FCNFG_PFLSH_WIDTH
131 #define FTFx_FCNFG_PFLSH(x) FTFE_FCNFG_PFLSH(x)
132 #define FTFx_FCNFG_ERSSUSP_MASK FTFE_FCNFG_ERSSUSP_MASK
133 #define FTFx_FCNFG_ERSSUSP_SHIFT FTFE_FCNFG_ERSSUSP_SHIFT
134 #define FTFx_FCNFG_ERSSUSP_WIDTH FTFE_FCNFG_ERSSUSP_WIDTH
135 #define FTFx_FCNFG_ERSSUSP(x) FTFE_FCNFG_ERSSUSP(x)
136 #define FTFx_FCNFG_ERSAREQ_MASK FTFE_FCNFG_ERSAREQ_MASK
137 #define FTFx_FCNFG_ERSAREQ_SHIFT FTFE_FCNFG_ERSAREQ_SHIFT
138 #define FTFx_FCNFG_ERSAREQ_WIDTH FTFE_FCNFG_ERSAREQ_WIDTH
139 #define FTFx_FCNFG_ERSAREQ(x) FTFE_FCNFG_ERSAREQ(x)
140 #define FTFx_FCNFG_RDCOLLIE_MASK FTFE_FCNFG_RDCOLLIE_MASK
141 #define FTFx_FCNFG_RDCOLLIE_SHIFT FTFE_FCNFG_RDCOLLIE_SHIFT
142 #define FTFx_FCNFG_RDCOLLIE_WIDTH FTFE_FCNFG_RDCOLLIE_WIDTH
143 #define FTFx_FCNFG_RDCOLLIE(x) FTFE_FCNFG_RDCOLLIE(x)
144 #define FTFx_FCNFG_CCIE_MASK FTFE_FCNFG_CCIE_MASK
145 #define FTFx_FCNFG_CCIE_SHIFT FTFE_FCNFG_CCIE_SHIFT
146 #define FTFx_FCNFG_CCIE_WIDTH FTFE_FCNFG_CCIE_WIDTH
147 #define FTFx_FCNFG_CCIE(x) FTFE_FCNFG_CCIE(x)
149 #define FTFx_FSEC_SEC_MASK FTFE_FSEC_SEC_MASK
150 #define FTFx_FSEC_SEC_SHIFT FTFE_FSEC_SEC_SHIFT
151 #define FTFx_FSEC_SEC_WIDTH FTFE_FSEC_SEC_WIDTH
152 #define FTFx_FSEC_SEC(x) FTFE_FSEC_SEC(x)
153 #define FTFx_FSEC_FSLACC_MASK FTFE_FSEC_FSLACC_MASK
154 #define FTFx_FSEC_FSLACC_SHIFT FTFE_FSEC_FSLACC_SHIFT
155 #define FTFx_FSEC_FSLACC_WIDTH FTFE_FSEC_FSLACC_WIDTH
156 #define FTFx_FSEC_FSLACC(x) FTFE_FSEC_FSLACC(x)
157 #define FTFx_FSEC_MEEN_MASK FTFE_FSEC_MEEN_MASK
158 #define FTFx_FSEC_MEEN_SHIFT FTFE_FSEC_MEEN_SHIFT
159 #define FTFx_FSEC_MEEN_WIDTH FTFE_FSEC_MEEN_WIDTH
160 #define FTFx_FSEC_MEEN(x) FTFE_FSEC_MEEN(x)
161 #define FTFx_FSEC_KEYEN_MASK FTFE_FSEC_KEYEN_MASK
162 #define FTFx_FSEC_KEYEN_SHIFT FTFE_FSEC_KEYEN_SHIFT
163 #define FTFx_FSEC_KEYEN_WIDTH FTFE_FSEC_KEYEN_WIDTH
164 #define FTFx_FSEC_KEYEN(x) FTFE_FSEC_KEYEN(x)
166 #define FTFx_FOPT_OPT_MASK FTFE_FOPT_OPT_MASK
167 #define FTFx_FOPT_OPT_SHIFT FTFE_FOPT_OPT_SHIFT
168 #define FTFx_FOPT_OPT_WIDTH FTFE_FOPT_OPT_WIDTH
169 #define FTFx_FOPT_OPT(x) FTFE_FOPT_OPT(x)
171 #define FTFx_FCCOB_CCOBn_MASK FTFE_FCCOB_CCOBn_MASK
172 #define FTFx_FCCOB_CCOBn_SHIFT FTFE_FCCOB_CCOBn_SHIFT
173 #define FTFx_FCCOB_CCOBn_WIDTH FTFE_FCCOB_CCOBn_WIDTH
174 #define FTFx_FCCOB_CCOBn(x) FTFE_FCCOB_CCOBn(x)
176 #define FTFx_FPROT_PROT_MASK FTFE_FPROT_PROT_MASK
177 #define FTFx_FPROT_PROT_SHIFT FTFE_FPROT_PROT_SHIFT
178 #define FTFx_FPROT_PROT_WIDTH FTFE_FPROT_PROT_WIDTH
179 #define FTFx_FPROT_PROT(x) FTFE_FPROT_PROT(x)
181 #define FTFx_FEPROT_EPROT_MASK FTFE_FEPROT_EPROT_MASK
182 #define FTFx_FEPROT_EPROT_SHIFT FTFE_FEPROT_EPROT_SHIFT
183 #define FTFx_FEPROT_EPROT_WIDTH FTFE_FEPROT_EPROT_WIDTH
184 #define FTFx_FEPROT_EPROT(x) FTFE_FEPROT_EPROT(x)
186 #define FTFx_FDPROT_DPROT_MASK FTFE_FDPROT_DPROT_MASK
187 #define FTFx_FDPROT_DPROT_SHIFT FTFE_FDPROT_DPROT_SHIFT
188 #define FTFx_FDPROT_DPROT_WIDTH FTFE_FDPROT_DPROT_WIDTH
189 #define FTFx_FDPROT_DPROT(x) FTFE_FDPROT_DPROT(x)
190 #if FEATURE_FLS_HAS_DETECT_ECC_ERROR
192 #define FTFx_FERSTAT_DFDIF_MASK FTFE_FERSTAT_DFDIF_MASK
193 #define FTFx_FERSTAT_DFDIF_SHIFT FTFE_FERSTAT_DFDIF_SHIFT
194 #define FTFx_FERSTAT_DFDIF_WIDTH FTFE_FERSTAT_DFDIF_WIDTH
195 #define FTFx_FERSTAT_DFDIF(x) FTFE_FERSTAT_DFDIF(x)
197 #define FTFx_FERCNFG_DFDIE_MASK FTFE_FERCNFG_DFDIE_MASK
198 #define FTFx_FERCNFG_DFDIE_SHIFT FTFE_FERCNFG_DFDIE_SHIFT
199 #define FTFx_FERCNFG_DFDIE_WIDTH FTFE_FERCNFG_DFDIE_WIDTH
200 #define FTFx_FERCNFG_DFDIE(x) FTFE_FERCNFG_DFDIE(x)
201 #define FTFx_FERCNFG_FDFD_MASK FTFE_FERCNFG_FDFD_MASK
202 #define FTFx_FERCNFG_FDFD_SHIFT FTFE_FERCNFG_FDFD_SHIFT
203 #define FTFx_FERCNFG_FDFD_WIDTH FTFE_FERCNFG_FDFD_WIDTH
204 #define FTFx_FERCNFG_FDFD(x) FTFE_FERCNFG_FDFD(x)
210 #define FTFx_BASE FTFC_BASE
211 #define FTFx_FSTAT FTFC->FSTAT
212 #define FTFx_FCNFG FTFC->FCNFG
213 #define FTFx_FSEC FTFC->FSEC
214 #define FTFx_FOPT FTFC->FOPT
215 #define FTFx_FCCOB3 FTFC->FCCOB[0]
216 #define FTFx_FCCOB2 FTFC->FCCOB[1]
217 #define FTFx_FCCOB1 FTFC->FCCOB[2]
218 #define FTFx_FCCOB0 FTFC->FCCOB[3]
219 #define FTFx_FCCOB7 FTFC->FCCOB[4]
220 #define FTFx_FCCOB6 FTFC->FCCOB[5]
221 #define FTFx_FCCOB5 FTFC->FCCOB[6]
222 #define FTFx_FCCOB4 FTFC->FCCOB[7]
223 #define FTFx_FCCOBB FTFC->FCCOB[8]
224 #define FTFx_FCCOBA FTFC->FCCOB[9]
225 #define FTFx_FCCOB9 FTFC->FCCOB[10]
226 #define FTFx_FCCOB8 FTFC->FCCOB[11]
227 #define FTFx_FPROT3 FTFC->FPROT[0]
228 #define FTFx_FPROT2 FTFC->FPROT[1]
229 #define FTFx_FPROT1 FTFC->FPROT[2]
230 #define FTFx_FPROT0 FTFC->FPROT[3]
231 #define FTFx_FEPROT FTFC->FEPROT
232 #define FTFx_FDPROT FTFC->FDPROT
233 #define FTFx_FCSESTAT FTFC->FCSESTAT
234 #if FEATURE_FLS_HAS_DETECT_ECC_ERROR
235 #define FTFx_FERSTAT FTFC->FERSTAT
236 #define FTFx_FERCNFG FTFC->FERCNFG
239 #define FTFx_FSTAT_MGSTAT0_MASK FTFC_FSTAT_MGSTAT0_MASK
240 #define FTFx_FSTAT_MGSTAT0_SHIFT FTFC_FSTAT_MGSTAT0_SHIFT
241 #define FTFx_FSTAT_MGSTAT0_WIDTH FTFC_FSTAT_MGSTAT0_WIDTH
242 #define FTFx_FSTAT_MGSTAT0(x) FTFC_FSTAT_MGSTAT0(x)
243 #define FTFx_FSTAT_FPVIOL_MASK FTFC_FSTAT_FPVIOL_MASK
244 #define FTFx_FSTAT_FPVIOL_SHIFT FTFC_FSTAT_FPVIOL_SHIFT
245 #define FTFx_FSTAT_FPVIOL_WIDTH FTFC_FSTAT_FPVIOL_WIDTH
246 #define FTFx_FSTAT_FPVIOL(x) FTFC_FSTAT_FPVIOL(x)
247 #define FTFx_FSTAT_ACCERR_MASK FTFC_FSTAT_ACCERR_MASK
248 #define FTFx_FSTAT_ACCERR_SHIFT FTFC_FSTAT_ACCERR_SHIFT
249 #define FTFx_FSTAT_ACCERR_WIDTH FTFC_FSTAT_ACCERR_WIDTH
250 #define FTFx_FSTAT_ACCERR(x) FTFC_FSTAT_ACCERR(x)
251 #define FTFx_FSTAT_RDCOLERR_MASK FTFC_FSTAT_RDCOLERR_MASK
252 #define FTFx_FSTAT_RDCOLERR_SHIFT FTFC_FSTAT_RDCOLERR_SHIFT
253 #define FTFx_FSTAT_RDCOLERR_WIDTH FTFC_FSTAT_RDCOLERR_WIDTH
254 #define FTFx_FSTAT_RDCOLERR(x) FTFC_FSTAT_RDCOLERR(x)
255 #define FTFx_FSTAT_CCIF_MASK FTFC_FSTAT_CCIF_MASK
256 #define FTFx_FSTAT_CCIF_SHIFT FTFC_FSTAT_CCIF_SHIFT
257 #define FTFx_FSTAT_CCIF_WIDTH FTFC_FSTAT_CCIF_WIDTH
258 #define FTFx_FSTAT_CCIF(x) FTFC_FSTAT_CCIF(x)
260 #define FTFx_FCNFG_EEERDY_MASK FTFC_FCNFG_EEERDY_MASK
261 #define FTFx_FCNFG_EEERDY_SHIFT FTFC_FCNFG_EEERDY_SHIFT
262 #define FTFx_FCNFG_EEERDY_WIDTH FTFC_FCNFG_EEERDY_WIDTH
263 #define FTFx_FCNFG_EEERDY(x) FTFC_FCNFG_EEERDY(x)
264 #define FTFx_FCNFG_RAMRDY_MASK FTFC_FCNFG_RAMRDY_MASK
265 #define FTFx_FCNFG_RAMRDY_SHIFT FTFC_FCNFG_RAMRDY_SHIFT
266 #define FTFx_FCNFG_RAMRDY_WIDTH FTFC_FCNFG_RAMRDY_WIDTH
267 #define FTFx_FCNFG_RAMRDY(x) FTFC_FCNFG_RAMRDY(x)
268 #define FTFx_FCNFG_ERSSUSP_MASK FTFC_FCNFG_ERSSUSP_MASK
269 #define FTFx_FCNFG_ERSSUSP_SHIFT FTFC_FCNFG_ERSSUSP_SHIFT
270 #define FTFx_FCNFG_ERSSUSP_WIDTH FTFC_FCNFG_ERSSUSP_WIDTH
271 #define FTFx_FCNFG_ERSSUSP(x) FTFC_FCNFG_ERSSUSP(x)
272 #define FTFx_FCNFG_ERSAREQ_MASK FTFC_FCNFG_ERSAREQ_MASK
273 #define FTFx_FCNFG_ERSAREQ_SHIFT FTFC_FCNFG_ERSAREQ_SHIFT
274 #define FTFx_FCNFG_ERSAREQ_WIDTH FTFC_FCNFG_ERSAREQ_WIDTH
275 #define FTFx_FCNFG_ERSAREQ(x) FTFC_FCNFG_ERSAREQ(x)
276 #define FTFx_FCNFG_RDCOLLIE_MASK FTFC_FCNFG_RDCOLLIE_MASK
277 #define FTFx_FCNFG_RDCOLLIE_SHIFT FTFC_FCNFG_RDCOLLIE_SHIFT
278 #define FTFx_FCNFG_RDCOLLIE_WIDTH FTFC_FCNFG_RDCOLLIE_WIDTH
279 #define FTFx_FCNFG_RDCOLLIE(x) FTFC_FCNFG_RDCOLLIE(x)
280 #define FTFx_FCNFG_CCIE_MASK FTFC_FCNFG_CCIE_MASK
281 #define FTFx_FCNFG_CCIE_SHIFT FTFC_FCNFG_CCIE_SHIFT
282 #define FTFx_FCNFG_CCIE_WIDTH FTFC_FCNFG_CCIE_WIDTH
283 #define FTFx_FCNFG_CCIE(x) FTFC_FCNFG_CCIE(x)
285 #define FTFx_FSEC_SEC_MASK FTFC_FSEC_SEC_MASK
286 #define FTFx_FSEC_SEC_SHIFT FTFC_FSEC_SEC_SHIFT
287 #define FTFx_FSEC_SEC_WIDTH FTFC_FSEC_SEC_WIDTH
288 #define FTFx_FSEC_SEC(x) FTFC_FSEC_SEC(x)
289 #define FTFx_FSEC_FSLACC_MASK FTFC_FSEC_FSLACC_MASK
290 #define FTFx_FSEC_FSLACC_SHIFT FTFC_FSEC_FSLACC_SHIFT
291 #define FTFx_FSEC_FSLACC_WIDTH FTFC_FSEC_FSLACC_WIDTH
292 #define FTFx_FSEC_FSLACC(x) FTFC_FSEC_FSLACC(x)
293 #define FTFx_FSEC_MEEN_MASK FTFC_FSEC_MEEN_MASK
294 #define FTFx_FSEC_MEEN_SHIFT FTFC_FSEC_MEEN_SHIFT
295 #define FTFx_FSEC_MEEN_WIDTH FTFC_FSEC_MEEN_WIDTH
296 #define FTFx_FSEC_MEEN(x) FTFC_FSEC_MEEN(x)
297 #define FTFx_FSEC_KEYEN_MASK FTFC_FSEC_KEYEN_MASK
298 #define FTFx_FSEC_KEYEN_SHIFT FTFC_FSEC_KEYEN_SHIFT
299 #define FTFx_FSEC_KEYEN_WIDTH FTFC_FSEC_KEYEN_WIDTH
300 #define FTFx_FSEC_KEYEN(x) FTFC_FSEC_KEYEN(x)
302 #define FTFx_FOPT_OPT_MASK FTFC_FOPT_OPT_MASK
303 #define FTFx_FOPT_OPT_SHIFT FTFC_FOPT_OPT_SHIFT
304 #define FTFx_FOPT_OPT_WIDTH FTFC_FOPT_OPT_WIDTH
305 #define FTFx_FOPT_OPT(x) FTFC_FOPT_OPT(x)
307 #define FTFx_FCCOB_CCOBn_MASK FTFC_FCCOB_CCOBn_MASK
308 #define FTFx_FCCOB_CCOBn_SHIFT FTFC_FCCOB_CCOBn_SHIFT
309 #define FTFx_FCCOB_CCOBn_WIDTH FTFC_FCCOB_CCOBn_WIDTH
310 #define FTFx_FCCOB_CCOBn(x) FTFC_FCCOB_CCOBn(x)
312 #define FTFx_FPROT_PROT_MASK FTFC_FPROT_PROT_MASK
313 #define FTFx_FPROT_PROT_SHIFT FTFC_FPROT_PROT_SHIFT
314 #define FTFx_FPROT_PROT_WIDTH FTFC_FPROT_PROT_WIDTH
315 #define FTFx_FPROT_PROT(x) FTFC_FPROT_PROT(x)
317 #define FTFx_FEPROT_EPROT_MASK FTFC_FEPROT_EPROT_MASK
318 #define FTFx_FEPROT_EPROT_SHIFT FTFC_FEPROT_EPROT_SHIFT
319 #define FTFx_FEPROT_EPROT_WIDTH FTFC_FEPROT_EPROT_WIDTH
320 #define FTFx_FEPROT_EPROT(x) FTFC_FEPROT_EPROT(x)
322 #define FTFx_FDPROT_DPROT_MASK FTFC_FDPROT_DPROT_MASK
323 #define FTFx_FDPROT_DPROT_SHIFT FTFC_FDPROT_DPROT_SHIFT
324 #define FTFx_FDPROT_DPROT_WIDTH FTFC_FDPROT_DPROT_WIDTH
325 #define FTFx_FDPROT_DPROT(x) FTFC_FDPROT_DPROT(x)
327 #define FTFx_FCSESTAT_IDB_MASK FTFC_FCSESTAT_IDB_MASK
328 #define FTFx_FCSESTAT_IDB_SHIFT FTFC_FCSESTAT_IDB_SHIFT
329 #define FTFx_FCSESTAT_IDB_WIDTH FTFC_FCSESTAT_IDB_WIDTH
330 #define FTFx_FCSESTAT_IDB(x) FTFC_FCSESTAT_IDB(x)
331 #define FTFx_FCSESTAT_EDB_MASK FTFC_FCSESTAT_EDB_MASK
332 #define FTFx_FCSESTAT_EDB_SHIFT FTFC_FCSESTAT_EDB_SHIFT
333 #define FTFx_FCSESTAT_EDB_WIDTH FTFC_FCSESTAT_EDB_WIDTH
334 #define FTFx_FCSESTAT_EDB(x) FTFC_FCSESTAT_EDB(x)
335 #define FTFx_FCSESTAT_RIN_MASK FTFC_FCSESTAT_RIN_MASK
336 #define FTFx_FCSESTAT_RIN_SHIFT FTFC_FCSESTAT_RIN_SHIFT
337 #define FTFx_FCSESTAT_RIN_WIDTH FTFC_FCSESTAT_RIN_WIDTH
338 #define FTFx_FCSESTAT_RIN(x) FTFC_FCSESTAT_RIN(x)
339 #define FTFx_FCSESTAT_BOK_MASK FTFC_FCSESTAT_BOK_MASK
340 #define FTFx_FCSESTAT_BOK_SHIFT FTFC_FCSESTAT_BOK_SHIFT
341 #define FTFx_FCSESTAT_BOK_WIDTH FTFC_FCSESTAT_BOK_WIDTH
342 #define FTFx_FCSESTAT_BOK(x) FTFC_FCSESTAT_BOK(x)
343 #define FTFx_FCSESTAT_BFN_MASK FTFC_FCSESTAT_BFN_MASK
344 #define FTFx_FCSESTAT_BFN_SHIFT FTFC_FCSESTAT_BFN_SHIFT
345 #define FTFx_FCSESTAT_BFN_WIDTH FTFC_FCSESTAT_BFN_WIDTH
346 #define FTFx_FCSESTAT_BFN(x) FTFC_FCSESTAT_BFN(x)
347 #define FTFx_FCSESTAT_BIN_MASK FTFC_FCSESTAT_BIN_MASK
348 #define FTFx_FCSESTAT_BIN_SHIFT FTFC_FCSESTAT_BIN_SHIFT
349 #define FTFx_FCSESTAT_BIN_WIDTH FTFC_FCSESTAT_BIN_WIDTH
350 #define FTFx_FCSESTAT_BIN(x) FTFC_FCSESTAT_BIN(x)
351 #define FTFx_FCSESTAT_SB_MASK FTFC_FCSESTAT_SB_MASK
352 #define FTFx_FCSESTAT_SB_SHIFT FTFC_FCSESTAT_SB_SHIFT
353 #define FTFx_FCSESTAT_SB_WIDTH FTFC_FCSESTAT_SB_WIDTH
354 #define FTFx_FCSESTAT_SB(x) FTFC_FCSESTAT_SB(x)
355 #define FTFx_FCSESTAT_BSY_MASK FTFC_FCSESTAT_BSY_MASK
356 #define FTFx_FCSESTAT_BSY_SHIFT FTFC_FCSESTAT_BSY_SHIFT
357 #define FTFx_FCSESTAT_BSY_WIDTH FTFC_FCSESTAT_BSY_WIDTH
358 #define FTFx_FCSESTAT_BSY(x) FTFC_FCSESTAT_BSY(x)
359 #if FEATURE_FLS_HAS_DETECT_ECC_ERROR
361 #define FTFx_FERSTAT_DFDIF_MASK FTFC_FERSTAT_DFDIF_MASK
362 #define FTFx_FERSTAT_DFDIF_SHIFT FTFC_FERSTAT_DFDIF_SHIFT
363 #define FTFxFERSTAT_DFDIF_WIDTH FTFC_FERSTAT_DFDIF_WIDTH
364 #define FTFx_FERSTAT_DFDIF(x) FTFC_FERSTAT_DFDIF(x)
366 #define FTFx_FERCNFG_DFDIE_MASK FTFC_FERCNFG_DFDIE_MASK
367 #define FTFx_FERCNFG_DFDIE_SHIFT FTFC_FERCNFG_DFDIE_SHIFT
368 #define FTFx_FERCNFG_DFDIE_WIDTH FTFC_FERCNFG_DFDIE_WIDTH
369 #define FTFx_FERCNFG_DFDIE(x) FTFC_FERCNFG_DFDIE(x)
370 #define FTFx_FERCNFG_FDFD_MASK FTFC_FERCNFG_FDFD_MASK
371 #define FTFx_FERCNFG_FDFD_SHIFT FTFC_FERCNFG_FDFD_SHIFT
372 #define FTFx_FERCNFG_FDFD_WIDTH FTFC_FERCNFG_FDFD_WIDTH
373 #define FTFx_FERCNFG_FDFD(x) FTFC_FERCNFG_FDFD(x)
380 #define CLEAR_FTFx_FSTAT_ERROR_BITS FTFx_FSTAT = (uint8_t)(FTFx_FSTAT_FPVIOL_MASK | FTFx_FSTAT_ACCERR_MASK | FTFx_FSTAT_RDCOLERR_MASK)
383 #define FTFx_WORD_SIZE 0x0002U
385 #define FTFx_LONGWORD_SIZE 0x0004U
387 #define FTFx_PHRASE_SIZE 0x0008U
389 #define FTFx_DPHRASE_SIZE 0x0010U
392 #if (FEATURE_FLS_PF_BLOCK_WRITE_UNIT_SIZE == FTFx_PHRASE_SIZE)
393 #define FTFx_RSRC_CODE_REG FTFx_FCCOB4
395 #define FTFx_RSRC_CODE_REG FTFx_FCCOB8
401 #define FTFx_VERIFY_BLOCK 0x00U
402 #define FTFx_VERIFY_SECTION 0x01U
403 #define FTFx_PROGRAM_CHECK 0x02U
404 #define FTFx_READ_RESOURCE 0x03U
405 #define FTFx_PROGRAM_LONGWORD 0x06U
406 #define FTFx_PROGRAM_PHRASE 0x07U
407 #define FTFx_ERASE_BLOCK 0x08U
408 #define FTFx_ERASE_SECTOR 0x09U
409 #define FTFx_PROGRAM_SECTION 0x0BU
410 #define FTFx_VERIFY_ALL_BLOCK 0x40U
411 #define FTFx_READ_ONCE 0x41U
412 #define FTFx_PROGRAM_ONCE 0x43U
413 #define FTFx_ERASE_ALL_BLOCK 0x44U
414 #define FTFx_SECURITY_BY_PASS 0x45U
415 #define FTFx_PFLASH_SWAP 0x46U
416 #define FTFx_ERASE_ALL_BLOCK_UNSECURE 0x49U
417 #define FTFx_PROGRAM_PARTITION 0x80U
418 #define FTFx_SET_EERAM 0x81U
426 #define FTFx_SWAP_SET_INDICATOR_ADDR 0x01U
428 #define FTFx_SWAP_SET_IN_PREPARE 0x02U
430 #define FTFx_SWAP_SET_IN_COMPLETE 0x04U
432 #define FTFx_SWAP_REPORT_STATUS 0x08U
440 #define FTFx_SWAP_UNINIT 0x00U
442 #define FTFx_SWAP_READY 0x01U
444 #define FTFx_SWAP_UPDATE 0x02U
446 #define FTFx_SWAP_UPDATE_ERASED 0x03U
448 #define FTFx_SWAP_COMPLETE 0x04U
452 #define RESUME_WAIT_CNT 0x20U
454 #define SUSPEND_WAIT_CNT 0x40U
456 #if (FEATURE_FLS_IS_FTFE == 1U)
457 #define DFLASH_IFR_READRESOURCE_ADDRESS 0x8003F8U
459 #define DFLASH_IFR_READRESOURCE_ADDRESS 0x8000FCU
462 #define GET_BIT_0_7(value) ((uint8_t)(((uint32_t)(value)) & 0xFFU))
463 #define GET_BIT_8_15(value) ((uint8_t)((((uint32_t)(value)) >> 8) & 0xFFU))
464 #define GET_BIT_16_23(value) ((uint8_t)((((uint32_t)(value)) >> 16) & 0xFFU))
465 #define GET_BIT_24_31(value) ((uint8_t)(((uint32_t)(value)) >> 24))
468 #define FLASH_SECURITY_STATE_KEYEN 0x80U
469 #define FLASH_SECURITY_STATE_UNSECURED 0x02U
472 #define CSE_KEY_SIZE_CODE_MAX 0x03U
498 #define FLASH_NOT_SECURE 0x01U
500 #define FLASH_SECURE_BACKDOOR_ENABLED 0x02U
502 #define FLASH_SECURE_BACKDOOR_DISABLED 0x04U
508 #ifndef FLASH_CALLBACK_CS
515 #define FLASH_CALLBACK_CS 0x0AU
526 #define NULL_CALLBACK ((flash_callback_t)0xFFFFFFFFU)
528 #if FEATURE_FLS_HAS_PF_BLOCK_SWAP
530 #define NULL_SWAP_CALLBACK ((flash_swap_callback_t)0xFFFFFFFFU)
544 #if FEATURE_FLS_HAS_PF_BLOCK_SWAP
546 typedef bool (* flash_swap_callback_t)(uint8_t
function);
618 #if defined(__cplusplus)
709 const uint8_t * keyBuffer);
744 uint8_t marginLevel);
805 uint8_t marginLevel);
842 uint8_t * pDataArray);
863 const uint8_t * pDataArray);
865 #if FEATURE_FLS_HAS_READ_RESOURCE_CMD
886 uint8_t * pDataArray,
887 uint8_t resourceSelectCode);
913 const uint8_t * pData);
941 const uint8_t * pExpectedData,
942 uint32_t * pFailAddr,
943 uint8_t marginLevel);
970 #if FEATURE_FLS_HAS_PROGRAM_SECTION_CMD
1006 #if FEATURE_FLS_HAS_ERASE_BLOCK_CMD
1030 #if FEATURE_FLS_HAS_READ_1S_BLOCK_CMD
1052 uint8_t marginLevel);
1055 #if FEATURE_FLS_HAS_FLEX_NVM
1139 uint16_t byteOfQuickWrite,
1172 const uint8_t * pData);
1208 uint8_t uEEEDataSizeCode,
1209 uint8_t uDEPartitionCode,
1210 uint8_t uCSEcKeySize,
1212 bool flexRamEnableLoadEEEData);
1235 uint8_t * protectStatus);
1259 uint8_t protectStatus);
1262 #if FEATURE_FLS_HAS_PF_BLOCK_SWAP
1324 flash_swap_callback_t pSwapCallback);
1358 uint8_t * pCurrentSwapMode,
1359 uint8_t * pCurrentSwapBlockStatus,
1360 uint8_t * pNextSwapBlockStatus);
1364 #if FEATURE_FLS_HAS_ERASE_ALL_BLOCKS_UNSECURE_CMD
1452 #if FEATURE_FLS_HAS_DETECT_ECC_ERROR
1508 if (
true == isEnable)
1519 #if defined(__cplusplus)
status_t FLASH_DRV_DEFlashPartition(const flash_ssd_config_t *pSSDConfig, uint8_t uEEEDataSizeCode, uint8_t uDEPartitionCode, uint8_t uCSEcKeySize, bool uSFE, bool flexRamEnableLoadEEEData)
Flash D/E-Flash Partition.
status_t FLASH_DRV_GetDFlashProtection(const flash_ssd_config_t *pSSDConfig, uint8_t *protectStatus)
D-Flash get protection.
status_t FLASH_DRV_VerifyAllBlock(const flash_ssd_config_t *pSSDConfig, uint8_t marginLevel)
Flash verify all blocks.
uint16_t sectorEraseCount
#define FTFx_FERSTAT_DFDIF_MASK
void FLASH_DRV_EraseResume(void)
Flash erase resume.
status_t FLASH_DRV_SetEERAMProtection(uint8_t protectStatus)
EERAM set protection.
flash_callback_t CallBack
status_t FLASH_DRV_GetEERAMProtection(uint8_t *protectStatus)
EERAM get protection.
static void FLASH_DRV_ClearDoubleBitFaultFlag(void)
Clear the double bit fault detect flag.
void FLASH_DRV_EraseSuspend(void)
Flash erase suspend.
status_t FLASH_DRV_EEEWrite(const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size, const uint8_t *pData)
EEPROM Emulator Write.
status_t FLASH_DRV_EraseSector(const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size)
Flash erase sector.
void FLASH_DRV_DisableDoubleBitFaultInterupt(void)
Disable the double bit fault detect interrupt.
#define FTFx_FSTAT_RDCOLERR_MASK
status_t FLASH_DRV_Init(const flash_user_config_t *const pUserConf, flash_ssd_config_t *const pSSDConfig)
Initializes Flash.
void(* flash_callback_t)(void)
Call back function pointer data type.
status_t FLASH_DRV_Program(const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size, const uint8_t *pData)
Flash program.
status_t FLASH_DRV_EnableReadColisionInterupt(void)
Enable the read collision error interrupt.
status_t FLASH_DRV_VerifyBlock(const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint8_t marginLevel)
Flash verify block.
flash_flexRam_function_control_code_t
FlexRAM Function control Code.
static void FLASH_DRV_ClearReadColisionFlag(void)
Clear the read collision error flag.
void FLASH_DRV_GetPFlashProtection(uint32_t *protectStatus)
P-Flash get protection.
status_t FLASH_DRV_ProgramCheck(const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size, const uint8_t *pExpectedData, uint32_t *pFailAddr, uint8_t marginLevel)
Flash program check.
status_t FLASH_DRV_SetFlexRamFunction(const flash_ssd_config_t *pSSDConfig, flash_flexRam_function_control_code_t flexRamFuncCode, uint16_t byteOfQuickWrite, flash_eeprom_status_t *const pEEPROMStatus)
Set FlexRAM function.
status_t FLASH_DRV_CheckSum(const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint32_t size, uint32_t *pSum)
Calculates check sum.
status_t FLASH_DRV_SetDFlashProtection(const flash_ssd_config_t *pSSDConfig, uint8_t protectStatus)
D-Flash set protection.
status_t FLASH_DRV_EraseBlock(const flash_ssd_config_t *pSSDConfig, uint32_t dest)
Flash erase block.
static bool FLASH_DRV_GetCmdCompleteFlag(void)
Check the command complete flag has completed or not.
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
status_t FLASH_DRV_ProgramSection(const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint16_t number)
Flash program section.
#define FTFx_FERSTAT_DFDIF_SHIFT
#define FTFx_FSTAT_CCIF_MASK
status_t FLASH_DRV_EnableCmdCompleteInterupt(void)
Enable the command complete interrupt.
void FLASH_DRV_DisableCmdCompleteInterupt(void)
Disable the command complete interrupt.
uint16_t numOfRecordReqMaintain
status_t FLASH_DRV_SetPFlashProtection(uint32_t protectStatus)
P-Flash set protection.
#define FTFx_FERCNFG_FDFD_MASK
static void FLASH_DRV_ForceDoubleBitFaultDetectCmd(bool isEnable)
Force Double Bit Fault Detect.
status_t FLASH_DRV_VerifySection(const flash_ssd_config_t *pSSDConfig, uint32_t dest, uint16_t number, uint8_t marginLevel)
Flash verify section.
status_t FLASH_DRV_ReadOnce(const flash_ssd_config_t *pSSDConfig, uint8_t recordIndex, uint8_t *pDataArray)
Flash read once.
static bool FLASH_DRV_GetDoubleBitFaultFlag(void)
Check the double bit fault flag is detected during a valid flash read access.
Flash SSD Configuration Structure.
static bool FLASH_DRV_GetReadColisionFlag(void)
Check the read collision error flag is detected or not.
status_t FLASH_DRV_EraseAllBlock(const flash_ssd_config_t *pSSDConfig)
Flash erase all blocks.
#define FTFx_FSTAT_RDCOLERR_SHIFT
#define FTFx_FSTAT_CCIF_SHIFT
status_t FLASH_DRV_EnableDoubleBitFaultInterupt(void)
Enable the double bit fault detect interrupt.
void FLASH_DRV_DisableReadColisionInterupt(void)
Disable the read collision error interrupt.
status_t FLASH_DRV_EraseAllBlockUnsecure(const flash_ssd_config_t *pSSDConfig)
Flash erase all blocks unsecure.
Flash User Configuration Structure.
status_t FLASH_DRV_SecurityBypass(const flash_ssd_config_t *pSSDConfig, const uint8_t *keyBuffer)
Flash security bypass.
status_t FLASH_DRV_ProgramOnce(const flash_ssd_config_t *pSSDConfig, uint8_t recordIndex, const uint8_t *pDataArray)
Flash program once.
void FLASH_DRV_GetSecurityState(uint8_t *securityState)
Flash get security state.