aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/agesa/eventlog.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2016-11-24 14:31:07 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2017-04-08 15:19:43 +0200
commitacc599b839dff95d062883ef3a5ff6f1f9fc256c (patch)
tree85e863d40968f7a8b520ad3a6671113cf0939854 /src/northbridge/amd/agesa/eventlog.c
parente522258907c0f16fb46c8abfed64532fd3d81202 (diff)
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>
Diffstat (limited to 'src/northbridge/amd/agesa/eventlog.c')
-rw-r--r--src/northbridge/amd/agesa/eventlog.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/northbridge/amd/agesa/eventlog.c b/src/northbridge/amd/agesa/eventlog.c
index 20944b2f10..c8dbe6025e 100644
--- a/src/northbridge/amd/agesa/eventlog.c
+++ b/src/northbridge/amd/agesa/eventlog.c
@@ -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: