Merge "target: msm8996: Use available size for hlos"
diff --git a/target/thulium/meminfo.c b/target/thulium/meminfo.c
index 9aa1dd5..c65525f 100644
--- a/target/thulium/meminfo.c
+++ b/target/thulium/meminfo.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-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
@@ -41,6 +41,7 @@
 	unsigned int index;
 	int ret = 0;
 	uint32_t len = 0;
+	uint64_t size = 0;
 
 	/* Make sure RAM partition table is initialized */
 	ASSERT(smem_ram_ptable_init_v1());
@@ -56,11 +57,16 @@
 			(ptn_entry.type == SYS_MEMORY))
 		{
 
+			if (smem_get_ram_ptable_version() == SMEM_RAM_PTABLE_VERSION_2)
+				size = ptn_entry.available_length;
+			else
+				size = ptn_entry.size;
+
 			/* Pass along all other usable memory regions to Linux */
 			ret = dev_tree_add_mem_info(fdt,
 							memory_node_offset,
 							ptn_entry.start,
-							ptn_entry.size);
+							size);
 
 			if (ret)
 			{