2 * flash.h - header file for the low level flash handling
4 * author: hackbard@hackdaworld.org
20 #define FLASH_BANK0 0x80000000
21 #define FLASH_BANK2 0x82000000
22 #define FLASH_SIZE 0x00100000
24 /* cmd addresses (shifted to left!) */
25 #define FLASH_B0F555 (*((volatile unsigned short *)(FLASH_BANK0|0xaaa)))
26 #define FLASH_B0F2AA (*((volatile unsigned short *)(FLASH_BANK0|0x554)))
27 #define FLASH_B0F (*((volatile unsigned short *)(FLASH_BANK0)))
28 #define FLASH_B2F555 (*((volatile unsigned short *)(FLASH_BANK2|0xaaa)))
29 #define FLASH_B2F2AA (*((volatile unsigned short *)(FLASH_BANK2|0x554)))
30 #define FLASH_B2F (*((volatile unsigned short *)(FLASH_BANK2)))
36 void flash_init(void);
37 void flash_reset(u8 bank);
38 void flash_sector_erase(u8 flash,u8 sector);
39 int flash_sec_erase(u32 addr);
40 void flash_chip_erase(u8 bank);
41 void flash_unlock_bypass(u8 bank);
42 void flash_unlock_bypass_reset(u8 bank);
43 int flash_write_word(u32 addr,u16 data);
44 int flash_write_buf(u32 addr,u16 *buf,int len);
45 void flash_read_buf(u32 addr,u16 *buf,int len);