3 * Reinhard Meyer, reinhard.meyer@emk-elektronik.de
5 * Enhanced Embedded Flash Controller
6 * Based on AT91SAM9XE datasheet
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
19 typedef struct at91_eefc {
20 u32 fmr; /* Flash Mode Register RW */
21 u32 fcr; /* Flash Command Register WO */
22 u32 fsr; /* Flash Status Register RO */
23 u32 frr; /* Flash Result Register RO */
26 #endif /* __ASSEMBLY__ */
28 #define AT91_EEFC_FMR_FWS_MASK 0x00000f00
29 #define AT91_EEFC_FMR_FRDY_BIT 0x00000001
31 #define AT91_EEFC_FCR_KEY 0x5a000000
32 #define AT91_EEFC_FCR_FARG_MASK 0x00ffff00
33 #define AT91_EEFC_FCR_FARG_SHIFT 8
34 #define AT91_EEFC_FCR_FCMD_GETD 0x0
35 #define AT91_EEFC_FCR_FCMD_WP 0x1
36 #define AT91_EEFC_FCR_FCMD_WPL 0x2
37 #define AT91_EEFC_FCR_FCMD_EWP 0x3
38 #define AT91_EEFC_FCR_FCMD_EWPL 0x4
39 #define AT91_EEFC_FCR_FCMD_EA 0x5
40 #define AT91_EEFC_FCR_FCMD_SLB 0x8
41 #define AT91_EEFC_FCR_FCMD_CLB 0x9
42 #define AT91_EEFC_FCR_FCMD_GLB 0xA
43 #define AT91_EEFC_FCR_FCMD_SGPB 0xB
44 #define AT91_EEFC_FCR_FCMD_CGPB 0xC
45 #define AT91_EEFC_FCR_FCMD_GGPB 0xD
47 #define AT91_EEFC_FSR_FRDY 1
48 #define AT91_EEFC_FSR_FCMDE 2
49 #define AT91_EEFC_FSR_FLOCKE 4