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 ?= 0 |
| 9 | WITH_EL3_EXCEPTIONS ?= 1 |
| 10 | AB_UPGRADE_APP := 1 |
| 11 | |
| 12 | LK_HEAP_IMPLEMENTATION ?= miniheap |
| 13 | |
| 14 | GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \ |
| 15 | |
| 16 | MT8518 :=1 |
| 17 | |
| 18 | GLOBAL_DEFINES += \ |
| 19 | MT8518=1 |
| 20 | |
| 21 | MODULE_SRCS += \ |
| 22 | $(LOCAL_DIR)/platform.c \ |
| 23 | $(LOCAL_DIR)/debug.c \ |
| 24 | $(LOCAL_DIR)/interrupts.c \ |
| 25 | $(LOCAL_DIR)/timer.c \ |
| 26 | |
| 27 | ifeq ($(WITH_KERNEL_VM),1) |
| 28 | KERNEL_ASPACE_BASE ?= 0xffff000000200000 |
| 29 | KERNEL_ASPACE_SIZE ?= 0x00000000f0000000 |
| 30 | MMU_IDENT_SIZE_SHIFT ?= 32 |
| 31 | endif |
| 32 | MEMBASE ?= 0x200000 |
| 33 | KERNEL_LOAD_OFFSET ?= 0x1000 |
| 34 | MEMSIZE ?= 0x00040000 # 256K |
| 35 | MACH_TYPE := 8518 |
| 36 | |
| 37 | MODULE_DEPS += \ |
| 38 | dev/timer/arm_generic \ |
| 39 | lib/cksum \ |
| 40 | lib/mempool \ |
| 41 | |
| 42 | ifeq ($(WITH_KERNEL_VM),1) |
| 43 | GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT) |
| 44 | endif |
| 45 | |
| 46 | ifeq ($(WITH_MTK_PMIC_WRAP_AND_PMIC),1) |
| 47 | GLOBAL_DEFINES += WITH_MTK_PMIC_WRAP_AND_PMIC=$(WITH_MTK_PMIC_WRAP_AND_PMIC) |
| 48 | endif |
| 49 | |
| 50 | ifeq ($(WITH_PMIC_MT6395),1) |
| 51 | GLOBAL_DEFINES += WITH_PMIC_MT6395=$(WITH_PMIC_MT6395) |
| 52 | endif |
| 53 | |
| 54 | ifeq ($(PMIC_MT6395_I2C0),1) |
| 55 | GLOBAL_DEFINES += PMIC_MT6395_I2C0=$(PMIC_MT6395_I2C0) |
| 56 | endif |
| 57 | |
| 58 | ifeq ($(MTK_TINYSYS_SCP_SUPPORT), yes) |
| 59 | MODULE_DEPS += $(LOCAL_DIR)/drivers/scp |
| 60 | GLOBAL_DEFINES += MTK_TINYSYS_SCP_SUPPORT |
| 61 | endif |
| 62 | ifeq ($(WITH_VCORE_I2C_BUCK),1) |
| 63 | GLOBAL_DEFINES += WITH_VCORE_I2C_BUCK=$(WITH_VCORE_I2C_BUCK) |
| 64 | endif |
| 65 | |
| 66 | ifeq ($(WITH_VCORE_PWM_BUCK),1) |
| 67 | GLOBAL_DEFINES += WITH_VCORE_PWM_BUCK=$(WITH_VCORE_PWM_BUCK) |
| 68 | endif |
| 69 | |
| 70 | ifeq ($(WITH_32K_OSC),1) |
| 71 | GLOBAL_DEFINES += WITH_32K_OSC=$(WITH_32K_OSC) |
| 72 | endif |
| 73 | |
| 74 | ifeq ($(WITH_UBOOT),1) |
| 75 | GLOBAL_DEFINES += WITH_UBOOT=$(WITH_UBOOT) |
| 76 | endif |
| 77 | |
| 78 | ifeq ($(UBOOT_ARCH64),1) |
| 79 | GLOBAL_DEFINES += UBOOT_ARCH64=$(UBOOT_ARCH64) |
| 80 | endif |
| 81 | |
| 82 | ifeq ($(SUPPORT_SLC_GPT_BACKUP), 1) |
| 83 | GLOBAL_DEFINES += SUPPORT_SLC_GPT_BACKUP=1 |
| 84 | endif |
| 85 | |
| 86 | ifeq ($(WITH_BOOTMODE_HANDSHAKE),1) |
| 87 | GLOBAL_DEFINES += WITH_BOOTMODE_HANDSHAKE=$(WITH_BOOTMODE_HANDSHAKE) |
| 88 | endif |
| 89 | |
| 90 | GLOBAL_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 | |
| 99 | LINKER_SCRIPT += \ |
| 100 | $(BUILDDIR)/system-onesegment.ld |
| 101 | |
| 102 | TOOLCHAIN_PREFIX := $(ARCH_$(ARCH)_TOOLCHAIN_PREFIX) |
| 103 | $(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX)) |
| 104 | ifneq ($(call TOBOOL,$(CLANGBUILD)),true) |
| 105 | GCC_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.`)) |
| 107 | ifeq ($(GCC_VER_GTE94),1) |
| 108 | ARCH_COMPILEFLAGS += -mno-outline-atomics |
| 109 | endif |
| 110 | endif |
| 111 | $(info ARCH_COMPILEFLAGS = $(ARCH_COMPILEFLAGS)) |
| 112 | |
| 113 | include make/module.mk $(LOCAL_DIR)/drivers/rules.mk |