blob: 314803a8a629e593d3713ce42a9f0df0999ffc7c [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 ?= 0
9WITH_EL3_EXCEPTIONS ?= 1
10
11LK_HEAP_IMPLEMENTATION ?= miniheap
12
13GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \
14
15MT8512 :=1
16AB_UPGRADE_APP :=1
17
18GLOBAL_DEFINES += \
19 MT8512=1
20
21MODULE_SRCS += \
22 $(LOCAL_DIR)/platform.c \
23 $(LOCAL_DIR)/debug.c \
24 $(LOCAL_DIR)/interrupts.c \
25 $(LOCAL_DIR)/timer.c \
26
27ifeq ($(WITH_KERNEL_VM),1)
28KERNEL_ASPACE_BASE ?= 0xffff000000110000
29KERNEL_ASPACE_SIZE ?= 0x00000000f0000000
30MMU_IDENT_SIZE_SHIFT ?= 32
31endif
32MEMBASE ?= 0x110000
33KERNEL_LOAD_OFFSET ?= 0x1000
34MEMSIZE ?= 0x00050000 # 256K
35MACH_TYPE := 8512
36
37MODULE_DEPS += \
38 dev/timer/arm_generic \
39 lib/cksum \
40 lib/mempool \
41
42ifeq ($(WITH_KERNEL_VM),1)
43GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT)
44endif
45
46ifeq ($(WITH_MTK_PMIC_WRAP_AND_PMIC),1)
47GLOBAL_DEFINES += WITH_MTK_PMIC_WRAP_AND_PMIC=$(WITH_MTK_PMIC_WRAP_AND_PMIC)
48endif
49
50ifeq ($(WITH_PMIC_MT6398),1)
51 GLOBAL_DEFINES += WITH_PMIC_MT6398=$(WITH_PMIC_MT6398)
52endif
53
54ifeq ($(WITH_PMIC_BD71828),1)
55 GLOBAL_DEFINES += WITH_PMIC_BD71828=$(WITH_PMIC_BD71828)
56endif
57
58ifeq ($(WITH_EXT_32K),1)
59 GLOBAL_DEFINES += WITH_EXT_32K=$(WITH_EXT_32K)
60endif
61
62ifeq ($(MTK_TINYSYS_SCP_SUPPORT), yes)
63MODULE_DEPS += $(LOCAL_DIR)/drivers/scp
64GLOBAL_DEFINES += MTK_TINYSYS_SCP_SUPPORT
65endif
66ifeq ($(WITH_VCORE_I2C_BUCK),1)
67 GLOBAL_DEFINES += WITH_VCORE_I2C_BUCK=$(WITH_VCORE_I2C_BUCK)
68endif
69
70ifeq ($(WITH_VCORE_PWM_BUCK),1)
71 GLOBAL_DEFINES += WITH_VCORE_PWM_BUCK=$(WITH_VCORE_PWM_BUCK)
72endif
73
74ifeq ($(WITH_32K_OSC),1)
75 GLOBAL_DEFINES += WITH_32K_OSC=$(WITH_32K_OSC)
76endif
77
78ifeq ($(WITH_UBOOT),1)
79GLOBAL_DEFINES += WITH_UBOOT=$(WITH_UBOOT)
80endif
81
82GLOBAL_DEFINES += \
83 MEMBASE=$(MEMBASE) \
84 MEMSIZE=$(MEMSIZE) \
85 RAMBASE=$(RAMBASE) \
86 MACH_TYPE=$(MACH_TYPE) \
87 PLATFORM_SUPPORTS_PANIC_SHELL=1 \
88 AB_UPGRADE_APP=$(AB_UPGRADE_APP) \
89 WITH_NO_FP=1 \
90
91LINKER_SCRIPT += \
92 $(BUILDDIR)/system-onesegment.ld
93
94TOOLCHAIN_PREFIX := $(ARCH_$(ARCH)_TOOLCHAIN_PREFIX)
95$(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX))
96ifneq ($(call TOBOOL,$(CLANGBUILD)),true)
97GCC_VER_GTE94 := $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.` \>= 9.4 | bc )
98$(info GCC_VER = $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.`))
99ifeq ($(GCC_VER_GTE94),1)
100ARCH_COMPILEFLAGS += -mno-outline-atomics
101endif
102endif
103$(info ARCH_COMPILEFLAGS = $(ARCH_COMPILEFLAGS))
104
105include make/module.mk $(LOCAL_DIR)/drivers/rules.mk