summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/Makefile.am4
-rw-r--r--src/flash/at91sam7_old.c956
-rw-r--r--src/flash/at91sam7_old.h98
-rw-r--r--src/flash/flash.c2
4 files changed, 2 insertions, 1058 deletions
diff --git a/src/flash/Makefile.am b/src/flash/Makefile.am
index ab208b41..db24001a 100644
--- a/src/flash/Makefile.am
+++ b/src/flash/Makefile.am
@@ -6,13 +6,13 @@ AM_CPPFLAGS = \
METASOURCES = AUTO
noinst_LIBRARIES = libflash.a
libflash_a_SOURCES = \
- flash.c lpc2000.c cfi.c non_cfi.c at91sam7.c at91sam7_old.c \
+ flash.c lpc2000.c cfi.c non_cfi.c at91sam7.c \
str7x.c str9x.c aduc702x.c nand.c nand_ecc.c \
lpc3180_nand_controller.c stellaris.c str9xpec.c stm32x.c tms470.c \
ecos.c orion_nand.c s3c24xx_nand.c s3c2410_nand.c s3c2412_nand.c \
s3c2440_nand.c s3c2443_nand.c lpc288x.c ocl.c mflash.c pic32mx.c avrf.c
noinst_HEADERS = \
- flash.h lpc2000.h cfi.h non_cfi.h at91sam7.h at91sam7_old.h str7x.h \
+ flash.h lpc2000.h cfi.h non_cfi.h at91sam7.h str7x.h \
str9x.h nand.h lpc3180_nand_controller.h stellaris.h str9xpec.h \
stm32x.h tms470.h s3c24xx_nand.h s3c24xx_regs_nand.h lpc288x.h \
mflash.h ocl.h pic32mx.h avrf.h
diff --git a/src/flash/at91sam7_old.c b/src/flash/at91sam7_old.c
deleted file mode 100644
index c898a152..00000000
--- a/src/flash/at91sam7_old.c
+++ /dev/null
@@ -1,956 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2006 by Magnus Lundin *
- * lundin@mlu.mine.nu *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-/***************************************************************************
-There are some things to notice
-
-* AT91SAM7S64 is tested
-* All AT91SAM7Sxx and AT91SAM7Xxx should work but is not tested
-* All parameters are identified from onchip configuartion registers
-*
-* The flash controller handles erases automatically on a page (128/265 byte) basis
-* Only an EraseAll command is supported by the controller
-* Partial erases can be implemented in software by writing one 0xFFFFFFFF word to
-* some location in every page in the region to be erased
-*
-* Lock regions (sectors) are 32 or 64 pages
-*
- ***************************************************************************/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "replacements.h"
-
-#include "at91sam7_old.h"
-
-#include "flash.h"
-#include "target.h"
-#include "log.h"
-#include "binarybuffer.h"
-#include "types.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-static int at91sam7_old_register_commands(struct command_context_s *cmd_ctx);
-static int at91sam7_old_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank);
-static int at91sam7_old_erase(struct flash_bank_s *bank, int first, int last);
-static int at91sam7_old_protect(struct flash_bank_s *bank, int set, int first, int last);
-static int at91sam7_old_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count);
-static int at91sam7_old_probe(struct flash_bank_s *bank);
-//static int at91sam7_old_auto_probe(struct flash_bank_s *bank);
-static int at91sam7_old_erase_check(struct flash_bank_s *bank);
-static int at91sam7_old_protect_check(struct flash_bank_s *bank);
-static int at91sam7_old_info(struct flash_bank_s *bank, char *buf, int buf_size);
-
-static u32 at91sam7_old_get_flash_status(flash_bank_t *bank, u8 flashplane);
-static void at91sam7_old_set_flash_mode(flash_bank_t *bank, u8 flashplane, int mode);
-static u32 at91sam7_old_wait_status_busy(flash_bank_t *bank, u8 flashplane, u32 waitbits, int timeout);
-static int at91sam7_old_flash_command(struct flash_bank_s *bank, u8 flashplane, u8 cmd, u16 pagen);
-static int at91sam7_old_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
-
-flash_driver_t at91sam7_old_flash =
-{
- .name = "at91sam7",
- .register_commands = at91sam7_old_register_commands,
- .flash_bank_command = at91sam7_old_flash_bank_command,
- .erase = at91sam7_old_erase,
- .protect = at91sam7_old_protect,
- .write = at91sam7_old_write,
- .probe = at91sam7_old_probe,
- .auto_probe = at91sam7_old_probe,
- .erase_check = at91sam7_old_erase_check,
- .protect_check = at91sam7_old_protect_check,
- .info = at91sam7_old_info
-};
-
-static u32 MC_FMR_old[4] = { 0xFFFFFF60, 0xFFFFFF70, 0xFFFFFF80, 0xFFFFFF90 };
-static u32 MC_FCR_old[4] = { 0xFFFFFF64, 0xFFFFFF74, 0xFFFFFF84, 0xFFFFFF94 };
-static u32 MC_FSR_old[4] = { 0xFFFFFF68, 0xFFFFFF78, 0xFFFFFF88, 0xFFFFFF98 };
-
-static char * EPROC_old[8]= {"Unknown","ARM946-E","ARM7TDMI","Unknown","ARM920T","ARM926EJ-S","Unknown","Unknown"};
-static long NVPSIZ_old[16] = {
- 0,
- 0x2000, /* 8K */
- 0x4000, /* 16K */
- 0x8000, /* 32K */
- -1,
- 0x10000, /* 64K */
- -1,
- 0x20000, /* 128K */
- -1,
- 0x40000, /* 256K */
- 0x80000, /* 512K */
- -1,
- 0x100000, /* 1024K */
- -1,
- 0x200000, /* 2048K */
- -1
-};
-
-#if 0
-static long SRAMSIZ_old[16] = {
- -1,
- 0x0400, /* 1K */
- 0x0800, /* 2K */
- -1,
- 0x1c000, /* 112K */
- 0x1000, /* 4K */
- 0x14000, /* 80K */
- 0x28000, /* 160K */
- 0x2000, /* 8K */
- 0x4000, /* 16K */
- 0x8000, /* 32K */
- 0x10000, /* 64K */
- 0x20000, /* 128K */
- 0x40000, /* 256K */
- 0x18000, /* 96K */
- 0x80000, /* 512K */
-};
-#endif
-
-static int at91sam7_old_register_commands(struct command_context_s *cmd_ctx)
-{
- command_t *at91sam7_old_cmd = register_command(cmd_ctx, NULL, "at91sam7", NULL, COMMAND_ANY, NULL);
- register_command(cmd_ctx, at91sam7_old_cmd, "gpnvm", at91sam7_old_handle_gpnvm_command, COMMAND_EXEC,
- "at91sam7 gpnvm <num> <bit> set|clear, set or clear at91sam7 gpnvm bit");
-
- return ERROR_OK;
-}
-
-static u32 at91sam7_old_get_flash_status(flash_bank_t *bank, u8 flashplane)
-{
- target_t *target = bank->target;
- u32 fsr;
-
- target_read_u32(target, MC_FSR_old[flashplane], &fsr);
-
- return fsr;
-}
-
-/* Read clock configuration and set at91sam7_old_info->usec_clocks*/
-static void at91sam7_old_read_clock_info(flash_bank_t *bank)
-{
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
- target_t *target = bank->target;
- u32 mckr, mcfr, pllr;
- unsigned long tmp = 0, mainfreq;
- int flashplane;
-
- /* Read main clock freqency register */
- target_read_u32(target, CKGR_MCFR_old, &mcfr);
- /* Read master clock register */
- target_read_u32(target, PMC_MCKR_old, &mckr);
- /* Read Clock Generator PLL Register */
- target_read_u32(target, CKGR_PLLR_old, &pllr);
-
- at91sam7_old_info->mck_valid = 0;
- switch (mckr & PMC_MCKR_CSS_old)
- {
- case 0: /* Slow Clock */
- at91sam7_old_info->mck_valid = 1;
- mainfreq = RC_FREQ_old / 16ul * (mcfr & 0xffff);
- tmp = mainfreq;
- break;
- case 1: /* Main Clock */
- if (mcfr & CKGR_MCFR_MAINRDY_old)
- {
- at91sam7_old_info->mck_valid = 1;
- mainfreq = RC_FREQ_old / 16ul * (mcfr & 0xffff);
- tmp = mainfreq;
- }
- break;
-
- case 2: /* Reserved */
- break;
- case 3: /* PLL Clock */
- if (mcfr & CKGR_MCFR_MAINRDY_old)
- {
- target_read_u32(target, CKGR_PLLR_old, &pllr);
- if (!(pllr & CKGR_PLLR_DIV_old))
- break; /* 0 Hz */
- at91sam7_old_info->mck_valid = 1;
- mainfreq = RC_FREQ_old / 16ul * (mcfr & 0xffff);
- /* Integer arithmetic should have sufficient precision
- as long as PLL is properly configured. */
- tmp = mainfreq / (pllr & CKGR_PLLR_DIV_old) *
- (((pllr & CKGR_PLLR_MUL_old) >> 16) + 1);
- }
- break;
- }
-
- /* Prescaler adjust */
- if (((mckr & PMC_MCKR_PRES_old) >> 2) == 7)
- at91sam7_old_info->mck_valid = 0;
- else
- at91sam7_old_info->mck_freq = tmp >> ((mckr & PMC_MCKR_PRES_old) >> 2);
-
- /* Forget old flash timing */
- for (flashplane = 0; flashplane<at91sam7_old_info->num_planes; flashplane++)
- {
- at91sam7_old_set_flash_mode(bank, flashplane, FMR_TIMING_NONE_old);
- }
-}
-
-/* Setup the timimg registers for nvbits or normal flash */
-static void at91sam7_old_set_flash_mode(flash_bank_t *bank, u8 flashplane, int mode)
-{
- u32 fmr, fmcn = 0, fws = 0;
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
- target_t *target = bank->target;
-
- if (mode && (mode != at91sam7_old_info->flashmode[flashplane]))
- {
- /* Always round up (ceil) */
- if (mode==FMR_TIMING_NVBITS_old)
- {
- if (at91sam7_old_info->cidr_arch == 0x60)
- {
- /* AT91SAM7A3 uses master clocks in 100 ns */
- fmcn = (at91sam7_old_info->mck_freq/10000000ul)+1;
- }
- else
- {
- /* master clocks in 1uS for ARCH 0x7 types */
- fmcn = (at91sam7_old_info->mck_freq/1000000ul)+1;
- }
- }
- else if (mode==FMR_TIMING_FLASH_old)
- /* main clocks in 1.5uS */
- fmcn = (at91sam7_old_info->mck_freq/666666ul)+1;
-
- /* Only allow fmcn=0 if clock period is > 30 us = 33kHz. */
- if (at91sam7_old_info->mck_freq <= 33333ul)
- fmcn = 0;
- /* Only allow fws=0 if clock frequency is < 30 MHz. */
- if (at91sam7_old_info->mck_freq > 30000000ul)
- fws = 1;
-
- LOG_DEBUG("fmcn[%i]: %i", flashplane, fmcn);
- fmr = fmcn << 16 | fws << 8;
- target_write_u32(target, MC_FMR_old[flashplane], fmr);
- }
-
- at91sam7_old_info->flashmode[flashplane] = mode;
-}
-
-static u32 at91sam7_old_wait_status_busy(flash_bank_t *bank, u8 flashplane, u32 waitbits, int timeout)
-{
- u32 status;
-
- while ((!((status = at91sam7_old_get_flash_status(bank,flashplane)) & waitbits)) && (timeout-- > 0))
- {
- LOG_DEBUG("status[%i]: 0x%x", flashplane, status);
- alive_sleep(1);
- }
-
- LOG_DEBUG("status[%i]: 0x%x", flashplane, status);
-
- if (status & 0x0C)
- {
- LOG_ERROR("status register: 0x%x", status);
- if (status & 0x4)
- LOG_ERROR("Lock Error Bit Detected, Operation Abort");
- if (status & 0x8)
- LOG_ERROR("Invalid command and/or bad keyword, Operation Abort");
- if (status & 0x10)
- LOG_ERROR("Security Bit Set, Operation Abort");
- }
-
- return status;
-}
-
-
-/* Send one command to the AT91SAM flash controller */
-static int at91sam7_old_flash_command(struct flash_bank_s *bank, u8 flashplane, u8 cmd, u16 pagen)
-{
- u32 fcr;
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
- target_t *target = bank->target;
-
- fcr = (0x5A<<24) | ((pagen&0x3FF)<<8) | cmd;
- target_write_u32(target, MC_FCR_old[flashplane], fcr);
- LOG_DEBUG("Flash command: 0x%x, flashplane: %i, pagenumber:%u", fcr, flashplane, pagen);
-
- if ((at91sam7_old_info->cidr_arch == 0x60)&&((cmd==SLB_old)|(cmd==CLB_old)))
- {
- /* Lock bit manipulation on AT91SAM7A3 waits for FC_FSR bit 1, EOL */
- if (at91sam7_old_wait_status_busy(bank, flashplane, MC_FSR_EOL_old, 10)&0x0C)
- {
- return ERROR_FLASH_OPERATION_FAILED;
- }
- return ERROR_OK;
- }
-
- if (at91sam7_old_wait_status_busy(bank, flashplane, MC_FSR_FRDY_old, 10)&0x0C)
- {
- return ERROR_FLASH_OPERATION_FAILED;
- }
- return ERROR_OK;
-}
-
-/* Read device id register, main clock frequency register and fill in driver info structure */
-static int at91sam7_old_read_part_info(struct flash_bank_s *bank)
-{
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
- target_t *target = bank->target;
- u32 cidr, status;
- int sectornum;
-
- if (at91sam7_old_info->cidr != 0)
- return ERROR_OK; /* already probed, multiple probes may cause memory leak, not allowed */
-
- /* Read and parse chip identification register */
- target_read_u32(target, DBGU_CIDR_old, &cidr);
-
- if (cidr == 0)
- {
- LOG_WARNING("Cannot identify target as an AT91SAM");
- return ERROR_FLASH_OPERATION_FAILED;
- }
-
- at91sam7_old_info->cidr = cidr;
- at91sam7_old_info->cidr_ext = (cidr>>31)&0x0001;
- at91sam7_old_info->cidr_nvptyp = (cidr>>28)&0x0007;
- at91sam7_old_info->cidr_arch = (cidr>>20)&0x00FF;
- at91sam7_old_info->cidr_sramsiz = (cidr>>16)&0x000F;
- at91sam7_old_info->cidr_nvpsiz2 = (cidr>>12)&0x000F;
- at91sam7_old_info->cidr_nvpsiz = (cidr>>8)&0x000F;
- at91sam7_old_info->cidr_eproc = (cidr>>5)&0x0007;
- at91sam7_old_info->cidr_version = cidr&0x001F;
- bank->size = NVPSIZ_old[at91sam7_old_info->cidr_nvpsiz];
- at91sam7_old_info->target_name = "Unknown";
-
- /* Support just for bulk erase of a single flash plane, whole device if flash size <= 256k */
- if (NVPSIZ_old[at91sam7_old_info->cidr_nvpsiz]<0x80000) /* Flash size less than 512K, one flash plane */
- {
- bank->num_sectors = 1;
- bank->sectors = malloc(sizeof(flash_sector_t));
- bank->sectors[0].offset = 0;
- bank->sectors[0].size = bank->size;
- bank->sectors[0].is_erased = -1;
- bank->sectors[0].is_protected = -1;
- }
- else /* Flash size 512K or larger, several flash planes */
- {
- bank->num_sectors = NVPSIZ_old[at91sam7_old_info->cidr_nvpsiz]/0x40000;
- bank->sectors = malloc(bank->num_sectors*sizeof(flash_sector_t));
- for (sectornum=0; sectornum<bank->num_sectors; sectornum++)
- {
- bank->sectors[sectornum].offset = sectornum*0x40000;
- bank->sectors[sectornum].size = 0x40000;
- bank->sectors[sectornum].is_erased = -1;
- bank->sectors[sectornum].is_protected = -1;
- }
- }
-
-
-
- LOG_DEBUG("nvptyp: 0x%3.3x, arch: 0x%4.4x", at91sam7_old_info->cidr_nvptyp, at91sam7_old_info->cidr_arch );
-
- /* Read main and master clock freqency register */
- at91sam7_old_read_clock_info(bank);
-
- at91sam7_old_info->num_planes = 1;
- status = at91sam7_old_get_flash_status(bank, 0);
- at91sam7_old_info->securitybit = (status>>4)&0x01;
- at91sam7_old_protect_check(bank); /* TODO Check the protect check */
-
- if (at91sam7_old_info->cidr_arch == 0x70 )
- {
- at91sam7_old_info->num_nvmbits = 2;
- at91sam7_old_info->nvmbits = (status>>8)&0x03;
- bank->base = 0x100000;
- bank->bus_width = 4;
- if (bank->size==0x80000) /* AT91SAM7S512 */
- {
- at91sam7_old_info->target_name = "AT91SAM7S512";
- at91sam7_old_info->num_planes = 2;
- if (at91sam7_old_info->num_planes != bank->num_sectors)
- LOG_WARNING("Internal error: Number of flash planes and erase sectors does not match, please report");;
- at91sam7_old_info->num_lockbits = 2*16;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 2*16*64;
- }
- if (bank->size==0x40000) /* AT91SAM7S256 */
- {
- at91sam7_old_info->target_name = "AT91SAM7S256";
- at91sam7_old_info->num_lockbits = 16;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 16*64;
- }
- if (bank->size==0x20000) /* AT91SAM7S128 */
- {
- at91sam7_old_info->target_name = "AT91SAM7S128";
- at91sam7_old_info->num_lockbits = 8;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 8*64;
- }
- if (bank->size==0x10000) /* AT91SAM7S64 */
- {
- at91sam7_old_info->target_name = "AT91SAM7S64";
- at91sam7_old_info->num_lockbits = 16;
- at91sam7_old_info->pagesize = 128;
- at91sam7_old_info->pages_in_lockregion = 32;
- at91sam7_old_info->num_pages = 16*32;
- }
- if (bank->size==0x08000) /* AT91SAM7S321/32 */
- {
- at91sam7_old_info->target_name = "AT91SAM7S321/32";
- at91sam7_old_info->num_lockbits = 8;
- at91sam7_old_info->pagesize = 128;
- at91sam7_old_info->pages_in_lockregion = 32;
- at91sam7_old_info->num_pages = 8*32;
- }
-
- return ERROR_OK;
- }
-
- if (at91sam7_old_info->cidr_arch == 0x71 )
- {
- at91sam7_old_info->num_nvmbits = 3;
- at91sam7_old_info->nvmbits = (status>>8)&0x07;
- bank->base = 0x100000;
- bank->bus_width = 4;
- if (bank->size==0x80000) /* AT91SAM7XC512 */
- {
- at91sam7_old_info->target_name = "AT91SAM7XC512";
- at91sam7_old_info->num_planes = 2;
- if (at91sam7_old_info->num_planes != bank->num_sectors)
- LOG_WARNING("Internal error: Number of flash planes and erase sectors does not match, please report");;
- at91sam7_old_info->num_lockbits = 2*16;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 2*16*64;
- }
- if (bank->size==0x40000) /* AT91SAM7XC256 */
- {
- at91sam7_old_info->target_name = "AT91SAM7XC256";
- at91sam7_old_info->num_lockbits = 16;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 16*64;
- }
- if (bank->size==0x20000) /* AT91SAM7XC128 */
- {
- at91sam7_old_info->target_name = "AT91SAM7XC128";
- at91sam7_old_info->num_lockbits = 8;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 8*64;
- }
-
- return ERROR_OK;
- }
-
- if (at91sam7_old_info->cidr_arch == 0x72 )
- {
- at91sam7_old_info->num_nvmbits = 3;
- at91sam7_old_info->nvmbits = (status>>8)&0x07;
- bank->base = 0x100000;
- bank->bus_width = 4;
- if (bank->size==0x80000) /* AT91SAM7SE512 */
- {
- at91sam7_old_info->target_name = "AT91SAM7SE512";
- at91sam7_old_info->num_planes = 2;
- if (at91sam7_old_info->num_planes != bank->num_sectors)
- LOG_WARNING("Internal error: Number of flash planes and erase sectors does not match, please report");;
- at91sam7_old_info->num_lockbits = 32;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 32*64;
- }
- if (bank->size==0x40000)
- {
- at91sam7_old_info->target_name = "AT91SAM7SE256";
- at91sam7_old_info->num_lockbits = 16;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 16*64;
- }
- if (bank->size==0x08000)
- {
- at91sam7_old_info->target_name = "AT91SAM7SE32";
- at91sam7_old_info->num_lockbits = 8;
- at91sam7_old_info->pagesize = 128;
- at91sam7_old_info->pages_in_lockregion = 32;
- at91sam7_old_info->num_pages = 8*32;
- }
-
- return ERROR_OK;
- }
-
- if (at91sam7_old_info->cidr_arch == 0x75 )
- {
- at91sam7_old_info->num_nvmbits = 3;
- at91sam7_old_info->nvmbits = (status>>8)&0x07;
- bank->base = 0x100000;
- bank->bus_width = 4;
- if (bank->size==0x80000) /* AT91SAM7X512 */
- {
- at91sam7_old_info->target_name = "AT91SAM7X512";
- at91sam7_old_info->num_planes = 2;
- if (at91sam7_old_info->num_planes != bank->num_sectors)
- LOG_WARNING("Internal error: Number of flash planes and erase sectors does not match, please report");;
- at91sam7_old_info->num_lockbits = 32;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 2*16*64;
- LOG_DEBUG("Support for AT91SAM7X512 is experimental in this version!");
- }
- if (bank->size==0x40000) /* AT91SAM7X256 */
- {
- at91sam7_old_info->target_name = "AT91SAM7X256";
- at91sam7_old_info->num_lockbits = 16;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 16*64;
- }
- if (bank->size==0x20000) /* AT91SAM7X128 */
- {
- at91sam7_old_info->target_name = "AT91SAM7X128";
- at91sam7_old_info->num_lockbits = 8;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 64;
- at91sam7_old_info->num_pages = 8*64;
- }
-
- return ERROR_OK;
- }
-
- if (at91sam7_old_info->cidr_arch == 0x60 )
- {
- at91sam7_old_info->num_nvmbits = 3;
- at91sam7_old_info->nvmbits = (status>>8)&0x07;
- bank->base = 0x100000;
- bank->bus_width = 4;
-
- if (bank->size == 0x40000) /* AT91SAM7A3 */
- {
- at91sam7_old_info->target_name = "AT91SAM7A3";
- at91sam7_old_info->num_lockbits = 16;
- at91sam7_old_info->pagesize = 256;
- at91sam7_old_info->pages_in_lockregion = 16;
- at91sam7_old_info->num_pages = 16*64;
- }
- return ERROR_OK;
- }
-
- LOG_WARNING("at91sam7_old flash only tested for AT91SAM7Sxx series");
- return ERROR_OK;
-}
-
-int at91sam7_old_erase_check(struct flash_bank_s *bank)
-{
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
-
- if (!at91sam7_old_info->working_area_size)
- {
- }
- else
- {
- }
-
- return ERROR_OK;
-}
-
-static int at91sam7_old_protect_check(struct flash_bank_s *bank)
-{
- u32 status;
- int flashplane;
-
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
-
- if (at91sam7_old_info->cidr == 0)
- {
- return ERROR_FLASH_BANK_NOT_PROBED;
- }
-
- if (bank->target->state != TARGET_HALTED)
- {
- LOG_ERROR("Target not halted");
- return ERROR_TARGET_NOT_HALTED;
- }
-
- for (flashplane=0;flashplane<at91sam7_old_info->num_planes;flashplane++)
- {
- status = at91sam7_old_get_flash_status(bank, flashplane);
- at91sam7_old_info->lockbits[flashplane] = (status >> 16);
- }
-
- return ERROR_OK;
-}
-
-/* flash_bank at91sam7_old 0 0 0 0 <target#>
- */
-int at91sam7_old_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct flash_bank_s *bank)
-{
- at91sam7_old_flash_bank_t *at91sam7_old_info;
- int i;
-
- if (argc < 6)
- {
- LOG_WARNING("incomplete flash_bank at91sam7_old configuration");
- return ERROR_FLASH_BANK_INVALID;
- }
-
- at91sam7_old_info = malloc(sizeof(at91sam7_old_flash_bank_t));
- bank->driver_priv = at91sam7_old_info;
-
- /* part wasn't probed for info yet */
- at91sam7_old_info->cidr = 0;
- for (i=0;i<4;i++)
- at91sam7_old_info->flashmode[i]=0;
-
- return ERROR_OK;
-}
-
-static int at91sam7_old_erase(struct flash_bank_s *bank, int first, int last)
-{
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
- u8 flashplane;
-
- if (at91sam7_old_info->cidr == 0)
- {
- return ERROR_FLASH_BANK_NOT_PROBED;
- }
-
- if (bank->target->state != TARGET_HALTED)
- {
- LOG_ERROR("Target not halted");
- return ERROR_TARGET_NOT_HALTED;
- }
-
- if ((first < 0) || (last < first) || (last >= bank->num_sectors))
- {
- if ((first == 0) && (last == (at91sam7_old_info->num_lockbits-1)))
- {
- LOG_WARNING("Sector numbers based on lockbit count, probably a deprecated script");
- last = bank->num_sectors-1;
- }
- else return ERROR_FLASH_SECTOR_INVALID;
- }
-
- /* Configure the flash controller timing */
- at91sam7_old_read_clock_info(bank);
- for (flashplane = first; flashplane<=last; flashplane++)
- {
- /* Configure the flash controller timing */
- at91sam7_old_set_flash_mode(bank, flashplane, FMR_TIMING_FLASH_old);
- if (at91sam7_old_flash_command(bank, flashplane, EA_old, 0) != ERROR_OK)
- {
- return ERROR_FLASH_OPERATION_FAILED;
- }
- }
- return ERROR_OK;
-
-}
-
-int at91sam7_old_protect(struct flash_bank_s *bank, int set, int first, int last)
-{
- u32 cmd, pagen;
- u8 flashplane;
- int lockregion;
-
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
-
- if (at91sam7_old_info->cidr == 0)
- {
- return ERROR_FLASH_BANK_NOT_PROBED;
- }
-
- if (bank->target->state != TARGET_HALTED)
- {
- LOG_ERROR("Target not halted");
- return ERROR_TARGET_NOT_HALTED;
- }
-
- if ((first < 0) || (last < first) || (last >= at91sam7_old_info->num_lockbits))
- {
- return ERROR_FLASH_SECTOR_INVALID;
- }
-
- at91sam7_old_read_clock_info(bank);
-
- for (lockregion=first;lockregion<=last;lockregion++)
- {
- pagen = lockregion*at91sam7_old_info->pages_in_lockregion;
- flashplane = (pagen>>10)&0x03;
- /* Configure the flash controller timing */
- at91sam7_old_set_flash_mode(bank, flashplane, FMR_TIMING_NVBITS_old);
-
- if (set)
- cmd = SLB_old;
- else
- cmd = CLB_old;
-
- if (at91sam7_old_flash_command(bank, flashplane, cmd, pagen) != ERROR_OK)
- {
- return ERROR_FLASH_OPERATION_FAILED;
- }
- }
-
- at91sam7_old_protect_check(bank);
-
- return ERROR_OK;
-}
-
-
-static int at91sam7_old_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
-{
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
- target_t *target = bank->target;
- u32 dst_min_alignment, wcount, bytes_remaining = count;
- u32 first_page, last_page, pagen, buffer_pos;
- u8 flashplane;
-
- if (at91sam7_old_info->cidr == 0)
- {
- return ERROR_FLASH_BANK_NOT_PROBED;
- }
-
- if (bank->target->state != TARGET_HALTED)
- {
- LOG_ERROR("Target not halted");
- return ERROR_TARGET_NOT_HALTED;
- }
-
- if (offset + count > bank->size)
- return ERROR_FLASH_DST_OUT_OF_BANK;
-
- dst_min_alignment = at91sam7_old_info->pagesize;
-
- if (offset % dst_min_alignment)
- {
- LOG_WARNING("offset 0x%x breaks required alignment 0x%x", offset, dst_min_alignment);
- return ERROR_FLASH_DST_BREAKS_ALIGNMENT;
- }
-
- if (at91sam7_old_info->cidr_arch == 0)
- return ERROR_FLASH_BANK_NOT_PROBED;
-
- first_page = offset/dst_min_alignment;
- last_page = CEIL(offset + count, dst_min_alignment);
-
- LOG_DEBUG("first_page: %i, last_page: %i, count %i", first_page, last_page, count);
-
- at91sam7_old_read_clock_info(bank);
-
- for (pagen=first_page; pagen<last_page; pagen++)
- {
- if (bytes_remaining<dst_min_alignment)
- count = bytes_remaining;
- else
- count = dst_min_alignment;
- bytes_remaining -= count;
-
- /* Write one block to the PageWriteBuffer */
- buffer_pos = (pagen-first_page)*dst_min_alignment;
- wcount = CEIL(count,4);
- target->type->write_memory(target, bank->base+pagen*dst_min_alignment, 4, wcount, buffer+buffer_pos);
- flashplane = (pagen>>10)&0x3;
-
- /* Configure the flash controller timing */
- at91sam7_old_set_flash_mode(bank, flashplane, FMR_TIMING_FLASH_old);
- /* Send Write Page command to Flash Controller */
- if (at91sam7_old_flash_command(bank, flashplane, WP_old, pagen) != ERROR_OK)
- {
- return ERROR_FLASH_OPERATION_FAILED;
- }
- LOG_DEBUG("Write flash plane:%i page number:%i", flashplane, pagen);
- }
-
- return ERROR_OK;
-}
-
-
-static int at91sam7_old_probe(struct flash_bank_s *bank)
-{
- /* we can't probe on an at91sam7_old
- * if this is an at91sam7_old, it has the configured flash
- */
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
- int retval;
-
- if (at91sam7_old_info->cidr != 0)
- {
- return ERROR_OK; /* already probed */
- }
-
- if (bank->target->state != TARGET_HALTED)
- {
- LOG_ERROR("Target not halted");
- return ERROR_TARGET_NOT_HALTED;
- }
-
- retval = at91sam7_old_read_part_info(bank);
- if (retval != ERROR_OK)
- return retval;
-
- return ERROR_OK;
-}
-
-
-static int at91sam7_old_info(struct flash_bank_s *bank, char *buf, int buf_size)
-{
- int printed, flashplane;
- at91sam7_old_flash_bank_t *at91sam7_old_info = bank->driver_priv;
-
- if (at91sam7_old_info->cidr == 0)
- {
- return ERROR_FLASH_BANK_NOT_PROBED;
- }
-
- printed = snprintf(buf, buf_size, "\nat91sam7_old information: Chip is %s\n",at91sam7_old_info->target_name);
- buf += printed;
- buf_size -= printed;
-
- printed = snprintf(buf, buf_size, "cidr: 0x%8.8x, arch: 0x%4.4x, eproc: %s, version:0x%3.3x, flashsize: 0x%8.8x\n",
- at91sam7_old_info->cidr, at91sam7_old_info->cidr_arch, EPROC_old[at91sam7_old_info->cidr_eproc], at91sam7_old_info->cidr_version, bank->size);
- buf += printed;
- buf_size -= printed;
-
- printed = snprintf(buf, buf_size, "master clock(estimated): %ikHz \n", at91sam7_old_info->mck_freq / 1000);
- buf += printed;
- buf_size -= printed;
-
- if (at91sam7_old_info->num_planes>1) {
- printed = snprintf(buf, buf_size, "flashplanes: %i, pagesize: %i, lock regions: %i, pages in lock region: %i \n",
- at91sam7_old_info->num_planes, at91sam7_old_info->pagesize, at91sam7_old_info->num_lockbits, at91sam7_old_info->num_pages/at91sam7_old_info->num_lockbits);
- buf += printed;
- buf_size -= printed;
- for (flashplane=0; flashplane<at91sam7_old_info->num_planes; flashplane++)
- {
- printed = snprintf(buf, buf_size, "lockbits[%i]: 0x%4.4x, ", flashplane, at91sam7_old_info->lockbits[flashplane]);
- buf += printed;
- buf_size -= printed;
- }
- }
- else
- if (at91sam7_old_info->num_lockbits>0) {
- printed = snprintf(buf, buf_size, "pagesize: %i, lockbits: %i 0x%4.4x, pages in lock region: %i \n",
- at91sam7_old_info->pagesize, at91sam7_old_info->num_lockbits, at91sam7_old_info->lockbits[0], at91sam7_old_info->num_pages/at91sam7_old_info->num_lockbits);
- buf += printed;
- buf_size -= printed;
- }
-
- printed = snprintf(buf, buf_size, "securitybit: %i, nvmbits(%i): 0x%1.1x\n", at91sam7_old_info->securitybit, at91sam7_old_info->num_nvmbits, at91sam7_old_info->nvmbits);
- buf += printed;
- buf_size -= printed;
-
- return ERROR_OK;
-}
-
-/*
-* On AT91SAM7S: When the gpnvm bits are set with
-* > at91sam7_old gpnvm 0 bitnr set
-* the changes are not visible in the flash controller status register MC_FSR_old
-* until the processor has been reset.
-* On the Olimex board this requires a power cycle.
-* Note that the AT91SAM7S has the following errata (doc6175.pdf sec 14.1.3):
-* The maximum number of write/erase cycles for Non Volatile Memory bits is 100. This includes
-* Lock Bits (LOCKx), General Purpose NVM bits (GPNVMx) and the Security Bit.
-*/
-static int at91sam7_old_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
-{
- flash_bank_t *bank;
- int bit;
- u8 flashcmd;
- u32 status;
- char *value;
- at91sam7_old_flash_bank_t *at91sam7_old_info;
- int retval;
-
- if (argc < 3)
- {
- command_print(cmd_ctx, "at91sam7_old gpnvm <num> <bit> <set|clear>");
- return ERROR_OK;
- }
-
- bank = get_flash_bank_by_num_noprobe(strtoul(args[0], NULL, 0));
- bit = atoi(args[1]);
- value = args[2];
-
- if (bank == NULL)
- {
- return ERROR_FLASH_BANK_INVALID;
- }
-
- if (bank->driver != &at91sam7_old_flash)
- {
- command_print(cmd_ctx, "not an at91sam7_old flash bank '%s'", args[0]);
- return ERROR_FLASH_BANK_INVALID;
- }
-
- if (strcmp(value, "set") == 0)
- {
- flashcmd = SGPB_old;
- }
- else if (strcmp(value, "clear") == 0)
- {
- flashcmd = CGPB_old;
- }
- else
- {
- return ERROR_COMMAND_SYNTAX_ERROR;
- }
-
- at91sam7_old_info = bank->driver_priv;
-
- if (bank->target->state != TARGET_HALTED)
- {
- LOG_ERROR("target has to be halted to perform flash operation");
- return ERROR_TARGET_NOT_HALTED;
- }
-
- if (at91sam7_old_info->cidr == 0)
- {
- retval = at91sam7_old_read_part_info(bank);
- if (retval != ERROR_OK) {
- return retval;
- }
- }
-
- if ((bit<0) || (at91sam7_old_info->num_nvmbits <= bit))
- {
- command_print(cmd_ctx, "gpnvm bit '#%s' is out of bounds for target %s", args[1],at91sam7_old_info->target_name);
- return ERROR_OK;
- }
-
- /* Configure the flash controller timing */
- at91sam7_old_read_clock_info(bank);
- at91sam7_old_set_flash_mode(bank, 0, FMR_TIMING_NVBITS_old);
-
- if (at91sam7_old_flash_command(bank, 0, flashcmd, (u16)(bit)) != ERROR_OK)
- {
- return ERROR_FLASH_OPERATION_FAILED;
- }
-
- status = at91sam7_old_get_flash_status(bank, 0);
- LOG_DEBUG("at91sam7_handle_gpnvm_command: cmd 0x%x, value 0x%x, status 0x%x \n",flashcmd,bit,status);
- at91sam7_old_info->nvmbits = (status>>8)&((1<<at91sam7_old_info->num_nvmbits)-1);
-
- return ERROR_OK;
-}
diff --git a/src/flash/at91sam7_old.h b/src/flash/at91sam7_old.h
deleted file mode 100644
index 75c881c2..00000000
--- a/src/flash/at91sam7_old.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2006 by Magnus Lundin *
- * lundin@mlu.mine.nu *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-#ifndef AT91SAM7_OLD_H
-#define AT91SAM7_OLD_H
-
-#include "flash.h"
-#include "target.h"
-
-typedef struct at91sam7_old_flash_bank_s
-{
- u32 working_area;
- u32 working_area_size;
-
- /* chip id register */
- u32 cidr;
- u16 cidr_ext;
- u16 cidr_nvptyp;
- u16 cidr_arch;
- u16 cidr_sramsiz;
- u16 cidr_nvpsiz;
- u16 cidr_nvpsiz2;
- u16 cidr_eproc;
- u16 cidr_version;
- char * target_name;
-
- /* flash geometry */
- u16 num_pages;
- u16 pagesize;
- u16 pages_in_lockregion;
- u8 num_erase_regions;
- u8 num_planes;
- u32 *erase_region_info;
-
- /* nv memory bits */
- u16 num_lockbits;
- u16 lockbits[4];
- u16 num_nvmbits;
- u16 nvmbits;
- u8 securitybit;
- u8 flashmode[4]; /* 0: not init, 1: fmcn for nvbits (1uS), 2: fmcn for flash (1.5uS) */
-
- /* main clock status */
- u8 mck_valid;
- u32 mck_freq;
-
-} at91sam7_old_flash_bank_t;
-
-/* AT91SAM7 control registers */
-#define DBGU_CIDR_old 0xFFFFF240
-#define CKGR_MCFR_old 0xFFFFFC24
-#define CKGR_MCFR_MAINRDY_old 0x10000
-#define CKGR_PLLR_old 0xFFFFFC2c
-#define CKGR_PLLR_DIV_old 0xff
-#define CKGR_PLLR_MUL_old 0x07ff0000
-#define PMC_MCKR_old 0xFFFFFC30
-#define PMC_MCKR_CSS_old 0x03
-#define PMC_MCKR_PRES_old 0x1c
-
-/* Flash Controller Commands */
-#define WP_old 0x01
-#define SLB_old 0x02
-#define WPL_old 0x03
-#define CLB_old 0x04
-#define EA_old 0x08
-#define SGPB_old 0x0B
-#define CGPB_old 0x0D
-#define SSB_old 0x0F
-
-/* MC_FSR bit definitions */
-#define MC_FSR_FRDY_old 1
-#define MC_FSR_EOL_old 2
-
-/* AT91SAM7 constants */
-#define RC_FREQ_old 32000
-
-/* FLASH_TIMING_MODES */
-#define FMR_TIMING_NONE_old 0
-#define FMR_TIMING_NVBITS_old 1
-#define FMR_TIMING_FLASH_old 2
-
-#endif /* AT91SAM7_OLD_H */
diff --git a/src/flash/flash.c b/src/flash/flash.c
index 2857ff6d..a23cbb9f 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -65,7 +65,6 @@ static int handle_flash_protect_command(struct command_context_s *cmd_ctx, char
extern flash_driver_t lpc2000_flash;
extern flash_driver_t cfi_flash;
extern flash_driver_t at91sam7_flash;
-extern flash_driver_t at91sam7_old_flash;
extern flash_driver_t str7x_flash;
extern flash_driver_t str9x_flash;
extern flash_driver_t aduc702x_flash;
@@ -83,7 +82,6 @@ flash_driver_t *flash_drivers[] = {
&lpc2000_flash,
&cfi_flash,
&at91sam7_flash,
- &at91sam7_old_flash,
&str7x_flash,
&str9x_flash,
&aduc702x_flash,
50 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630