summaryrefslogtreecommitdiff
path: root/include/chipset.h
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2019-08-23 15:06:57 -0700
committerCommit Bot <commit-bot@chromium.org>2019-09-03 20:48:41 +0000
commitaf51b9ea19c0ba4c6d57cdc4c5f3380647be3034 (patch)
tree92e5b04103e0342380c510bd632cbc7db43579a5 /include/chipset.h
parentdfbc632cd5b5a856086249253a98bc83d8942a29 (diff)
downloadchrome-ec-af51b9ea19c0ba4c6d57cdc4c5f3380647be3034.tar.gz
common: Add uptime host command
This moves the EC_CMD_GET_UPTIME_INFO command from behind the CONFIG_CMD_AP_RESET_LOG config in chipset.c into the generic common/uptime.c file, so that all boards in the codebase can use it. If CONFIG_CMD_AP_RESET_LOG is enabled, the "AP reset stats" will be filled. Otherwise, ap_reset_stats is a no-op and recent_ap_reset is filled with zero. BRANCH=none BUG=chromium:997314 TEST=cat /sys/kernel/debug/cros_fp/uptime Change-Id: I3b6f91b2dd22d3d55b707309ec1fdfd26d42fd70 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1769393 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'include/chipset.h')
-rw-r--r--include/chipset.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/chipset.h b/include/chipset.h
index 9b30b7f454..7b684598cb 100644
--- a/include/chipset.h
+++ b/include/chipset.h
@@ -15,7 +15,9 @@
#include "common.h"
#include "compile_time_macros.h"
+#include "ec_commands.h"
#include "gpio.h"
+#include "stddef.h"
/*
* Chipset state mask
@@ -256,10 +258,29 @@ __override_proto enum critical_shutdown board_system_is_idle(
*/
void report_ap_reset(enum chipset_shutdown_reason reason);
+/**
+ * Get statistics about AP resets.
+ *
+ * @param reset_log_entries Pointer to array of log entries.
+ * @param num_reset_log_entries Number of items in reset_log_entries.
+ * @param resets_since_ec_boot Number of AP resets since EC boot.
+ */
+test_mockable enum ec_error_list
+get_ap_reset_stats(struct ap_reset_log_entry *reset_log_entries,
+ size_t num_reset_log_entries,
+ uint32_t *resets_since_ec_boot);
+
#else
static inline void report_ap_reset(enum chipset_shutdown_reason reason) { }
+test_mockable_static_inline enum ec_error_list
+get_ap_reset_stats(struct ap_reset_log_entry *reset_log_entries,
+ size_t num_reset_log_entries, uint32_t *resets_since_ec_boot)
+{
+ return EC_SUCCESS;
+}
+
#endif /* !CONFIG_CMD_AP_RESET_LOG */
#endif /* __CROS_EC_CHIPSET_H */