From 8e4a355773cc64a89b3fc4d79981cfb02bda7e66 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 8 Feb 2013 17:28:04 -0600 Subject: coreboot: introduce CONFIG_RELOCATABLE_RAMSTAGE This patch adds an option to build the ramstage as a reloctable binary. It uses the rmodule library for the relocation. The main changes consist of the following: 1. The ramstage is loaded just under the cmbem space. 2. Payloads cannot be loaded over where ramstage is loaded. If a payload is attempted to load where the relocatable ramstage resides the load is aborted. 3. The memory occupied by the ramstage is reserved from the OS's usage using the romstage_handoff structure stored in cbmem. This region is communicated to ramstage by an CBMEM_ID_ROMSTAGE_INFO entry in cbmem. 4. There is no need to reserve cbmem space for the OS controlled memory for the resume path because the ramsage region has been reserved in #3. 5. Since no memory needs to be preserved in the wake path, the loading and begin of execution of a elf payload is straight forward. Change-Id: Ia66cf1be65c29fa25ca7bd9ea6c8f11d7eee05f5 Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/2792 Reviewed-by: Ronald G. Minnich Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/Kconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/Kconfig') diff --git a/src/Kconfig b/src/Kconfig index f6a83e8a85..7a8985ce0f 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -307,7 +307,14 @@ config HAVE_INIT_TIMER config HIGH_SCRATCH_MEMORY_SIZE hex + default 0x5000 if RELOCATABLE_RAMSTAGE default 0x0 + help + The amount of extra memory to reserve from the OS. If + RELOCATABLE_RAMSTAGE is enabled a size of 20KiB is reserved. This is + for the use of a stack in romstage after memory has been initialized. + The stack size required in romstage can be large when needing to + decompress the ramstage. config USE_OPTION_TABLE bool @@ -374,6 +381,17 @@ config RELOCATABLE_MODULES building relocatable modules in the ram stage. Those modules can be loaded anywhere and all the relocations are handled automatically. +config RELOCATABLE_RAMSTAGE + depends on RELOCATABLE_MODULES + bool "Build the ramstage to be relocatable in 32-bit address space." + default n + help + The reloctable ramstage support allows for the ramstage to be built + as a relocatable module. The stage loader can identify a place + out of the OS way so that copying memory is unnecessary during an S3 + wake. When selecting this option the romstage is responsible for + determing a stack location to use for loading the ramstage. + config HAVE_ACPI_TABLES bool help -- cgit v1.2.3