From: Erik M. <er...@us...> - 2001-10-15 21:52:12
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv19896/include/blob Modified Files: flash.h Log Message: First cleanup of the flash code Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/flash.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- flash.h 2001/10/07 15:27:35 1.2 +++ flash.h 2001/10/15 21:52:09 1.3 @@ -36,6 +36,30 @@ #include <blob/types.h> +typedef struct { + u32 size; + u32 num; + int lockable; +} flash_descriptor_t; + +/* should be filled out by the architecture dependent files */ +extern flash_descriptor_t flash_descriptors[]; + +/* should be provided by the architecture dependent files */ +int erase_flash(u32 *addr); +int write_flash(u32 *dst, const u32* src); + +/* flash data mangle functions */ +u32 data_from_flash(u32 what); +u32 data_to_flash(u32 what); + +/* exported functions */ +int flash_erase_region(u32 *start, u32 nwords); +int flash_write_region(u32 *dst, const u32 *src, u32 nwords); + + +/* -------- OLD ---------------------------------------------------- */ + #define NUM_FLASH_BLOCKS (31) #define FLASH_BLOCK_BASE ((u32 *) 0x020000) #define FLASH_BLOCK_SIZE ((u32) 0x020000) @@ -106,23 +130,9 @@ #define INITRD_LEN (NUM_INITRD_BLOCKS * MAIN_BLOCK_SIZE) #endif -typedef struct { - u32 signature; - char name[BLOCK_NAME_LEN]; - tBlockType type; - u32 seqNum, totSeq; - u32 bytesInBlock; - u32 defLoadAddr; -} tBlkHdr; - -typedef struct { - tBlkHdr headers[NUM_FLASH_BLOCKS]; - u8 firstBlockIndex[NUM_FLASH_BLOCKS]; -} tBlkInfo; -void ScanFlash(tBlkInfo *blocksInfo); -void LoadBlocksToMem(tBlkInfo *blocksInfo, u8 which, u32 *baseAddr); void EraseBlocks(tBlockType which); void WriteBlocksFromMem(tBlockType type, const u32 *source, int length); + #endif |