[PATCH] arm: socfpga: reserve the region at start of phys mem
Josh Cartwright
joshc at codeaurora.org
Wed Apr 30 09:17:17 PDT 2014
On Tue, Feb 18, 2014 at 06:34:57PM +0100, Sebastian Andrzej Siewior wrote:
> 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 at linutronix.de>
[..]
> +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
Is there a particular reason why you aren't describing this reservation
in devicetree using a /memreserve/ node?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
More information about the linux-arm-kernel
mailing list