Merge "target: msm8952: disable splash screen for msm8937"
diff --git a/dev/gcdb/display/gcdb_autopll.c b/dev/gcdb/display/gcdb_autopll.c
index b78cecc..562ca0b 100755
--- a/dev/gcdb/display/gcdb_autopll.c
+++ b/dev/gcdb/display/gcdb_autopll.c
@@ -242,10 +242,17 @@
 }
 #endif
 
-static uint32_t calculate_vco_thulium()
+static uint32_t calculate_vco_thulium(uint8_t bpp, uint8_t lanes)
 {
 	uint32_t rate;
 	uint32_t mod;
+	int bpp_lane;
+
+	/* round up the pixel clock to get the correct n2 div */
+	bpp_lane = bpp / lanes;
+	mod = pll_data.bit_clock % bpp_lane;
+	if (mod)
+		pll_data.pixel_clock++;
 
 	pll_data.vco_min = MIN_THULIUM_VCO_RATE;
 	pll_data.vco_max = MAX_THULIUM_VCO_RATE;
diff --git a/dev/gcdb/display/include/panel_hx8394f_720p_video.h b/dev/gcdb/display/include/panel_hx8394f_720p_video.h
new file mode 100755
index 0000000..c2fc441
--- /dev/null
+++ b/dev/gcdb/display/include/panel_hx8394f_720p_video.h
@@ -0,0 +1,278 @@
+/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _PANEL_HX8394F_720P_VIDEO_H_
+#define _PANEL_HX8394F_720P_VIDEO_H_
+/*---------------------------------------------------------------------------*/
+/* HEADER files                                                              */
+/*---------------------------------------------------------------------------*/
+#include "panel.h"
+
+/*---------------------------------------------------------------------------*/
+/* Panel configuration                                                       */
+/*---------------------------------------------------------------------------*/
+static struct panel_config hx8394f_720p_video_panel_data = {
+	"qcom,mdss_dsi_hx8394f_720p_video", "dsi:0:", "qcom,mdss-dsi-panel",
+	10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/*---------------------------------------------------------------------------*/
+/* Panel resolution                                                          */
+/*---------------------------------------------------------------------------*/
+static struct panel_resolution hx8394f_720p_video_panel_res = {
+	720, 1280, 16, 16, 10, 0, 15, 12, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/*---------------------------------------------------------------------------*/
+/* Panel color information                                                   */
+/*---------------------------------------------------------------------------*/
+static struct color_info hx8394f_720p_video_color = {
+	24, 0, 0xff, 0, 0, 0
+};
+
+/*---------------------------------------------------------------------------*/
+/* Panel on/off command information                                          */
+/*---------------------------------------------------------------------------*/
+static char hx8394f_720p_video_on_cmd0[] = {
+	0x04, 0x00, 0x29, 0xC0,
+	0xB9, 0xFF, 0x83, 0x94,
+
+};
+
+static char hx8394f_720p_video_on_cmd1[] = {
+	0x07, 0x00, 0x29, 0xC0,
+	0xBA, 0x63, 0x03, 0x68,
+	0x6b, 0xb2, 0xc0, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd2[] = {
+	0x0B, 0x00, 0x29, 0xC0,
+	0xB1, 0x50, 0x12, 0x72,
+	0x09, 0x32, 0x34, 0x71,
+	0x31, 0x70, 0x2f, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd3[] = {
+	0x07, 0x00, 0x29, 0xC0,
+	0xB2, 0x00, 0x80, 0x64,
+	0x0E, 0x0D, 0x2F, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd4[] = {
+	0x16, 0x00, 0x29, 0xC0,
+	0xB4, 0x6C, 0x6D, 0x6C,
+	0x6D, 0x6C, 0x6D, 0x01,
+	0x01, 0xFF, 0x75, 0x00,
+	0x3f, 0x6C, 0x6D, 0x6C,
+	0x6D, 0x6C, 0x6D, 0x01,
+	0x01, 0xFF, 0xFF, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd5[] = {
+	0x22, 0x00, 0x29, 0xC0,
+	0xD3, 0x00, 0x00, 0x07,
+	0x07, 0x40, 0x07, 0x10,
+	0x00, 0x08, 0x10, 0x08,
+	0x00, 0x08, 0x54, 0x15,
+	0x0E, 0x05, 0x0E, 0x02,
+	0x15, 0x06, 0x05, 0x06,
+	0x47, 0x44, 0x0A, 0x0A,
+	0x4B, 0x10, 0x07, 0x07,
+	0x0e, 0x40, 0xFF, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd6[] = {
+	0x2d, 0x00, 0x29, 0xC0,
+	0xD5, 0x1A, 0x1A, 0x1B,
+	0x1B, 0x00, 0x01, 0x02,
+	0x03, 0x04, 0x05, 0x06,
+	0x07, 0x08, 0x09, 0x0A,
+	0x0B, 0x24, 0x25, 0x18,
+	0x18, 0x26, 0x27, 0x18,
+	0x18, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0x18, 0x20,
+	0x21, 0x18, 0x18, 0x18,
+	0x18, 0xFF, 0xFF, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd7[] = {
+	0x2d, 0x00, 0x29, 0xC0,
+	0xD6, 0x1A, 0x1A, 0x1B,
+	0x1B, 0x0B, 0x0A, 0x09,
+	0x08, 0x07, 0x06, 0x05,
+	0x04, 0x03, 0x02, 0x01,
+	0x00, 0x21, 0x20, 0x18,
+	0x18, 0x27, 0x26, 0x18,
+	0x18, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0x18, 0x18,
+	0x18, 0x18, 0x18, 0x25,
+	0x24, 0x18, 0x18, 0x18,
+	0x18, 0xFF, 0xFF, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd8[] = {
+	0x3B, 0x00, 0x29, 0xC0,
+	0xE0, 0x00, 0x0C, 0x19,
+	0x20, 0x23, 0x26, 0x29,
+	0x28, 0x51, 0x61, 0x70,
+	0x6F, 0x76, 0x86, 0x89,
+	0x8D, 0x99, 0x9A, 0x95,
+	0xA1, 0xB0, 0x57, 0x55,
+	0x58, 0x5C, 0x5e, 0x64,
+	0x6b, 0x7f, 0x00, 0x0C,
+	0x19, 0x20, 0x23, 0x26,
+	0x29, 0x28, 0x51, 0x61,
+	0x70, 0x6F, 0x76, 0x86,
+	0x89, 0x8D, 0x99, 0x9A,
+	0x95, 0xA1, 0xB0, 0x57,
+	0x55, 0x58, 0x5C, 0x5e,
+	0x64, 0x6b, 0x7f, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd9[] = {
+	0x03, 0x00, 0x29, 0xC0,
+	0xC0, 0x1f, 0x73, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd10[] = {
+	0x02, 0x00, 0x29, 0xC0,
+	0xCC, 0x0B, 0xFF, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd11[] = {
+	0x02, 0x00, 0x29, 0xC0,
+	0xd4, 0x02, 0xFF, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd12[] = {
+	0x03, 0x00, 0x29, 0xC0,
+	0xB6, 0x7E, 0x7E, 0xFF,
+};
+
+static char hx8394f_720p_video_on_cmd13[] = {
+	0x11, 0x00, 0x05, 0x80
+};
+
+static char hx8394f_720p_video_on_cmd14[] = {
+	0x29, 0x00, 0x05, 0x80
+};
+
+static struct mipi_dsi_cmd hx8394f_720p_video_on_command[] = {
+	{0x8, hx8394f_720p_video_on_cmd0, 0x00},
+	{0xc, hx8394f_720p_video_on_cmd1, 0x00},
+	{0x10, hx8394f_720p_video_on_cmd2, 0x00},
+	{0xc, hx8394f_720p_video_on_cmd3, 0x00},
+	{0x1c, hx8394f_720p_video_on_cmd4, 0x00},
+	{0x28, hx8394f_720p_video_on_cmd5, 0x00},
+	{0x34, hx8394f_720p_video_on_cmd6, 0x00},
+	{0x34, hx8394f_720p_video_on_cmd7, 0x00},
+	{0x40, hx8394f_720p_video_on_cmd8, 0x00},
+	{0x8, hx8394f_720p_video_on_cmd9, 0x00},
+	{0x8, hx8394f_720p_video_on_cmd10, 0x00},
+	{0x8, hx8394f_720p_video_on_cmd11, 0x00},
+	{0x8, hx8394f_720p_video_on_cmd12, 0x00},
+	{0x4, hx8394f_720p_video_on_cmd13, 0x96},
+	{0x4, hx8394f_720p_video_on_cmd14, 0x0a}
+};
+
+#define HX8394F_720P_VIDEO_ON_COMMAND 15
+
+
+static char hx8394f_720p_videooff_cmd0[] = {
+	0x28, 0x00, 0x05, 0x80
+};
+
+static char hx8394f_720p_videooff_cmd1[] = {
+	0x10, 0x00, 0x05, 0x80
+};
+
+static struct mipi_dsi_cmd hx8394f_720p_video_off_command[] = {
+	{0x4, hx8394f_720p_videooff_cmd0, 0x78},
+	{0x4, hx8394f_720p_videooff_cmd1, 0x96}
+};
+
+#define HX8394F_720P_VIDEO_OFF_COMMAND 2
+
+
+static struct command_state hx8394f_720p_video_state = {
+	0, 1
+};
+
+/*---------------------------------------------------------------------------*/
+/* Command mode panel information                                            */
+/*---------------------------------------------------------------------------*/
+static struct commandpanel_info hx8394f_720p_video_command_panel = {
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/*---------------------------------------------------------------------------*/
+/* Video mode panel information                                              */
+/*---------------------------------------------------------------------------*/
+static struct videopanel_info hx8394f_720p_video_video_panel = {
+	1, 0, 0, 0, 1, 1, 2, 0, 0x9
+};
+
+/*---------------------------------------------------------------------------*/
+/* Lane configuration                                                        */
+/*---------------------------------------------------------------------------*/
+
+static struct lane_configuration hx8394f_720p_video_lane_config = {
+  4, 0, 1, 1, 1, 1, 0
+};
+
+/*---------------------------------------------------------------------------*/
+/* Panel timing                                                              */
+/*---------------------------------------------------------------------------*/
+static const uint32_t hx8394f_720p_video_timings[] = {
+	0x72, 0x16, 0x0e, 0x00, 0x38, 0x3c, 0x12, 0x1a, 0x10, 0x03, 0x04, 0x00
+};
+
+static struct panel_timing hx8394f_720p_video_timing_info = {
+	0, 4, 0x04, 0x18
+};
+
+/*---------------------------------------------------------------------------*/
+/* Panel reset sequence                                                      */
+/*---------------------------------------------------------------------------*/
+static struct panel_reset_sequence hx8394f_720p_video_reset_seq = {
+	{1, 0, 1, }, {20, 2, 20, }, 2
+};
+
+/*---------------------------------------------------------------------------*/
+/* Backlight setting                                                         */
+/*---------------------------------------------------------------------------*/
+static struct backlight hx8394f_720p_video_backlight = {
+	1, 1, 4095, 100, 1, "PMIC_8941"
+};
+
+#define HX8394F_720P_VIDEO_SIGNATURE 0xFFFF
+
+#endif /*_PANEL_HX8394F_720P_VIDEO_H_*/
diff --git a/platform/msm_shared/smem.h b/platform/msm_shared/smem.h
index 278a0eb..30af435 100644
--- a/platform/msm_shared/smem.h
+++ b/platform/msm_shared/smem.h
@@ -441,7 +441,8 @@
 	MDMFERMIUM  = 290,
 	APQ8096  = 291,
 	MSMTITANIUM  = 293,
-	MSMTHORIUM = 294,
+	MSM8937 = 294,
+	APQ8037 = 295,
 };
 
 enum platform {
diff --git a/target/msm8952/init.c b/target/msm8952/init.c
index ebf0349..e25b615 100644
--- a/target/msm8952/init.c
+++ b/target/msm8952/init.c
@@ -298,6 +298,12 @@
 		ASSERT(0);
 	}
 
+	if (rpmb_init() < 0)
+	{
+		dprintf(CRITICAL, "RPMB init failed\n");
+		ASSERT(0);
+	}
+
 	/*
 	 * Load the sec app for first time
 	 */
@@ -306,13 +312,6 @@
 		dprintf(CRITICAL, "Failed to load App for verified\n");
 		ASSERT(0);
 	}
-
-	if (rpmb_init() < 0)
-	{
-		dprintf(CRITICAL, "RPMB init failed\n");
-		ASSERT(0);
-	}
-
 #if SMD_SUPPORT
 	rpm_smd_init();
 #endif
@@ -349,12 +348,13 @@
 	case MSM8952:
 	case MSM8956:
 	case MSM8976:
-	case MSMTHORIUM:
+	case MSM8937:
 		board->baseband = BASEBAND_MSM;
 		break;
 	case APQ8052:
 	case APQ8056:
 	case APQ8076:
+	case APQ8037:
 		board->baseband = BASEBAND_APQ;
 		break;
 	default: