1 /***************************************************************************
2 * Copyright (C) 2007 by Pavel Chromy *
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. *
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. *
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 ***************************************************************************/
25 #define FLASH_AREA_ADDR 0x100000
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
33 extern unsigned int flash_page_count;
34 extern unsigned int flash_page_size; /* words */
36 /* detect chip and set loader parameters */
37 extern int flash_init(void);
39 /* program single flash page */
40 extern int flash_page_program(uint32 *data, int page_num);
42 /* erase whole chip */
43 extern int flash_erase_all(void);
45 /* verify written data */
46 extern int flash_verify(uint32 adr, unsigned int len, uint8 *src);