platform: msm_shared: Add support for ram ptable v2
Add support for smem ram ptable v2 support
Change-Id: I2caad4fe74a79ee4884ab97187f30487221e04f8
diff --git a/platform/msm_shared/smem.h b/platform/msm_shared/smem.h
index b3b6fed..0edfac6 100644
--- a/platform/msm_shared/smem.h
+++ b/platform/msm_shared/smem.h
@@ -54,6 +54,7 @@
{
SMEM_RAM_PTABLE_VERSION_0,
SMEM_RAM_PTABLE_VERSION_1,
+ SMEM_RAM_PTABLE_VERSION_2,
};
struct smem_proc_comm {
@@ -550,6 +551,21 @@
uint32_t reserved5; /* Reserved for future use */
} __attribute__ ((__packed__));
+struct smem_ram_ptn_v2 {
+ char name[RAM_PART_NAME_LENGTH];
+ uint64_t start;
+ uint64_t size;
+ uint32_t attr; /* RAM Partition attribute: READ_ONLY, READWRITE etc.*/
+ uint32_t category; /* RAM Partition category: EBI0, EBI1, IRAM, IMEM */
+ uint32_t domain; /* RAM Partition domain: APPS, MODEM, APPS & MODEM (SHARED) etc. */
+ uint32_t type; /* RAM Partition type: system, bootloader, appsboot, apps etc. */
+ uint32_t num_partitions;/* Number of memory partitions */
+ uint32_t hw_info; /* hw information such as type and frequency */
+ uint64_t available_length; /* Available partition length in RAM in bytes */
+ uint64_t reserved4;
+ uint64_t reserved5; /* Reserved for future use */
+} __attribute__ ((__packed__));
+
struct smem_ram_ptable {
unsigned magic[2];
unsigned version;
@@ -573,6 +589,12 @@
struct smem_ram_ptn_v1 parts[RAM_NUM_PART_ENTRIES];
} __attribute__ ((__packed__));
+struct smem_ram_ptable_v2 {
+ struct smem_ram_ptable_hdr hdr;
+ uint32_t reserved2; /* Added for 8 bytes alignment of header */
+ struct smem_ram_ptn_v2 parts[RAM_NUM_PART_ENTRIES];
+} __attribute__ ((__packed__));
+
/* Power on reason/status info */
#define PWR_ON_EVENT_RTC_ALARM 0x2
#define PWR_ON_EVENT_USB_CHG 0x20
@@ -601,8 +623,8 @@
struct smem_ptn parts[SMEM_PTABLE_MAX_PARTS];
} __attribute__ ((__packed__));
-typedef struct smem_ram_ptable_v1 ram_partition_table;
-typedef struct smem_ram_ptn_v1 ram_partition;
+typedef struct smem_ram_ptable_v2 ram_partition_table;
+typedef struct smem_ram_ptn_v2 ram_partition;
unsigned smem_read_alloc_entry_offset(smem_mem_type_t type, void *buf, int len, int offset);
int smem_ram_ptable_init(struct smem_ram_ptable *smem_ram_ptable);