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