import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / tpw8127_c_mlc / common / partition_define.h
1 #ifndef __PARTITION_DEFINE_H__
2 #define __PARTITION_DEFINE_H__
3
4
5
6
7 #define KB (1024ULL)
8 #define MB (1024 * KB)
9 #define GB (1024 * MB)
10
11 #define PART_PRELOADER "PRELOADER"
12 #define PART_MBR "MBR"
13 #define PART_EBR1 "EBR1"
14 #define PART_PRO_INFO "PRO_INFO"
15 #define PART_NVRAM "NVRAM"
16 #define PART_PROTECT_F "PROTECT_F"
17 #define PART_PROTECT_S "PROTECT_S"
18 #define PART_SECCFG "SECCFG"
19 #define PART_UBOOT "UBOOT"
20 #define PART_BOOTIMG "BOOTIMG"
21 #define PART_RECOVERY "RECOVERY"
22 #define PART_SEC_RO "SEC_RO"
23 #define PART_MISC "MISC"
24 #define PART_LOGO "LOGO"
25 #define PART_EBR2 "EBR2"
26 #define PART_EXPDB "EXPDB"
27 #define PART_TEE1 "TEE1"
28 #define PART_TEE2 "TEE2"
29 #define PART_KB "KB"
30 #define PART_DKB "DKB"
31 #define PART_ANDROID "ANDROID"
32 #define PART_CACHE "CACHE"
33 #define PART_USRDATA "USRDATA"
34 #define PART_FAT "FAT"
35 #define PART_BMTPOOL "BMTPOOL"
36 /*preloader re-name*/
37 #define PART_SECURE "SECURE"
38 #define PART_SECSTATIC "SECSTATIC"
39 #define PART_ANDSYSIMG "ANDSYSIMG"
40 #define PART_USER "USER"
41 /*Uboot re-name*/
42 #define PART_APANIC "APANIC"
43
44 #define PART_FLAG_NONE 0
45 #define PART_FLAG_LEFT 0x1
46 #define PART_FLAG_END 0x2
47 #define PART_MAGIC 0x58881688
48
49 #define PART_SIZE_PRELOADER (256*KB)
50 #define PART_SIZE_MBR (512*KB)
51 #define PART_SIZE_EBR1 (512*KB)
52 #define PART_SIZE_PRO_INFO (3072*KB)
53 #define PART_SIZE_NVRAM (5120*KB)
54 #define PART_SIZE_PROTECT_F (10240*KB)
55 #define PART_SIZE_PROTECT_S (10240*KB)
56 #define PART_SIZE_SECCFG (128*KB)
57 #define PART_OFFSET_SECCFG (0x1d00000)
58 #define PART_SIZE_UBOOT (384*KB)
59 #define PART_SIZE_BOOTIMG (16384*KB)
60 #define PART_SIZE_RECOVERY (16384*KB)
61 #define PART_SIZE_SEC_RO (6144*KB)
62 #define PART_OFFSET_SEC_RO (0x3d80000)
63 #define PART_SIZE_MISC (512*KB)
64 #define PART_SIZE_LOGO (3072*KB)
65 #define PART_SIZE_EBR2 (512*KB)
66 #define PART_SIZE_EXPDB (10240*KB)
67 #define PART_SIZE_TEE1 (5120*KB)
68 #define PART_SIZE_TEE2 (5120*KB)
69 #define PART_SIZE_KB (1024*KB)
70 #define PART_SIZE_DKB (1024*KB)
71 #define PART_SIZE_ANDROID (1048576*KB)
72 #define PART_SIZE_CACHE (129024*KB)
73 #define PART_SIZE_USRDATA (2097152*KB)
74 #define PART_SIZE_FAT (0*KB)
75 #define PART_SIZE_BMTPOOL (0)//(0xa8)
76
77 #ifdef CONFIG_MTK_EMMC_SUPPORT
78 #define PART_NUM 25
79 #else
80 extern int get_part_num_nand();
81
82 #define PART_NUM get_part_num_nand()
83 #endif
84
85
86
87 #define PART_MAX_COUNT 40
88
89 #define MBR_START_ADDRESS_BYTE (20480*KB)
90
91 #define WRITE_SIZE_Byte 512
92 typedef enum {
93 EMMC = 1,
94 NAND = 2,
95 } dev_type;
96
97 #ifdef CONFIG_MTK_EMMC_SUPPORT
98 typedef enum {
99 EMMC_PART_UNKNOWN=0
100 ,EMMC_PART_BOOT1
101 ,EMMC_PART_BOOT2
102 ,EMMC_PART_RPMB
103 ,EMMC_PART_GP1
104 ,EMMC_PART_GP2
105 ,EMMC_PART_GP3
106 ,EMMC_PART_GP4
107 ,EMMC_PART_USER
108 ,EMMC_PART_END
109 } Region;
110 #else
111 typedef enum {
112 NAND_PART_UNKNOWN=0
113 ,NAND_PART_USER
114 } Region;
115 #endif
116 struct excel_info{
117 char * name;
118 unsigned long long size;
119 unsigned long long start_address;
120 dev_type type ;
121 unsigned int partition_idx;
122 Region region;
123 };
124
125 #ifdef CONFIG_MTK_EMMC_SUPPORT
126 /*MBR or EBR struct*/
127 #define SLOT_PER_MBR 4
128 #define MBR_COUNT 8
129
130 struct MBR_EBR_struct{
131 char part_name[8];
132 int part_index[SLOT_PER_MBR];
133 };
134
135 extern struct MBR_EBR_struct MBR_EBR_px[MBR_COUNT];
136 #endif
137 extern struct excel_info PartInfo[PART_MAX_COUNT];
138
139
140 #endif