blob: 6bae6f6b4f6acfc3de519250920d7a0f3b0aefc6 [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
10AB_UPGRADE_APP := 1
11
12LK_HEAP_IMPLEMENTATION ?= miniheap
13
14GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \
15
16MT8518 :=1
17
18GLOBAL_DEFINES += \
19 MT8518=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 ?= 0xffff000000200000
29KERNEL_ASPACE_SIZE ?= 0x00000000f0000000
30MMU_IDENT_SIZE_SHIFT ?= 32
31endif
32MEMBASE ?= 0x200000
33KERNEL_LOAD_OFFSET ?= 0x1000
34MEMSIZE ?= 0x00040000 # 256K
35MACH_TYPE := 8518
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_MT6395),1)
51 GLOBAL_DEFINES += WITH_PMIC_MT6395=$(WITH_PMIC_MT6395)
52endif
53
54ifeq ($(PMIC_MT6395_I2C0),1)
55 GLOBAL_DEFINES += PMIC_MT6395_I2C0=$(PMIC_MT6395_I2C0)
56endif
57
58ifeq ($(MTK_TINYSYS_SCP_SUPPORT), yes)
59MODULE_DEPS += $(LOCAL_DIR)/drivers/scp
60GLOBAL_DEFINES += MTK_TINYSYS_SCP_SUPPORT
61endif
62ifeq ($(WITH_VCORE_I2C_BUCK),1)
63 GLOBAL_DEFINES += WITH_VCORE_I2C_BUCK=$(WITH_VCORE_I2C_BUCK)
64endif
65
66ifeq ($(WITH_VCORE_PWM_BUCK),1)
67 GLOBAL_DEFINES += WITH_VCORE_PWM_BUCK=$(WITH_VCORE_PWM_BUCK)
68endif
69
70ifeq ($(WITH_32K_OSC),1)
71 GLOBAL_DEFINES += WITH_32K_OSC=$(WITH_32K_OSC)
72endif
73
74ifeq ($(WITH_UBOOT),1)
75GLOBAL_DEFINES += WITH_UBOOT=$(WITH_UBOOT)
76endif
77
78ifeq ($(UBOOT_ARCH64),1)
79GLOBAL_DEFINES += UBOOT_ARCH64=$(UBOOT_ARCH64)
80endif
81
82ifeq ($(SUPPORT_SLC_GPT_BACKUP), 1)
83GLOBAL_DEFINES += SUPPORT_SLC_GPT_BACKUP=1
84endif
85
86ifeq ($(WITH_BOOTMODE_HANDSHAKE),1)
87GLOBAL_DEFINES += WITH_BOOTMODE_HANDSHAKE=$(WITH_BOOTMODE_HANDSHAKE)
88endif
89
90GLOBAL_DEFINES += \
91 MEMBASE=$(MEMBASE) \
92 MEMSIZE=$(MEMSIZE) \
93 RAMBASE=$(RAMBASE) \
94 MACH_TYPE=$(MACH_TYPE) \
95 PLATFORM_SUPPORTS_PANIC_SHELL=1 \
96 WITH_NO_FP=1 \
97 AB_UPGRADE_APP=$(AB_UPGRADE_APP) \
98
99LINKER_SCRIPT += \
100 $(BUILDDIR)/system-onesegment.ld
101
102TOOLCHAIN_PREFIX := $(ARCH_$(ARCH)_TOOLCHAIN_PREFIX)
103$(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX))
104ifneq ($(call TOBOOL,$(CLANGBUILD)),true)
105GCC_VER_GTE94 := $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.` \>= 9.4 | bc )
106$(info GCC_VER = $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.`))
107ifeq ($(GCC_VER_GTE94),1)
108ARCH_COMPILEFLAGS += -mno-outline-atomics
109endif
110endif
111$(info ARCH_COMPILEFLAGS = $(ARCH_COMPILEFLAGS))
112
113include make/module.mk $(LOCAL_DIR)/drivers/rules.mk