blob: 80897eaa5cb8438fa684549403a4bc2f32eae939 [file] [log] [blame]
LOCAL_DIR := $(GET_LOCAL_DIR)
MODULE := $(LOCAL_DIR)
COMMON_PLAT := $(LOCAL_DIR)/../mediatek/common
ARCH ?= arm64
ARM_CPU ?= cortex-a53
WITH_SMP ?= 0
WITH_KERNEL_VM ?= 1
GICV3_SUPPORT_GIC600 ?= 1
LK_HEAP_IMPLEMENTATION ?= miniheap
GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \
MODULE_SRCS += \
$(COMMON_PLAT)/boot_mode.c \
$(LOCAL_DIR)/fixup/plat_fixup.c \
$(LOCAL_DIR)/platform.c \
$(LOCAL_DIR)/debug.c \
$(LOCAL_DIR)/interrupts.c \
$(LOCAL_DIR)/plat_dbg_info.c \
$(LOCAL_DIR)/../mediatek/common/fastboot_oem_cmd/oem_ab_cmd.c \
$(LOCAL_DIR)/../mediatek/common/fastboot_oem_cmd/oem_efuse_cmd.c \
$(LOCAL_DIR)/../mediatek/common/fastboot_oem_cmd/oem_mac_cmd.c \
MACH_TYPE := 2735
ifeq ($(WITH_KERNEL_VM),1)
ifeq ($(ARCH),arm64)
KERNEL_ASPACE_BASE ?= 0xfffffff000000000
KERNEL_ASPACE_SIZE ?= 0x0000000180000000
MMU_IDENT_SIZE_SHIFT ?= 32
endif
endif
# mempool configuration
ifeq ($(WITH_KERNEL_VM),1)
ifeq ($(ARCH),arm64)
CACHED_MEMPOOL_ADDR ?= 0xfffffff044000000
CACHED_MEMPOOL_SIZE ?= 0x01E00000 # 30MB
UNCACHED_MEMPOOL_ADDR ?= 0xfffffff045E00000
UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB
BL33_ADDR ?= 0xfffffff042110000
MD_ADDR ?= 0xfffffff046000000
HSM_OS_ADDR ?= 0xfffffff042080000
AP_MD_SHARE_NC ?= 0xfffffff056000000
AP_MD_SHARE_C ?= 0xfffffff058000000
endif
ifeq ($(ARCH),arm)
CACHED_MEMPOOL_ADDR ?= 0x44000000
CACHED_MEMPOOL_SIZE ?= 0x01E00000 # 30MB
UNCACHED_MEMPOOL_ADDR ?= 0x45E00000
UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB
BL33_ADDR ?= 0x42110000
MD_ADDR ?= 0x46000000
HSM_OS_ADDR ?= 0x42080000
AP_MD_SHARE_NC ?= 0x56000000
AP_MD_SHARE_C ?= 0x58000000
endif
else
CACHED_MEMPOOL_ADDR ?= 0 # don't care this when mmu is off
CACHED_MEMPOOL_SIZE ?= 0
UNCACHED_MEMPOOL_ADDR ?= 0x45E00000
UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB
BL33_ADDR ?= 0x42110000
MD_ADDR ?= 0x46000000
HSM_OS_ADDR ?= 0x42080000
AP_MD_SHARE_NC ?= 0x56000000
AP_MD_SHARE_C ?= 0x58000000
endif
# LK build as BL2 or BL33 setting
LK_AS_BL33 ?= 0
# CPU FREQ: CA35_FREQ_806MHZ (0.8G), CA35_FREQ_1196MHZ (1.2G)
CA35_FREQ ?= CA35_FREQ_1196MHZ
MODULE_DEPS += \
dev/interrupt/arm_gic_v3 \
dev/timer/arm_generic \
lib/bio \
lib/fastboot \
lib/fdt \
lib/fit \
lib/kcmdline \
lib/mempool \
lib/partition \
# if BOOTAPP is not specified elsewhere, and AVB is required, choose 'avbboot'
ifeq ($(strip $(SECURE_BOOT_ENABLE)),yes)
ifeq ($(strip $(SECURE_BOOT_TYPE)),avb)
BOOTAPP ?= avbboot
endif
endif
# otherwise, choose 'fitboot'
BOOTAPP ?= fitboot
MODULES += app/$(BOOTAPP)
ifeq ($(WITH_KERNEL_VM),1)
GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT)
else
GLOBAL_DEFINES += NOVM_MAX_ARENAS=2
endif
ifeq ($(SECURE_BOOT_ENABLE),yes)
ifeq ($(MD_VERIFY),yes)
GLOBAL_DEFINES += MTK_SECURITY_SW_SUPPORT
endif
endif
# for AEE
GLOBAL_DEFINES += MTK_PMIC_FULL_RESET
# for user load
ifeq ($(BUILD_LOAD_TYPE),user)
GLOBAL_DEFINES += MTK_BUILD_USER_LOAD
endif
GLOBAL_DEFINES += \
RAMBASE=$(RAMBASE) \
MACH_TYPE=$(MACH_TYPE) \
PLATFORM_SUPPORTS_PANIC_SHELL=1 \
WITH_NO_FP=1 \
CACHED_MEMPOOL_ADDR=$(CACHED_MEMPOOL_ADDR) \
CACHED_MEMPOOL_SIZE=$(CACHED_MEMPOOL_SIZE) \
UNCACHED_MEMPOOL_ADDR=$(UNCACHED_MEMPOOL_ADDR) \
UNCACHED_MEMPOOL_SIZE=$(UNCACHED_MEMPOOL_SIZE) \
BL33_ADDR=$(BL33_ADDR) \
MD_ADDR=$(MD_ADDR) \
HSM_OS_ADDR=$(HSM_OS_ADDR) \
AP_MD_SHARE_NC=$(AP_MD_SHARE_NC) \
AP_MD_SHARE_C=$(AP_MD_SHARE_C) \
$(CA35_FREQ) \
LK_AS_BL33=$(LK_AS_BL33) \
GICV3_SUPPORT_GIC600=$(GICV3_SUPPORT_GIC600)
LINKER_SCRIPT += \
$(BUILDDIR)/system-onesegment.ld
include $(LOCAL_DIR)/bl2_bl33_options.mk
include make/module.mk $(LOCAL_DIR)/drivers/rules.mk