blob: 6c690419088a1d7a6abb783666c561655ced9242 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4MTK_COMMON_PLAT_DIR := $(LOCAL_DIR)/../../platform/mediatek/common
5# [TODO] follow normal ways to remove lib from MODULE_INCLUDES
6MODULE_INCLUDES += $(MODULE_BUILDDIR)/../../../include lib \
7 $(MTK_COMMON_PLAT_DIR)/include
8
9SCRATCH_SIZE ?= 0x04000000 # 64MB
10MAX_DTB_SIZE ?= 0x00200000 # 2MB
11
12GLOBAL_DEFINES += SCRATCH_SIZE=$(SCRATCH_SIZE) \
13 MAX_DTB_SIZE=$(MAX_DTB_SIZE)
14
15# secure boot options
16ifeq ($(strip $(SECURE_BOOT_ENABLE)),yes)
17ifeq ($(strip $(SECURE_BOOT_TYPE)),avb)
18GLOBAL_COMPILEFLAGS += -DAVB_VERIFY_KERNEL
19
20ifeq ($(strip $(AVB_ENABLE_ANTIROLLBACK)),yes)
21GLOBAL_COMPILEFLAGS += -DAVB_ENABLE_ANTIROLLBACK
22endif
23endif # SECURE_BOOT_TYPE
24endif # SECURE_BOOT_ENABLE
25
26ifeq ($(strip $(AB_OTA_UPDATER)),yes)
27GLOBAL_COMPILEFLAGS += -DAB_OTA_UPDATER
28endif
29
30# loading kernel format config,
31# 0: fit image header 1: android image header
32ENABLE_ANDROID_BOOTIMG_SUPPORT ?= 0
33GLOBAL_DEFINES += \
34 ENABLE_ANDROID_BOOTIMG_SUPPORT=$(ENABLE_ANDROID_BOOTIMG_SUPPORT)
35
36ifeq ($(strip $(ENABLE_ANDROID_BOOTIMG_SUPPORT)),1)
37MODULE_DEPS += lib/android_bootimg
38endif
39
40# Todo: remove this option after cmdlineoverlay integration done
41ifeq ($(strip $(ANDROID_2712)),yes)
42MODULE_COMPILEFLAGS += -DMT2712_ANDROID
43endif
44
45MODULE_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
55MODULE_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
65ifeq ($(strip $(AB_OTA_UPDATER)),yes)
66MODULE_DEPS += lib/bootctrl
67endif
68
69ifeq ($(strip $(AB_UPGRADE_APP)),yes)
70MODULE_DEPS += lib/upgrade_app_ctrl
71endif
72
73ifeq ($(LK_AS_BL33),0)
74MODULE_SRCS += $(LOCAL_DIR)/bl2boot.c
75else
76MODULE_SRCS += $(LOCAL_DIR)/bl33boot.c
77endif
78
79GLOBAL_COMPILEFLAGS += -Os
80
81include $(LOCAL_DIR)/images_ab_slot_def.mk
82include make/module.mk