custom_FeatureConfig.h 21.8 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2008
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 *   custom_FeatureConfig.h
 *
 * Project:
 * --------
 *   Maui_Software
 *
 * Description:
 * ------------
 *   This Module defines feature-related configurations.
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/

#ifndef __CUSTOM_FEATURECONFIG_H__
#define __CUSTOM_FEATURECONFIG_H__

/*
 ****************************************************************************
 [README , VERY IMPORTANT NOTICE]
 --------------------------------
 After user configured this C header file, not only C compiler compile it but
 also auto-gen tool parse user's configure setting.
 Here are recommend configure convention to make both work fine.

 1. All configurations in this file form as #define MACRO_NAME MACRO_VALUE format.
    Note the #define must be the first non-space character of a line

 2. To disable the optional configurable item. Please use // before #define,
    for example: //#define MEMORY_DEVICE_TYPE

 3. Please don't use #if , #elif , #else , #endif conditional macro key word here.
    Such usage might cause compile result conflict with auto-gen tool parsing result.
    Auto-Gen tool will show error and stop.
    3.1.  any conditional keyword such as #if , #ifdef , #ifndef , #elif , #else detected.
          execpt this #ifndef __CUSTOM_FEATURECONFIG_H__
    3.2.  any duplicated MACRO_NAME parsed. For example auto-gen tool got
          2nd MEMORY_DEVICE_TYPE macro value.
 ****************************************************************************
*/

/*
 ****************************************************************************
 [NOTE]
 --------------------------------
 Add include header files here.
 Please note that the include file path needs to exist in
 custom/bootloader/fota modules under all cases.
 ****************************************************************************
*/
#include "kbd_table.h"
#include "bl_custom.h"
#include "kal_general_types.h"
#include "dcl.h"


/*
 ****************************************************************************
 Part 1: Following definitions are used to configure the VI sizes

         [Makefile option] ZIMAGE_SUPPORT = TRUE
                           BOOT_ZIMAGE_SUPPORT = TRUE
                           ALICE_SUPPORT = TRUE
                           DCM_COMPRESSION_SUPPORT = TRUE

         [Configurations]
         CONFIG_ZIMAGE_MAX_COMPRESSED_SIZE - defines the maximum ROM space allocated
                                             for ZIMAGE compressed binary
         CONFIG_BOOT_ZIMAGE_MAX_COMPRESSED_SIZE - defines the maximum ROM space allocated
                                                  for BOOT_ZIMAGE compressed binary
         CONFIG_ALICE_MAX_COMPRESSED_SIZE - defines the maximum ROM space allocated
                                            for ALICE compressed binary
         CONFIG_DCMP_MAX_COMPRESSED_SIZE - defines the maximum ROM space allocated
                                           for DYNAMICE_COMP_CODE compressed binary

         Not that configurations below only take effect when MBA + ZIMAGE is enable

         CONFIG_LANG_PACK_ROM_DECOMPRESSED_SIZE - defines the maximum RAM space allocated
                                                  for langpack decompressed binary
         CONFIG_LANG_PACK_ROM_MAX_COMPRESSED_SIZE - defines the maximum ROM space allocated
                                                  for langpack compressed binary
         CONFIG_CUSTPACK_ROM_DECOMPRESSED_SIZE - defines the maximum RAM space allocated
                                                  for custpack decompressed binary
         CONFIG_CUSTPACK_ROM_MAX_COMPRESSED_SIZE - defines the maximum ROM space allocated
                                                  for custpack compressed binary

         [VERY IMPORTANT NOTICE]
         =======================
         If the setting is invalid. An auto mechanism will try to calculate valid
         values and replace the settings.

   Low
   +------------------+
   |      ROM         |
   |                  |
   +------------------+
   |     VIVA         |
   |                  |
   +------------------+   <-----  FS_BASE_ADDRESS
   |       FS         |
   |                  |
   +------------------+
   High

   When MBA enable

      Low
   +------------------+
   |      ROM         |
   |                  |
   +------------------+
   |    langpack      |
   |                  |
   +------------------+
   |    custpack      |
   |                  |
   +------------------+
   |      VIVA        |
   |                  |
   +------------------+   <-----  FS_BASE_ADDRESS
   |       FS         |
   |                  |
   +------------------+
   High


 ****************************************************************************
*/
#define CONFIG_ZIMAGE_MAX_COMPRESSED_SIZE 0x00052C00
#define CONFIG_BOOT_ZIMAGE_MAX_COMPRESSED_SIZE 0x00001B80
#define CONFIG_ALICE_MAX_COMPRESSED_SIZE 0x0021E400
#define CONFIG_DCMP_MAX_COMPRESSED_SIZE 0x00024500

