[msm7630] Add support to detect physical memory usable by apps proc

Modem bootloader places information about physical memory regions
that are usable by apps in shared memory.  This information is available
in shared memory before apps processor is brought out of reset.

Add support to read this "ram partition table" and check for physical
memory chunks that are set as read/write for apps processor, exclude the
apps bootloader area and give the rest to Linux kernel using atags.

As a result, if modem physical memory requirement reduces, then apps
bootloader does not have to change.  Apps can pick up the extra memory
made available by detecting this from ram partition table.

Change-Id: I6abd85cd57710ceda89d4f125e3dffc59e7078b7
diff --git a/platform/msm_shared/smem_ptable.c b/platform/msm_shared/smem_ptable.c
index de4422d..60d0e26 100644
--- a/platform/msm_shared/smem_ptable.c
+++ b/platform/msm_shared/smem_ptable.c
@@ -133,3 +133,24 @@
 	}
 }
 
+/* RAM Partition table from SMEM */
+int smem_ram_ptable_init(struct smem_ram_ptable *smem_ram_ptable)
+{
+	unsigned i;
+
+	i = smem_read_alloc_entry(SMEM_USABLE_RAM_PARTITION_TABLE,
+				  smem_ram_ptable, sizeof(struct smem_ram_ptable));
+	if (i != 0)
+		return 0;
+
+	if (smem_ram_ptable->magic[0] != _SMEM_RAM_PTABLE_MAGIC_1 ||
+	    smem_ram_ptable->magic[1] != _SMEM_RAM_PTABLE_MAGIC_2)
+		return 0;
+
+	dprintf(INFO, "smem ram ptable found: ver: %d len: %d\n",
+		smem_ram_ptable->version, smem_ram_ptable->len);
+
+	return 1;
+}
+
+