text: #ifndef _PMT_H
  #define _PMT_H
  
  #define MAX_PARTITION_NAME_LEN 64
  #define PART_MAX_COUNT    20
  
  #ifdef MTK_EMMC_SUPPORT
  
  typedef struct
  {
      unsigned char name[MAX_PARTITION_NAME_LEN];     /* partition name */
      unsigned long long size;     						/* partition size */	
      unsigned long long offset;       					/* partition start */
      unsigned long long mask_flags;       				/* partition flags */
  
  } pt_resident;
  
  typedef struct 
  {
      unsigned char name[MAX_PARTITION_NAME_LEN];     /* partition name */
      unsigned long  size;     						/* partition size */	
      unsigned long  offset;       					/* partition start */
      unsigned long mask_flags;       				/* partition flags */
  
  } pt_resident32;
  #else
  typedef struct
  {
      unsigned char name[MAX_PARTITION_NAME_LEN];     /* partition name */
      unsigned long size;     						/* partition size */	
      unsigned long offset;       					/* partition start */
      unsigned long mask_flags;       				/* partition flags */
  
  } pt_resident;
  #endif
  
  #define DM_ERR_OK 0
  #define DM_ERR_NO_VALID_TABLE 9
  #define DM_ERR_NO_SPACE_FOUND 10
  #define ERR_NO_EXIST  1
  
  //Sequnce number
  
  //for temp test
  //#define PT_LOCATION          4090      // (4096-80)
  //#define MPT_LOCATION        4091            // (4096-81)
  #define PT_SIG      0x50547631            //"PTv1"
  #define MPT_SIG    0x4D505431           //"MPT1"
  #define PT_SIG_SIZE 4
  #define is_valid_mpt(buf) ((*(u32 *)(buf))==MPT_SIG)
  #define is_valid_pt(buf) ((*(u32 *)(buf))==PT_SIG)
  #define RETRY_TIMES 5
  
  
  typedef struct _DM_PARTITION_INFO
  {
      char part_name[MAX_PARTITION_NAME_LEN];             /* the name of partition */
      unsigned int start_addr;                                  /* the start address of partition */
      unsigned int part_len;                                    /* the length of partition */
      unsigned char part_visibility;                              /* part_visibility is 0: this partition is hidden and CANNOT download */
                                                          /* part_visibility is 1: this partition is visible and can download */                                            
      unsigned char dl_selected;                                  /* dl_selected is 0: this partition is NOT selected to download */
                                                          /* dl_selected is 1: this partition is selected to download */
  } DM_PARTITION_INFO;
  
  typedef struct {
      unsigned int pattern;
      unsigned int part_num;                              /* The actual number of partitions */
      DM_PARTITION_INFO part_info[PART_MAX_COUNT];
  } DM_PARTITION_INFO_PACKET;
  
  typedef struct {
  	int sequencenumber:8;
  	int tool_or_sd_update:8;
  	int mirror_pt_dl:4;   //mirror download OK
  	int mirror_pt_has_space:4;
  	int pt_changed:4;
  	int pt_has_space:4;
  } pt_info;
  
  
  #endif
  