4 Copyright (c) 2005 Broadcom Corporation
6 No portions of this material may be reproduced in any form without the
10 Irvine, California 92619
11 All information contained in this document is Broadcom Corporation
12 company private, proprietary, and trade secret.
16 /***************************************************************************
17 * File Name : flash_api.h
19 * Description: This file contains definitions and prototypes for a public
20 * flash device interface and an internal flash device interface.
21 ***************************************************************************/
23 #if !defined(_FLASH_API_H)
30 /* Flash definitions. */
31 #define FLASH_API_OK 1
32 #define FLASH_API_ERROR -1
34 /* Public Interface Prototypes. */
36 int flash_sector_erase_int(unsigned short sector);
37 int flash_read_buf(unsigned short sector, int offset, unsigned char *buffer,
39 int flash_write_buf(unsigned short sector, int offset, unsigned char *buffer,
41 int flash_get_numsectors(void);
42 int flash_get_sector_size(unsigned short sector);
43 unsigned char *flash_get_memptr(unsigned short sector);
44 int flash_get_blk(int addr);
45 int flash_get_total_size(void);
46 int flash_get_total_memory_mapped_size(void);
49 /* Internal Flash Device Driver Information. */
50 typedef struct flash_device_info_s
52 unsigned short flash_device_id;
53 char flash_device_name[30];
55 int (*fn_flash_sector_erase_int) (unsigned short sector);
56 int (*fn_flash_read_buf) (unsigned short sector, int offset,
57 unsigned char *buffer, int numbytes);
58 int (*fn_flash_write_buf) (unsigned short sector, int offset,
59 unsigned char *buffer, int numbytes);
60 int (*fn_flash_get_numsectors) (void);
61 int (*fn_flash_get_sector_size) (unsigned short sector);
62 unsigned char * (*fn_flash_get_memptr) (unsigned short sector);
63 int (*fn_flash_get_blk) (int addr);
64 int (*fn_flash_get_total_size) (void);
65 int (*fn_flash_get_total_memory_mapped_size) (void);
66 } flash_device_info_t;
72 #endif /* _FLASH_API_H */