msm: 8625: Remove static mapping for second core
Instead of having a fixed physical address for second core and doing a
memblock_remove, move to randomly allocating a physical address.
As allocation of address can fall in HIGHMEM region and to map
it to kernel address space adding kmap_atomic.
Change-Id: If71c9d816b3ab2923eddcad90efcb296373417da
Signed-off-by: Taniya Das <tdas@codeaurora.org>
diff --git a/arch/arm/mach-msm/devices-msm7x27a.c b/arch/arm/mach-msm/devices-msm7x27a.c
index e1276d6..ff11c7a 100644
--- a/arch/arm/mach-msm/devices-msm7x27a.c
+++ b/arch/arm/mach-msm/devices-msm7x27a.c
@@ -17,6 +17,7 @@
#include <linux/regulator/machine.h>
#include <linux/init.h>
#include <linux/irq.h>
+#include <linux/memblock.h>
#include <mach/irqs.h>
#include <mach/msm_iomap.h>
#include <mach/board.h>
@@ -1590,8 +1591,32 @@
(void *)MSM_QGIC_CPU_BASE);
}
+static phys_addr_t msm8625_phys_base;
+
+static void __init msm_reserve_sdram_memblock(void)
+{
+ phys_addr_t paddr;
+
+ paddr = memblock_alloc(SZ_8, SZ_64K);
+ pr_debug("%s physical address = %x\n", __func__, paddr);
+
+ if (!paddr) {
+ pr_err("%s: failed to reserve SZ_8 bytes\n", __func__);
+ return;
+ }
+
+ msm8625_phys_base = paddr;
+}
+
+phys_addr_t msm8625_get_phys_base(void)
+{
+ return msm8625_phys_base;
+}
+EXPORT_SYMBOL(msm8625_get_phys_base);
+
void __init msm8625_map_io(void)
{
+ msm_reserve_sdram_memblock();
msm_map_msm8625_io();
if (socinfo_init() < 0)