summaryrefslogtreecommitdiff
path: root/memories
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-01-08 15:08:14 +0100
committerHarald Welte <laforge@gnumonks.org>2012-01-08 15:08:14 +0100
commit0d9de4db679436581f554242d7635ddef4b96773 (patch)
treee7e6ce584576c80b7e3b77ea615f80704b34ed2e /memories
parente236846cf9227f848b78ef167e07b72a62010bdb (diff)
Implement SAM3U Errata 46.2.1.4 about reading Unique Identifier
Diffstat (limited to 'memories')
-rw-r--r--memories/flash/flashd_eefc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/memories/flash/flashd_eefc.c b/memories/flash/flashd_eefc.c
index 45b9038..a367c8d 100644
--- a/memories/flash/flashd_eefc.c
+++ b/memories/flash/flashd_eefc.c
@@ -472,6 +472,7 @@ __attribute__ ((section (".ramfunc")))
unsigned char FLASHD_ReadUniqueID (unsigned long * uniqueID)
{
unsigned char error;
+ AT91S_EFC *pEfc = AT91C_BASE_EFC0;
SANITY_CHECK(uniqueID != NULL);
@@ -480,6 +481,9 @@ unsigned char FLASHD_ReadUniqueID (unsigned long * uniqueID)
uniqueID[2] = 0;
uniqueID[3] = 0;
+ /* SAM3U Errata 46.2.1.4 */
+ pEfc->EFC_FMR |= (1 << 16);
+
EFC_StartCommand(AT91C_BASE_EFC, AT91C_EFC_FCMD_STUI, 0);
uniqueID[0] = *(unsigned int *)AT91C_IFLASH;
@@ -488,6 +492,10 @@ unsigned char FLASHD_ReadUniqueID (unsigned long * uniqueID)
uniqueID[3] = *(unsigned int *)(AT91C_IFLASH + 12);
error = EFC_PerformCommand(AT91C_BASE_EFC, AT91C_EFC_FCMD_SPUI, 0);
+
+ /* SAM3U Errata 46.2.1.4 */
+ pEfc->EFC_FMR &= ~(1 << 16);
+
if (error) return error;
return 0;
personal git repositories of Harald Welte. Your mileage may vary