bootloader_ext.mak 20.5 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 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581
##############################################################
# Define ext bootloader internal configuration
##############################################################
BL_SLIM_SEG                = 16_3_SEG

##############################################################
# Define source file lists to SRC_LIST
##############################################################

SRC_LIST =  \
            hal\system\bootloader\src\bl_BOOTARM.S \
            hal\system\bootloader\src\bl_Cache.c \
            hal\system\bootloader\src\bl_DBGPRINT.C \
            hal\system\bootloader\src\bl_FOTA.c \
            hal\system\bootloader\src\bl_FTL.c \
            hal\system\bootloader\src\bl_GFH_body.c \
            hal\system\bootloader\src\bl_ImageLoader.c \
            hal\system\bootloader\src\bl_ImageLoaderCommon.c \
            hal\system\bootloader\src\bl_ImageLoader_v5.c \
            hal\system\bootloader\src\bl_Init.c \
            hal\system\bootloader\src\bl_Main.c \
            hal\system\bootloader\src\bl_NFI.c \
            hal\system\bootloader\src\bl_NFI_V3.c \
            hal\system\bootloader\src\bl_NFI_V31.c \
            hal\system\bootloader\src\bl_SNAND_V2.c \
            hal\system\bootloader\src\bl_portingfunc.c \
            hal\system\bootloader\src\bl_regioninit.s \
            hal\system\bootloader\src\bl_UART.C \
            hal\system\bootloader\src\bl_pdn.c \
            hal\system\bootloader\src\bl_Update.c \
            hal\system\bootloader\src\bl_FUNET.c \
            hal\system\bootloader\src\bl_Alg.c \
            hal\system\bootloader\src\bl_verno.c \
            hal\system\bootloader\src\drv_comm_bl.c \
            hal\system\bootloader\src\lcd_display.c \
            hal\system\bootloader\src\msdc_adap_bl.c \
            hal\system\bootloader\src\msdc_dma_bl.c \
            hal\system\bootloader\src\pmic_adpt_bl.c \
            hal\system\bootloader\src\usbdl_debug_tool.c \
            hal\system\bootloader\src\usbdl_pmu.c \
            hal\system\bootloader\src\usbdl_upll.c \
            hal\system\bootloader\src\usbdl_usb.c  \
            hal\system\bootloader\src\usbdl_usbacm_adap.c \
            hal\system\bootloader\src\usbdl_usbacm_drv.c \
            hal\system\bootloader\src\usbdl_usb_drv.c \
            hal\system\bootloader\src\usbdl_usb_resource.c \
            hal\system\init\src\arm_unaligned.s \
            hal\system\GFH\public\br_GFH_parser.c \
            hal\system\GFH\public\br_GFH_file_info.c \
            custom\system\$(strip $(BOARD_VER))\custom_blconfig.c \
            custom\common\hal\custom_flash.c \
            custom\common\hal\custom_SNAND.c \
            custom\common\hal\combo_flash_init.c \
            custom\system\$(strip $(BOARD_VER))\custom_img_config.c \
            $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,custom_hw_default.c) \
            $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,gpio_drv.c) \
            $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,keypad_def.c) \
            $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,usb_custom.c) \
            custom\drv\common_drv\nld_central_ctrl.c \
            custom\drv\common_drv\gpio_setting.c \
            hal\peripheral\src\dcl_gpio.c \
            hal\peripheral\src\gpio.c \
            custom\drv\common_drv\pwic_cust.c \
            hal\system\cache\src\cp15.s \
            hal\system\cache\src\cache.c \
            hal\system\pdn\src\pdn.c \
            hal\system\init\src\init_comm.c \
            hal\system\pdn\src\pdnoldarch.c \
            hal\peripheral\src\lpwr.c \
            hal\peripheral\src\pwm.c \
            hal\peripheral\src\dcl_rtc.c \
            hal\peripheral\src\rtc.c \
            hal\peripheral\src\f32k_clk.c \
            hal\peripheral\src\dcl_f32k_clk.c \
            hal\peripheral\src\bmt_bl_chr_setting.c \
            hal\peripheral\src\bmt_hw.c \
            hal\peripheral\src\dcl_pwm.c \
            hal\peripheral\src\pwm.c 
            
            
SRC_LIST += hal\system\CBR\src\CBR.c \
            hal\system\CBR\src\cbr_util.c

