[msm_shared/mmc]: Add support to read/write recovery partition on mmc device.

Change-Id: Ife4b60b69b2042564051e992059fddc8136d1c3c
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 5fdf7ab..f17ddfd 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -231,11 +231,21 @@
 		hdr = uhdr;
 		goto unified_boot;
 	}
-
-	ptn = mmc_ptn_offset("boot");
-	if(ptn == 0) {
-		dprintf(CRITICAL, "ERROR: No boot partition found\n");
-                return -1;
+	if(!boot_into_recovery)
+	{
+		ptn = mmc_ptn_offset("boot");
+		if(ptn == 0) {
+			dprintf(CRITICAL, "ERROR: No boot partition found\n");
+                    return -1;
+		}
+	}
+	else
+	{
+		ptn = mmc_ptn_offset("recovery");
+		if(ptn == 0) {
+			dprintf(CRITICAL, "ERROR: No recovery partition found\n");
+                    return -1;
+		}
 	}
 
 	if (mmc_read(ptn + offset, (unsigned int *)buf, page_size)) {
diff --git a/platform/msm_shared/include/mmc.h b/platform/msm_shared/include/mmc.h
index 6c9f1a2..660db66 100755
--- a/platform/msm_shared/include/mmc.h
+++ b/platform/msm_shared/include/mmc.h
@@ -536,6 +536,7 @@
 #define MMC_BOOT_TYPE 			0x48

 #define MMC_SYSTEM_TYPE 		0x82

 #define MMC_USERDATA_TYPE 		0x83

+#define MMC_RECOVERY_TYPE 		0x60

 

 #define MMC_RCA 2

 

diff --git a/platform/msm_shared/mmc.c b/platform/msm_shared/mmc.c
index 9628562..96ff275 100644
--- a/platform/msm_shared/mmc.c
+++ b/platform/msm_shared/mmc.c
@@ -2400,6 +2400,9 @@
             strcpy((char *)mbr_ent->name,(const char *)ext3_partitions[ext3_count]);

             ext3_count++;

             break;

+        case MMC_RECOVERY_TYPE:

+            memcpy(mbr_ent->name,"recovery",8);

+            break;

     };

 }