blob: 80897eaa5cb8438fa684549403a4bc2f32eae939 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4COMMON_PLAT := $(LOCAL_DIR)/../mediatek/common
5
6ARCH ?= arm64
7ARM_CPU ?= cortex-a53
8WITH_SMP ?= 0
9WITH_KERNEL_VM ?= 1
10GICV3_SUPPORT_GIC600 ?= 1
11
12LK_HEAP_IMPLEMENTATION ?= miniheap
13
14GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \
15
16MODULE_SRCS += \
17 $(COMMON_PLAT)/boot_mode.c \
18 $(LOCAL_DIR)/fixup/plat_fixup.c \
19 $(LOCAL_DIR)/platform.c \
20 $(LOCAL_DIR)/debug.c \
21 $(LOCAL_DIR)/interrupts.c \
22 $(LOCAL_DIR)/plat_dbg_info.c \
23 $(LOCAL_DIR)/../mediatek/common/fastboot_oem_cmd/oem_ab_cmd.c \
24 $(LOCAL_DIR)/../mediatek/common/fastboot_oem_cmd/oem_efuse_cmd.c \
25 $(LOCAL_DIR)/../mediatek/common/fastboot_oem_cmd/oem_mac_cmd.c \
26
27MACH_TYPE := 2735
28
29ifeq ($(WITH_KERNEL_VM),1)
30ifeq ($(ARCH),arm64)
31KERNEL_ASPACE_BASE ?= 0xfffffff000000000
32KERNEL_ASPACE_SIZE ?= 0x0000000180000000
33MMU_IDENT_SIZE_SHIFT ?= 32
34endif
35endif
36
37# mempool configuration
38ifeq ($(WITH_KERNEL_VM),1)
39
40ifeq ($(ARCH),arm64)
41CACHED_MEMPOOL_ADDR ?= 0xfffffff044000000
42CACHED_MEMPOOL_SIZE ?= 0x01E00000 # 30MB
43UNCACHED_MEMPOOL_ADDR ?= 0xfffffff045E00000
44UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB
45BL33_ADDR ?= 0xfffffff042110000
46MD_ADDR ?= 0xfffffff046000000
47HSM_OS_ADDR ?= 0xfffffff042080000
48AP_MD_SHARE_NC ?= 0xfffffff056000000
49AP_MD_SHARE_C ?= 0xfffffff058000000
50endif
51
52ifeq ($(ARCH),arm)
53CACHED_MEMPOOL_ADDR ?= 0x44000000
54CACHED_MEMPOOL_SIZE ?= 0x01E00000 # 30MB
55UNCACHED_MEMPOOL_ADDR ?= 0x45E00000
56UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB
57BL33_ADDR ?= 0x42110000
58MD_ADDR ?= 0x46000000
59HSM_OS_ADDR ?= 0x42080000
60AP_MD_SHARE_NC ?= 0x56000000
61AP_MD_SHARE_C ?= 0x58000000
62endif
63
64else
65CACHED_MEMPOOL_ADDR ?= 0 # don't care this when mmu is off
66CACHED_MEMPOOL_SIZE ?= 0
67UNCACHED_MEMPOOL_ADDR ?= 0x45E00000
68UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB
69BL33_ADDR ?= 0x42110000
70MD_ADDR ?= 0x46000000
71HSM_OS_ADDR ?= 0x42080000
72AP_MD_SHARE_NC ?= 0x56000000
73AP_MD_SHARE_C ?= 0x58000000
74endif
75
76# LK build as BL2 or BL33 setting
77LK_AS_BL33 ?= 0
78
79# CPU FREQ: CA35_FREQ_806MHZ (0.8G), CA35_FREQ_1196MHZ (1.2G)
80CA35_FREQ ?= CA35_FREQ_1196MHZ
81
82MODULE_DEPS += \
83 dev/interrupt/arm_gic_v3 \
84 dev/timer/arm_generic \
85 lib/bio \
86 lib/fastboot \
87 lib/fdt \
88 lib/fit \
89 lib/kcmdline \
90 lib/mempool \
91 lib/partition \
92
93# if BOOTAPP is not specified elsewhere, and AVB is required, choose 'avbboot'
94ifeq ($(strip $(SECURE_BOOT_ENABLE)),yes)
95ifeq ($(strip $(SECURE_BOOT_TYPE)),avb)
96BOOTAPP ?= avbboot
97endif
98endif
99
100# otherwise, choose 'fitboot'
101BOOTAPP ?= fitboot
102
103MODULES += app/$(BOOTAPP)
104
105ifeq ($(WITH_KERNEL_VM),1)
106GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT)
107else
108GLOBAL_DEFINES += NOVM_MAX_ARENAS=2
109endif
110
111ifeq ($(SECURE_BOOT_ENABLE),yes)
112ifeq ($(MD_VERIFY),yes)
113GLOBAL_DEFINES += MTK_SECURITY_SW_SUPPORT
114endif
115endif
116
117# for AEE
118GLOBAL_DEFINES += MTK_PMIC_FULL_RESET
119
120# for user load
121ifeq ($(BUILD_LOAD_TYPE),user)
122GLOBAL_DEFINES += MTK_BUILD_USER_LOAD
123endif
124
125GLOBAL_DEFINES += \
126 RAMBASE=$(RAMBASE) \
127 MACH_TYPE=$(MACH_TYPE) \
128 PLATFORM_SUPPORTS_PANIC_SHELL=1 \
129 WITH_NO_FP=1 \
130 CACHED_MEMPOOL_ADDR=$(CACHED_MEMPOOL_ADDR) \
131 CACHED_MEMPOOL_SIZE=$(CACHED_MEMPOOL_SIZE) \
132 UNCACHED_MEMPOOL_ADDR=$(UNCACHED_MEMPOOL_ADDR) \
133 UNCACHED_MEMPOOL_SIZE=$(UNCACHED_MEMPOOL_SIZE) \
134 BL33_ADDR=$(BL33_ADDR) \
135 MD_ADDR=$(MD_ADDR) \
136 HSM_OS_ADDR=$(HSM_OS_ADDR) \
137 AP_MD_SHARE_NC=$(AP_MD_SHARE_NC) \
138 AP_MD_SHARE_C=$(AP_MD_SHARE_C) \
139 $(CA35_FREQ) \
140 LK_AS_BL33=$(LK_AS_BL33) \
141 GICV3_SUPPORT_GIC600=$(GICV3_SUPPORT_GIC600)
142
143
144LINKER_SCRIPT += \
145 $(BUILDDIR)/system-onesegment.ld
146
147
148include $(LOCAL_DIR)/bl2_bl33_options.mk
149include make/module.mk $(LOCAL_DIR)/drivers/rules.mk