rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | LOCAL_DIR := $(GET_LOCAL_DIR) |
| 2 | |
| 3 | MODULE := $(LOCAL_DIR) |
| 4 | |
| 5 | ARCH ?= arm64 |
| 6 | ARM_CPU ?= cortex-a53 |
| 7 | WITH_SMP ?= 0 |
| 8 | WITH_KERNEL_VM ?= 1 |
| 9 | WITH_MTK_PMIC_WRAP_AND_PMIC ?= 0 |
| 10 | AB_UPGRADE_APP := 1 |
| 11 | |
| 12 | LK_HEAP_IMPLEMENTATION ?= miniheap |
| 13 | |
| 14 | GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \ |
| 15 | |
| 16 | MODULE_SRCS += \ |
| 17 | $(LOCAL_DIR)/platform.c \ |
| 18 | $(LOCAL_DIR)/plat_dbg_info.c \ |
| 19 | $(LOCAL_DIR)/../common/debug.c \ |
| 20 | $(LOCAL_DIR)/../common/interrupts.c \ |
| 21 | |
| 22 | GLOBAL_INCLUDES += \ |
| 23 | $(LOCAL_DIR)/../common/include \ |
| 24 | |
| 25 | ifeq ($(WITH_KERNEL_VM),1) |
| 26 | KERNEL_ASPACE_BASE ?= 0xfffffff000000000 |
| 27 | KERNEL_ASPACE_SIZE ?= 0x0000000180000000 |
| 28 | KERNEL_BASE ?= 0xfffffff000200000 # KERNEL_ASPACE_BASE + MEMBASE |
| 29 | MMU_IDENT_SIZE_SHIFT ?= 32 |
| 30 | endif |
| 31 | |
| 32 | MEMBASE ?= 0x200000 |
| 33 | KERNEL_LOAD_OFFSET ?= 0x1000 |
| 34 | MEMSIZE ?= 0x00080000 # 512K |
| 35 | MACH_TYPE := 6771 |
| 36 | |
| 37 | ifeq ($(WITH_KERNEL_VM),1) |
| 38 | GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT) |
| 39 | else |
| 40 | GLOBAL_DEFINES += NOVM_MAX_ARENAS=2 |
| 41 | endif |
| 42 | |
| 43 | # LK build as BL2 or BL33 setting |
| 44 | LK_AS_BL33 ?= 0 |
| 45 | MODULE_DEPS += \ |
| 46 | dev/interrupt/arm_gic_v3 \ |
| 47 | dev/timer/arm_generic \ |
| 48 | lib/bio \ |
| 49 | lib/cksum \ |
| 50 | lib/partition \ |
| 51 | lib/fdt \ |
| 52 | lib/mempool \ |
| 53 | |
| 54 | GLOBAL_DEFINES += \ |
| 55 | MEMBASE=$(MEMBASE) \ |
| 56 | MEMSIZE=$(MEMSIZE) \ |
| 57 | RAMBASE=$(RAMBASE) \ |
| 58 | MACH_TYPE=$(MACH_TYPE) \ |
| 59 | PLATFORM_SUPPORTS_PANIC_SHELL=1 \ |
| 60 | NOVM_MAX_ARENAS=2 \ |
| 61 | WITH_NO_FP=1 \ |
| 62 | AB_UPGRADE_APP=$(AB_UPGRADE_APP) \ |
| 63 | |
| 64 | GLOBAL_CFLAGS += -fno-stack-protector -Wno-return-type\ |
| 65 | |
| 66 | LINKER_SCRIPT += \ |
| 67 | $(BUILDDIR)/system-onesegment.ld |
| 68 | |
| 69 | include make/module.mk $(LOCAL_DIR)/drivers/rules.mk |
| 70 | |
| 71 | WITH_DISPLAY ?= 0 |
| 72 | |
| 73 | ifeq ($(WITH_DISPLAY),1) |
| 74 | GLOBAL_DEFINES += WITH_DISPLAY=$(WITH_DISPLAY) |
| 75 | endif |
| 76 | |
| 77 | HDMI_MAIN_PATH ?= 0 |
| 78 | |
| 79 | ifeq ($(WITH_DISPLAY),1) |
| 80 | GLOBAL_DEFINES += HDMI_MAIN_PATH=$(HDMI_MAIN_PATH) |
| 81 | endif |
| 82 | |
| 83 | ifeq ($(WITH_PANEL_TPV_PH060PB16A),1) |
| 84 | GLOBAL_DEFINES += WITH_PANEL_TPV_PH060PB16A=$(WITH_PANEL_TPV_PH060PB16A) |
| 85 | endif |
| 86 | |
| 87 | TOOLCHAIN_PREFIX := $(ARCH_$(ARCH)_TOOLCHAIN_PREFIX) |
| 88 | $(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX)) |
| 89 | ifneq ($(call TOBOOL,$(CLANGBUILD)),true) |
| 90 | GCC_VER_GTE94 := $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.` \>= 9.4 | bc ) |
| 91 | $(info GCC_VER = $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.`)) |
| 92 | ifeq ($(GCC_VER_GTE94),1) |
| 93 | ARCH_COMPILEFLAGS += -mno-outline-atomics |
| 94 | endif |
| 95 | endif |
| 96 | $(info ARCH_COMPILEFLAGS = $(ARCH_COMPILEFLAGS)) |
| 97 | |