yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | #ifndef UPI_IMG_INTERFACE_H |
| 2 | #define UPI_IMG_INTERFACE_H |
| 3 | |
| 4 | |
| 5 | |
| 6 | typedef struct { |
| 7 | unsigned int mtd_totalsize; // mtd device total size |
| 8 | unsigned int mtd_pageperblock; // mtd device page per block |
| 9 | unsigned int mtd_blocksize; // mtd device block size |
| 10 | unsigned int mtd_pagesize; // mtd device page size |
| 11 | unsigned int mtd_oobsize; // mtd device oob size |
| 12 | // char mtd_path[256]; // mtd path |
| 13 | int parti_file_desc; // partition update file description |
| 14 | }partition_mtd_info_t; |
| 15 | |
| 16 | #if 0 |
| 17 | int ZXIC_GetBlockSize(partition_mtd_info_t *mtd_info, int *block_size); |
| 18 | int ZXIC_GetFiledesc(partition_mtd_info_t *mtd_info, int *fd_dst); |
| 19 | #endif |
| 20 | |
| 21 | int ZXIC_ReadImage(partition_mtd_info_t *mtd_info, unsigned char *buffer, int start_address, int size); |
| 22 | int ZXIC_WriteBlock(partition_mtd_info_t *mtd_info, int start_address, unsigned char *buffer); |
| 23 | unsigned long translateToGoodAddress(partition_mtd_info_t *mtd_info, unsigned long dwBlockAddress, int *badnum); |
| 24 | |
| 25 | |
| 26 | |
| 27 | int ZXIC_ReadImageSeg( |
| 28 | partition_mtd_info_t *mtd_info, |
| 29 | unsigned char *buffer, |
| 30 | int start_address, |
| 31 | int stop_address, |
| 32 | int index, |
| 33 | int size) ; |
| 34 | |
| 35 | |
| 36 | int ZXIC_WriteBlockSeg( |
| 37 | partition_mtd_info_t *mtd_info, |
| 38 | int start_address, |
| 39 | int stop_address, |
| 40 | int index, |
| 41 | unsigned char *buffer, |
| 42 | int size); |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | #endif /*UPI_IMG_INTERFACE_H*/ |
| 50 | |