AGESA: Add helpers to track heap relocation

Change-Id: Ib43e59e4d4ee5e48abf7177b36cb06fdae40bde9
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/18627
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Kyösti Mälkki 2016-11-24 14:31:07 +02:00
parent e522258907
commit acc599b839
4 changed files with 45 additions and 5 deletions

View File

@ -16,6 +16,7 @@
#include <stdint.h>
#include <string.h>
#include <northbridge/amd/agesa/state_machine.h>
#include <northbridge/amd/agesa/agesa_helper.h>
#include <northbridge/amd/agesa/agesawrapper.h>
#include <northbridge/amd/agesa/BiosCallOuts.h>

View File

@ -27,10 +27,6 @@ AGESA_STATUS agesawrapper_amdinitlate(void);
AGESA_STATUS agesawrapper_amdinitpost(void);
AGESA_STATUS agesawrapper_amdinitmid(void);
void agesawrapper_trace(AGESA_STATUS ret, AMD_CONFIG_PARAMS *StdHeader, const char *func);
#define AGESA_EVENTLOG(status, stdheader) \
agesawrapper_trace(status, stdheader, __func__)
AGESA_STATUS agesawrapper_amdinitresume(void);
AGESA_STATUS agesawrapper_amdS3Save(void);
AGESA_STATUS agesawrapper_amds3laterestore(void);
@ -39,6 +35,9 @@ AGESA_STATUS agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *Conf
AGESA_STATUS agesawrapper_fchs3earlyrestore(void);
AGESA_STATUS agesawrapper_fchs3laterestore(void);
#define AGESA_EVENTLOG(status, stdheader) \
agesawrapper_trace(status, stdheader, __func__)
struct OEM_HOOK
{
/* romstage */

View File

@ -15,12 +15,46 @@
#include <stdint.h>
#include <string.h>
#include <northbridge/amd/agesa/agesawrapper.h>
#include <northbridge/amd/agesa/state_machine.h>
#include <northbridge/amd/agesa/BiosCallOuts.h>
#include "amdlib.h"
#include "AGESA.h"
#include "AMD.h"
#include <heapManager.h>
static const char undefined[] = "undefined";
/* Match order of enum AGESA_STRUCT_NAME. */
static const char *AgesaFunctionNameStr[] = {
"AmdInitRecovery", "AmdCreateStruct", "AmdInitEarly", "AmdInitEnv", "AmdInitLate",
"AmdInitMid", "AmdInitPost", "AmdInitReset", "AmdInitResume", "AmdReleaseStruct",
"AmdS3LateRestore","AmdS3Save", "AmdGetApicId", "AmdGetPciAddress", "AmdIdentifyCore",
"AmdReadEventLog", "AmdGetAvailableExeCacheSize", "AmdLateRunApTask", "AmdIdentifyDimm",
};
/* heapManager.h */
static const char *HeapStatusStr[] = {
"DoNotExistYet", "LocalCache", "TempMem", "SystemMem", "DoNotExistAnymore","S3Resume"
};
const char *agesa_struct_name(int state)
{
if ((state < AMD_INIT_RECOVERY) || (state > AMD_IDENTIFY_DIMMS))
return undefined;
int index = state - AMD_INIT_RECOVERY;
return AgesaFunctionNameStr[index];
}
const char *heap_status_name(int status)
{
if ((status < HEAP_DO_NOT_EXIST_YET) || (status > HEAP_S3_RESUME))
return undefined;
int index = status - HEAP_DO_NOT_EXIST_YET;
return HeapStatusStr[index];
}
/*
* Possible AGESA_STATUS values:

View File

@ -17,6 +17,12 @@
#define _STATE_MACHINE_H_
#include <stdint.h>
#include <AGESA.h>
/* eventlog */
const char *agesa_struct_name(int state);
const char *heap_status_name(int status);
void agesawrapper_trace(AGESA_STATUS ret, AMD_CONFIG_PARAMS *StdHeader, const char *func);
struct sysinfo
{