platform: msm8952: Use correct rpmb receive buffer address.
rpmb receive buffer address is different, for devices with 512MB DDR
memory configuration. Change ensures, we use correct address.
Change-Id: I53185124ad7ef2699580e0cbe6be4366bbd7147c
diff --git a/include/platform.h b/include/platform.h
index 6965c5a..55fd39e 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -91,4 +91,5 @@
bool platform_is_glink_enabled();
bool platform_is_mdm9206();
int is_vb_le_enabled();
+void* get_rpmb_snd_rcv_buff();
#endif
diff --git a/platform/msm8952/include/platform/iomap.h b/platform/msm8952/include/platform/iomap.h
index 6f4b28f..057d909 100644
--- a/platform/msm8952/include/platform/iomap.h
+++ b/platform/msm8952/include/platform/iomap.h
@@ -163,7 +163,8 @@
* as device memory, define the start address
* and size in MB
*/
-#define RPMB_SND_RCV_BUF 0xA0000000
+#define RPMB_SND_RCV_BUF get_rpmb_snd_rcv_buff()
+#define RPMB_SND_RCV_BUF_STRT 0xA0000000
#define RPMB_SND_RCV_BUF_512 0x9FE00000
#define RPMB_SND_RCV_BUF_SZ 0x1
diff --git a/platform/msm8952/platform.c b/platform/msm8952/platform.c
index 77b8f8a..11501c2 100644
--- a/platform/msm8952/platform.c
+++ b/platform/msm8952/platform.c
@@ -68,7 +68,7 @@
{ MSM_SHARED_IMEM_BASE, MSM_SHARED_IMEM_BASE, 1, COMMON_MEMORY},
{ SCRATCH_ADDR, SCRATCH_ADDR, SCRATCH_SIZE, SCRATCH_MEMORY},
{ MIPI_FB_ADDR, MIPI_FB_ADDR, 20, COMMON_MEMORY},
- { RPMB_SND_RCV_BUF, RPMB_SND_RCV_BUF, RPMB_SND_RCV_BUF_SZ, IOMAP_MEMORY},
+ { RPMB_SND_RCV_BUF_STRT, RPMB_SND_RCV_BUF_STRT, RPMB_SND_RCV_BUF_SZ, IOMAP_MEMORY},
};
static mmu_section_t mmu_section_table_512[] = {
@@ -314,3 +314,11 @@
return ret;
}
+
+void *get_rpmb_snd_rcv_buff()
+{
+ if(smem_get_ddr_size() > 0x20000000)
+ return (void *)RPMB_SND_RCV_BUF_STRT;
+ else
+ return (void *)RPMB_SND_RCV_BUF_512;
+}