4 #include "partition_define.h"
6 //mt6516_partition.h has defination
7 //mt6516_download.h define again, both is 20
9 #define MAX_PARTITION_NAME_LEN 64
10 #ifdef CONFIG_MTK_EMMC_SUPPORT
14 char name
[MAX_PARTITION_NAME_LEN
]; /* partition name */
15 unsigned long long size
; /* partition size */
16 unsigned long long part_id
; /* partition region */
17 unsigned long long offset
; /* partition start */
18 unsigned long long mask_flags
; /* partition flags */
24 char name
[MAX_PARTITION_NAME_LEN
]; /* partition name */
25 unsigned long size
; /* partition size */
26 unsigned long offset
; /* partition start */
27 unsigned long mask_flags
; /* partition flags */
34 char name
[MAX_PARTITION_NAME_LEN
]; /* partition name */
35 unsigned long long size
; /* partition size */
36 unsigned long long part_id
; /* partition region */
37 unsigned long long offset
; /* partition start */
38 unsigned long long mask_flags
; /* partition flags */
45 #define DM_ERR_NO_VALID_TABLE 9
46 #define DM_ERR_NO_SPACE_FOUND 10
47 #define ERR_NO_EXIST 1
52 //#define PT_LOCATION 4090 // (4096-80)
53 //#define MPT_LOCATION 4091 // (4096-81)
54 #define PT_SIG 0x50547633 //"PTv3"
55 #define MPT_SIG 0x4D505433 //"MPT3"
57 //#define is_valid_mpt(buf) ((*(unsigned int *)(buf))==MPT_SIG)
58 //#define is_valid_pt(buf) ((*(unsigned int *)(buf))==PT_SIG)
59 #define is_valid_pt(buf) (!memcmp(buf, "3vTP", 4))
60 #define is_valid_mpt(buf) (!memcmp(buf, "3TPM", 4))
64 typedef struct _DM_PARTITION_INFO
66 char part_name
[MAX_PARTITION_NAME_LEN
]; /* the name of partition */
67 unsigned long long start_addr
; /* the start address of partition */
68 unsigned long long part_len
; /* the length of partition */
69 unsigned char part_visibility
; /* part_visibility is 0: this partition is hidden and CANNOT download */
70 /* part_visibility is 1: this partition is visible and can download */
71 unsigned char dl_selected
; /* dl_selected is 0: this partition is NOT selected to download */
72 /* dl_selected is 1: this partition is selected to download */
77 unsigned int part_num
; /* The actual number of partitions */
78 DM_PARTITION_INFO part_info
[PART_MAX_COUNT
];
79 } DM_PARTITION_INFO_PACKET
;
83 int tool_or_sd_update
:8;
84 int mirror_pt_dl
:4; //mirror download OK
85 int mirror_pt_has_space
:4;