Merge tag 'v3.10.55' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / tpw8127_tb_c_l / 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 (0xa8)
76
77
78 #define PART_NUM 25
79
80
81
82 #define PART_MAX_COUNT 40
83
84 #define MBR_START_ADDRESS_BYTE (20480*KB)
85
86 #define WRITE_SIZE_Byte 512
87 typedef enum {
88 EMMC = 1,
89 NAND = 2,
90 } dev_type;
91
92 #ifdef CONFIG_MTK_EMMC_SUPPORT
93 typedef enum {
94 EMMC_PART_UNKNOWN=0
95 ,EMMC_PART_BOOT1
96 ,EMMC_PART_BOOT2
97 ,EMMC_PART_RPMB
98 ,EMMC_PART_GP1
99 ,EMMC_PART_GP2
100 ,EMMC_PART_GP3
101 ,EMMC_PART_GP4
102 ,EMMC_PART_USER
103 ,EMMC_PART_END
104 } Region;
105 #else
106 typedef enum {
107 NAND_PART_UNKNOWN=0
108 ,NAND_PART_USER
109 } Region;
110 #endif
111 struct excel_info{
112 char * name;
113 unsigned long long size;
114 unsigned long long start_address;
115 dev_type type ;
116 unsigned int partition_idx;
117 Region region;
118 };
119
120 #ifdef CONFIG_MTK_EMMC_SUPPORT
121 /*MBR or EBR struct*/
122 #define SLOT_PER_MBR 4
123 #define MBR_COUNT 8
124
125 struct MBR_EBR_struct{
126 char part_name[8];
127 int part_index[SLOT_PER_MBR];
128 };
129
130 extern struct MBR_EBR_struct MBR_EBR_px[MBR_COUNT];
131 #endif
132 extern struct excel_info *PartInfo;
133
134
135 #endif