[Feature]add MT2731_MP2_MR2_SVN388 baseline version

Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/src/bsp/lk/platform/mt8518/rules.mk b/src/bsp/lk/platform/mt8518/rules.mk
new file mode 100644
index 0000000..6bae6f6
--- /dev/null
+++ b/src/bsp/lk/platform/mt8518/rules.mk
@@ -0,0 +1,113 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+
+MODULE := $(LOCAL_DIR)
+
+ARCH ?= arm64
+ARM_CPU ?= cortex-a53
+WITH_SMP ?= 0
+WITH_KERNEL_VM ?= 0
+WITH_EL3_EXCEPTIONS ?= 1
+AB_UPGRADE_APP := 1
+
+LK_HEAP_IMPLEMENTATION ?= miniheap
+
+GLOBAL_INCLUDES += -I$(LK_TOP_DIR)/include \
+
+MT8518 :=1
+
+GLOBAL_DEFINES += \
+       MT8518=1
+
+MODULE_SRCS += \
+    $(LOCAL_DIR)/platform.c \
+    $(LOCAL_DIR)/debug.c \
+    $(LOCAL_DIR)/interrupts.c \
+    $(LOCAL_DIR)/timer.c \
+
+ifeq ($(WITH_KERNEL_VM),1)
+KERNEL_ASPACE_BASE ?= 0xffff000000200000
+KERNEL_ASPACE_SIZE ?= 0x00000000f0000000
+MMU_IDENT_SIZE_SHIFT ?= 32
+endif
+MEMBASE ?= 0x200000
+KERNEL_LOAD_OFFSET ?= 0x1000
+MEMSIZE ?= 0x00040000   # 256K
+MACH_TYPE := 8518
+
+MODULE_DEPS += \
+    dev/timer/arm_generic \
+    lib/cksum \
+    lib/mempool \
+
+ifeq ($(WITH_KERNEL_VM),1)
+GLOBAL_DEFINES += MMU_IDENT_SIZE_SHIFT=$(MMU_IDENT_SIZE_SHIFT)
+endif
+
+ifeq ($(WITH_MTK_PMIC_WRAP_AND_PMIC),1)
+GLOBAL_DEFINES += WITH_MTK_PMIC_WRAP_AND_PMIC=$(WITH_MTK_PMIC_WRAP_AND_PMIC)
+endif
+
+ifeq ($(WITH_PMIC_MT6395),1)
+    GLOBAL_DEFINES += WITH_PMIC_MT6395=$(WITH_PMIC_MT6395)
+endif
+
+ifeq ($(PMIC_MT6395_I2C0),1)
+    GLOBAL_DEFINES += PMIC_MT6395_I2C0=$(PMIC_MT6395_I2C0)
+endif
+
+ifeq ($(MTK_TINYSYS_SCP_SUPPORT), yes)
+MODULE_DEPS += $(LOCAL_DIR)/drivers/scp
+GLOBAL_DEFINES += MTK_TINYSYS_SCP_SUPPORT
+endif
+ifeq ($(WITH_VCORE_I2C_BUCK),1)
+    GLOBAL_DEFINES += WITH_VCORE_I2C_BUCK=$(WITH_VCORE_I2C_BUCK)
+endif
+
+ifeq ($(WITH_VCORE_PWM_BUCK),1)
+    GLOBAL_DEFINES += WITH_VCORE_PWM_BUCK=$(WITH_VCORE_PWM_BUCK)
+endif
+
+ifeq ($(WITH_32K_OSC),1)
+    GLOBAL_DEFINES += WITH_32K_OSC=$(WITH_32K_OSC)
+endif
+
+ifeq ($(WITH_UBOOT),1)
+GLOBAL_DEFINES += WITH_UBOOT=$(WITH_UBOOT)
+endif
+
+ifeq ($(UBOOT_ARCH64),1)
+GLOBAL_DEFINES += UBOOT_ARCH64=$(UBOOT_ARCH64)
+endif
+
+ifeq ($(SUPPORT_SLC_GPT_BACKUP), 1)
+GLOBAL_DEFINES += SUPPORT_SLC_GPT_BACKUP=1
+endif
+
+ifeq ($(WITH_BOOTMODE_HANDSHAKE),1)
+GLOBAL_DEFINES += WITH_BOOTMODE_HANDSHAKE=$(WITH_BOOTMODE_HANDSHAKE)
+endif
+
+GLOBAL_DEFINES += \
+    MEMBASE=$(MEMBASE) \
+    MEMSIZE=$(MEMSIZE) \
+    RAMBASE=$(RAMBASE) \
+    MACH_TYPE=$(MACH_TYPE) \
+    PLATFORM_SUPPORTS_PANIC_SHELL=1 \
+    WITH_NO_FP=1 \
+    AB_UPGRADE_APP=$(AB_UPGRADE_APP) \
+
+LINKER_SCRIPT += \
+    $(BUILDDIR)/system-onesegment.ld
+
+TOOLCHAIN_PREFIX := $(ARCH_$(ARCH)_TOOLCHAIN_PREFIX)
+$(info TOOLCHAIN_PREFIX = $(TOOLCHAIN_PREFIX))
+ifneq ($(call TOBOOL,$(CLANGBUILD)),true)
+GCC_VER_GTE94 := $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.` \>= 9.4 | bc )
+$(info GCC_VER = $(shell echo `$(TOOLCHAIN_PREFIX)gcc -dumpfullversion | cut -f1-2 -d.`))
+ifeq ($(GCC_VER_GTE94),1)
+ARCH_COMPILEFLAGS += -mno-outline-atomics
+endif
+endif
+$(info ARCH_COMPILEFLAGS = $(ARCH_COMPILEFLAGS))
+
+include make/module.mk $(LOCAL_DIR)/drivers/rules.mk