# PMU
SRC_LIST +=  hal\peripheral\src\dcl_pmu.c \
           hal\peripheral\src\dcl_pmu_common.c

ifeq ($(strip $(PMIC)),MT6235PMU)
   SRC_LIST += hal\peripheral\src\dcl_pmu6235.c
endif
ifneq ($(filter MT6236PMU MT6921PMU, $(strip $(PMIC))),)
   SRC_LIST += hal\peripheral\src\dcl_pmu6236.c
endif
ifeq ($(strip $(PMIC)),MT6253PMU)
   SRC_LIST += hal\peripheral\src\dcl_pmu6253.c
endif
ifeq ($(strip $(PMIC)),MT6326_CCCI)
   SRC_LIST += hal\peripheral\src\dcl_pmic6326_ccci.c
endif
#ifeq ($(strip $(PMIC)),MT6326)
#   SRC_LIST += hal\system\bootloader\src\usbdl_pmic6326.c
#endif

ifeq ($(strip $(PMIC)),MT6326)
   SRC_LIST += 	hal\peripheral\src\dcl_pmic6326.c \
                hal\peripheral\src\i2c_dual.c
   SRC_LIST +=  $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,pmic_custom.c)
endif
ifeq ($(strip $(PMIC)),MT6250PMU)
	SRC_LIST += hal\peripheral\src\dcl_pmu6250.c \
				hal\peripheral\src\dcl_pmu6250_init.c
endif
ifeq ($(strip $(PMIC)),MT6251PMU)
   SRC_LIST += hal\peripheral\src\dcl_pmu6251.c
endif
ifeq ($(strip $(PMIC)),MT6252PMU)
   SRC_LIST += hal\peripheral\src\dcl_pmu6252.c
endif
ifeq ($(strip $(PMIC)),MT6255PMU)
   SRC_LIST += hal\peripheral\src\dcl_pmu6255.c \
               hal\peripheral\src\dcl_pmu6255_init.c
endif
ifeq ($(strip $(PMIC)),MT6256PMU)
   SRC_LIST += hal\peripheral\src\dcl_pmu6256.c \
               hal\peripheral\src\dcl_pmu6256_init.c
endif
ifeq ($(strip $(PMIC)),MT6260PMU)
	SRC_LIST += hal\peripheral\src\dcl_pmu6260.c \
				hal\peripheral\src\dcl_pmu6260_init.c
endif
ifeq ($(strip $(PMIC)),MT6261PMU)
	SRC_LIST += hal\peripheral\src\dcl_pmu6261.c \
				hal\peripheral\src\dcl_pmu6261_init.c
endif
ifeq ($(strip $(PMIC)),MT6276PMU)
   SRC_LIST += hal\peripheral\src\dcl_pmu6276.c
endif
ifeq ($(strip $(PMIC)),MT6573PMU)
   SRC_LIST += hal\peripheral\src\dcl_pmu6573.c
endif

SRC_LIST +=  $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,pmu_custom.c)

FILE_EXIST = $(shell dir custom\codegen\$(strip $(BOARD_VER))\gpio_var.c /b 2>nul)
ifneq ($(words $(strip $(FILE_EXIST))),0)
  SRC_LIST += custom\codegen\$(strip $(BOARD_VER))\gpio_var.c
endif
     
SRC_LIST += hal\peripheral\src\keypad_bl.c
SRC_LIST += hal\peripheral\src\sw_keypad.c

SRC_LIST += custom\common\hal\custom_sfi.c

# eMMC driver
ifneq ($(filter __EMMC_BOOTING__, $(strip $(MODULE_DEFS))),)
  SRC_LIST += $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,msdc_custom.c) \
              hal\storage\mc\src\msdc.c \
              hal\storage\mc\src\sd.c \
              hal\storage\mc\src\msdc_fake_kal.c \
              hal\storage\mc\src\dcl_memory_card.c \
              hal\storage\mc\src\sd_drv.c \
              hal\storage\mc\src\sd_adap.c
endif


