Reinhard Meyer | 8ec18f4 | 2010-07-27 15:18:38 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 |
| 3 | * Reinhard Meyer, reinhard.meyer@emk-elektronik.de |
| 4 | * |
| 5 | * Enhanced Embedded Flash Controller |
| 6 | * Based on AT91SAM9XE datasheet |
| 7 | * |
| 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. |
| 12 | */ |
| 13 | |
| 14 | #ifndef AT91_EEFC_H |
| 15 | #define AT91_EEFC_H |
| 16 | |
| 17 | #ifndef __ASSEMBLY__ |
| 18 | |
| 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 */ |
| 24 | } at91_eefc_t; |
| 25 | |
| 26 | #endif /* __ASSEMBLY__ */ |
| 27 | |
| 28 | #define AT91_EEFC_FMR_FWS_MASK 0x00000f00 |
| 29 | #define AT91_EEFC_FMR_FRDY_BIT 0x00000001 |
| 30 | |
| 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 |
| 46 | |
| 47 | #define AT91_EEFC_FSR_FRDY 1 |
| 48 | #define AT91_EEFC_FSR_FCMDE 2 |
| 49 | #define AT91_EEFC_FSR_FLOCKE 4 |
| 50 | |
| 51 | #endif |