#define CONFIG_LANG_PACK_ROM_DECOMPRESSED_SIZE      0x3F800
#define CONFIG_LANG_PACK_ROM_MAX_COMPRESSED_SIZE    0x12000
#define CONFIG_CUSTPACK_ROM_DECOMPRESSED_SIZE       0xA9800
#define CONFIG_CUSTPACK_ROM_MAX_COMPRESSED_SIZE     0x81000

//#define CONFIG_VIVA_VENEER_RESERVE_SIZE_RATIO 0.05
//#define CONFIG_VIVA_MIN_VENEER_RESERVE_SIZE 5120
//#define CONFIG_VIVA_MAX_VENEER_RESERVE_SIZE 102400
/*
 ****************************************************************************
 Part 2: The following definitions are used to configure flash memory arrangement
         for FOTA enabled image.

         [Makefile option] FOTA_ENABLE = FOTA_DM

         [Document] FOTA customization document.doc
         			http://dms.mediatek.inc:80/webtop/drl/objectId/0900006f80126799

         [Configurations]
         CONFIG_FOTA_UE_FLASH_SPACE - the maximum available flash memory size
                                      for update engine image
         CONFIG_FOTA_NAND_MAP_TABLE_SIZE - the maximum mapping table size for update engine
                                           to manage NAND flash image.
         CONFIG_FOTA_PACKAGE_BLOCK_NUMBER - the size of NOR flash area
                                            for update package and update state record
         CONFIG_FOTA_PACKAGE_AREA_SIZE - the size of NAND flash area
                                         for update package and update state record

         [VERY IMPORTANT NOTICE]
         =======================
         CONFIG_FOTA_UE_FLASH_SPACE is used to configure flash memory arrangement
         for FOTA update agent image. It must be the same as that specified in FUE scatter file.
         Otherwise, error may occur during update agent image linking process. Besides,
         these values would be transfered into a block aligned setting, FOTA_UE_FLASH_SPACE_SIZE,
         in custom_img_config.h

         CONFIG_FOTA_PACKAGE_BLOCK_NUMBER and CONFIG_FOTA_PACKAGE_AREA_SIZE are used to
         configure the reserved flash area for update purpose. Without enhanced single bank support,
         the reserved flash space would share the same bank with FAT. Moreover,
         the blocks within the reserved area must have the same size.

         [REMINDER]
         =======================
         The reserved block space is not equal to the available space for update package storage,
         since some flash space is used for management and update status record purpose.

         NOR flash vailable update package storage space:
         ( CONFIG_FOTA_PACKAGE_BLOCK_NUMBER - 2 ) x ( block size - 4KB )

         NAND flash vailable update package storage space:
         ( (CONFIG_FOTA_PACKAGE_AREA_SIZE/block_size) - 2 ) x ( block size - 4KB )

 ****************************************************************************
*/
#define CONFIG_FOTA_UE_FLASH_SPACE        0x60000
#define CONFIG_FOTA_NAND_MAP_TABLE_SIZE   0x800
#define CONFIG_FOTA_PACKAGE_BLOCK_NUMBER  4
#define CONFIG_FOTA_PACKAGE_AREA_SIZE     0x200000


/*
 ****************************************************************************
 Part 3: The following definitions are used to configure flash memory arrangement
         for SDS secure data storage region.

         [Makefile option] SDS_SUPPORT = TRUE

         [Document] Secure_Data_Storage_Introduction_Customer.pptx
                    http://dms.mediatek.inc:80/webtop/drl/objectId/0900006f801671f5

         [Configurations]
         SDS_MAX_SIZE - The the total size of the secure storage.
                        The secure data storage region will be placed behind the file system
                        so that it will not be erased unexpectedly. This max size specifies
                        the size of flash memory that secure storage can occupy.
                        The total size must be multiple of block size.
                        In NAND case, the SDS_MAX_SIZE should be specified by
                        (the size of flash memory that secure storage can occupy +
                         SDS_RESERVED_SIZE_FOR_BBM)
         SDS_RGN_NUM - The number of sub-regions in secure storage region.
         SDS_RESERVED_SIZE_FOR_BBM - The size of reserved blocks used for bad block management
                                     in NAND flash. It should be set as 0 for other types
                                     of flash devices (NOR/S-F/eMMC)

 ****************************************************************************
*/
//#define SDS_MAX_SIZE  	           0x80000
//#define SDS_RGN_NUM 	           2
//#define SDS_RESERVED_SIZE_FOR_BBM  0x0