# Add by Kuohong
# NAND driver build condition
# #if ( defined(__NAND_FDM_50__) && (defined(__NFI_VERSION2__)||defined(__NFI_VERSION3_1__)) )
ifneq ($(filter __NAND_FDM_50__, $(strip $(MODULE_DEFS))),)
  ifneq ($(filter __NFI_VERSION2__, $(strip $(MODULE_DEFS))),)
    SRC_LIST += hal\storage\flash\mtd\src\NAND_DAL.c
    SRC_LIST += hal\storage\flash\mtd\src\NAND_MTD_FDM50.c
    SRC_LIST += hal\storage\flash\mtd\src\NAND_DevConfig.c
  else 
     ifneq ($(filter __NFI_VERSION3_1__, $(strip $(MODULE_DEFS))),)
       SRC_LIST += hal\storage\flash\mtd\src\NAND_DAL.c
       SRC_LIST += hal\storage\flash\mtd\src\NAND_MTD_FDM50.c
       SRC_LIST += hal\storage\flash\mtd\src\NAND_DevConfig.c
     endif
  endif
endif
ifneq ($(filter _NAND_FLASH_BOOTING_, $(strip $(MODULE_DEFS))),)
  ifeq ($(filter __NFI_VERSION3__, $(strip $(MODULE_DEFS))),)
    ifeq ($(filter __NFI_VERSION2__, $(strip $(MODULE_DEFS))),)    
    endif
  endif
else
 ifneq ($(filter __NOR_FLASH_BOOTING__, $(strip $(MODULE_DEFS))),)
  ifeq ($(filter __NFI_VERSION3__, $(strip $(MODULE_DEFS))),)
    ifeq ($(filter __NFI_VERSION2__, $(strip $(MODULE_DEFS))),)    
    endif
  endif 
 endif
endif
# Add by Kuohong


# For SPI-NAND (begin)
ifneq ($(filter __NAND_FDM_50__, $(strip $(MODULE_DEFS))),)
  ifneq ($(filter __SNAND_VERSION2__, $(strip $(MODULE_DEFS))),)
    SRC_LIST += hal\storage\flash\mtd\src\SPI_NAND_DAL.c
    SRC_LIST += hal\storage\flash\mtd\src\SPI_NAND_MTD_FDM50.c
    SRC_LIST += hal\storage\flash\mtd\src\SPI_NAND_DevConfig.c
    ifneq ($(filter __SNAND_STT_EN__, $(strip $(MODULE_DEFS))),)
      SRC_LIST += hal\storage\flash\mtd\src\bl_STT_SNAND.c
    endif
  endif
endif
# For SPI-NAND (end)

# NOR/SF driver
ifeq ($(filter _NAND_FLASH_BOOTING_, $(strip $(MODULE_DEFS))),)
ifeq ($(filter __EMMC_BOOTING__, $(strip $(MODULE_DEFS))),)
  SRC_LIST += custom\common\hal\combo_flash_init.c \
              custom\common\hal\combo_flash_nor.c \
              hal\storage\flash\mtd\src\flash_mtd_sf_common.c \
              hal\storage\flash\mtd\src\flash_cfi.c \
              hal\storage\flash\mtd\src\flash_disk.c \
              hal\storage\flash\mtd\src\flash_mtd.c \
              hal\storage\flash\mtd\src\flash_mtd_sf_dal.c \
              hal\storage\flash\mtd\src\flash_mtd_pf_dal.c \
              hal\storage\flash\mtd\src\flash_mtd.amd.c \
              hal\storage\flash\mtd\src\flash_mtd.intel.c \
              hal\storage\flash\mtd\src\bl_STT_SF.c \
              hal\system\emi\src\emi.c
endif
endif

