Merge "platform: msm_shared: enable MDP5 support for msm8939"
diff --git a/AndroidBoot.mk b/AndroidBoot.mk
index 6ddf49d..089c4d8 100644
--- a/AndroidBoot.mk
+++ b/AndroidBoot.mk
@@ -1,6 +1,10 @@
 #Android makefile to build lk bootloader as a part of Android Build
 
+ifndef 2ND_TARGET_GCC_VERSION
 CROSS_COMPILE := ../../../prebuilts/gcc/linux-x86/arm/arm-eabi-$(TARGET_GCC_VERSION)/bin/arm-eabi-
+else
+CROSS_COMPILE := ../../../prebuilts/gcc/linux-x86/arm/arm-eabi-$(2ND_TARGET_GCC_VERSION)/bin/arm-eabi-
+endif
 
 # Set flags if we need to include security libs
 ifeq ($(TARGET_BOOTIMG_SIGNED),true)
diff --git a/dev/gcdb/display/include/panel_otm8019a_fwvga_video.h b/dev/gcdb/display/include/panel_otm8019a_fwvga_video.h
old mode 100644
new mode 100755
index 07bc257..235057e
--- a/dev/gcdb/display/include/panel_otm8019a_fwvga_video.h
+++ b/dev/gcdb/display/include/panel_otm8019a_fwvga_video.h
@@ -132,7 +132,7 @@
 
 static char otm8019a_fwvga_video_on_cmd13[] = {
 	0x03, 0x00, 0x29, 0xC0,
-	0xC5, 0x4e, 0x76, 0xFF,
+	0xC5, 0x6e, 0x76, 0xFF,
 };
 
 static char otm8019a_fwvga_video_on_cmd14[] = {
@@ -152,7 +152,7 @@
 
 static char otm8019a_fwvga_video_on_cmd17[] = {
 	0x02, 0x00, 0x29, 0xC0,
-	0xD9, 0x3e, 0xFF, 0xFF,
+	0xD9, 0x33, 0xFF, 0xFF,
 };
 
 static char otm8019a_fwvga_video_on_cmd18[] = {
@@ -599,11 +599,11 @@
 
 static char otm8019a_fwvga_video_on_cmd95[] = {
 	0x15, 0x00, 0x29, 0xC0,
-	0xE1, 0x00, 0x04, 0x10,
-	0x26, 0x3f, 0x50, 0x59,
-	0x88, 0x73, 0x88, 0x7f,
-	0x6f, 0x86, 0x72, 0x76,
-	0x71, 0x67, 0x5e, 0x52,
+	0xE1, 0x00, 0x07, 0x14,
+	0x29, 0x3f, 0x52, 0x59,
+	0x85, 0x72, 0x87, 0x81,
+	0x70, 0x88, 0x74, 0x79,
+	0x72, 0x6a, 0x61, 0x55,
 	0x00, 0xFF, 0xFF, 0xFF,
 };
 
@@ -614,11 +614,11 @@
 
 static char otm8019a_fwvga_video_on_cmd97[] = {
 	0x15, 0x00, 0x29, 0xC0,
-	0xE2, 0x00, 0x04, 0x10,
-	0x26, 0x3f, 0x50, 0x59,
-	0x88, 0x73, 0x88, 0x7f,
-	0x6f, 0x86, 0x72, 0x76,
-	0x71, 0x67, 0x5e, 0x52,
+	0xE2, 0x00, 0x07, 0x14,
+	0x29, 0x3f, 0x52, 0x59,
+	0x85, 0x72, 0x87, 0x81,
+	0x70, 0x88, 0x74, 0x79,
+	0x72, 0x6a, 0x61, 0x55,
 	0x00, 0xFF, 0xFF, 0xFF,
 };
 
@@ -642,33 +642,33 @@
 
 static struct mipi_dsi_cmd otm8019a_fwvga_video_on_command[] = {
 	{0x8, otm8019a_fwvga_video_on_cmd0, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd1, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd1, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd2, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd3, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd3, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd4, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd5, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd5, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd6, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd7, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd7, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd8, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd9, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd9, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd10, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd11, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd11, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd12, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd13, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd13, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd14, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd15, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd15, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd16, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd17, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd17, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd18, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd19, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd19, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd20, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd21, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd21, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd22, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd23, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd23, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd24, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd25, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd25, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd26, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd27, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd27, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd28, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd29, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd30, 0x00},
@@ -686,55 +686,55 @@
 	{0x8, otm8019a_fwvga_video_on_cmd42, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd43, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd44, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd45, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd45, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd46, 0x00},
-	{0x8, otm8019a_fwvga_video_on_cmd47, 0x0A},
+	{0x8, otm8019a_fwvga_video_on_cmd47, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd48, 0x00},
-	{0x10, otm8019a_fwvga_video_on_cmd49, 0x0A},
+	{0x10, otm8019a_fwvga_video_on_cmd49, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd50, 0x00},
-	{0xc, otm8019a_fwvga_video_on_cmd51, 0x0A},
+	{0xc, otm8019a_fwvga_video_on_cmd51, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd52, 0x00},
-	{0xc, otm8019a_fwvga_video_on_cmd53, 0x0A},
+	{0xc, otm8019a_fwvga_video_on_cmd53, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd54, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd55, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd55, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd56, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd57, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd57, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd58, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd59, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd59, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd60, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd61, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd61, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd62, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd63, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd63, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd64, 0x00},
-	{0x10, otm8019a_fwvga_video_on_cmd65, 0x0A},
+	{0x10, otm8019a_fwvga_video_on_cmd65, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd66, 0x00},
-	{0x10, otm8019a_fwvga_video_on_cmd67, 0x0A},
+	{0x10, otm8019a_fwvga_video_on_cmd67, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd68, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd69, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd69, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd70, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd71, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd71, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd72, 0x00},
-	{0x10, otm8019a_fwvga_video_on_cmd73, 0x0A},
+	{0x10, otm8019a_fwvga_video_on_cmd73, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd74, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd75, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd75, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd76, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd77, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd77, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd78, 0x00},
-	{0x10, otm8019a_fwvga_video_on_cmd79, 0x0A},
+	{0x10, otm8019a_fwvga_video_on_cmd79, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd80, 0x00},
-	{0x10, otm8019a_fwvga_video_on_cmd81, 0x0A},
+	{0x10, otm8019a_fwvga_video_on_cmd81, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd82, 0x00},
-	{0x10, otm8019a_fwvga_video_on_cmd83, 0x0A},
+	{0x10, otm8019a_fwvga_video_on_cmd83, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd84, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd85, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd85, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd86, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd87, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd87, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd88, 0x00},
-	{0x10, otm8019a_fwvga_video_on_cmd89, 0x0A},
+	{0x10, otm8019a_fwvga_video_on_cmd89, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd90, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd91, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd91, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd92, 0x00},
-	{0x14, otm8019a_fwvga_video_on_cmd93, 0x0A},
+	{0x14, otm8019a_fwvga_video_on_cmd93, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd94, 0x00},
 	{0x1c, otm8019a_fwvga_video_on_cmd95, 0x00},
 	{0x8, otm8019a_fwvga_video_on_cmd96, 0x00},
diff --git a/platform/msm_shared/include/qusb2_phy.h b/platform/msm_shared/include/qusb2_phy.h
new file mode 100644
index 0000000..764a5dc
--- /dev/null
+++ b/platform/msm_shared/include/qusb2_phy.h
@@ -0,0 +1,35 @@
+/* Copyright (c) 2014, 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 _QUSB2_PHY_H_
+#define _QUSB2_PHY_H_
+
+#include <platform/iomap.h>
+
+void qusb2_phy_reset(void);
+
+#endif
diff --git a/platform/msm_shared/qusb2_phy.c b/platform/msm_shared/qusb2_phy.c
new file mode 100644
index 0000000..8e59579
--- /dev/null
+++ b/platform/msm_shared/qusb2_phy.c
@@ -0,0 +1,51 @@
+/* Copyright (c) 2014, 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.
+ */
+
+#include <platform/iomap.h>
+#include <reg.h>
+#include <bits.h>
+#include <debug.h>
+
+void qusb2_phy_reset(void)
+{
+	uint32_t val;
+
+	/* Block Reset */
+	val = readl(GCC_QUSB2_PHY_BCR) | BIT(0);
+	writel(val, GCC_QUSB2_PHY_BCR);
+	udelay(10);
+	writel(val & ~BIT(0), GCC_QUSB2_PHY_BCR);
+
+	/* Deassert POWERDOWN by clearing bit 0 to enable the PHY */
+	val = readl(QUSB2PHY_PORT_POWERDOWN);
+	writel(val & ~BIT(0), QUSB2PHY_PORT_POWERDOWN);
+	udelay(10);
+
+	/* set CLAMP_N_EN and FREEZIO_N */
+	writel(0x22, QUSB2PHY_PORT_POWERDOWN);
+}