amd/common: Define regions in AGESA cbmem

In 6c747068 "amd/stoneyridge: Put AGESA heap into cbmem" the AGESA
heap was moved completely into cbmem.  This was a departure from the
"late cbmem init" method of adding it late in post, then storing the
S3 volatile data to the region.  Remove the hardcoded base address
that was missed in that commit.

To prepare for S3 support, split the region into subregions for
heap, AGESA's S3 volatile storage, and an MTRR save area.

BUG=b:69614064

Change-Id: I06c137f56516f3a04091d1191cd657a0aa07320b
Signed-off-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Reviewed-on: https://review.coreboot.org/22720
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Marshall Dawson 2017-11-15 15:47:54 -07:00 committed by Martin Roth
parent 85b2e910df
commit e01cfc9475
3 changed files with 33 additions and 2 deletions

View File

@ -18,11 +18,18 @@
#define __CALLOUTS_AMD_AGESA_H__
#include <amdblocks/agesawrapper.h>
#include <amdblocks/s3_resume.h>
#define BIOS_HEAP_START_ADDRESS 0x010000000
#define BIOS_HEAP_SIZE 0x30000
#define BSP_STACK_BASE_ADDR 0x30000
struct cbmem_usage {
uint8_t heap_base[BIOS_HEAP_SIZE];
#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
uint8_t s3_vol_data[S3_VOLATILE_SIZE];
#endif
};
typedef struct _BIOS_HEAP_MANAGER {
UINT32 StartOfAllocatedNodes;
UINT32 StartOfFreedNodes;

View File

@ -0,0 +1,21 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2017 Advanced Micro Devices, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __AMD_S3_RESUME_H__
#define __AMD_S3_RESUME_H__
#define S3_VOLATILE_SIZE 0x6000
#endif /* __AMD_S3_RESUME_H__ */

View File

@ -21,7 +21,10 @@
static void *GetHeapBase(void)
{
return cbmem_add(CBMEM_ID_RESUME_SCRATCH, BIOS_HEAP_SIZE);
struct cbmem_usage *heap;
heap = (struct cbmem_usage *)cbmem_add(CBMEM_ID_RESUME_SCRATCH,
sizeof(struct cbmem_usage));
return &heap->heap_base;
}
static void EmptyHeap(int unused)