/*
 ****************************************************************************
 Part 4: The following definitions are used to enable Root Key Management feature on secure chip.

         [Makefile option] N/A

         [Document] N/A

         [Configurations]
         ROOT_KEY_MANAGEMENT_ENABLE - Uncomment this configuration to enable Root Key Management.

         [VERY IMPORTANT NOTICE]
         =======================
         It can only be enabled on SV5 secure chip project.

 ****************************************************************************
*/
//#define ROOT_KEY_MANAGEMENT_ENABLE


/*
 ****************************************************************************
 Part 5: This is an optional step specially for Internal Project ONLY!
         By default, Scatter File will bound CODE BINARY as FS BASE ADDRESS.
         And bound the RAM Limit as Memory Density.
         For specific purpose, users are able to manually configure a smaller
         EXPECTED RAM LIMIT and EXPECTED CODE LIMIT here.

         [Makefile option] N/A

         [Document] N/A

         [Configurations]
         PROJECT_EXPECTED_RAM_LIMIT - Specify expected RAM limit when the physical RAM boundary
                                      is larger than expected.
         PROJECT_EXPECTED_CODE_LIMIT - Specify expected CODE/ROM limit when
                                       the expected ROM boundary is smaller than FS BASE.
         PROJECT_EXPECTED_RAM_LIMIT_NFB - Specify the expected RAM limit when
                                          the physical RAM boundary is larger than expected
                                          on NAND_FLASH_BOOTINIG/EMMC_BOOTING projects.

         [VERY IMPORTANT NOTICE]
         =======================
         Recommend to comment out these configurations and use the default setting.

         PROJECT_EXPECTED_RAM_LIMIT and PROJECT_EXPECTED_CODE_LIMIT are only for
         Generic NOR-XIP configuration.
         For NAND+DRAM case, please set PROJECT_EXPECTED_RAM_LIMIT_NFB as RAM boundary.

         Please note that the manually configured value cannot exceeded physical density
         and cannot overlap with FAT.
         DO NOT set PROJECT_EXPECTED_CODE_LIMIT if the expected CODE/ROM limit is
         the same as FS BASE!!

 ****************************************************************************
*/
//#define PROJECT_EXPECTED_RAM_LIMIT
//#define PROJECT_EXPECTED_CODE_LIMIT
//#define PROJECT_EXPECTED_RAM_LIMIT_NFB


/*
 ****************************************************************************
 Part 6: The following definitions define the upper limit of each binary.

         [Makefile option] NAND_FLASH_BOOTING = ONDEMAND or
                           EMMC_BOOTING = ONDEMAND or
                           FOTA_ENABLE = FOTA_DM or
                           MULTIPLE_BINARY_FILES = TRUE

         [Document] Demand_Paging_User_Guide_V1.2.doc
                    http://dms.mediatek.inc:80/webtop/drl/objectId/0900006f80183188
                    FOTA customization document.doc
         			http://dms.mediatek.inc:80/webtop/drl/objectId/0900006f80126799
         			Multiple Bin Architecture (MBA) Standard Operating Procedure.doc
         			http://dms.mediatek.inc:80/webtop/drl/objectId/0900006f8019993e

         [Configurations]
         MAX_ROM_SIZE - Specify the binary size upper limit of ROM for
                        FOTA/Multi-Bin partial update.
         MAX_SECONDARY_ROM_SIZE - Specify the binary size upper limit of SECONDARY_ROM for
                                  FOTA/Multi-Bin partial update.
         MAX_DEMAND_PAGING_ROM0_SIZE - Specify Demand Paging binary size upper limit.
                                       This value, if defined, will be used as
                                       the upper bound of DEMAND_PAGING_ROM0 region
                                       when NAND_FLASH_BOOTING = ONDEMAND or
                                       EMMC_BOOTING = ONDEMAND.
                                       This value will also be used as partial update
                                       reserved size for FOTA and Multi-Bin.
         MAX_LANG_PACK_ROM_SIZE - Specify the binary size upper limit of LANG_PACK_ROM
                                  for Multi-Bin partial update.
         MAX_CUSTPACK_ROM_SIZE - Specify the binary size upper limit of CUSTPACK_ROM
                                 for Multi-Bin partial update.
         MAX_BL_SIZE - Specify the binary size upper limit of bootloader reserved sizes
         MAX_EXT_BL_SIZE - Specify the binary size upper limit of ext_bootloader reserved sizes

         [VERY IMPORTANT NOTICE]
         =======================
         Please note that MAX_DEMAND_PAGING_ROM0_SIZE, MAX_LANG_PACK_ROM_SIZE,
         and MAX_CUSTPACK_ROM_SIZE should be multiples of MB when
         NAND_FLASH_BOOTING/EMMC_BOOTING = ONDEMAND.
         This is for page table setting.

 ****************************************************************************
*/
//#define MAX_ROM_SIZE
//#define MAX_SECONDARY_ROM_SIZE
//#define MAX_DEMAND_PAGING_ROM0_SIZE
//#define MAX_LANG_PACK_ROM_SIZE
//#define MAX_CUSTPACK_ROM_SIZE
#define MAX_BL_SIZE 0x1c00
#define MAX_EXT_BL_SIZE 0x7800

