- added svn props for newly added files
[openocd.git] / src / flash / ocl / at91sam7x / samflash.h
1 /***************************************************************************
2 * Copyright (C) 2007 by Pavel Chromy *
3 * chromy@asix.cz *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifndef samflashH
21 #define samflashH
22
23 #include "platform.h"
24
25 #define FLASH_AREA_ADDR 0x100000
26
27 #define FLASH_STAT_OK 0
28 #define FLASH_STAT_PROGE 1
29 #define FLASH_STAT_LOCKE 2
30 #define FLASH_STAT_VERIFE 3
31 #define FLASH_STAT_INITE 4
32
33 extern unsigned int flash_page_count;
34 extern unsigned int flash_page_size; /* words */
35
36 /* detect chip and set loader parameters */
37 extern int flash_init(void);
38
39 /* program single flash page */
40 extern int flash_page_program(uint32 *data, int page_num);
41
42 /* erase whole chip */
43 extern int flash_erase_all(void);
44
45 /* verify written data */
46 extern int flash_verify(uint32 adr, unsigned int len, uint8 *src);
47
48 #endif