summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-01-21 16:50:31 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2011-01-21 16:50:31 +0000
commit3ca15914dfb37611a5fbd9907cf3e41bc934d577 (patch)
treec059bfda5d1d37f5e61beb03a0b918a195840c9a
parent76389e18c04833a87811550ed6db06f1790aacde (diff)
downloadedk2-3ca15914dfb37611a5fbd9907cf3e41bc934d577.tar.gz
edk2-3ca15914dfb37611a5fbd9907cf3e41bc934d577.tar.bz2
edk2-3ca15914dfb37611a5fbd9907cf3e41bc934d577.zip
OvmfPkg: Add DEBUG messages to dump the contents of CMOS
The contents of CMOS on boot can describe some aspects of the system configuration. For example, the size of memory available to qemu/kvm. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11264 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--OvmfPkg/PlatformPei/Platform.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 833f62adff..66bb0984c8 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -31,6 +31,7 @@
#include <Guid/MemoryTypeInformation.h>
#include "Platform.h"
+#include "Cmos.h"
EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {
{ EfiACPIMemoryNVS, 0x004 },
@@ -200,6 +201,27 @@ ReserveEmuVariableNvStore (
}
+VOID
+DebugDumpCmos (
+ VOID
+ )
+{
+ UINTN Loop;
+
+ DEBUG ((EFI_D_INFO, "CMOS:\n"));
+
+ for (Loop = 0; Loop < 0x80; Loop++) {
+ if ((Loop % 0x10) == 0) {
+ DEBUG ((EFI_D_INFO, "%02x:", Loop));
+ }
+ DEBUG ((EFI_D_INFO, " %02x", CmosRead8 (Loop)));
+ if ((Loop % 0x10) == 0xf) {
+ DEBUG ((EFI_D_INFO, "\n"));
+ }
+ }
+}
+
+
/**
Perform Platform PEI initialization.
@@ -220,6 +242,8 @@ InitializePlatform (
DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));
+ DebugDumpCmos ();
+
TopOfMemory = MemDetect ();
ReserveEmuVariableNvStore ();