blob: a42533e2bf2d417273affa277a094a9714568872 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001LOCAL_DIR := $(GET_LOCAL_DIR)
2
3MODULE := $(LOCAL_DIR)
4COMMON_PLAT := $(LOCAL_DIR)/../common
5
6ARCH ?= arm64
7ARM_CPU ?= cortex-a53
8WITH_SMP ?= 0
9
10LK_HEAP_IMPLEMENTATION ?= miniheap
11
12GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include
13GLOBAL_CFLAGS += -fno-stack-protector
14MODULE_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
21GLOBAL_INCLUDES += \
22 $(LOCAL_DIR)/../common/include
23
24MACH_TYPE := 8133
25
26KERNEL_ASPACE_BASE ?= 0xfffffff000000000
27KERNEL_ASPACE_SIZE ?= 0x0000000180000000
28MMU_IDENT_SIZE_SHIFT ?= 32
29
30CACHED_MEMPOOL_ADDR ?= 0xfffffff04c500000
31CACHED_MEMPOOL_SIZE ?= 0x03A00000 # 58MB
32UNCACHED_MEMPOOL_ADDR ?= 0xfffffff04c300000
33UNCACHED_MEMPOOL_SIZE ?= 0x200000 # 2MB
34BL33_ADDR ?= 0xfffffff043200000
35
36# LK build as BL2 or BL33 setting
37LK_AS_BL33 ?= 0
38
39MODULE_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'
49ifeq ($(strip $(SECURE_BOOT_ENABLE)),yes)
50ifeq ($(strip $(SECURE_BOOT_TYPE)),avb)
51BOOTAPP ?= avbboot
52endif
53endif
54
55# otherwise, choose 'fitboot'
56BOOTAPP ?= fitboot
57
58MODULES += app/$(BOOTAPP)
59
60GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT)
61
62GLOBAL_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
74TOOLCHAIN_PREFIX := $(ARCH_$(ARCH)_TOOLCHAIN_PREFIX)
75$(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX))
76ifneq ($(call TOBOOL,$(CLANGBUILD)),true)
77GCC_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.`))
79ifeq ($(GCC_VER_GTE94),1)
80ARCH_COMPILEFLAGS += -mno-outline-atomics
81endif
82endif
83$(info ARCH_COMPILEFLAGS = $(ARCH_COMPILEFLAGS))
84
85LINKER_SCRIPT += \
86 $(BUILDDIR)/system-onesegment.ld
87
88include $(LOCAL_DIR)/bl2_bl33_options.mk
89include make/module.mk $(LOCAL_DIR)/drivers/rules.mk