2 * (C) Copyright 2000-2005
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 /*-----------------------------------------------------------------------
29 * FLASH Info: contains chip specific data, per FLASH bank
33 ulong size; /* total bank size in bytes */
34 ulong sector_size; /* size of erase unit in bytes */
35 ushort sector_count; /* number of erase units */
36 ulong flash_id; /* combined device & manufacturer code */
37 ulong start[CFG_MAX_FLASH_SECT]; /* physical sector start addresses */
42 extern unsigned long flash_init (void);
43 extern int flash_erase(flash_info_t *, int, int);
44 extern int flash_sect_erase(ulong addr_first, ulong addr_last);
47 extern int flash_write(char *, ulong, ulong);
48 extern flash_info_t *addr2info(ulong);
49 extern int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt);
51 /*-----------------------------------------------------------------------
52 * return codes from flash_write():
56 #define ERR_NOT_ERASED 2
57 #define ERR_PROTECTED 4
60 #define ERR_UNKNOWN_FLASH_VENDOR 32
61 #define ERR_UNKNOWN_FLASH_TYPE 64
62 #define ERR_PROG_ERROR 128
64 /*-----------------------------------------------------------------------
67 #define FLASH_CUSTOM 0x1111
68 #define FLASH_UNKNOWN 0xFFFF /* unknown flash type */
70 #endif /* !CFG_NO_FLASH */
72 #endif /* _FLASH_H_ */