linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: socfpga: reserve the region at start of phys mem
@ 2014-02-18 17:34 Sebastian Andrzej Siewior
  2014-03-14 17:01 ` Dinh Nguyen
  2014-04-30 16:17 ` Josh Cartwright
  0 siblings, 2 replies; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-02-18 17:34 UTC (permalink / raw)
  To: linux-arm-kernel

The SMP bringup code copies trampline code to the physical location 0x0.
If somebody allocated memory from this location then it will be
overwritten.
This patch reserves the few bytes so that it won't be used by the memory
allocator.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/arm/mach-socfpga/socfpga.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
index a9050e6..2ba992a 100644
--- a/arch/arm/mach-socfpga/socfpga.c
+++ b/arch/arm/mach-socfpga/socfpga.c
@@ -26,6 +26,7 @@
 #include <linux/phy.h>
 #include <linux/micrel_phy.h>
 #include <linux/sys_soc.h>
+#include <linux/memblock.h>
 
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
@@ -315,6 +316,17 @@ static void __init socfpga_cyclone5_init(void)
 	socfpga_soc_device_init();
 }
 
+static void __init socfmpga_smp_reserve(void)
+{
+#ifdef CONFIG_SMP
+	int trampoline_size = &secondary_trampoline_end - &secondary_trampoline;
+	int ret;
+
+	ret = memblock_reserve(0, trampoline_size);
+	WARN_ON(ret);
+#endif
+}
+
 static const char *altera_dt_match[] = {
 	"altr,socfpga",
 	NULL
@@ -327,4 +339,5 @@ DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
 	.init_machine	= socfpga_cyclone5_init,
 	.restart	= socfpga_cyclone5_restart,
 	.dt_compat	= altera_dt_match,
+	.reserve	= socfmpga_smp_reserve,
 MACHINE_END
-- 
1.9.0.rc3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-04-30 22:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-18 17:34 [PATCH] arm: socfpga: reserve the region at start of phys mem Sebastian Andrzej Siewior
2014-03-14 17:01 ` Dinh Nguyen
2014-03-14 17:06   ` Sebastian Andrzej Siewior
2014-04-30 15:27   ` Sebastian Andrzej Siewior
2014-04-30 16:17 ` Josh Cartwright
2014-04-30 17:01   ` Sebastian Andrzej Siewior
2014-04-30 17:32     ` Josh Cartwright
2014-04-30 22:06       ` Dinh Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).