ifdef FUNET_ENABLE
ifneq ($(strip $(FUNET_ENABLE)),NONE)
  
  # For LCD
  SRC_LIST += hal\display\fota\src\lcd_fota.c \
              hal\display\lcd_if_manager\src\lcd_if_manager.c \
              hal\display\common\src\lcm_proxy.c \
              hal\lqt\src\lcd_lqt.c \
              hal\system\compression\src\code_decompression_fota.c \
              hal\graphics\misc\src\simple_memory_manager.c

  ifneq ($(filter MT6260, $(strip $(MODULE_DEFS))),)
    SRC_LIST += custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm.c \
                custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm_ILI9486.c \
                custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm_R61529.c
  else
	SRC_LIST += custom\drv\LCD\$(strip $(LCD_MODULE))\lcd.c
  endif
  
  # For Backlight
  SRC_LIST += $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,pwmdrv.c) \
              hal\peripheral\src\rtc.c \
              hal\peripheral\src\rwg.c \
              hal\peripheral\src\pwm.c \
              custom\common\ps\custom_uem.c \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,custom_equipment.c) \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,uem_gpio.c) \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,custom_hw_default.c) \
              custom\codegen\$(strip $(BOARD_VER))\uem_drv.c

  #LCD only display picture in COSMOS/PLUTO project
  ifdef MMI_VERSION
    ifneq ($(filter COSMOS_MMI PLUTO_MMI,$(MMI_VERSION)),)
      SRC_LIST += hal\system\bootloader\src\gdi_image_alpha_bmp_v2_internal.c \
                  hal\system\bootloader\src\gdi_image_alpha_bmp_v2_core.c
    endif
  endif
  
  SRC_LIST += hal\peripheral\src\dcl_rtc.c \
              hal\peripheral\src\dcl_pwm.c \
              hal\peripheral\src\dcl_pw.c


  # IOT FOTA FS
  SRC_LIST += custom\system\$(strip $(BOARD_VER))\fs_config.c \
              fs\fat\src\Format.c \
              fs\efs\src\fs_bl_func.c \
              fs\efs\src\fs_utility.c \
              fs\fat\src\fs_bl_main.c \
              fs\fat\src\fs_kal.c \
              fs\fat\src\rtfcore.c \
              fs\fat\src\rtfbuf.c \
              fs\fat\src\rtfex.c \
              fs\efs\src\fs_internal.c\
              fs\common\src\fs_internal_api.c\
              fs\fat\src\rtfiles.c\
              fs\fat\src\rtfbs.c

endif
endif
ifneq ($(strip $(CARD_DOWNLOAD)),NONE)
  # For card
  SRC_LIST += $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,msdc_custom.c) \
              hal\storage\mc\src\msdc.c \
              hal\storage\mc\src\sd.c \
              hal\storage\mc\src\dcl_memory_card.c \
              hal\storage\mc\src\sd_drv.c \
              hal\storage\mc\src\msdc_fake_kal.c
              
  # For LCD
  SRC_LIST += hal\display\fota\src\lcd_fota.c \
              hal\display\lcd_if_manager\src\lcd_if_manager.c \
              hal\display\common\src\lcm_proxy.c \
              hal\lqt\src\lcd_lqt.c

ifneq ($(filter MT6260, $(strip $(MODULE_DEFS))),)
  SRC_LIST += custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm.c \
              custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm_ILI9486.c \
              custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm_R61529.c
else
  SRC_LIST += custom\drv\LCD\$(strip $(LCD_MODULE))\lcd.c
endif
  
  # For Backlight
  SRC_LIST += $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,pwmdrv.c) \
              hal\peripheral\src\rtc.c \
              hal\peripheral\src\rwg.c \
              hal\peripheral\src\pwm.c \
              custom\common\ps\custom_uem.c \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,custom_equipment.c) \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,uem_gpio.c) \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,custom_hw_default.c) \
              custom\codegen\$(strip $(BOARD_VER))\uem_drv.c

  #LCD only display picture in COSMOS/PLUTO project
  ifdef MMI_VERSION
    ifneq ($(filter COSMOS_MMI PLUTO_MMI,$(MMI_VERSION)),)
      SRC_LIST += hal\system\bootloader\src\gdi_image_alpha_bmp_v2_internal.c \
                  hal\system\bootloader\src\gdi_image_alpha_bmp_v2_core.c
    endif
  endif
  
  SRC_LIST += hal\peripheral\src\dcl_rtc.c \
              hal\peripheral\src\dcl_pwm.c \
              hal\peripheral\src\dcl_pw.c

  ifeq ($(strip $(CARD_DOWNLOAD)),FILESYSTEM_ON_CARD)
    SRC_LIST += custom\system\$(strip $(BOARD_VER))\fs_config.c \
                fs\fat\src\Format.c \
                fs\efs\src\fs_bl_func.c \
                fs\efs\src\fs_utility.c \
                fs\fat\src\fs_bl_main.c \
                fs\fat\src\fs_kal.c \
                fs\fat\src\rtfcore.c \
                fs\fat\src\rtfbuf.c \
                fs\fat\src\rtfex.c
  endif

endif

ifneq ($(filter __FOTA_DM__,$(strip $(MODULE_DEFS))),)
  SRC_LIST += hal\system\bootloader\src\bl_fota.c \
              custom\system\$(strip $(BOARD_VER))\custom_fota.c
endif
ifneq ($(filter __SV5_ENABLED__,$(strip $(MODULE_DEFS))),)
  SRC_LIST += hal\system\bootloader\src\bl_gfh_body.c \
              hal\system\bootloader\src\bl_imageloader_v5.c
