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)/../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)/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 |
| 26 | BCB_RECOVERY_SUPPORT ?= 0 |
| 27 | |
| 28 | ifeq ($(WITH_SMP),1) |
| 29 | SMP_MAX_CPUS := 6 # if we need only one big core, set this to 5 |
| 30 | SMP_CPU_CLUSTER_SHIFT := 2 |
| 31 | SMP_CPU_ON_MASK ?= 0x11 # mask for which cpu to be on |
| 32 | |
| 33 | MODULE_SRCS += \ |
| 34 | $(COMMON_PLAT)/arch/$(ARCH)/mp.c \ |
| 35 | $(LOCAL_DIR)/plat_mp.c |
| 36 | |
| 37 | GLOBAL_DEFINES += SMP_CPU_ON_MASK=$(SMP_CPU_ON_MASK) |
| 38 | endif |
| 39 | |
| 40 | ifeq ($(LK_AS_BL33),1) |
| 41 | MODULE_SRCS += \ |
| 42 | $(COMMON_PLAT)/fastboot_oem_cmd/oem_efuse_cmd.c |
| 43 | endif |
| 44 | |
| 45 | GLOBAL_INCLUDES += \ |
| 46 | $(COMMON_PLAT)/include \ |
| 47 | |
| 48 | MACH_TYPE := 2712 |
| 49 | |
| 50 | ifeq ($(WITH_KERNEL_VM),1) |
| 51 | KERNEL_ASPACE_BASE ?= 0xfffffff000000000 |
| 52 | KERNEL_ASPACE_SIZE ?= 0x0000000180000000 |
| 53 | MMU_IDENT_SIZE_SHIFT ?= 32 |
| 54 | endif |
| 55 | |
| 56 | SCRATCH_SIZE := 0x02000000 # 32MB |
| 57 | |
| 58 | # mempool configuration |
| 59 | ifeq ($(WITH_KERNEL_VM),1) |
| 60 | CACHED_MEMPOOL_ADDR ?= 0xfffffff073800000 |
| 61 | CACHED_MEMPOOL_SIZE ?= 0x02800000 # 40MB |
| 62 | UNCACHED_MEMPOOL_ADDR ?= 0xfffffff073600000 |
| 63 | UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB |
| 64 | BL33_ADDR ?= 0xfffffff073500000 |
| 65 | else |
| 66 | CACHED_MEMPOOL_ADDR ?= 0 # don't care this when mmu is off |
| 67 | CACHED_MEMPOOL_SIZE ?= 0 |
| 68 | UNCACHED_MEMPOOL_ADDR ?= 0x73600000 |
| 69 | UNCACHED_MEMPOOL_SIZE ?= 0x0c800000 # 200MB |
| 70 | BL33_ADDR ?= 0x73500000 |
| 71 | endif |
| 72 | |
| 73 | # if DEBUG is not 0, enable debug feature |
| 74 | ifneq ($(DEBUG),0) |
| 75 | LOG_STORE_SUPPORT ?= 1 |
| 76 | endif |
| 77 | |
| 78 | # LK build as BL2 or BL33 setting |
| 79 | LK_AS_BL33 ?= 0 |
| 80 | |
| 81 | # CA35 FREQ: |
| 82 | # CA35_FREQ_806MHZ (0.8G), CA35_FREQ_1001MHZ (1.0G), CA35_FREQ_1196MHZ (1.2G) |
| 83 | CA35_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) |
| 88 | CA72_FREQ ?= CA72_FREQ_1599MHZ |
| 89 | |
| 90 | MODULE_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 | |
| 101 | ifeq ($(LOG_STORE_SUPPORT),1) |
| 102 | MODULE_DEPS += \ |
| 103 | lib/log_store |
| 104 | |
| 105 | GLOBAL_DEFINES += LOG_STORE_SUPPORT=$(LOG_STORE_SUPPORT) |
| 106 | endif |
| 107 | |
| 108 | # if BOOTAPP is not specified elsewhere, and AVB is required, choose 'avbboot' |
| 109 | ifeq ($(strip $(SECURE_BOOT_ENABLE)),yes) |
| 110 | ifeq ($(strip $(SECURE_BOOT_TYPE)),avb) |
| 111 | BOOTAPP ?= avbboot |
| 112 | endif |
| 113 | endif |
| 114 | |
| 115 | # otherwise, choose 'fitboot' |
| 116 | BOOTAPP ?= fitboot |
| 117 | |
| 118 | MODULES += app/$(BOOTAPP) |
| 119 | |
| 120 | # RTC OSC Removal |
| 121 | ifeq ($(strip $(MTK_CLK32K_EXT_REMOVAL_SUPPORT)),yes) |
| 122 | GLOBAL_DEFINES += MTK_CLK32K_EXT_REMOVAL_SUPPORT=1 |
| 123 | endif |
| 124 | |
| 125 | GLOBAL_DEFINES += MTK_THERMAL_RESET_SUPPORT |
| 126 | |
| 127 | ifeq ($(WITH_KERNEL_VM),1) |
| 128 | GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT) |
| 129 | else |
| 130 | GLOBAL_DEFINES += NOVM_MAX_ARENAS=2 |
| 131 | endif |
| 132 | |
| 133 | GLOBAL_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 | |
| 148 | LINKER_SCRIPT += \ |
| 149 | $(BUILDDIR)/system-onesegment.ld |
| 150 | |
| 151 | include $(LOCAL_DIR)/bl2_bl33_options.mk |
| 152 | include make/module.mk $(LOCAL_DIR)/drivers/rules.mk |