2 * OpenBIOS - free your system!
3 * ( firmware/flash device driver for Linux )
5 * flashchips.h - flash device structures.
7 * This program is part of a free implementation of the IEEE 1275-1994
8 * Standard for Boot (Initialization Configuration) Firmware.
10 * Copyright (C) 1998-2004 Stefan Reinauer, <stepan@openbios.org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; version 2 of the License.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
29 * bit 0 = needs erase before write (f_needs_erase)
30 * bit 1-3 flash manu type
31 * bit 4-6 probably needed for more manu
32 * bit 7 = sector erase happens one sector at a time
33 * (f_slow_sector_erase)
36 #define f_needs_erase 0x01
38 /* 3 bit for flashtype */
39 #define f_manuf_compl 0x0e /* Mask out bits 1-3 */
40 #define f_intel_compl 0x02 /* 001 */
41 #define f_atmel_compl 0x04 /* 010 */
42 #define f_fwh_compl 0x08 /* 100 */
44 #define f_slow_sector_erase 0x80
46 #define FLASH_UNKNOWN 0
50 typedef struct flashdevice {
52 unsigned long physical;
54 unsigned int flashnum, manufnum;
56 unsigned int size, sectors;
59 int open_mode, open_cnt;
62 typedef struct flashchip {
66 unsigned int size; /* KBytes */
67 unsigned int supported;
68 unsigned int pagesize; /* Bytes */
70 unsigned int *sectors; /* Kbytes[] including end of last sector */
73 typedef struct manufacturer {
78 extern unsigned int currflash;
79 extern flashdevice_t flashdevices[BIOS_MAXDEV];
80 extern const flashchip_t flashchips[];
81 extern const manufacturer_t manufacturers[];