rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | LOCAL_DIR := $(GET_LOCAL_DIR) |
| 2 | |
| 3 | MODULE := $(LOCAL_DIR) |
| 4 | MTK_COMMON_PLAT_DIR := $(LOCAL_DIR)/../../platform/mediatek/common |
| 5 | # [TODO] follow normal ways to remove lib from MODULE_INCLUDES |
| 6 | MODULE_INCLUDES += $(MODULE_BUILDDIR)/../../../include lib \ |
| 7 | $(MTK_COMMON_PLAT_DIR)/include |
| 8 | |
| 9 | SCRATCH_SIZE ?= 0x04000000 # 64MB |
| 10 | MAX_DTB_SIZE ?= 0x00200000 # 2MB |
| 11 | |
| 12 | GLOBAL_DEFINES += SCRATCH_SIZE=$(SCRATCH_SIZE) \ |
| 13 | MAX_DTB_SIZE=$(MAX_DTB_SIZE) |
| 14 | |
| 15 | # secure boot options |
| 16 | ifeq ($(strip $(SECURE_BOOT_ENABLE)),yes) |
| 17 | ifeq ($(strip $(SECURE_BOOT_TYPE)),avb) |
| 18 | GLOBAL_COMPILEFLAGS += -DAVB_VERIFY_KERNEL |
| 19 | |
| 20 | ifeq ($(strip $(AVB_ENABLE_ANTIROLLBACK)),yes) |
| 21 | GLOBAL_COMPILEFLAGS += -DAVB_ENABLE_ANTIROLLBACK |
| 22 | endif |
| 23 | endif # SECURE_BOOT_TYPE |
| 24 | endif # SECURE_BOOT_ENABLE |
| 25 | |
| 26 | ifeq ($(strip $(AB_OTA_UPDATER)),yes) |
| 27 | GLOBAL_COMPILEFLAGS += -DAB_OTA_UPDATER |
| 28 | endif |
| 29 | |
| 30 | # loading kernel format config, |
| 31 | # 0: fit image header 1: android image header |
| 32 | ENABLE_ANDROID_BOOTIMG_SUPPORT ?= 0 |
| 33 | GLOBAL_DEFINES += \ |
| 34 | ENABLE_ANDROID_BOOTIMG_SUPPORT=$(ENABLE_ANDROID_BOOTIMG_SUPPORT) |
| 35 | |
| 36 | ifeq ($(strip $(ENABLE_ANDROID_BOOTIMG_SUPPORT)),1) |
| 37 | MODULE_DEPS += lib/android_bootimg |
| 38 | endif |
| 39 | |
| 40 | # Todo: remove this option after cmdlineoverlay integration done |
| 41 | ifeq ($(strip $(ANDROID_2712)),yes) |
| 42 | MODULE_COMPILEFLAGS += -DMT2712_ANDROID |
| 43 | endif |
| 44 | |
| 45 | MODULE_DEPS += \ |
| 46 | lib/bio \ |
| 47 | lib/mempool \ |
| 48 | lib/fdt \ |
| 49 | lib/fit \ |
| 50 | lib/fastboot \ |
| 51 | lib/libavb \ |
| 52 | lib/libavb_ab \ |
| 53 | lib/android_dtbo |
| 54 | |
| 55 | MODULE_SRCS += \ |
| 56 | $(LOCAL_DIR)/blxboot.c \ |
| 57 | $(LOCAL_DIR)/blxboot_ab.c \ |
| 58 | $(LOCAL_DIR)/blxboot_plat.c \ |
| 59 | $(LOCAL_DIR)/dto.c \ |
| 60 | $(LOCAL_DIR)/imagelist.c \ |
| 61 | $(LOCAL_DIR)/avb.c \ |
| 62 | $(MTK_COMMON_PLAT_DIR)/drivers/smc/smc.c \ |
| 63 | $(MTK_COMMON_PLAT_DIR)/drivers/smc/psci.c |
| 64 | |
| 65 | ifeq ($(strip $(AB_OTA_UPDATER)),yes) |
| 66 | MODULE_DEPS += lib/bootctrl |
| 67 | endif |
| 68 | |
| 69 | ifeq ($(strip $(AB_UPGRADE_APP)),yes) |
| 70 | MODULE_DEPS += lib/upgrade_app_ctrl |
| 71 | endif |
| 72 | |
| 73 | ifeq ($(LK_AS_BL33),0) |
| 74 | MODULE_SRCS += $(LOCAL_DIR)/bl2boot.c |
| 75 | else |
| 76 | MODULE_SRCS += $(LOCAL_DIR)/bl33boot.c |
| 77 | endif |
| 78 | |
| 79 | GLOBAL_COMPILEFLAGS += -Os |
| 80 | |
| 81 | include $(LOCAL_DIR)/images_ab_slot_def.mk |
| 82 | include make/module.mk |