diff --git a/1.1/libboot_control_qti/libboot_control_qti.cpp b/1.1/libboot_control_qti/libboot_control_qti.cpp
index 1a36300..99b15e8 100644
--- a/1.1/libboot_control_qti/libboot_control_qti.cpp
+++ b/1.1/libboot_control_qti/libboot_control_qti.cpp
@@ -27,6 +27,9 @@
  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+//#define LOG_NDEBUG 0
+#define LOG_TAG "bootcontrolhal"
+
 #include <libboot_control_qti.h>
 
 #include <map>
@@ -34,7 +37,6 @@
 #include <string>
 #include <vector>
 #include <errno.h>
-#define LOG_TAG "bootcontrolhal"
 #include <cutils/log.h>
 #include <stdio.h>
 #include <string.h>
@@ -46,12 +48,15 @@
 #include <limits.h>
 #include <cutils/properties.h>
 #include <gpt-utils.h>
+#include <bootloader_message/bootloader_message.h>
 #include <libboot_control/libboot_control.h>
 
 #define BOOTDEV_DIR "/dev/block/bootdevice/by-name"
 #define BOOT_IMG_PTN_NAME "boot"
 #define LUN_NAME_END_LOC 14
 #define BOOT_SLOT_PROP "ro.boot.slot_suffix"
+#define BOARD_PLATFORM_PROP  "ro.build.product"
+#define GVMQ_PLATFORM        "msmnile_gvmq"
 
 #define SLOT_ACTIVE 1
 #define SLOT_INACTIVE 2
@@ -419,11 +424,18 @@
 
 bool bootcontrol_init()
 {
+	char platform[256];
+	property_get(BOARD_PLATFORM_PROP , platform, "");
+	if (!strncmp(platform, GVMQ_PLATFORM, strlen(GVMQ_PLATFORM)))
+		mGvmqPlatform = true;
 	return InitMiscVirtualAbMessageIfNeeded();
 }
 
 unsigned get_number_slots()
 {
+	if (mGvmqPlatform)
+		return 2;
+
 	struct dirent *de = NULL;
 	DIR *dir_bootdev = NULL;
 	unsigned slot_count = 0;
@@ -480,8 +492,35 @@
 	return 0;
 }
 
-int mark_boot_successful()
-{
+int mark_boot_successful(){
+	if (mGvmqPlatform) {
+		std::string err;
+		std::string misc_blk_device = get_bootloader_message_blk_device(&err);
+		if (misc_blk_device.empty()) {
+			ALOGE("Could not find bootloader message block device: %s", err.c_str());
+			return -1;
+		}
+		bootloader_message boot;
+		if (!read_bootloader_message_from(&boot, misc_blk_device, &err)) {
+			ALOGE(" Failed to read from %s due to %s ", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		ALOGV(" bootloader_message is : boot.reserved[0] = %c, boot.reserved[1] = %c",
+					boot.reserved[0], boot.reserved[1]);
+		boot.reserved[2] = 'y';
+		if (!write_bootloader_message_to(boot, misc_blk_device, &err)) {
+			ALOGE("Failed to write to %s  because : %s", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		bootloader_message boot_verify;
+		if (!read_bootloader_message_from(&boot_verify, misc_blk_device, &err)) {
+			ALOGE("Failed to read from %s due to %s ", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		ALOGV(" bootloader_message : boot_verify.reserved[0] = %c, boot_verify.reserved[1] = %c,boot_verify.reserved[2] = %c",
+				boot_verify.reserved[0],boot_verify.reserved[1], boot_verify.reserved[2]);
+	}
+
 	unsigned cur_slot = 0;
 	cur_slot = get_current_slot();
 	if (update_slot_attribute(slot_suffix_arr[cur_slot],
@@ -496,6 +535,41 @@
 
 int set_active_boot_slot(unsigned slot)
 {
+	if (mGvmqPlatform) {
+		std::string err;
+		std::string misc_blk_device = get_bootloader_message_blk_device(&err);
+		if (misc_blk_device.empty()) {
+			ALOGE("Could not find bootloader message block device: %s", err.c_str());
+			return -1;
+		}
+		unsigned current_slot = get_current_slot();
+		uint32_t num_slots = get_number_slots();
+		if ((num_slots < 1) || (current_slot > num_slots - 1)) {
+			ALOGE("Invalid slot number");
+			return -1;
+		}
+		bootloader_message boot;
+		if(current_slot == 0)
+			boot.reserved[0] = 'a';
+		else
+			boot.reserved[0] = 'b';
+		if(slot == 0)
+			boot.reserved[1] = 'a';
+		else
+			boot.reserved[1] = 'b';
+		boot.reserved[2] = '\0';
+		if (!write_bootloader_message_to(boot, misc_blk_device, &err)) {
+			ALOGE("Failed to write to %s  because : %s", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		bootloader_message boot_verify;
+		if (!read_bootloader_message_from(&boot_verify, misc_blk_device, &err)) {
+			ALOGE("Failed to read from %s due to %s ", misc_blk_device.c_str(), err.c_str());
+			return -1;
+		}
+		ALOGV("bootloader_message is : boot_verify.reserved[0] = %c, boot_verify.reserved[1] = %c,boot_verify.reserved[2] = %c",
+			boot_verify.reserved[0],boot_verify.reserved[1], boot_verify.reserved[2]);
+	}
 	map<string, vector<string>> ptn_map;
 	vector<string> ptn_vec;
 	const char ptn_list[][MAX_GPT_NAME_SIZE] = { AB_PTN_LIST };
@@ -587,7 +661,6 @@
 	ALOGE("%s: Failed to mark slot unbootable", __func__);
 	return -1;
 }
-
 int is_slot_bootable(unsigned slot)
 {
 	int attr = 0;
diff --git a/1.1/libboot_control_qti/libboot_control_qti.h b/1.1/libboot_control_qti/libboot_control_qti.h
index b055a49..c669a0e 100644
--- a/1.1/libboot_control_qti/libboot_control_qti.h
+++ b/1.1/libboot_control_qti/libboot_control_qti.h
@@ -48,3 +48,5 @@
 // IBootControl 1.1 methods
 bool set_snapshot_merge_status(MergeStatus status);
 MergeStatus get_snapshot_merge_status();
+
+bool mGvmqPlatform = false;
