linux/arch/arm/mach-socfpga
Dinh Nguyen 3a4356c0c0 arm: socfpga: fix fetching cpu1start_addr for SMP
When CPU1 is brought out of reset, it's MMU is not turned on yet, so it will
only be able to use physical addresses. For systems with that have the
MMU page configured for 0xC0000000, 0x80000000, or 0x40000000
"BIC 0x40000000" will work just fine, as it was just converting the
virtual address of &cpu1start_addr into a physical address, ie. 0xC0000000
became 0x80000000. So for systems where the SDRAM controller was able to do a
wrap-around access, this was working fine, as it was just dropping the MSB,
but for systems where out of bounds memory access is not allowed, this would
not allow CPU1 to correctly fetch &cpu1start_addr.

This patch fixes the secondary_trampoline code to correctly fetch the
physical address of cpu1start_addr directly. The patch will subtract the
correct PAGE_OFFSET from &cpu1start_addr. And since on this platform, the
physical memory will always start at 0x0, subtracting PAGE_OFFSET from
&cpu1start_addr will allow CPU1 to correctly fetch the value of cpu1start_addr.

While at it, change the name of cpu1start_addr to socfpga_cpu1start_addr
to avoid any future naming collisions for multiplatform image.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
---
v4: Updated commit log to correctly lay out the usage of PAGE_OFFSET and
    add comments to the same effect.
v3: Used PAGE_OFFSET to get the physical address
v2: Correctly get the physical address instead of just a BIC hack.
2014-10-21 14:04:14 -05:00
..
Kconfig ARM: select HAVE_SMP for V7 multi-platform 2014-02-19 16:43:27 -06:00
Makefile ARM: socfpga: Enable SMP for socfpga 2012-10-26 14:59:39 +02:00
core.h arm: socfpga: fix fetching cpu1start_addr for SMP 2014-10-21 14:04:14 -05:00
headsmp.S arm: socfpga: fix fetching cpu1start_addr for SMP 2014-10-21 14:04:14 -05:00
platsmp.c arm: socfpga: fix fetching cpu1start_addr for SMP 2014-10-21 14:04:14 -05:00
socfpga.c arm: socfpga: fix fetching cpu1start_addr for SMP 2014-10-21 14:04:14 -05:00