AGESA: Use common romstage ram stack
Change-Id: Ie120360fa79aa0f6f6d82606838404bb0b0d9681 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/15466 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
a2a7e981d6
commit
bce9bbdfd4
|
@ -21,18 +21,20 @@
|
||||||
#include <cpu/amd/mtrr.h>
|
#include <cpu/amd/mtrr.h>
|
||||||
#include <cpu/x86/cache.h>
|
#include <cpu/x86/cache.h>
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
|
#include <program_loading.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <halt.h>
|
#include <halt.h>
|
||||||
#include "s3_resume.h"
|
#include "s3_resume.h"
|
||||||
|
|
||||||
static void move_stack_high_mem(void)
|
static void move_stack_high_mem(void)
|
||||||
{
|
{
|
||||||
void *high_stack = cbmem_find(CBMEM_ID_ROMSTAGE_RAM_STACK);
|
uintptr_t high_stack = romstage_ram_stack_base(HIGH_ROMSTAGE_STACK_SIZE,
|
||||||
if (high_stack == NULL)
|
ROMSTAGE_STACK_CBMEM);
|
||||||
|
if (!high_stack)
|
||||||
halt();
|
halt();
|
||||||
|
|
||||||
/* TODO: Make the switch with empty stack instead. */
|
/* TODO: Make the switch with empty stack instead. */
|
||||||
memcpy(high_stack, (void *)BSP_STACK_BASE_ADDR, HIGH_ROMSTAGE_STACK_SIZE);
|
memcpy((void*)high_stack, (void *)BSP_STACK_BASE_ADDR, HIGH_ROMSTAGE_STACK_SIZE);
|
||||||
|
|
||||||
/* TODO: We only switch stack on BSP. */
|
/* TODO: We only switch stack on BSP. */
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
|
|
|
@ -81,6 +81,7 @@ ramstage-$(CONFIG_PRIMITIVE_MEMTEST) += primitive_memtest.c
|
||||||
romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c
|
romstage-$(CONFIG_CACHE_AS_RAM) += ramtest.c
|
||||||
romstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c
|
romstage-$(CONFIG_GENERIC_GPIO_LIB) += gpio.c
|
||||||
romstage-y += romstage_stack.c
|
romstage-y += romstage_stack.c
|
||||||
|
ramstage-y += romstage_stack.c
|
||||||
romstage-y += stack.c
|
romstage-y += stack.c
|
||||||
ramstage-y += rtc.c
|
ramstage-y += rtc.c
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <spi_flash.h>
|
#include <spi_flash.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
|
#include <program_loading.h>
|
||||||
#include <cpu/amd/agesa/s3_resume.h>
|
#include <cpu/amd/agesa/s3_resume.h>
|
||||||
#include <northbridge/amd/agesa/agesawrapper.h>
|
#include <northbridge/amd/agesa/agesawrapper.h>
|
||||||
#include <AGESA.h>
|
#include <AGESA.h>
|
||||||
|
@ -119,8 +120,7 @@ AGESA_STATUS OemS3Save(AMD_S3SAVE_PARAMS *S3SaveParams)
|
||||||
u32 MTRRStorageSize = 0;
|
u32 MTRRStorageSize = 0;
|
||||||
uintptr_t pos, size;
|
uintptr_t pos, size;
|
||||||
|
|
||||||
if (HIGH_ROMSTAGE_STACK_SIZE)
|
romstage_ram_stack_base(HIGH_ROMSTAGE_STACK_SIZE, ROMSTAGE_STACK_CBMEM);
|
||||||
cbmem_add(CBMEM_ID_ROMSTAGE_RAM_STACK, HIGH_ROMSTAGE_STACK_SIZE);
|
|
||||||
|
|
||||||
/* To be consumed in AmdInitResume. */
|
/* To be consumed in AmdInitResume. */
|
||||||
get_s3nv_data(S3DataTypeNonVolatile, &pos, &size);
|
get_s3nv_data(S3DataTypeNonVolatile, &pos, &size);
|
||||||
|
|
Loading…
Reference in New Issue