- Remove all of the annoying $Id strings
[coreboot.git] / src / mainboard / motorola / sandpoint / flash.h
1 /* Copyright 2000  AG Electronics Ltd. */
2 /* This code is distributed without warranty under the GPL v2 (see COPYING) */
3
4 #ifndef _FLASH_H
5 #define _FLASH_H
6
7 struct flash_device;
8
9 typedef struct flash_fn
10 {
11     const char *(* identify)(struct flash_device *flash);
12     void *(* ptr)(void *data);
13     int (* erase_all)(void *data);
14     int (* erase)(void *data, unsigned offset, unsigned length);
15     int (* program)(void *data, unsigned offset, const void *source, unsigned length);    
16     uint8_t ( *read_byte)(void *data, unsigned offset);
17 } flash_fn;
18
19 typedef struct flash_device
20 {
21     const flash_fn *fn;
22     char *tag;
23     void *data;
24     unsigned long base;
25     unsigned size;
26     unsigned erase_size;
27     unsigned store_size;
28     struct flash_device *next;
29 } flash_device;
30
31 int register_flash_device(const flash_fn *fn, char *tag, void *data);
32 flash_device *find_flash_device(const char *tag);
33 int init_flash_amd800(char *tag, unsigned base, unsigned spacing);
34
35 #endif