blob: 2a0ea674d9a793d495843d81a49c2a538cf665d3 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001#ifndef UPI_IMG_INTERFACE_H
2#define UPI_IMG_INTERFACE_H
3
4
5
6typedef 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
17int ZXIC_GetBlockSize(partition_mtd_info_t *mtd_info, int *block_size);
18int ZXIC_GetFiledesc(partition_mtd_info_t *mtd_info, int *fd_dst);
19#endif
20
21int ZXIC_ReadImage(partition_mtd_info_t *mtd_info, unsigned char *buffer, int start_address, int size);
22int ZXIC_WriteBlock(partition_mtd_info_t *mtd_info, int start_address, unsigned char *buffer);
23unsigned long translateToGoodAddress(partition_mtd_info_t *mtd_info, unsigned long dwBlockAddress, int *badnum);
24
25
26
27int 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
36int 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