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 <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/2792 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
This commit is contained in:
committed by
Stefan Reinauer
parent
43e4a80a92
commit
8e4a355773
@@ -232,11 +232,14 @@ struct lb_memory *write_tables(void)
|
||||
post_code(0x9e);
|
||||
|
||||
#if CONFIG_HAVE_ACPI_RESUME
|
||||
/* Only add CBMEM_ID_RESUME when the ramstage isn't relocatable. */
|
||||
#if !CONFIG_RELOCATABLE_RAMSTAGE
|
||||
/* Let's prepare the ACPI S3 Resume area now already, so we can rely on
|
||||
* it begin there during reboot time. We don't need the pointer, nor
|
||||
* the result right now. If it fails, ACPI resume will be disabled.
|
||||
*/
|
||||
cbmem_add(CBMEM_ID_RESUME, HIGH_MEMORY_SAVE);
|
||||
#endif
|
||||
#if CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY14 || CONFIG_NORTHBRIDGE_AMD_AGESA_FAMILY15_TN
|
||||
cbmem_add(CBMEM_ID_RESUME_SCRATCH, CONFIG_HIGH_SCRATCH_MEMORY_SIZE);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user