Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / cmnos / sflash_api.h
1 #ifndef __SFLASH_API_H__
2 #define __SFLASH_API_H__
3
4 /* Constant definition */
5 #define ZM_SFLASH_SECTOR_ERASE          1
6 #define ZM_SFLASH_BLOCK_ERASE           2
7 #define ZM_SFLASH_CHIP_ERASE            0
8
9 /*!- interface of eeprom access
10  *
11  */
12 struct sflash_api {
13     /* Indispensable functions */
14     void (* _sflash_init)(void);
15     void (* _sflash_erase)(A_UINT32 erase_type, A_UINT32 addr);             /* 1. erase_type : chip/block/sector, 2. addr : no use for chip erase */
16     void (* _sflash_program)(A_UINT32 addr, A_UINT32 len, A_UINT8 *buf);    /* 1. addr : spi flash address(start from 0x0), 2. len : bite number to write , 3. *buf : source memory address */
17     void (* _sflash_read)(A_UINT32 fast, A_UINT32 addr, A_UINT32 len, A_UINT8 *buf);    /* 1. fast : 1 for fast read, 0 for read, 2. addr : spi flash address(start from 0x0), 3. len : bite number to read , 3. *buf : destination memory address */
18
19     /* Dispensable functions */
20     A_UINT32 (* _sflash_rdsr)(void); /* return the value of status register */
21 };
22
23 #endif /* __SFLASH_API_H__ */
24