blob: 22403e62a9a8cb929e017ba7dbc89b2b7bcd5a58 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4
5ARCH ?= arm64
6ARM_CPU ?= cortex-a53
7WITH_SMP ?= 0
8WITH_KERNEL_VM ?= 1
9WITH_MTK_PMIC_WRAP_AND_PMIC ?= 0
10AB_UPGRADE_APP := 1
11
12LK_HEAP_IMPLEMENTATION ?= miniheap
13
14GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \
15
16MODULE_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
22GLOBAL_INCLUDES += \
23 $(LOCAL_DIR)/../common/include \
24
25ifeq ($(WITH_KERNEL_VM),1)
26KERNEL_ASPACE_BASE ?= 0xfffffff000000000
27KERNEL_ASPACE_SIZE ?= 0x0000000180000000
28KERNEL_BASE ?= 0xfffffff000200000 # KERNEL_ASPACE_BASE + MEMBASE
29MMU_IDENT_SIZE_SHIFT ?= 32
30endif
31
32MEMBASE ?= 0x200000
33KERNEL_LOAD_OFFSET ?= 0x1000
34MEMSIZE ?= 0x00080000 # 512K
35MACH_TYPE := 6771
36
37ifeq ($(WITH_KERNEL_VM),1)
38GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT)
39else
40GLOBAL_DEFINES += NOVM_MAX_ARENAS=2
41endif
42
43# LK build as BL2 or BL33 setting
44LK_AS_BL33 ?= 0
45MODULE_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
54GLOBAL_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
64GLOBAL_CFLAGS += -fno-stack-protector -Wno-return-type\
65
66LINKER_SCRIPT += \
67 $(BUILDDIR)/system-onesegment.ld
68
69include make/module.mk $(LOCAL_DIR)/drivers/rules.mk
70
71WITH_DISPLAY ?= 0
72
73ifeq ($(WITH_DISPLAY),1)
74GLOBAL_DEFINES += WITH_DISPLAY=$(WITH_DISPLAY)
75endif
76
77HDMI_MAIN_PATH ?= 0
78
79ifeq ($(WITH_DISPLAY),1)
80GLOBAL_DEFINES += HDMI_MAIN_PATH=$(HDMI_MAIN_PATH)
81endif
82
83ifeq ($(WITH_PANEL_TPV_PH060PB16A),1)
84GLOBAL_DEFINES += WITH_PANEL_TPV_PH060PB16A=$(WITH_PANEL_TPV_PH060PB16A)
85endif
86
87TOOLCHAIN_PREFIX := $(ARCH_$(ARCH)_TOOLCHAIN_PREFIX)
88$(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX))
89ifneq ($(call TOBOOL,$(CLANGBUILD)),true)
90GCC_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.`))
92ifeq ($(GCC_VER_GTE94),1)
93ARCH_COMPILEFLAGS += -mno-outline-atomics
94endif
95endif
96$(info ARCH_COMPILEFLAGS = $(ARCH_COMPILEFLAGS))
97