blob: 67d8a28e681d97e8084627862fb8019233337a9f [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4COMMON_PLAT := $(LOCAL_DIR)/../common
5
6ARCH ?= arm64
7ARM_CPU ?= cortex-a53
8WITH_SMP ?= 0
9WITH_KERNEL_VM ?= 1
10
11LK_HEAP_IMPLEMENTATION ?= miniheap
12
13GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \
14
15MODULE_SRCS += \
16 $(COMMON_PLAT)/debug.c \
17 $(COMMON_PLAT)/fastboot_oem_cmd/oem_ab_cmd.c \
18 $(COMMON_PLAT)/fastboot_oem_cmd/oem_mac_cmd.c \
19 $(COMMON_PLAT)/interrupts.c \
20 $(COMMON_PLAT)/boot_mode.c \
21 $(LOCAL_DIR)/boot_mode.c \
22 $(LOCAL_DIR)/fixup/plat_fixup.c \
23 $(LOCAL_DIR)/platform.c \
24
25# check bcb (bootloader control block) for recovery mode
26BCB_RECOVERY_SUPPORT ?= 0
27
28ifeq ($(WITH_SMP),1)
29SMP_MAX_CPUS := 6 # if we need only one big core, set this to 5
30SMP_CPU_CLUSTER_SHIFT := 2
31SMP_CPU_ON_MASK ?= 0x11 # mask for which cpu to be on
32
33MODULE_SRCS += \
34 $(COMMON_PLAT)/arch/$(ARCH)/mp.c \
35 $(LOCAL_DIR)/plat_mp.c
36
37GLOBAL_DEFINES += SMP_CPU_ON_MASK=$(SMP_CPU_ON_MASK)
38endif
39
40ifeq ($(LK_AS_BL33),1)
41MODULE_SRCS += \
42 $(COMMON_PLAT)/fastboot_oem_cmd/oem_efuse_cmd.c
43endif
44
45GLOBAL_INCLUDES += \
46 $(COMMON_PLAT)/include \
47
48MACH_TYPE := 2712
49
50ifeq ($(WITH_KERNEL_VM),1)
51KERNEL_ASPACE_BASE ?= 0xfffffff000000000
52KERNEL_ASPACE_SIZE ?= 0x0000000180000000
53MMU_IDENT_SIZE_SHIFT ?= 32
54endif
55
56SCRATCH_SIZE := 0x02000000 # 32MB
57
58# mempool configuration
59ifeq ($(WITH_KERNEL_VM),1)
60CACHED_MEMPOOL_ADDR ?= 0xfffffff073800000
61CACHED_MEMPOOL_SIZE ?= 0x02800000 # 40MB
62UNCACHED_MEMPOOL_ADDR ?= 0xfffffff073600000
63UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB
64BL33_ADDR ?= 0xfffffff073500000
65else
66CACHED_MEMPOOL_ADDR ?= 0 # don't care this when mmu is off
67CACHED_MEMPOOL_SIZE ?= 0
68UNCACHED_MEMPOOL_ADDR ?= 0x73600000
69UNCACHED_MEMPOOL_SIZE ?= 0x0c800000 # 200MB
70BL33_ADDR ?= 0x73500000
71endif
72
73# if DEBUG is not 0, enable debug feature
74ifneq ($(DEBUG),0)
75LOG_STORE_SUPPORT ?= 1
76endif
77
78# LK build as BL2 or BL33 setting
79LK_AS_BL33 ?= 0
80
81# CA35 FREQ:
82# CA35_FREQ_806MHZ (0.8G), CA35_FREQ_1001MHZ (1.0G), CA35_FREQ_1196MHZ (1.2G)
83CA35_FREQ ?= CA35_FREQ_1196MHZ
84
85# CA72 FREQ:
86# CA72_FREQ_1001MHZ(1.0G), CA72_FREQ_1196MHZ(1.2G), CA72_FREQ_1391MHZ(1.4G),
87# CA72_FREQ_1495MHZ(1.5G), CA72_FREQ_1599MHZ(1.6G)
88CA72_FREQ ?= CA72_FREQ_1599MHZ
89
90MODULE_DEPS += \
91 dev/interrupt/arm_gic \
92 dev/timer/arm_generic \
93 lib/bio \
94 lib/fastboot \
95 lib/fdt \
96 lib/fit \
97 lib/kcmdline \
98 lib/partition \
99 lib/mempool
100
101ifeq ($(LOG_STORE_SUPPORT),1)
102MODULE_DEPS += \
103 lib/log_store
104
105GLOBAL_DEFINES += LOG_STORE_SUPPORT=$(LOG_STORE_SUPPORT)
106endif
107
108# if BOOTAPP is not specified elsewhere, and AVB is required, choose 'avbboot'
109ifeq ($(strip $(SECURE_BOOT_ENABLE)),yes)
110ifeq ($(strip $(SECURE_BOOT_TYPE)),avb)
111BOOTAPP ?= avbboot
112endif
113endif
114
115# otherwise, choose 'fitboot'
116BOOTAPP ?= fitboot
117
118MODULES += app/$(BOOTAPP)
119
120# RTC OSC Removal
121ifeq ($(strip $(MTK_CLK32K_EXT_REMOVAL_SUPPORT)),yes)
122GLOBAL_DEFINES += MTK_CLK32K_EXT_REMOVAL_SUPPORT=1
123endif
124
125GLOBAL_DEFINES += MTK_THERMAL_RESET_SUPPORT
126
127ifeq ($(WITH_KERNEL_VM),1)
128GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT)
129else
130GLOBAL_DEFINES += NOVM_MAX_ARENAS=2
131endif
132
133GLOBAL_DEFINES += \
134 RAMBASE=$(RAMBASE) \
135 MACH_TYPE=$(MACH_TYPE) \
136 PLATFORM_SUPPORTS_PANIC_SHELL=1 \
137 WITH_NO_FP=1 \
138 CACHED_MEMPOOL_ADDR=$(CACHED_MEMPOOL_ADDR) \
139 CACHED_MEMPOOL_SIZE=$(CACHED_MEMPOOL_SIZE) \
140 UNCACHED_MEMPOOL_ADDR=$(UNCACHED_MEMPOOL_ADDR) \
141 UNCACHED_MEMPOOL_SIZE=$(UNCACHED_MEMPOOL_SIZE) \
142 BL33_ADDR=$(BL33_ADDR) \
143 $(CA35_FREQ) \
144 $(CA72_FREQ) \
145 LK_AS_BL33=$(LK_AS_BL33) \
146 BCB_RECOVERY_SUPPORT=$(BCB_RECOVERY_SUPPORT)
147
148LINKER_SCRIPT += \
149 $(BUILDDIR)/system-onesegment.ld
150
151include $(LOCAL_DIR)/bl2_bl33_options.mk
152include make/module.mk $(LOCAL_DIR)/drivers/rules.mk