summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-11-04 10:07:14 -0500
committerFurquan Shaikh <furquan@google.com>2016-11-06 18:14:29 +0100
commit7d9068fe0b5d87fe3fe075d5d9a5f7493f5b1eac (patch)
treeae9b6a540a055222398a830e9b84dda9b832d652 /src/soc
parentd5be4e3d7e7d092d3ea9dc98738c39ea43d3f738 (diff)
downloadcoreboot-7d9068fe0b5d87fe3fe075d5d9a5f7493f5b1eac.tar.xz
soc/intel/common: log event when MRC cache is updated
Log when the MRC cache is attempted to be updated with status of success or failure. Just one slot is supported currently which is deemed 'normal'. This is because there are more slots anticipated in the future. BUG=chrome-os-partner:59395 Change-Id: I0f81458325697aff9924cc359a4173e0d35da5da Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17231 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/common/mrc_cache.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/soc/intel/common/mrc_cache.c b/src/soc/intel/common/mrc_cache.c
index c123da9dc7..bef3ba204c 100644
--- a/src/soc/intel/common/mrc_cache.c
+++ b/src/soc/intel/common/mrc_cache.c
@@ -17,6 +17,7 @@
#include <bootstate.h>
#include <console/console.h>
#include <cbmem.h>
+#include <elog.h>
#include <fmap.h>
#include <ip_checksum.h>
#include <vboot/vboot_common.h>
@@ -281,6 +282,18 @@ static int protect_mrc_cache(const struct mrc_data_region *region)
return 0;
}
+static void log_event_cache_update(uint8_t slot, uint8_t status)
+{
+ const int type = ELOG_TYPE_MEM_CACHE_UPDATE;
+ struct elog_event_mem_cache_update event = {
+ .slot = slot,
+ .status = status,
+ };
+
+ if (elog_add_event_raw(type, &event, sizeof(event)) < 0)
+ printk(BIOS_ERR, "Failed to log mem cache update event.\n");
+}
+
static void update_mrc_cache(void *unused)
{
const struct mrc_saved_data *current_boot;
@@ -336,7 +349,13 @@ static void update_mrc_cache(void *unused)
current_boot->size + sizeof(*current_boot))) {
printk(BIOS_DEBUG, "Failure writing MRC cache to %p.\n",
next_slot);
+ log_event_cache_update(ELOG_MEM_CACHE_UPDATE_SLOT_NORMAL,
+ ELOG_MEM_CACHE_UPDATE_STATUS_FAIL);
+ } else {
+ log_event_cache_update(ELOG_MEM_CACHE_UPDATE_SLOT_NORMAL,
+ ELOG_MEM_CACHE_UPDATE_STATUS_SUCCESS);
}
+
protect_mrc_cache(&region);
}