summaryrefslogtreecommitdiff
path: root/src/vendorcode/amd/agesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendorcode/amd/agesa')
-rw-r--r--src/vendorcode/amd/agesa/common/Makefile.inc1
-rw-r--r--src/vendorcode/amd/agesa/common/debug_util.c24
-rw-r--r--src/vendorcode/amd/agesa/common/debug_util.h8
-rw-r--r--src/vendorcode/amd/agesa/f12/Makefile.inc1
-rw-r--r--src/vendorcode/amd/agesa/f14/Makefile.inc2
-rw-r--r--src/vendorcode/amd/agesa/f15tn/Makefile.inc2
-rw-r--r--src/vendorcode/amd/agesa/f16kb/Makefile.inc2
7 files changed, 33 insertions, 7 deletions
diff --git a/src/vendorcode/amd/agesa/common/Makefile.inc b/src/vendorcode/amd/agesa/common/Makefile.inc
index 78dd4fc988..247969477c 100644
--- a/src/vendorcode/amd/agesa/common/Makefile.inc
+++ b/src/vendorcode/amd/agesa/common/Makefile.inc
@@ -30,6 +30,7 @@
romstage-y += agesa-entry.c
ramstage-y += agesa-entry.c
+libagesa-y += debug_util.c
libagesa-y += amdlib.c
# Do not optimise performance-critical low-level IO for size with -Os,
diff --git a/src/vendorcode/amd/agesa/common/debug_util.c b/src/vendorcode/amd/agesa/common/debug_util.c
new file mode 100644
index 0000000000..29d0841904
--- /dev/null
+++ b/src/vendorcode/amd/agesa/common/debug_util.c
@@ -0,0 +1,24 @@
+
+#include <AGESA.h>
+#include <AMD.h>
+#include <heapManager.h>
+
+#include "debug_util.h"
+
+static const char undefined[] = "undefined";
+
+static const char *HeapStatusStr[] = {
+ "DoNotExistYet", "LocalCache", "TempMem", "SystemMem", "DoNotExistAnymore","S3Resume"
+};
+
+/* This function has to match with enumeration of XXXX defined
+ * inside heapManager.h header file.
+ */
+const char *heap_status_name(UINT8 HeapStatus)
+{
+ if ((HeapStatus < HEAP_DO_NOT_EXIST_YET) || (HeapStatus > HEAP_S3_RESUME))
+ return undefined;
+
+ int index = HeapStatus - HEAP_DO_NOT_EXIST_YET;
+ return HeapStatusStr[index];
+}
diff --git a/src/vendorcode/amd/agesa/common/debug_util.h b/src/vendorcode/amd/agesa/common/debug_util.h
new file mode 100644
index 0000000000..a8d9a33c50
--- /dev/null
+++ b/src/vendorcode/amd/agesa/common/debug_util.h
@@ -0,0 +1,8 @@
+#ifndef __AGESA_DEBUG_UTIL_H__
+#define __AGESA_DEBUG_UTIL_H__
+
+#include "AMD.h"
+
+const char *heap_status_name(UINT8 HeapStatus);
+
+#endif
diff --git a/src/vendorcode/amd/agesa/f12/Makefile.inc b/src/vendorcode/amd/agesa/f12/Makefile.inc
index f925ccb5f0..dbea9c368c 100644
--- a/src/vendorcode/amd/agesa/f12/Makefile.inc
+++ b/src/vendorcode/amd/agesa/f12/Makefile.inc
@@ -46,7 +46,6 @@ CFLAGS_x86_64 += -march=k8-sse3 -mtune=k8-sse3 -fno-zero-initialized-in-bss -fno
# These are invalid, coreboot proper should not require
# use of AGESA internal header files.
CPPFLAGS_x86_ANY =
-CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU # heapManager.h
CPPFLAGS_x86_32 += $(AGESA_INC) $(CPPFLAGS_x86_ANY)
CPPFLAGS_x86_64 += $(AGESA_INC) $(CPPFLAGS_x86_ANY)
diff --git a/src/vendorcode/amd/agesa/f14/Makefile.inc b/src/vendorcode/amd/agesa/f14/Makefile.inc
index ad2d2dc63d..bf1051c9aa 100644
--- a/src/vendorcode/amd/agesa/f14/Makefile.inc
+++ b/src/vendorcode/amd/agesa/f14/Makefile.inc
@@ -46,8 +46,6 @@ CFLAGS_x86_64 += -march=k8-sse3 -mtune=k8-sse3 -fno-zero-initialized-in-bss -fno
# These are invalid, coreboot proper should not require
# use of AGESA internal header files.
CPPFLAGS_x86_ANY =
-CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU # heapManager.h
-CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU/Family
CPPFLAGS_x86_32 += $(AGESA_INC) $(CPPFLAGS_x86_ANY)
CPPFLAGS_x86_64 += $(AGESA_INC) $(CPPFLAGS_x86_ANY)
diff --git a/src/vendorcode/amd/agesa/f15tn/Makefile.inc b/src/vendorcode/amd/agesa/f15tn/Makefile.inc
index 57350d9571..1c5dc18d85 100644
--- a/src/vendorcode/amd/agesa/f15tn/Makefile.inc
+++ b/src/vendorcode/amd/agesa/f15tn/Makefile.inc
@@ -46,8 +46,6 @@ CFLAGS_x86_64 += -march=k8-sse3 -mtune=k8-sse3 -fno-zero-initialized-in-bss -fno
# These are invalid, coreboot proper should not require
# use of AGESA internal header files.
CPPFLAGS_x86_ANY =
-CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU # heapManager.h
-CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU/Family
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/Fch # FchPlatform.h
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/Fch/Common # FchCommonCfg.h
diff --git a/src/vendorcode/amd/agesa/f16kb/Makefile.inc b/src/vendorcode/amd/agesa/f16kb/Makefile.inc
index 3115c4d996..c423cf2bab 100644
--- a/src/vendorcode/amd/agesa/f16kb/Makefile.inc
+++ b/src/vendorcode/amd/agesa/f16kb/Makefile.inc
@@ -46,8 +46,6 @@ CFLAGS_x86_64 += -march=k8-sse3 -mtune=k8-sse3 -fno-zero-initialized-in-bss -fno
# These are invalid, coreboot proper should not require
# use of AGESA internal header files.
CPPFLAGS_x86_ANY =
-CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU # heapManager.h
-CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/CPU/Family
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/Fch # FchPlatform.h
CPPFLAGS_x86_ANY += -I$(AGESA_ROOT)/Proc/Fch/Common # FchCommonCfg.h