[Feature]add MT2731_MP2_MR2_SVN388 baseline version
Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/include/target/cust_usb.h b/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/include/target/cust_usb.h
new file mode 100644
index 0000000..501b4ad
--- /dev/null
+++ b/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/include/target/cust_usb.h
@@ -0,0 +1,9 @@
+#pragma once
+
+#define CONFIG_USBD_LANG "0409"
+
+#define USB_VENDORID (0x0E8D)
+#define USB_PRODUCTID (0x201C)
+#define USB_VERSIONID (0x0100)
+#define USB_MANUFACTURER "MediaTek"
+#define USB_PRODUCT_NAME "Yocto"
diff --git a/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/include/target/debugconfig.h b/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/include/target/debugconfig.h
new file mode 100644
index 0000000..9513af6
--- /dev/null
+++ b/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/include/target/debugconfig.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2018 MediaTek Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+#pragma once
+
+#define DEBUG_UART 0
+
diff --git a/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/rules.mk b/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/rules.mk
new file mode 100644
index 0000000..c03a2f6
--- /dev/null
+++ b/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/rules.mk
@@ -0,0 +1,66 @@
+LOCAL_DIR := $(GET_LOCAL_DIR)
+MODULE := ${LOCAL_DIR}
+
+GLOBAL_INCLUDES += \
+ $(LOCAL_DIR)/include
+
+MODULE_SRCS += \
+ $(LOCAL_DIR)/target.c
+
+PLATFORM := mt8512
+
+SPI_NAND_PROJECT := y
+
+TZ_PART_NAME := tee_a
+RECOVERY_TZ_PART_NAME = tee_b
+DTBO_PART_NAME := dtbo
+BOOT_PART_NAME := boot_a
+RECOVERY_BOOT_PART_NAME = boot_b
+
+ifeq ($(WITH_KERNEL_VM),1)
+# The physical dram address is 0x40000000 and its virtual address 0xffff00000d600000
+# The CACHED_MEMPOOL_ADDR virtual address would be 0xffff00000d600000 + 0x4000000 = 0xffff000011600000
+# The UNCACHED_MEMPOOL_ADDR virtual address would be 0xffff000011600000UL + 0x0AA00000 = 0xffff00001C000000UL
+# The BL33_ADDR virtual address would be 0xffff00000d600000 + 0x1e00000 = 0xffff00000f400000
+# The NAND_BUF_ADDR virtual address would be 0xffff00001C000000UL + 0x00200000 = 0xffff00001C200000UL
+CACHED_MEMPOOL_ADDR := 0xffff00000e600000UL
+UNCACHED_MEMPOOL_ADDR := 0xffff000010600000UL
+BL33_ADDR := 0xffff000011000000UL
+NAND_BUF_ADDR := 0xffff000010900000UL
+else
+CACHED_MEMPOOL_ADDR := 0x41000000
+UNCACHED_MEMPOOL_ADDR := 0x43000000
+BL33_ADDR := 0x43a00000
+NAND_BUF_ADDR := 0x43300000
+endif
+
+CACHED_MEMPOOL_SIZE := 0x2000000 # 48MB
+UNCACHED_MEMPOOL_SIZE := 0x0007D000 # 500k
+
+SCRATCH_SIZE := 0x800000 # 8MB
+
+MAX_TEE_DRAM_SIZE := 0x00400000 # 4M
+MAX_KERNEL_SIZE := 0x01000000 # 16M
+MAX_DTB_SIZE := 0x00200000 # 2M
+MAX_LZ4_BUF_SIZE := 0x00100000 # 1M
+MAX_NAND_BUF_SIZE := 0x00100000 # 1M
+
+# CACHED_MEMPOOL_ADDR + CACHED_MEMPOOL_SIZE for upgrade
+# CACHED_MEMPOOL_ADDR + MAX_TEE_DRAM_SIZE + MAX_KERNEL_SIZE
+# + MAX_DTB_SIZE + MAX_LZ4_BUF_SIZE for boot
+
+GLOBAL_CFLAGS += -DTZ_PART_NAME=\"$(TZ_PART_NAME)\" \
+ -DDTBO_PART_NAME=\"$(DTBO_PART_NAME)\" \
+ -DBOOT_PART_NAME=\"$(BOOT_PART_NAME)\" \
+ -DRECOVERY_BOOT_PART_NAME=\"$(RECOVERY_BOOT_PART_NAME)\" \
+ -DRECOVERY_TZ_PART_NAME=\"$(RECOVERY_TZ_PART_NAME)\" \
+
+GLOBAL_DEFINES += CACHED_MEMPOOL_ADDR=$(CACHED_MEMPOOL_ADDR) \
+ CACHED_MEMPOOL_SIZE=$(CACHED_MEMPOOL_SIZE) \
+ UNCACHED_MEMPOOL_ADDR=$(UNCACHED_MEMPOOL_ADDR) \
+ UNCACHED_MEMPOOL_SIZE=$(UNCACHED_MEMPOOL_SIZE) \
+ SCRATCH_SIZE=$(SCRATCH_SIZE) \
+ BL33_ADDR=$(BL33_ADDR) \
+ NAND_BUF_ADDR=$(NAND_BUF_ADDR)
+
+include make/module.mk
diff --git a/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/target.c b/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/target.c
new file mode 100644
index 0000000..de4f9d8
--- /dev/null
+++ b/src/bsp/lk/target/aud8512ap2v1-linux-slc-test/target.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018 MediaTek Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#include <platform/nand.h>
+
+void target_init(void)
+{
+ nand_init_device();
+}