From 8d70c862002bafc1c2f7d1bb4095de68d399294e Mon Sep 17 00:00:00 2001 From: Ulf Wetzker Date: Mon, 27 May 2013 12:58:46 +0200 Subject: [PATCH] flash/nor/at91sam3: fixed lock region size According to the "AT91SAM ARM-based Flash MCU SAM3S Series datasheet" (http://www.atmel.com/Images/doc11090s.pdf) p. 30 the lock region size for the at91sam3sd9 family is 32 kbyte. This fix is only based on the datasheet due to missing hardware. Change-Id: Ic47b0642e4f11a60de477eaa0167038103b8ff15 Signed-off-by: Ulf Wetzker Reviewed-on: http://openocd.zylin.com/1422 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/flash/nor/at91sam3.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/flash/nor/at91sam3.c b/src/flash/nor/at91sam3.c index f8024b94..13959900 100644 --- a/src/flash/nor/at91sam3.c +++ b/src/flash/nor/at91sam3.c @@ -73,6 +73,11 @@ /* at91sam3s series (has always one flash bank) */ #define FLASH_BANK_BASE_S 0x00400000 +/* at91sam3sd series (has always two flash banks) */ +#define FLASH_BANK0_BASE_SD FLASH_BANK_BASE_S +#define FLASH_BANK1_BASE_512K_SD (FLASH_BANK0_BASE_SD+(512*1024/2)) + + /* at91sam3n series (has always one flash bank) */ #define FLASH_BANK_BASE_N 0x00400000 @@ -82,9 +87,6 @@ #define FLASH_BANK1_BASE_256K_AX 0x000A0000 #define FLASH_BANK1_BASE_512K_AX 0x000C0000 -#define FLASH_BANK0_BASE_SD FLASH_BANK_BASE_S -#define FLASH_BANK1_BASE_512K_SD (FLASH_BANK0_BASE_SD+(512*1024/2)) - #define AT91C_EFC_FCMD_GETD (0x0) /* (EFC) Get Flash Descriptor */ #define AT91C_EFC_FCMD_WP (0x1) /* (EFC) Write Page */ #define AT91C_EFC_FCMD_WPL (0x2) /* (EFC) Write Page and Lock */ @@ -749,7 +751,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .present = 1, .size_bytes = 256 * 1024, .nsectors = 16, - .sector_size = 16384, + .sector_size = 32768, .page_size = 256, }, /* .bank[1] = { */ @@ -764,7 +766,7 @@ static const struct sam3_chip_details all_sam3_details[] = { .present = 1, .size_bytes = 256 * 1024, .nsectors = 16, - .sector_size = 16384, + .sector_size = 32768, .page_size = 256, }, }, -- 2.39.5