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 | |
| 10 | LK_HEAP_IMPLEMENTATION ?= miniheap |
| 11 | |
| 12 | GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include |
| 13 | GLOBAL_CFLAGS += -fno-stack-protector |
| 14 | MODULE_SRCS += \ |
| 15 | $(LOCAL_DIR)/platform.c \ |
| 16 | $(LOCAL_DIR)/../common/debug.c \ |
| 17 | $(LOCAL_DIR)/../common/interrupts.c \ |
| 18 | $(LOCAL_DIR)/../common/boot_mode.c \ |
| 19 | $(LOCAL_DIR)/fixup/plat_fixup.c \ |
| 20 | |
| 21 | GLOBAL_INCLUDES += \ |
| 22 | $(LOCAL_DIR)/../common/include |
| 23 | |
| 24 | MACH_TYPE := 8133 |
| 25 | |
| 26 | KERNEL_ASPACE_BASE ?= 0xfffffff000000000 |
| 27 | KERNEL_ASPACE_SIZE ?= 0x0000000180000000 |
| 28 | MMU_IDENT_SIZE_SHIFT ?= 32 |
| 29 | |
| 30 | CACHED_MEMPOOL_ADDR ?= 0xfffffff04c500000 |
| 31 | CACHED_MEMPOOL_SIZE ?= 0x03A00000 # 58MB |
| 32 | UNCACHED_MEMPOOL_ADDR ?= 0xfffffff04c300000 |
| 33 | UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB |
| 34 | BL33_ADDR ?= 0xfffffff043200000 |
| 35 | |
| 36 | # LK build as BL2 or BL33 setting |
| 37 | LK_AS_BL33 ?= 0 |
| 38 | |
| 39 | MODULE_DEPS += \ |
| 40 | dev/interrupt/arm_gic_v3 \ |
| 41 | dev/timer/arm_generic \ |
| 42 | lib/bio \ |
| 43 | lib/partition \ |
| 44 | lib/fdt \ |
| 45 | lib/mempool \ |
| 46 | lib/kcmdline |
| 47 | |
| 48 | # if BOOTAPP is not specified elsewhere, and AVB is required, choose 'avbboot' |
| 49 | ifeq ($(strip $(SECURE_BOOT_ENABLE)),yes) |
| 50 | ifeq ($(strip $(SECURE_BOOT_TYPE)),avb) |
| 51 | BOOTAPP ?= avbboot |
| 52 | endif |
| 53 | endif |
| 54 | |
| 55 | # otherwise, choose 'fitboot' |
| 56 | BOOTAPP ?= fitboot |
| 57 | |
| 58 | MODULES += app/$(BOOTAPP) |
| 59 | |
| 60 | GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT) |
| 61 | |
| 62 | GLOBAL_DEFINES += \ |
| 63 | RAMBASE=$(RAMBASE) \ |
| 64 | MACH_TYPE=$(MACH_TYPE) \ |
| 65 | PLATFORM_SUPPORTS_PANIC_SHELL=1 \ |
| 66 | WITH_NO_FP=1 \ |
| 67 | CACHED_MEMPOOL_ADDR=$(CACHED_MEMPOOL_ADDR) \ |
| 68 | CACHED_MEMPOOL_SIZE=$(CACHED_MEMPOOL_SIZE) \ |
| 69 | UNCACHED_MEMPOOL_ADDR=$(UNCACHED_MEMPOOL_ADDR) \ |
| 70 | UNCACHED_MEMPOOL_SIZE=$(UNCACHED_MEMPOOL_SIZE) \ |
| 71 | BL33_ADDR=$(BL33_ADDR) \ |
| 72 | LK_AS_BL33=$(LK_AS_BL33) |
| 73 | |
| 74 | TOOLCHAIN_PREFIX := $(ARCH_$(ARCH)_TOOLCHAIN_PREFIX) |
| 75 | $(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX)) |
| 76 | ifneq ($(call TOBOOL,$(CLANGBUILD)),true) |
| 77 | GCC_VER_GTE94 := $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.` \>= 9.4 | bc ) |
| 78 | $(info GCC_VER = $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.`)) |
| 79 | ifeq ($(GCC_VER_GTE94),1) |
| 80 | ARCH_COMPILEFLAGS += -mno-outline-atomics |
| 81 | endif |
| 82 | endif |
| 83 | $(info ARCH_COMPILEFLAGS = $(ARCH_COMPILEFLAGS)) |
| 84 | |
| 85 | LINKER_SCRIPT += \ |
| 86 | $(BUILDDIR)/system-onesegment.ld |
| 87 | |
| 88 | include $(LOCAL_DIR)/bl2_bl33_options.mk |
| 89 | include make/module.mk $(LOCAL_DIR)/drivers/rules.mk |