Revert "msm: 8625: Remove static mapping for second core"
Second core booting is not always successful, so reverting it for now.
This reverts commit 0c29caec8efb6ebfd23b27bda4f8e10ab4f504f0.
Change-Id: Ia017e12488e11f0700f76d6df06d41f7dea717c3
Signed-off-by: Taniya Das <tdas@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm7x27a.c b/arch/arm/mach-msm/board-msm7x27a.c
index d07703b..ec2be96 100644
--- a/arch/arm/mach-msm/board-msm7x27a.c
+++ b/arch/arm/mach-msm/board-msm7x27a.c
@@ -948,6 +948,7 @@
static void __init msm8625_reserve(void)
{
msm7x27a_reserve();
+ memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8);
msm_pm_8625_boot_pdata.p_addr = memblock_alloc(SZ_8, SZ_64K);
}
diff --git a/arch/arm/mach-msm/board-qrd7627a.c b/arch/arm/mach-msm/board-qrd7627a.c
index a83cde0..41c02ab 100644
--- a/arch/arm/mach-msm/board-qrd7627a.c
+++ b/arch/arm/mach-msm/board-qrd7627a.c
@@ -843,6 +843,12 @@
msm_pm_8625_boot_pdata.p_addr = memblock_alloc(SZ_8, SZ_64K);
}
+static void __init msm8625_reserve(void)
+{
+ memblock_remove(MSM8625_SECONDARY_PHYS, SZ_8);
+ msm7627a_reserve();
+}
+
static void msmqrd_adsp_add_pdev(void)
{
int rc = 0;
@@ -1268,7 +1274,7 @@
MACHINE_START(MSM8625_EVB, "QRD MSM8625 EVB")
.boot_params = PHYS_OFFSET + 0x100,
.map_io = msm8625_map_io,
- .reserve = msm7627a_reserve,
+ .reserve = msm8625_reserve,
.init_irq = msm8625_init_irq,
.init_machine = msm_qrd_init,
.timer = &msm_timer,
diff --git a/arch/arm/mach-msm/devices-msm7x27a.c b/arch/arm/mach-msm/devices-msm7x27a.c
index f7e67cb..beb0c55 100644
--- a/arch/arm/mach-msm/devices-msm7x27a.c
+++ b/arch/arm/mach-msm/devices-msm7x27a.c
@@ -17,7 +17,6 @@
#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>
@@ -1625,32 +1624,8 @@
(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)
diff --git a/arch/arm/mach-msm/devices-msm7x2xa.h b/arch/arm/mach-msm/devices-msm7x2xa.h
index 73b58e0..3c81ccf 100644
--- a/arch/arm/mach-msm/devices-msm7x2xa.h
+++ b/arch/arm/mach-msm/devices-msm7x2xa.h
@@ -31,5 +31,4 @@
void __init msm8625_map_io(void);
int ar600x_wlan_power(bool on);
void __init msm8x25_spm_device_init(void);
-phys_addr_t msm8625_get_phys_base(void);
#endif
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap.h b/arch/arm/mach-msm/include/mach/msm_iomap.h
index 48e3837..27965d3 100644
--- a/arch/arm/mach-msm/include/mach/msm_iomap.h
+++ b/arch/arm/mach-msm/include/mach/msm_iomap.h
@@ -93,6 +93,8 @@
0xFB600000 */
#define MSM_STRONGLY_ORDERED_PAGE 0xFA0F0000
+#define MSM8625_SECONDARY_PHYS 0x0FE00000
+
#if defined(CONFIG_ARCH_MSM9615) || defined(CONFIG_ARCH_MSM7X27)
#define MSM_SHARED_RAM_SIZE SZ_1M
diff --git a/arch/arm/mach-msm/platsmp-8625.c b/arch/arm/mach-msm/platsmp-8625.c
index 92ed764..3c46d0f 100644
--- a/arch/arm/mach-msm/platsmp-8625.c
+++ b/arch/arm/mach-msm/platsmp-8625.c
@@ -17,7 +17,6 @@
#include <linux/jiffies.h>
#include <linux/smp.h>
#include <linux/io.h>
-#include <linux/highmem.h>
#include <asm/cacheflush.h>
#include <asm/hardware/gic.h>
@@ -26,9 +25,7 @@
#include <asm/unified.h>
#include <mach/msm_iomap.h>
#include <mach/smp.h>
-
#include "pm.h"
-#include "devices-msm7x2xa.h"
#define MSM_CORE1_RESET 0xA8600590
#define MSM_CORE1_STATUS_MSK 0x02800000
@@ -209,8 +206,7 @@
void __init platform_smp_prepare_cpus(unsigned int max_cpus)
{
int i, value;
- phys_addr_t base;
- void *vaddr;
+ void __iomem *second_ptr;
/*
* Initialise the present map, which describes the set of CPUs
@@ -225,14 +221,18 @@
* Write the address of secondary startup into the
* boot remapper register. The secondary CPU branches to this address.
*/
- base = msm8625_get_phys_base();
- __raw_writel(base, (MSM_CFG_CTL_BASE + 0x34));
+ __raw_writel(MSM8625_SECONDARY_PHYS, (MSM_CFG_CTL_BASE + 0x34));
mb();
- vaddr = kmap_atomic(phys_to_page(base));
+ second_ptr = ioremap_nocache(MSM8625_SECONDARY_PHYS, SZ_8);
+ if (!second_ptr) {
+ pr_err("failed to ioremap for secondary core\n");
+ return;
+ }
- msm8625_boot_vector_init(vaddr, virt_to_phys(msm_secondary_startup));
- kunmap_atomic(vaddr);
+ msm8625_boot_vector_init(second_ptr,
+ virt_to_phys(msm_secondary_startup));
+ iounmap(second_ptr);
/* Enable boot remapper address: bit 26 for core1 */
value = __raw_readl(MSM_CFG_CTL_BASE + 0x30);