endif


ifneq ($(filter __DSP_FCORE4__,$(strip $(MODULE_DEFS))),)
  SRC_LIST += hal\system\init\src\dmdsp_init.c
endif

ifdef FAST_LOGO_SUPPORT
  ifneq ($(strip $(FAST_LOGO_SUPPORT)),FALSE)

  # For LCD
  SRC_LIST += hal\display\fota\src\lcd_fota.c \
              hal\display\lcd_if_manager\src\lcd_if_manager.c \
              hal\display\common\src\lcm_proxy.c \
              hal\lqt\src\lcd_lqt.c

ifneq ($(filter MT6260, $(strip $(MODULE_DEFS))),)
  SRC_LIST += custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm.c \
              custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm_ILI9486.c \
              custom\drv\LCD\$(strip $(LCD_MODULE))\combo_lcm_R61529.c
else
  SRC_LIST += custom\drv\LCD\$(strip $(LCD_MODULE))\lcd.c
endif
  
  # For Backlight
  SRC_LIST += $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,pwmdrv.c) \
              hal\peripheral\src\rtc.c \
              hal\peripheral\src\rwg.c \
              hal\peripheral\src\pwm.c \
              custom\common\ps\custom_uem.c \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,custom_equipment.c) \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,uem_gpio.c) \
              $(call AUTO_MERGE_FILE_CHECK,custom\drv\misc_drv,custom_hw_default.c) \
              custom\codegen\$(strip $(BOARD_VER))\uem_drv.c

  # For ABM V2 decoder
  SRC_LIST += hal\system\bootloader\src\gdi_image_alpha_bmp_v2_internal.c \
              hal\system\bootloader\src\gdi_image_alpha_bmp_v2_core.c

  # For latching power in Bootloader
  SRC_LIST += hal\peripheral\src\dcl_rtc.c \
              hal\peripheral\src\dcl_pwm.c \
              hal\peripheral\src\dcl_pw.c \
              hal\peripheral\src\rtc.c \
              hal\peripheral\src\pw_bl.c
  endif
endif

##############################################################
#  Define include path lists to INC_DIR
##############################################################
INC_DIR = hal\system\bootloader\inc \
          interface\hal\system \
          inc \
          hal\system\pll\inc \
          hal\system\cache\inc \
          drv\include \
          hal\storage\flash\mtd\inc \
          hal\storage\flash\fdm\inc \
          hal\storage\mc\inc \
          dp_engine\che\include \
          applib\misc\include \
          custom\codegen\$(strip $(BOARD_VER)) \
          custom\system\$(strip $(BOARD_VER)) \
          custom\drv\misc_drv\$(strip $(BOARD_VER)) \
          hal\system\fota\inc \
          sss\interface\inc \
          ssf\inc \
          sst\include \
          fs\Efs\include \
          fs\fat\include \
          custom\common \
          custom\common\hal \
          custom\common\ps \
          interface\fs \
          interface\l1interface \
          interface\hwdrv \
          plutommi\Framework\GDI\GDIInc \
          plutommi\Customer\CustResource \
          plutommi\MMI\Inc \
          hal\system\CBR\inc \
          hal\system\GFH\public \
          hal\system\profile\inc \
          hal\peripheral\inc \
          hal\storage\mc\inc \
          hal\dsp_ram \
          security\sds \
          hal\display\ddv1\include \
          hal\display\ddv1\include\mt6236govl \
          hal\display\ddv1\include\mt6236lcd \
          hal\display\ddv1\include\mt6253lcd \
          hal\display\ddv1\include\mt6252lcd \
          hal\display\ddv1\include\mt6268lcd \
          hal\display\ddv1\include\mt6276lcd \
          hal\lqt\include \
          hal\display\common\include \
          interface\hal\display \
          interface\hal\display\ddv1 \
          interface\hal\system \
          usb\include \
          interface\hal\peripheral \
          hal\system\DP\inc \
          custom\common\hal_public \
          hal\drv_def \
          interface\hal\storage \
          interface\fs \
          hal\system\funet\inc


##############################################################
# Define the specified compile options to COMP_DEFS
##############################################################
COMP_DEFS = BL_ECC_ENABLE \
            __UBL__ \
            __EXT_BOOTLOADER__ \
            USBACM_TX_WITHOUT_DMA \
            BL_ENABLE \
            __CP_DEFINED_ALL_CONTEXT__ \
            __CP_DEFINED_WORKING_BUF__ \
            __CRYPTO_LIB__ \
            __CRYPTO_SCHEME__

