msm: pm-boot: Use different memory API to allocate block of memory
Currently PM driver uses the memory given by the "memblock_alloc"
api. These initial memory bytes are programmed with warm boot entry
sequences to come out of the low power modes. Currently this API is
causing the system instability with 1GB DDR parts and HIGH MEM is
enabled. To resolve this issue use a different API to allocate the
memory i.e memblock_remove.
Change-Id: I1016d63f1154e7b4d4d4b702202878d6f93cecf0
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm7x27a.c b/arch/arm/mach-msm/board-msm7x27a.c
index e75a963..7563300 100644
--- a/arch/arm/mach-msm/board-msm7x27a.c
+++ b/arch/arm/mach-msm/board-msm7x27a.c
@@ -950,7 +950,7 @@
{
msm7x27a_reserve();
memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8);
- msm_pm_8625_boot_pdata.p_addr = memblock_alloc(SZ_16, SZ_64K);
+ memblock_remove(MSM8625_WARM_BOOT_PHYS, SZ_32);
}
static void __init msm7x27a_device_i2c_init(void)
diff --git a/arch/arm/mach-msm/board-qrd7627a.c b/arch/arm/mach-msm/board-qrd7627a.c
index 91bc1ab..8bffe16 100644
--- a/arch/arm/mach-msm/board-qrd7627a.c
+++ b/arch/arm/mach-msm/board-qrd7627a.c
@@ -924,7 +924,7 @@
{
reserve_info = &msm7627a_reserve_info;
msm_reserve();
- msm_pm_8625_boot_pdata.p_addr = memblock_alloc(SZ_8, SZ_64K);
+ memblock_remove(MSM8625_WARM_BOOT_PHYS, SZ_32);
}
static void __init msm8625_reserve(void)
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap.h b/arch/arm/mach-msm/include/mach/msm_iomap.h
index 8f5d673..34af610 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap.h
@@ -51,6 +51,8 @@
#define MSM_DEBUG_UART_PHYS CONFIG_MSM_DEBUG_UART_PHYS
#endif
+#define MSM8625_WARM_BOOT_PHYS 0x0FD00000
+
#if defined(CONFIG_ARCH_MSM8960) || defined(CONFIG_ARCH_APQ8064) || \
defined(CONFIG_ARCH_MSM8930) || defined(CONFIG_ARCH_MSM9615) || \
diff --git a/arch/arm/mach-msm/pm-boot.c b/arch/arm/mach-msm/pm-boot.c
index f65b8ad..80e5a55 100644
--- a/arch/arm/mach-msm/pm-boot.c
+++ b/arch/arm/mach-msm/pm-boot.c
@@ -102,6 +102,7 @@
{
int ret = 0;
unsigned long entry;
+ void __iomem *warm_boot_ptr;
switch (pdata->mode) {
case MSM_PM_BOOT_CONFIG_TZ:
@@ -124,16 +125,17 @@
= msm_pm_config_rst_vector_after_pc;
break;
case MSM_PM_BOOT_CONFIG_REMAP_BOOT_ADDR:
- /*
- * Set the boot remap address and enable remapping of
- * reset vector
- */
- if (!pdata->p_addr || !pdata->v_addr)
- return -ENODEV;
-
- ret = msm_pm_boot_reset_vector_init(__va(pdata->p_addr));
-
if (!cpu_is_msm8625()) {
+ /*
+ * Set the boot remap address and enable remapping of
+ * reset vector
+ */
+ if (!pdata->p_addr || !pdata->v_addr)
+ return -ENODEV;
+
+ ret = msm_pm_boot_reset_vector_init(
+ __va(pdata->p_addr));
+
__raw_writel((pdata->p_addr | BOOT_REMAP_ENABLE),
pdata->v_addr);
@@ -142,6 +144,10 @@
msm_pm_boot_after_pc
= msm_pm_config_rst_vector_after_pc;
} else {
+ warm_boot_ptr = ioremap_nocache(
+ MSM8625_WARM_BOOT_PHYS, SZ_64);
+ ret = msm_pm_boot_reset_vector_init(warm_boot_ptr);
+
entry = virt_to_phys(msm_pm_boot_entry);
/* Below sequence is a work around for cores
@@ -159,8 +165,8 @@
/* Here upper 16bits[16:31] used by CORE1
* lower 16bits[0:15] used by CORE0
*/
- entry = (pdata->p_addr) |
- ((pdata->p_addr & 0xFFFF0000) >> 16);
+ entry = (MSM8625_WARM_BOOT_PHYS |
+ ((MSM8625_WARM_BOOT_PHYS & 0xFFFF0000) >> 16));
/* write 'entry' to boot remapper register */
__raw_writel(entry, (pdata->v_addr +