partition_define_tlc.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (C) 2015 MediaTek Inc.
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef __PARTITION_DEFINE_H__
  14. #define __PARTITION_DEFINE_H__
  15. #define KB (1024)
  16. #define MB (1024 * KB)
  17. #define GB (1024 * MB)
  18. #define PART_PRELOADER "PRELOADER"
  19. #define PART_PRO_INFO "PRO_INFO"
  20. #define PART_NVRAM "NVRAM"
  21. #define PART_PROTECT_F "PROTECT_F"
  22. #define PART_PROTECT_S "PROTECT_S"
  23. #define PART_SECCFG "SECCFG"
  24. #define PART_UBOOT "UBOOT"
  25. #define PART_BOOTIMG "BOOTIMG"
  26. #define PART_RECOVERY "RECOVERY"
  27. #define PART_SEC_RO "SEC_RO"
  28. #define PART_MISC "MISC"
  29. #define PART_FRP "FRP"
  30. #define PART_LOGO "LOGO"
  31. #define PART_EXPDB "EXPDB"
  32. #define PART_FAT "FAT"
  33. #define PART_ANDROID "ANDROID"
  34. #define PART_CACHE "CACHE"
  35. #define PART_NVDATA "NVDATA"
  36. #define PART_USRDATA "USRDATA"
  37. #define PART_BMTPOOL "BMTPOOL"
  38. /*preloader re-name*/
  39. #define PART_SECURE "SECURE"
  40. #define PART_SECSTATIC "SECSTATIC"
  41. #define PART_ANDSYSIMG "ANDSYSIMG"
  42. #define PART_USER "USER"
  43. /*Uboot re-name*/
  44. #define PART_APANIC "APANIC"
  45. #define PART_FLAG_NONE 0
  46. #define PART_FLAG_LEFT 0x1
  47. #define PART_FLAG_END 0x2
  48. #define PART_MAGIC 0x58881688
  49. #if defined(CONFIG_MTK_MLC_NAND_SUPPORT)
  50. #define PART_SIZE_BMTPOOL (168*1024*1024)
  51. #else
  52. #define PART_SIZE_BMTPOOL (14*1024*1024)
  53. #endif
  54. #if 0
  55. #ifdef CONFIG_MTK_EMMC_SUPPORT
  56. #define PART_SIZE_SECCFG (128*KB)
  57. #define PART_OFFSET_SECCFG (0x2900000)
  58. #define PART_SIZE_SEC_RO (256*KB)
  59. #define PART_OFFSET_SEC_RO (0x3780000)
  60. #else
  61. #define PART_SIZE_SECCFG (256*KB)
  62. #define PART_OFFSET_SECCFG (0xb00000)
  63. #define PART_SIZE_SEC_RO (256*KB)
  64. #define PART_OFFSET_SEC_RO (0x19c0000)
  65. #endif
  66. #else
  67. #define PART_SIZE_SECCFG 0
  68. #define PART_OFFSET_SECCFG 0
  69. #define PART_SIZE_SEC_RO 0
  70. #define PART_OFFSET_SEC_RO 0
  71. #endif
  72. #ifndef RAND_START_ADDR
  73. #define RAND_START_ADDR 0
  74. #endif
  75. #define PART_MAX_COUNT 40
  76. #define WRITE_SIZE_Byte (16*1024)
  77. typedef enum {
  78. EMMC = 1,
  79. NAND = 2,
  80. } dev_type;
  81. typedef enum {
  82. USER = 0,
  83. BOOT_1,
  84. BOOT_2,
  85. RPMB,
  86. GP_1,
  87. GP_2,
  88. GP_3,
  89. GP_4,
  90. } Region;
  91. struct excel_info {
  92. char *name;
  93. unsigned long long size;
  94. unsigned long long start_address;
  95. dev_type type;
  96. unsigned int partition_idx;
  97. Region region;
  98. };
  99. extern struct excel_info PartInfo[PART_MAX_COUNT];
  100. #else
  101. extern int get_part_num_nand(void);
  102. #define PART_NUM get_part_num_nand()
  103. #endif