arm64: Add support for save/restore registers for CPU startup

Hardware / Coreboot - Furquan Shaikh [google.com] - 10 April 2015 13:47 UTC

startup.c provides function to enable CPU in any stage to save register data that can be used by secondary CPU (for normal boot) or any CPU (for resume boot). stage_entry.S defines space for saving arm64_startup_data. This can be filled by: 1) Primary CPU before bringing up secondary CPUs so that the secondary can use register values to initialize MMU-related and other required registers to appropriate values. 2) CPU suspend path to ensure that on resume the values which were saved are restored appropriately.

stage_entry.S provides a common path for both normal and resume boot to initialize saved registers. For resume path, it is important to set the secondary entry point for startup since x26 needs to be 1 for enabling MMU and cache.

This also ensures that we do not fall into false memory cache errors which caused CPU to fail during normal / resume boot. Thus, we can get rid of the stack cache invalidate for secondary CPUs.

BUG=chrome-os-partner:33962 BRANCH=None TEST=Compiles and boots both CPU0 and CPU1 on ryu without mmu_enable and stack cache invalidate for CPU1.

Change-Id: Ia4ca0e7d35c0738dbbaa926cce4268143c6f9de3

9482498 arm64: Add support for save/restore registers for CPU startup.
src/arch/arm64/Makefile.inc | 2 +
src/arch/arm64/armv8/secmon/secmon_init.c | 40 ++-------------
src/arch/arm64/c_entry.c | 17 ++-----
src/arch/arm64/cpu_ramstage.c | 14 ++++--
src/arch/arm64/include/arch/startup.h | 46 +++++++++++++++++
src/arch/arm64/include/armv8/arch/cpu.h | 11 ++++
src/arch/arm64/stage_entry.S | 78 ++++++++++++++++++++++++++---
src/arch/arm64/startup.c | 54 ++++++++++++++++++++
8 files changed, 201 insertions(+), 61 deletions(-)

Upstream: review.coreboot.org


  • Share