[Feature]add MT2731_MP2_MR2_SVN388 baseline version

Change-Id: Ief04314834b31e27effab435d3ca8ba33b499059
diff --git a/src/bsp/lk/platform/mt2735/platform.c b/src/bsp/lk/platform/mt2735/platform.c
new file mode 100644
index 0000000..dffb588
--- /dev/null
+++ b/src/bsp/lk/platform/mt2735/platform.c
@@ -0,0 +1,113 @@
+/*
+ * 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 <debug.h>
+#include <dev/interrupt/arm_gic.h>
+#include <dev/timer/arm_generic.h>
+#include <dev/uart.h>
+#include <err.h>
+#include <errno.h>
+#include <lib/mempool.h>
+#include <platform.h>
+#include <platform/platform_blx.h>
+#include <platform/gic.h>
+#include <platform/mtk_wdt.h>
+#include <platform/mtk_drm.h>
+#include <platform/mt_gpio.h>
+
+void platform_early_init(void)
+{
+    uart_init_early();
+
+    /* initialize the interrupt controller */
+    arm_gic_init();
+
+    arm_generic_timer_init(ARM_GENERIC_TIMER_PHYSICAL_INT, 13000000);
+
+    /* init debugtop DRM */
+    mtk_drm_init();
+
+    /* init AP watchdog and set timeout to 10 secs */
+    mtk_wdt_init();
+
+    /* init gpio */
+    mtk_gpio_init();
+
+    /* bl2 or bl33 specific platform early init */
+    platform_early_init_blx();
+
+    extern void  mtk_wdt_early_init(void) __attribute__((weak));
+    if (mtk_wdt_early_init)
+        mtk_wdt_early_init();
+}
+
+void platform_init(void)
+{
+    int cache_ret, uncache_ret;
+
+    cache_ret = NO_ERROR;
+    if (CACHED_MEMPOOL_ADDR && CACHED_MEMPOOL_SIZE)
+        cache_ret = mempool_init((void *)CACHED_MEMPOOL_ADDR,
+                                 CACHED_MEMPOOL_SIZE, MEMPOOL_CACHE);
+
+    uncache_ret = NO_ERROR;
+    if (UNCACHED_MEMPOOL_ADDR && UNCACHED_MEMPOOL_SIZE)
+        uncache_ret = mempool_init((void *)UNCACHED_MEMPOOL_ADDR,
+                                   UNCACHED_MEMPOOL_SIZE, MEMPOOL_UNCACHE);
+
+    if ((cache_ret != NO_ERROR) || (uncache_ret != NO_ERROR))
+        platform_halt(HALT_ACTION_REBOOT, HALT_REASON_SW_PANIC);
+}
+
+/* Initialization context in start.S before switching from EL3 to EL1.
+ * Note data/bss segment NOT initialized, i.e. No assumption on global variable initialization.*/
+void platform_el3_init(void)
+{
+    gic_setup();
+}
+
+
+/*
+ * target_ab_set_active_bootdev() - set active boot device in ab boot flow
+ *
+ * this function is used to set the active boot device, aka slot in ab boot
+ * concept. For mt2735, the slot concept should be defined by the actual
+ * target. For targets that support ab boot concept should override this
+ * function.
+ *
+ * @slot: the slot # to be set as active boot device
+ *
+ * returns:
+ *     -ENOTSUP: function not supported
+ */
+__WEAK int target_ab_set_active_bootdev(int slot)
+{
+    return 0;
+}
+
+/*
+ * override the common plat_ab_set_active_bootdev() impl.
+ */
+int plat_ab_set_active_bootdev(int slot)
+{
+    return target_ab_set_active_bootdev(slot);
+}