ifneq ($(strip $(PLATFORM)),MT6251)
ifneq ($(strip $(PACKAGE_SEG)),32_32_SEG)
  COMP_DEFS += BL_DEBUG
endif
endif

ifneq ($(filter $(BL_SLIM_SEG), $(strip $(PACKAGE_SEG))),)
  COMP_DEFS    +=  __BL_SLIM_SEG__
endif

ifneq ($(strip $(CARD_DOWNLOAD)),NONE)
  COMP_DEFS += BL_DEBUG
endif

ifdef FAST_LOGO_SUPPORT
  ifneq ($(strip $(FAST_LOGO_SUPPORT)),FALSE)
    COMP_DEFS += __FAST_LOGO__
    COMP_DEFS += __LCD_DRIVER_IN_BL__
    COMP_DEFS += __BG_IMAGE__
  endif
endif

ifdef CARD_DOWNLOAD
  ifneq ($(strip $(CARD_DOWNLOAD)),NONE)
    COMP_DEFS += __CARD_DOWNLOAD__ 
    COMP_DEFS += __LCD_DRIVER_IN_BL__
    COMP_DEFS += __MSDC_NOT_SUPPORT_HOT_PLUG__
    #LCD only display picture in COSMOS/PLUTO project
    ifdef MMI_VERSION
      ifneq ($(filter COSMOS_MMI PLUTO_MMI,$(MMI_VERSION)),)
        COMP_DEFS += __BG_IMAGE__
      endif
    endif
  endif
endif

COMP_DEFS += $(strip $(PLATFORM))

ifneq ($(filter $(strip $(PLATFORM)),$(ARM9_PLATFORM)),)
  COMP_DEFS += ARM9_MMU
endif

ifneq ($(strip $(NAND_FLASH_BOOTING)),NONE)
  COMP_DEFS  += _NAND_FLASH_BOOTING_
endif
    
ifdef EMMC_BOOTING
  ifneq ($(strip $(EMMC_BOOTING)),NONE)
    COMP_DEFS  += __EMMC_BOOTING__
  endif
endif
    
ifneq ($(strip $(FOTA_ENABLE)),NONE)
  ifneq ($(strip $(FOTA_ENABLE)),)
    COMP_DEFS  += __FOTA_ENABLE__
  endif
endif

ifdef USB_DOWNLOAD_IN_BL
  ifneq ($(strip $(USB_DOWNLOAD_IN_BL)),NONE)
    COMP_DEFS += __USB_DOWNLOAD__
    ifeq ($(strip $(USB_DOWNLOAD_IN_BL)),SECURE)
      COMP_DEFS += __SECURE_USB_DOWNLOAD__
    endif
  endif
endif

ifdef SERIAL_FLASH_STT_SUPPORT
  ifeq ($(strip $(SERIAL_FLASH_STT_SUPPORT)),TRUE)
    COMP_DEFS += __ADV_DBG_PRINT__
  endif
endif

ifdef SERIAL_FLASH_SUPPORT
  ifeq ($(strip $(SERIAL_FLASH_SUPPORT)),TRUE)
    COMP_DEFS += __NOR_FULL_DRIVER__
  endif
endif

# TS_PROFILING := TRUE
COMP_DEFS += BL_DEBUG

ifeq ($(TS_PROFILING),TRUE)
COMP_DEFS += \
             __TIME_STAMP__ \
             __TIME_STAMP_UTIL__ \
             __TIME_STAMP_TDMA_TIMER__ \
             __TIME_STAMP_FORCE_ENABLE__
COMP_DEFS += BL_DEBUG
COMP_DEFS += __BRINGUP_SUPPORT__
SRC_LIST += hal\system\bootloader\src\bl_time_stamp_util.c \
            hal\system\profile\src\br_time_stamp.c \
            hal\system\profile\src\time_stamp_timer.c
endif

ifdef FUNET_ENABLE
  ifneq ($(strip $(FUNET_ENABLE)),NONE)
    COMP_DEFS += BL_DEBUG
    COMP_DEFS += \
             __UBL_NOR_FULL_DRIVER__ \
             __NOR_FULL_DRIVER__ \
             __FS_FUNET_ENABLE__
  endif
endif