/*
 ****************************************************************************
 Part 7: The following definitions define Demand Paging related configurations.

         [Makefile option] NAND_FLASH_BOOTING = ONDEMAND or
                           EMMC_BOOTING = ONDEMAND

         [Document] Demand_Paging_User_Guide_V1.2.doc
                    http://dms.mediatek.inc:80/webtop/drl/objectId/0900006f80183188

         [Configurations]
         DEMAND_PAGING_POOL_SIZE - Specify the size of Demand Paging pool.

 ****************************************************************************
*/
//#define CONFIG_DEMAND_PAGE_SHARE_POOL_SIZE


/*
 ****************************************************************************
 Part 8: Define USB-Download related configurations

         [Makefile option] USB_DOWNLOAD_IN_BL != NONE

         [Document] N/A

         [Configurations]
         USBDL_KEY_POSITION - USB Download Key Configure. The key ID is defined in kbd_table.h
                              To disable USBDL by key press, set it as NO_USBDL_KEY.
         USBDL_AUTO_TIMEOUT - USB Download Auto Mode Configure (ms).
                              To disable USBDL by key press, set it NO_USBDL_AUTO_TIMEOUT.
                              Maximum value is 65535.
         USBDL_HOLDING_MODE - USB Download Holding mode Configure. When holding mode is enabled,
                              Bootloader will wait for USB connection forever
                              once USBDL is triggered. Do not enable this option
                              when USBDL_AUTO_TIMEOUT is not NO_USBDL_AUTO_TIMEOUT.

 ****************************************************************************
*/
//#define USBDL_KEY_POSITION
//#define USBDL_AUTO_TIMEOUT
//#define USBDL_HOLDING_MODE


/*
 ****************************************************************************
 Part 9: Define configurations for KAL_RECORD_BOOTUP_LOG & KEYPAD_DEBUG_TRACE
            & all time memory dump

         [Makefile option] KAL_RECORD_BOOTUP_LOG = TRUE
                           or KEYPAD_DEBUG_TRACE = TRUE

         [Document] MAUI Init Debugging Trace.ppt
                    http://dms.mediatek.inc:80/webtop/drl/objectId/0900006f80038f69

         [Configurations]
         DEBUG_PORT - Define the port of boot-up trace and all time memory dump.
         DEBUG_BAUDRATE - Baudrate of boot-up trace and all time memory dump.

 ****************************************************************************
*/
//#define DEBUG_PORT
//#define DEBUG_BAUDRATE


/*
 ****************************************************************************
 Part 10: Define Bootloader and Fast META related configurations

         [Makefile option] N/A

         [Document] N/A

         [Configurations]
         BOOTLOADER_DEBUG_LEVEL - Define what kinds of BL debugging messages can be dumped to UART.
         FAST_META_KEY_POSITION - Define USB Fast Meta key. When pressing Fast Meta Key,
                                  Bootloader will not try to open USB COM port but switch to
                                  USB Meta mode directly in order to speed up
                                  the readiness of Meta mode.

 ****************************************************************************
*/
//#define BOOTLOADER_DEBUG_LEVEL
//#define FAST_META_KEY_POSITION

/*
 ****************************************************************************
 Part11: Following definitions are used to configure if resource BIN need to be compressed.

         [Makefile option] MULTIPLE_BINARY_FILES = TRUE, ZIMAGE_SUPPORT = TRUE
                           Can only enable when SV5+MBA+Zimage switch on

         [Document] MBA SOP.doc
                    http://dms.mediatek.inc:80/webtop/drl/objectId/0900006f80322fcf
         [Configurations]
         LANG_PACK_ROM_COMPRESS - Decide if langpack should be compressed or not
         CUSTPACK_ROM_COMPRESS  - Decide if custpack should be compressed or not

         Compress = 1
         Don't compress = 0
 ****************************************************************************
*/
#define LANG_PACK_ROM_COMPRESS  0
#define CUSTPACK_ROM_COMPRESS   0


#endif /* __CUSTOM_FEATURECONFIG_H__ */