Merge "platform/target: msm8996: Add support for new mem map"
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 1ac074e..7120a7e 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -1952,6 +1952,17 @@
return;
}
+ /* Handle overflow if the input image size is greater than
+ * boot image buffer can hold
+ */
+#if VERIFIED_BOOT
+ if ((target_get_max_flash_size() - (image_actual - sig_actual)) < page_size)
+ {
+ fastboot_fail("booimage: size is greater than boot image buffer can hold");
+ return;
+ }
+#endif
+
/* Verify the boot image
* device & page_size are initialized in aboot_init
*/
@@ -2971,8 +2982,8 @@
return 0;
}
- if ((header->width != fb_display->width) || (header->height != fb_display->height)) {
- dprintf(CRITICAL, "Logo config doesn't match with fb config. Fall back default logo\n");
+ if ((header->width > fb_display->width) || (header->height > fb_display->height)) {
+ dprintf(CRITICAL, "Logo config greater than fb config. Fall back default logo\n");
return -1;
}
@@ -3058,8 +3069,8 @@
fbcon_extract_to_screen(header, (base + LOGO_IMG_HEADER_SIZE));
} else { /* 2 Raw BGR data */
- if ((header->width != fb_display->width) || (header->height != fb_display->height)) {
- dprintf(CRITICAL, "Logo config doesn't match with fb config. Fall back default logo\n");
+ if ((header->width > fb_display->width) || (header->height > fb_display->height)) {
+ dprintf(CRITICAL, "Logo config greater than fb config. Fall back default logo\n");
return -1;
}
diff --git a/app/aboot/fastboot_test.c b/app/aboot/fastboot_test.c
index f32435c..5cad0b5 100644
--- a/app/aboot/fastboot_test.c
+++ b/app/aboot/fastboot_test.c
@@ -33,6 +33,8 @@
#include "fastboot.h"
#include "fastboot_test.h"
#include <app/tests.h>
+#include <target.h>
+#include <boot_device.h>
#if USE_RPMB_FOR_DEVINFO
#include <rpmb.h>
#endif
@@ -40,10 +42,37 @@
extern void ramdump_table_map();
extern void kauth_test();
+extern int ufs_get_boot_lun();
+extern int ufs_set_boot_lun(uint32_t bootlunid);
+extern int fastboot_init();
void cmd_oem_runtests()
{
dprintf(INFO, "Running LK tests ... \n");
+
+ // Test boot lun enable for UFS
+ if (!platform_boot_dev_isemmc())
+ {
+ int ret = 0;
+ uint32_t set_lun = 0x2, get_lun;
+ ret = ufs_set_boot_lun(set_lun);
+ if (ret == UFS_SUCCESS)
+ {
+ get_lun = ufs_get_boot_lun();
+ if (get_lun == set_lun)
+ {
+ dprintf(INFO, "UFS Boot LUN En TEST: [ PASS ]\n");
+ set_lun = 0x1; // default is 0x1 LUN A, revert back to 0x1
+ ret = ufs_set_boot_lun(set_lun);
+ }
+ else
+ dprintf(INFO, "UFS Boot LUN En TEST: [ FAIL ]\n");
+ }
+ else
+ dprintf(INFO, "UFS Boot LUN En TEST: [ FAIL ]\n");
+ }
+
+
#if LPAE
ramdump_table_map();
#endif
diff --git a/dev/gcdb/display/include/panel_byd_1200p_video.h b/dev/gcdb/display/include/panel_byd_1200p_video.h
new file mode 100644
index 0000000..20e0d75
--- /dev/null
+++ b/dev/gcdb/display/include/panel_byd_1200p_video.h
@@ -0,0 +1,1375 @@
+/* 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE 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_BYD_1200P_VIDEO_H_
+
+#define _PANEL_BYD_1200P_VIDEO_H_
+/*---------------------------------------------------------------------------*/
+/* HEADER files */
+/*---------------------------------------------------------------------------*/
+#include "panel.h"
+
+/*---------------------------------------------------------------------------*/
+/* Panel configuration */
+/*---------------------------------------------------------------------------*/
+
+static struct panel_config byd_1200p_video_panel_data = {
+ "qcom,mdss_dsi_byd_1200p_video", "dsi:0:", "qcom,mdss-dsi-panel",
+ 10, 0, "DISPLAY_1", 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, NULL
+};
+
+/*---------------------------------------------------------------------------*/
+/* Panel resolution */
+/*---------------------------------------------------------------------------*/
+static struct panel_resolution byd_1200p_video_panel_res = {
+ 1200, 1920, 96, 64, 16, 0, 4, 16, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/*---------------------------------------------------------------------------*/
+/* Panel Color Information */
+/*---------------------------------------------------------------------------*/
+static struct color_info byd_1200p_video_color = {
+ 24, 0, 0xff, 0, 0, 0
+};
+
+/*---------------------------------------------------------------------------*/
+/* Panel Command information */
+/*---------------------------------------------------------------------------*/
+static char byd_1200p_video_on_cmd0 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0x8C, 0x8E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd1 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0xC5, 0x23, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd2 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0xC7, 0x23, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd3 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0xFD, 0x5C, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd4 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0xFA, 0x14, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd5 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0X83, 0XAA, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd6 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0X84, 0X11, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd7 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC0, 0X0E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd8 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC1, 0X12, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd9 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC2, 0X25, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd10 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC3, 0X34, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd11 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC4, 0X3F, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd12 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC5, 0X49, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd13 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC6, 0X52, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd14 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC7, 0X59, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd15 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC8, 0X60, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd16 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC9, 0XC8, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd17 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCA, 0XC7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd18 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCB, 0XD6, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd19 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCC, 0XD9, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd20 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCD, 0XD7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd21 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCE, 0XD1, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd22 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCF, 0XD3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd23 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD0, 0XD4, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd24 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD1, 0XFF, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd25 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD2, 0X08, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd26 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD3, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd27 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD4, 0X3B, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd28 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD5, 0XAA, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd29 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD6, 0XB3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd30 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD7, 0XBC, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd31 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD8, 0XC5, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd32 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD9, 0XD0, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd33 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDA, 0XDB, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd34 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDB, 0XE7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd35 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDC, 0XF7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd36 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDD, 0XFE, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd37 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDE, 0X00, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd38 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDF, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd39 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE0, 0X0E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd40 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE1, 0X12, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd41 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE2, 0X25, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd42 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE3, 0X34, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd43 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE4, 0X3F, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd44 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE5, 0X49, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd45 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE6, 0X52, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd46 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE7, 0X59, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd47 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE8, 0X60, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd48 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE9, 0XC8, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd49 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEA, 0XC7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd50 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEB, 0XD6, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd51 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEC, 0XD9, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd52 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XED, 0XD7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd53 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEE, 0XD1, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd54 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEF, 0XD3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd55 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF0, 0XD4, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd56 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF1, 0XFF, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd57 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF2, 0X08, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd58 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF3, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd59 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF4, 0X3B, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd60 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF5, 0XAA, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd61 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF6, 0XB3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd62 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF7, 0XBC, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd63 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF8, 0XC5, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd64 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF9, 0XD0, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd65 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFA, 0XDB, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd66 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFB, 0XE7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd67 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFC, 0XF7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd68 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFD, 0XFE, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd69 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFE, 0X00, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd70 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFF, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd71 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XA9, 0X4b, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd72 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0X83, 0XBB, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd73 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0X84, 0X22, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd74 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC0, 0X0E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd75 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC1, 0X12, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd76 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC2, 0X25, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd77 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC3, 0X34, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd78 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC4, 0X3F, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd79 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC5, 0X49, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd80 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC6, 0X52, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd81 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC7, 0X59, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd82 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC8, 0X60, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd83 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC9, 0XC8, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd84 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCA, 0XC7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd85 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCB, 0XD6, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd86 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCC, 0XD9, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd87 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCD, 0XD7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd88 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCE, 0XD1, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd89 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCF, 0XD3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd90 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD0, 0XD4, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd91 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD1, 0XFF, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd92 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD2, 0X08, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd93 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD3, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd94 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD4, 0X3B, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd95 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD5, 0XAA, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd96 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD6, 0XB3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd97 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD7, 0XBC, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd98 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD8, 0XC5, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd99 [] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD9, 0XD0, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd100[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDA, 0XDB, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd101[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDB, 0XE7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd102[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDC, 0XF7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd103[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDD, 0XFE, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd104[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDE, 0X00, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd105[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDF, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd106[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE0, 0X0E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd107[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE1, 0X12, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd108[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE2, 0X25, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd109[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE3, 0X34, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd110[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE4, 0X3F, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd111[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE5, 0X49, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd112[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE6, 0X52, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd113[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE7, 0X59, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd114[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE8, 0X60, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd115[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE9, 0XC8, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd116[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEA, 0XC7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd117[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEB, 0XD6, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd118[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEC, 0XD9, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd119[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XED, 0XD7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd120[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEE, 0XD1, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd121[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEF, 0XD3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd122[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF0, 0XD4, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd123[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF1, 0XFF, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd124[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF2, 0X08, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd125[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF3, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd126[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF4, 0X3B, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd127[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF5, 0XAA, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd128[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF6, 0XB3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd129[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF7, 0XBC, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd130[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF8, 0XC5, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd131[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF9, 0XD0, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd132[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFA, 0XDB, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd133[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFB, 0XE7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd134[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFC, 0XF7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd135[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFD, 0XFE, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd136[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFE, 0X00, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd137[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFF, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd138[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0X83, 0XCC, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd139[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0X84, 0X33, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd140[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC0, 0X0E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd141[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC1, 0X12, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd142[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC2, 0X25, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd143[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC3, 0X34, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd144[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC4, 0X3F, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd145[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC5, 0X49, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd146[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC6, 0X52, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd147[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC7, 0X59, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd148[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC8, 0X60, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd149[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XC9, 0XC8, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd150[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCA, 0XC7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd151[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCB, 0XD6, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd152[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCC, 0XD9, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd153[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCD, 0XD7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd154[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCE, 0XD1, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd155[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XCF, 0XD3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd156[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD0, 0XD4, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd157[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD1, 0XFF, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd158[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD2, 0X08, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd159[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD3, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd160[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD4, 0X3B, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd161[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD5, 0XAA, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd162[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD6, 0XB3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd163[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD7, 0XBC, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd164[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD8, 0XC5, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd165[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XD9, 0XD0, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd166[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDA, 0XDB, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd167[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDB, 0XE7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd168[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDC, 0XF7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd169[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDD, 0XFE, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd170[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDE, 0X00, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd171[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XDF, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd172[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE0, 0X0E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd173[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE1, 0X12, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd174[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE2, 0X25, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd175[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE3, 0X34, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd176[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE4, 0X3F, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd177[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE5, 0X49, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd178[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE6, 0X52, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd179[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE7, 0X59, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd180[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE8, 0X60, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd181[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XE9, 0XC8, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd182[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEA, 0XC7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd183[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEB, 0XD6, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd184[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEC, 0XD9, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd185[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XED, 0XD7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd186[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEE, 0XD1, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd187[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XEF, 0XD3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd188[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF0, 0XD4, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd189[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF1, 0XFF, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd190[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF2, 0X08, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd191[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF3, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd192[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF4, 0X3B, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd193[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF5, 0XAA, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd194[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF6, 0XB3, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd195[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF7, 0XBC, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd196[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF8, 0XC5, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd197[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XF9, 0XD0, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd198[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFA, 0XDB, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd199[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFB, 0XE7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd200[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFC, 0XF7, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd201[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFD, 0XFE, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd202[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFE, 0X00, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd203[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0XFF, 0X2E, 0xFF, 0xFF,
+};
+
+static char byd_1200p_video_on_cmd204[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0x11, 0x00, 0xFF, 0xFF,};
+
+static char byd_1200p_video_on_cmd205[] = {
+ 0x02, 0x00, 0x29, 0xC0,
+ 0x29, 0x00, 0xFF, 0xFF,
+};
+
+static struct mipi_dsi_cmd byd_1200p_video_on_command[] = {
+ { 0x8 , byd_1200p_video_on_cmd0, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd1, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd2, 0x10},
+ { 0x8 , byd_1200p_video_on_cmd3, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd4, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd5, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd6, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd7, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd8, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd9, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd10, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd11, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd12, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd13, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd14, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd15, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd16, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd17, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd18, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd19, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd20, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd21, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd22, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd23, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd24, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd25, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd26, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd27, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd28, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd29, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd30, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd31, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd32, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd33, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd34, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd35, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd36, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd37, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd38, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd39, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd40, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd41, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd42, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd43, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd44, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd45, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd46, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd47, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd48, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd49, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd50, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd51, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd52, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd53, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd54, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd55, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd56, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd57, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd58, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd59, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd60, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd61, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd62, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd63, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd64, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd65, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd66, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd67, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd68, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd69, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd70, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd71, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd72, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd73, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd74, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd75, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd76, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd77, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd78, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd79, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd80, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd81, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd82, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd83, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd84, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd85, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd86, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd87, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd88, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd89, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd90, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd91, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd92, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd93, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd94, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd95, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd96, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd97, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd98, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd99, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd100, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd101, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd102, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd103, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd104, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd105, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd106, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd107, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd108, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd109, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd110, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd111, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd112, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd113, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd114, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd115, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd116, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd117, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd118, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd119, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd120, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd121, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd122, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd123, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd124, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd125, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd126, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd127, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd128, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd129, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd130, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd131, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd132, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd133, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd134, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd135, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd136, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd137, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd138, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd139, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd140, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd141, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd142, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd143, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd144, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd145, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd146, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd147, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd148, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd149, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd150, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd151, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd152, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd153, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd154, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd155, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd156, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd157, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd158, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd159, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd160, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd161, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd162, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd163, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd164, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd165, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd166, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd167, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd168, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd169, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd170, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd171, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd172, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd173, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd174, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd175, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd176, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd177, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd178, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd179, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd180, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd181, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd182, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd183, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd184, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd185, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd186, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd187, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd188, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd189, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd190, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd191, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd192, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd193, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd194, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd195, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd196, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd197, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd198, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd199, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd200, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd201, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd202, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd203, 0x00},
+ { 0x8 , byd_1200p_video_on_cmd204, 0xca},
+ { 0x8 , byd_1200p_video_on_cmd205, 0x1f},
+};
+
+#define BYD_1200P_VIDEO_ON_COMMAND 206
+
+
+static char byd_1200p_video_off_cmd0[] = {
+ 0x28, 0x00, 0x05, 0x80
+};
+
+static char byd_1200p_video_off_cmd1[] = {
+ 0x10, 0x00, 0x05, 0x80
+};
+
+
+static struct mipi_dsi_cmd byd_1200p_video_off_command[] = {
+ { 0x4 , byd_1200p_video_off_cmd0, 0x0},
+ { 0x4 , byd_1200p_video_off_cmd1, 0x0}
+};
+
+#define BYD_1200P_VIDEO_OFF_COMMAND 2
+
+static struct command_state byd_1200p_video_state = {
+ 0, 1
+};
+
+/*---------------------------------------------------------------------------*/
+/* Command mode panel information */
+/*---------------------------------------------------------------------------*/
+
+static struct commandpanel_info byd_1200p_video_command_panel = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/*---------------------------------------------------------------------------*/
+/* Video mode panel information */
+/*---------------------------------------------------------------------------*/
+
+static struct videopanel_info byd_1200p_video_video_panel = {
+ 0, 0, 0, 0, 1, 1, 1, 0, 0x9
+};
+
+/*---------------------------------------------------------------------------*/
+/* Lane Configuration */
+/*---------------------------------------------------------------------------*/
+
+static struct lane_configuration byd_1200p_video_lane_config = {
+ 4, 0, 1, 1, 1, 1, 1
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Panel Timing */
+/*---------------------------------------------------------------------------*/
+const uint32_t byd_1200p_video_timings[] = {
+ 0xE6, 0x38, 0x26, 0x00, 0x68, 0x6e, 0x2A, 0x3c, 0x44, 0x03, 0x04, 0x00
+};
+
+static struct panel_timing byd_1200p_video_timing_info = {
+ 0, 4, 0x02, 0x2d
+};
+
+static struct panel_reset_sequence byd_1200p_video_panel_reset_seq = {
+ { 0, 1, 0, }, { 200, 200, 200, }, 2
+};
+
+/*---------------------------------------------------------------------------*/
+/* Backlight Settings */
+/*---------------------------------------------------------------------------*/
+
+static struct backlight byd_1200p_video_backlight = {
+ 1, 1, 4095, 100, 1, "PMIC_8941"
+};
+
+#define BYD_1200P_VIDEO_SIGNATURE 0xFFFF
+
+#endif /*_BYD_1200P_VIDEO_H_*/
diff --git a/platform/msm_shared/boot_verifier.c b/platform/msm_shared/boot_verifier.c
index 67f28c3..b167d70 100644
--- a/platform/msm_shared/boot_verifier.c
+++ b/platform/msm_shared/boot_verifier.c
@@ -42,11 +42,11 @@
#define ASN1_ENCODED_SHA256_SIZE 0x33
#define ASN1_ENCODED_SHA256_OFFSET 0x13
+#define ASN1_SIGNATURE_BUFFER_SZ mmc_page_size()
static KEYSTORE *oem_keystore;
static KEYSTORE *user_keystore;
static uint32_t dev_boot_state = RED;
-BUF_DMA_ALIGN(keystore_buf, 4096);
char KEYSTORE_PTN_NAME[] = "keystore";
static const char *VERIFIED_FLASH_ALLOWED_PTN[] = {
@@ -118,18 +118,38 @@
len_bytes = (input[pos] & ~(0x80));
pos++;
}
+
while(len_bytes)
{
- /* Shift len by 1 octet */
- len = len << 8;
+ /* Shift len by 1 octet, make sure to check unsigned int overflow */
+ if (len <= (UINT_MAX >> 8))
+ len <<= 8;
+ else
+ {
+ dprintf(CRITICAL, "Error: Length exceeding max size of uintmax\n");
+ return 0;
+ }
/* Read next octet */
- len = len | input[pos];
+ if (pos < (int) ASN1_SIGNATURE_BUFFER_SZ)
+ len = len | input[pos];
+ else
+ {
+ dprintf(CRITICAL, "Error: Pos index exceeding the input buffer size\n");
+ return 0;
+ }
+
pos++; len_bytes--;
}
/* Add number of octets representing sequence id and length */
- len += pos;
+ if ((UINT_MAX - pos) > len)
+ len += pos;
+ else
+ {
+ dprintf(CRITICAL, "Error: Len overflows UINT_MAX value\n");
+ return 0;
+ }
return len;
}
@@ -301,19 +321,12 @@
static void read_oem_keystore()
{
KEYSTORE *ks = NULL;
- uint32_t len = 0;
+ uint32_t len = sizeof(OEM_KEYSTORE);
const unsigned char *input = OEM_KEYSTORE;
if(oem_keystore != NULL)
return;
- len = read_der_message_length((unsigned char *)input);
- if(!len)
- {
- dprintf(CRITICAL, "boot_verifier: oem keystore length is invalid.\n");
- return;
- }
-
ks = d2i_KEYSTORE(NULL, (const unsigned char **) &input, len);
if(ks != NULL)
{
@@ -322,7 +335,7 @@
}
}
-static int read_user_keystore_ptn()
+static int read_user_keystore_ptn(uint8_t *keystore_buf)
{
int index = INVALID_PTN;
unsigned long long ptn = 0;
@@ -346,12 +359,19 @@
unsigned char *input = user_addr;
KEYSTORE *ks = NULL;
uint32_t len = read_der_message_length(input);
+
if(!len)
{
dprintf(CRITICAL, "boot_verifier: user keystore length is invalid.\n");
return;
}
+ if (len > ASN1_SIGNATURE_BUFFER_SZ)
+ {
+ dprintf(CRITICAL, "boot_verifier: user keystore exceeds size signature buffer\n");
+ return;
+ }
+
ks = d2i_KEYSTORE(NULL, (const unsigned char **)&input, len);
if(ks != NULL)
{
@@ -372,11 +392,16 @@
uint32_t boot_verify_keystore_init()
{
+ uint8_t *keystore_buf = NULL;
+
/* Read OEM Keystore */
read_oem_keystore();
+ keystore_buf = memalign(ASN1_SIGNATURE_BUFFER_SZ, CACHE_LINE);
+ ASSERT(keystore_buf);
+
/* Read User Keystore */
- if(!read_user_keystore_ptn())
+ if(!read_user_keystore_ptn(keystore_buf))
read_user_keystore((unsigned char *)keystore_buf);
return dev_boot_state;
}
@@ -386,7 +411,8 @@
bool ret = false;
VERIFIED_BOOT_SIG *sig = NULL;
unsigned char* sig_addr = (unsigned char*)(img_addr + img_size);
- uint32_t sig_len = read_der_message_length(sig_addr);
+ uint32_t sig_len = 0;
+ unsigned char *signature = NULL;
if(dev_boot_state == ORANGE)
{
@@ -395,12 +421,25 @@
return false;
}
+ signature = malloc(ASN1_SIGNATURE_BUFFER_SZ);
+ ASSERT(signature);
+
+ /* Copy the signature from scratch memory to buffer */
+ memcpy(signature, sig_addr, ASN1_SIGNATURE_BUFFER_SZ);
+ sig_len = read_der_message_length(signature);
+
if(!sig_len)
{
dprintf(CRITICAL, "boot_verifier: Error while reading singature length.\n");
goto verify_image_error;
}
+ if (sig_len > ASN1_SIGNATURE_BUFFER_SZ)
+ {
+ dprintf(CRITICAL, "boot_verifier: Signature length exceeds size signature buffer\n");
+ goto verify_image_error;
+ }
+
if((sig = d2i_VERIFIED_BOOT_SIG(NULL, (const unsigned char **) &sig_addr, sig_len)) == NULL)
{
dprintf(CRITICAL,
@@ -411,6 +450,7 @@
ret = verify_image_with_sig(img_addr, img_size, pname, sig, user_keystore);
verify_image_error:
+ free(signature);
if(sig != NULL)
VERIFIED_BOOT_SIG_free(sig);
if(!ret)
diff --git a/platform/msm_shared/dme.c b/platform/msm_shared/dme.c
index f83ee93..c6d651d 100644
--- a/platform/msm_shared/dme.c
+++ b/platform/msm_shared/dme.c
@@ -96,7 +96,7 @@
}
if (resp_upiu->basic_hdr.response != UPIU_QUERY_RESP_SUCCESS)
{
- dprintf(CRITICAL, "%s:%d UPIU Response is not SUCCESS\n", __func__, __LINE__);
+ dprintf(CRITICAL, "%s:%d UPIU Response is not SUCCESS, response code: 0x%x\n", __func__, __LINE__, resp_upiu->basic_hdr.response);
return -UFS_FAILURE;
}
@@ -111,8 +111,9 @@
return -UFS_FAILURE;
}
- *((uint32_t *) buffer) = resp_upiu->flag_value;
+ *((uint32_t *) buffer) = resp_upiu->resv_1[3]; //resv_1[3] contains the data for flag
break;
+ case UPIU_QUERY_OP_WRITE_ATTRIBUTE:
case UPIU_QUERY_OP_TOGGLE_FLAG:
case UPIU_QUERY_OP_CLEAR_FLAG:
case UPIU_QUERY_OP_READ_DESCRIPTOR:
@@ -149,6 +150,9 @@
req_upiu.resp_data_len = query->buf_len;
}
+ if (query->opcode == UPIU_QUERY_OP_WRITE_ATTRIBUTE)
+ req_upiu.data_buffer_addr = query->buf; // attribute is 4 byte value
+
ret = utp_enqueue_upiu(dev, &req_upiu);
if (ret)
goto utp_send_query_upiu_err;
@@ -161,6 +165,47 @@
return ret;
}
+int dme_set_bbootlunen(struct ufs_dev *dev, uint32_t val)
+{
+ int ret = 0;
+ STACKBUF_DMA_ALIGN(value, sizeof(uint32_t));
+ memset((void *)value, 0, sizeof(uint32_t));
+ *value = val;
+ struct utp_query_req_upiu_type set_query = {UPIU_QUERY_OP_WRITE_ATTRIBUTE,
+ UFS_IDX_bBootLunEn,
+ 0,
+ 0,
+ (addr_t)value,
+ sizeof(uint32_t)};
+ if ((ret = dme_send_query_upiu(dev, &set_query)))
+ {
+ arch_invalidate_cache_range((addr_t) value, sizeof(uint32_t));
+ dprintf(CRITICAL, "%s:%d DME Set Boot Lun Query failed. Value 0x%x\n", __func__, __LINE__, *value);
+ return -UFS_FAILURE;
+ }
+ return UFS_SUCCESS;
+}
+
+int dme_get_bbootlunen(struct ufs_dev *dev)
+{
+ STACKBUF_DMA_ALIGN(value, sizeof(uint32_t));
+ memset((void *)value, 0, sizeof(uint32_t));
+ int ret = 0;
+ struct utp_query_req_upiu_type set_query = {UPIU_QUERY_OP_READ_ATTRIBUTE,
+ UFS_IDX_bBootLunEn,
+ 0,
+ 0,
+ (addr_t)value,
+ sizeof(uint32_t)};
+ if ((ret = dme_send_query_upiu(dev, &set_query)))
+ {
+ dprintf(CRITICAL, "%s:%d DME Set Boot Lun Query failed\n", __func__, __LINE__);
+ return -UFS_FAILURE;
+ }
+ arch_invalidate_cache_range((addr_t) value, sizeof(uint32_t));
+ return *value;
+}
+
int dme_set_fpurgeenable(struct ufs_dev *dev)
{
STACKBUF_DMA_ALIGN(result, sizeof(uint32_t));
@@ -551,6 +596,7 @@
req_upiu->basic_hdr.query_task_mgmt_func = UPIU_QUERY_FUNC_STD_READ_REQ;
break;
case UPIU_QUERY_OP_TOGGLE_FLAG:
+ case UPIU_QUERY_OP_WRITE_ATTRIBUTE:
case UPIU_QUERY_OP_CLEAR_FLAG:
case UPIU_QUERY_OP_SET_FLAG:
req_upiu->basic_hdr.query_task_mgmt_func = UPIU_QUERY_FUNC_STD_WRITE_REQ;
@@ -559,6 +605,13 @@
dprintf(CRITICAL, "%s:%d UPIU query opcode not supported.\n", __func__, __LINE__);
return -UFS_FAILURE;
}
+ if (upiu_data->opcode == UPIU_QUERY_OP_WRITE_ATTRIBUTE)
+ {
+ req_upiu->resv_1[0] = (*(uint32_t *)(upiu_data->data_buffer_addr) >> 24);
+ req_upiu->resv_1[1] = (*(uint32_t *)(upiu_data->data_buffer_addr) >> 16);
+ req_upiu->resv_1[2] = (*(uint32_t *)(upiu_data->data_buffer_addr) >> 8);
+ req_upiu->resv_1[3] = (*(uint32_t *)(upiu_data->data_buffer_addr) & 0xFF);
+ }
return UFS_SUCCESS;
}
diff --git a/platform/msm_shared/include/dme.h b/platform/msm_shared/include/dme.h
index aa11c54..4930024 100644
--- a/platform/msm_shared/include/dme.h
+++ b/platform/msm_shared/include/dme.h
@@ -73,6 +73,7 @@
#define UFS_IDX_bBootLunEn 0x00
#define UFS_IDX_bCurrentPowerMode 0x01
#define UFS_IDX_bActiveICCLevel 0x03
+#define UFS_IDX_bBootLunID 0x04
#define UFS_IDX_bPurgeStatus 0x06
#define UFS_IDX_bRefClkFreq 0x0a
#define UFS_IDX_bConfigDescrLock 0x0b
@@ -268,4 +269,9 @@
*/
int dme_read_geo_desc(struct ufs_dev *dev);
+/* function to return the boot lun currently booting from */
+int dme_get_bbootlunen(struct ufs_dev *dev);
+
+/* function to set the boot lun to either 0, 1 or 2 */
+int dme_set_bbootlunen(struct ufs_dev *dev, uint32_t val);
#endif
diff --git a/platform/msm_shared/include/mmc_sdhci.h b/platform/msm_shared/include/mmc_sdhci.h
index 54f09ee..5461b49 100644
--- a/platform/msm_shared/include/mmc_sdhci.h
+++ b/platform/msm_shared/include/mmc_sdhci.h
@@ -215,7 +215,7 @@
({ \
uint32_t indx = (start) / (size_of); \
uint32_t offset = (start) % (size_of); \
- uint32_t mask = (((len)<(size_of))? 1ULL<<(len):0) - 1; \
+ unsigned long long mask = (((len)<(size_of))? 1ULL<<(len):0) - 1; \
uint32_t unpck = array[indx] >> offset; \
uint32_t indx2 = ((start) + (len) - 1) / (size_of); \
if(indx2 > indx) \
diff --git a/platform/msm_shared/include/mmc_wrapper.h b/platform/msm_shared/include/mmc_wrapper.h
index f52a117..fbae494 100644
--- a/platform/msm_shared/include/mmc_wrapper.h
+++ b/platform/msm_shared/include/mmc_wrapper.h
@@ -49,4 +49,6 @@
uint8_t mmc_get_lun(void);
void mmc_read_partition_table(uint8_t arg);
uint32_t mmc_write_protect(const char *name, int set_clr);
+int ufs_set_boot_lun(uint32_t boot_lun_id);
+int ufs_get_boot_lun();
#endif
diff --git a/platform/msm_shared/include/upiu.h b/platform/msm_shared/include/upiu.h
index e081909..2c8fee5 100644
--- a/platform/msm_shared/include/upiu.h
+++ b/platform/msm_shared/include/upiu.h
@@ -74,8 +74,8 @@
uint8_t selector;
uint8_t resv_0[2];
uint16_t resp_len;
- uint8_t resv_1[3];
- uint8_t flag_value;
+ // this structure is used for several queries. resv_1 field is reserved for some and used for others
+ uint8_t resv_1[4];
uint8_t resv_2[4];
}__PACKED;
diff --git a/platform/msm_shared/mmc_sdhci.c b/platform/msm_shared/mmc_sdhci.c
index 20eb840..7e88b63 100644
--- a/platform/msm_shared/mmc_sdhci.c
+++ b/platform/msm_shared/mmc_sdhci.c
@@ -233,15 +233,22 @@
memcpy((struct mmc_csd *)&card->csd,(struct mmc_csd *)&mmc_csd,
sizeof(struct mmc_csd));
- /* Calculate the wp grp size */
- if (card->ext_csd[MMC_ERASE_GRP_DEF])
- card->wp_grp_size = MMC_HC_ERASE_MULT * card->ext_csd[MMC_HC_ERASE_GRP_SIZE] / MMC_BLK_SZ;
- else
- card->wp_grp_size = (card->csd.wp_grp_size + 1) * (card->csd.erase_grp_size + 1) \
- * (card->csd.erase_grp_mult + 1);
+ if (MMC_CARD_MMC(card)) {
- card->rpmb_size = RPMB_PART_MIN_SIZE * card->ext_csd[RPMB_SIZE_MULT];
- card->rel_wr_count = card->ext_csd[REL_WR_SEC_C];
+ /* Calculate the wp grp size */
+ if (card->ext_csd[MMC_ERASE_GRP_DEF])
+ card->wp_grp_size = MMC_HC_ERASE_MULT * card->ext_csd[MMC_HC_ERASE_GRP_SIZE] / MMC_BLK_SZ;
+ else
+ card->wp_grp_size = (card->csd.wp_grp_size + 1) * (card->csd.erase_grp_size + 1) \
+ * (card->csd.erase_grp_mult + 1);
+
+ card->rpmb_size = RPMB_PART_MIN_SIZE * card->ext_csd[RPMB_SIZE_MULT];
+ card->rel_wr_count = card->ext_csd[REL_WR_SEC_C];
+ }
+ else {
+ card->wp_grp_size = (card->csd.wp_grp_size + 1) * (card->csd.erase_grp_size + 1) \
+ * (card->csd.erase_grp_mult + 1);
+ }
dprintf(SPEW, "Decoded CSD fields:\n");
dprintf(SPEW, "cmmc_structure: %u\n", mmc_csd.cmmc_structure);
@@ -766,7 +773,6 @@
ret = mmc_switch_cmd(host, card, MMC_ACCESS_WRITE, MMC_EXT_MMC_HS_TIMING, value);
if (!ret)
drv_type_changed = true;
-
return drv_type_changed;
}
/*
@@ -1355,11 +1361,13 @@
for (i = 15, j = 0; i >=0 ; i--, j++)
sd_status[i] = swap_endian32(sd_status[j]);
- au_size = UNPACK_BITS(status, MMC_SD_AU_SIZE_BIT, MMC_SD_AU_SIZE_LEN, 32);
+ au_size = UNPACK_BITS(status, MMC_SD_AU_SIZE_BIT, MMC_SD_AU_SIZE_LEN, 4);
/* Card AU size in sectors */
card->ssr.au_size = 1 << (au_size + 4);
- card->ssr.num_aus = UNPACK_BITS(status, MMC_SD_ERASE_SIZE_BIT, MMC_SD_ERASE_SIZE_LEN, 32);
-
+ card->ssr.num_aus = UNPACK_BITS(status, MMC_SD_ERASE_SIZE_BIT, MMC_SD_ERASE_SIZE_LEN, 16);
+ /*if num_aus is 0 then host should assign number of AU erased at a time*/
+ if (!card->ssr.num_aus)
+ card->ssr.num_aus = 0x10;
return 0;
}
@@ -1671,18 +1679,20 @@
card->block_size = MMC_BLK_SZ;
- /* Enable RST_n_FUNCTION */
- if (!card->ext_csd[MMC_EXT_CSD_RST_N_FUNC])
- {
- mmc_return = mmc_switch_cmd(host, card, MMC_SET_BIT, MMC_EXT_CSD_RST_N_FUNC, RST_N_FUNC_ENABLE);
-
- if (mmc_return)
+ if (MMC_CARD_MMC(card)) {
+ /* Enable RST_n_FUNCTION */
+ if (!card->ext_csd[MMC_EXT_CSD_RST_N_FUNC])
{
- dprintf(CRITICAL, "Failed to enable RST_n_FUNCTION\n");
- return mmc_return;
- }
- }
+ mmc_return = mmc_switch_cmd(host, card, MMC_SET_BIT, MMC_EXT_CSD_RST_N_FUNC, RST_N_FUNC_ENABLE);
+ if (mmc_return)
+ {
+ dprintf(CRITICAL, "Failed to enable RST_n_FUNCTION\n");
+ return mmc_return;
+ }
+ }
+
+ }
return mmc_return;
}
@@ -2178,7 +2188,10 @@
* As per emmc 4.5 spec section 7.4.27, calculate the erase timeout
* erase_timeout = 300ms * ERASE_TIMEOUT_MULT * num_erase_grps
*/
- erase_timeout = ((uint64_t)300 * 1000 * card->ext_csd[MMC_ERASE_TIMEOUT_MULT] * num_erase_grps);
+ if (MMC_CARD_MMC(card))
+ erase_timeout = ((uint64_t)300 * 1000 * card->ext_csd[MMC_ERASE_TIMEOUT_MULT] * num_erase_grps);
+ else
+ erase_timeout = ((uint64_t)300 * 1000 * num_erase_grps);
/* Send CMD38 to perform erase */
if (mmc_send_erase(dev, erase_timeout))
@@ -2359,15 +2372,17 @@
dprintf(CRITICAL, "card deselect error: %s\n", __func__);
return;
}
+ if(MMC_CARD_MMC(card)){
+ /*CMD5 is reserved in SD card */
+ cmd.cmd_index = CMD5_SLEEP_AWAKE;
+ cmd.argument = (card->rca << MMC_CARD_RCA_BIT) | MMC_CARD_SLEEP;
+ cmd.cmd_type = SDHCI_CMD_TYPE_NORMAL;
+ cmd.resp_type = SDHCI_CMD_RESP_R1B;
- cmd.cmd_index = CMD5_SLEEP_AWAKE;
- cmd.argument = (card->rca << MMC_CARD_RCA_BIT) | MMC_CARD_SLEEP;
- cmd.cmd_type = SDHCI_CMD_TYPE_NORMAL;
- cmd.resp_type = SDHCI_CMD_RESP_R1B;
-
- /* send command */
- if(sdhci_send_command(&dev->host, &cmd))
- dprintf(CRITICAL, "card sleep error: %s\n", __func__);
+ /* send command */
+ if(sdhci_send_command(&dev->host, &cmd))
+ dprintf(CRITICAL, "card sleep error: %s\n", __func__);
+ }
}
/*
diff --git a/platform/msm_shared/mmc_wrapper.c b/platform/msm_shared/mmc_wrapper.c
index 10e9955..495767a 100755
--- a/platform/msm_shared/mmc_wrapper.c
+++ b/platform/msm_shared/mmc_wrapper.c
@@ -534,6 +534,41 @@
}
/*
+ * Function : ufs_get_boot_lun
+ * Arg : none
+ * Return type : current boot lun
+ */
+
+int ufs_get_boot_lun()
+{
+ int ret = 0;
+ void *dev;
+ dev = target_mmc_device();
+
+ if (!(platform_boot_dev_isemmc()))
+ ret = dme_get_bbootlunen((struct ufs_dev *)dev);
+ return ret;
+}
+
+
+/*
+ * Function : ufs_set_boot_lun
+ * Arg : boot lun id
+ * Return type : status
+ */
+
+int ufs_set_boot_lun(uint32_t boot_lun_id)
+{
+ int ret = 0;
+ void *dev;
+ dev = target_mmc_device();
+
+ if (!(platform_boot_dev_isemmc()))
+ ret = dme_set_bbootlunen((struct ufs_dev *)dev, boot_lun_id);
+ return ret;
+}
+
+/*
* Function : mmc set LUN for ufs
* Arg : LUN number
* Return type : void
diff --git a/platform/msm_shared/qpic_nand.c b/platform/msm_shared/qpic_nand.c
index c39d584..d2b6044 100644
--- a/platform/msm_shared/qpic_nand.c
+++ b/platform/msm_shared/qpic_nand.c
@@ -77,6 +77,7 @@
{0x9590DC2C, 0x56, 0xFFFFFFFF, 0x0, 0x10000000, 0, 2048, 0x00020000, 0x40, 0},
{0x1590aa98, 0x76, 0xFFFFFFFF, 0x0, 0x10000000, 0, 2048, 0x00020000, 0x80, 1},
{0x2690A32C, 0x64, 0xFFFFFFFF, 0x0, 0x20000000, 0, 4096, 0x00040000, 0xE0, 1},
+ {0x2690AC98, 0x81676, 0xFFFFFFFF, 0x0, 0x20000000, 0, 4096, 0x00040000, 0xE0, 1},
/* Note: Width flag is 0 for 8 bit Flash and 1 for 16 bit flash */
};
diff --git a/project/msm8952.mk b/project/msm8952.mk
index 54d4fa8..7fbfae6 100644
--- a/project/msm8952.mk
+++ b/project/msm8952.mk
@@ -64,8 +64,6 @@
ifeq ($(ENABLE_MDTP_SUPPORT),1)
DEFINES += MDTP_SUPPORT=1
-DEFINES += MDTP_EFUSE_ADDRESS=0x0005C250 # QFPROM_CORR_QC_SPARE_REG_LSB_ADDR
-DEFINES += MDTP_EFUSE_START=0
endif
ENABLE_WDOG_SUPPORT := 0
diff --git a/target/mdmfermium/init.c b/target/mdmfermium/init.c
index 1ccc227..4bad773 100644
--- a/target/mdmfermium/init.c
+++ b/target/mdmfermium/init.c
@@ -199,6 +199,13 @@
};
}
+void target_serialno(unsigned char *buf)
+{
+ uint32_t serialno;
+ serialno = board_chip_serial();
+ snprintf((char *)buf, sizeof(uint32_t)+1, "%x", serialno);
+}
+
unsigned check_reboot_mode(void)
{
uint32_t restart_reason = 0;
diff --git a/target/msm8952/mdtp_ui_defs.c b/target/msm8952/mdtp_defs.c
similarity index 77%
rename from target/msm8952/mdtp_ui_defs.c
rename to target/msm8952/mdtp_defs.c
index 668feb2..ebcdafb 100644
--- a/target/msm8952/mdtp_ui_defs.c
+++ b/target/msm8952/mdtp_defs.c
@@ -27,8 +27,15 @@
*
*/
+#include "platform.h"
#include "mdtp_defs.h"
+#define MDTP_EFUSE_ADDRESS_MSM8952 0x0005C250 // QFPROM_CORR_QC_SPARE_REG_LSB_ADDR
+#define MDTP_EFUSE_START_MSM8952 0
+
+#define MDTP_EFUSE_ADDRESS_MSM8956 0x000A4408 // QFPROM_CORR_SPARE_REG18_LSB_ADDR
+#define MDTP_EFUSE_START_MSM8956 0
+
struct mdtp_ui_defs mdtp_ui_defs_msm8952 = {
// Image dimensions
952, // error_msg_width;
@@ -65,3 +72,25 @@
{
return mdtp_ui_defs_msm8952;
}
+
+int mdtp_get_target_efuse(struct mdtp_target_efuse* target_efuse)
+{
+ if (target_efuse == NULL)
+ {
+ dprintf(CRITICAL, "mdtp: mdtp_get_target_efuse: ERROR, target_efuse is NULL\n");
+ return -1;
+ }
+
+ if (platform_is_msm8956())
+ {
+ target_efuse->address = MDTP_EFUSE_ADDRESS_MSM8956;
+ target_efuse->start = MDTP_EFUSE_START_MSM8956;
+ }
+ else
+ {
+ target_efuse->address = MDTP_EFUSE_ADDRESS_MSM8952;
+ target_efuse->start = MDTP_EFUSE_START_MSM8952;
+ }
+
+ return 0;
+}
diff --git a/target/msm8952/rules.mk b/target/msm8952/rules.mk
index 142cd88..17c6536 100644
--- a/target/msm8952/rules.mk
+++ b/target/msm8952/rules.mk
@@ -48,5 +48,5 @@
endif
ifeq ($(ENABLE_MDTP_SUPPORT),1)
OBJS += \
- $(LOCAL_DIR)/mdtp_ui_defs.o
+ $(LOCAL_DIR)/mdtp_defs.o
endif