aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@google.com>2021-05-11 15:44:23 -0500
committerBill Richardson <wfrichar@google.com>2021-05-12 20:09:43 +0000
commit494977d8a7ad4c3b78385203869a7a72d39c1751 (patch)
treeff826a0e85a8008b9901300e308a8834b38d2f66
parent6599c8ab569ef80485513c6d9428a48304845023 (diff)
downloadgeneric-494977d8a7ad4c3b78385203869a7a72d39c1751.tar.gz
Add new fields to the stats command
This adds the temp and pin state to the stats command. Bug: 187544290 Test: manual Signed-off-by: Bill Richardson <wfrichar@google.com> Change-Id: I112249046b3633c8dce74419aef4ab1f9dbea466 Reviewed-on: https://nugget-os-review.googlesource.com/c/host/generic/+/43089 Reviewed-by: Randall Spangler <rspangler@google.com> Presubmit-Verified: TreeHugger Robot <android-build-prod@system.gserviceaccount.com>
-rw-r--r--nugget/include/app_nugget.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/nugget/include/app_nugget.h b/nugget/include/app_nugget.h
index e0b6497..f9ae76e 100644
--- a/nugget/include/app_nugget.h
+++ b/nugget/include/app_nugget.h
@@ -412,10 +412,11 @@ enum nugget_app_selftest_cmd {
/*
* This struct is specific to Citadel and Nugget OS, but it's enough for the
- * AP-side implementation to translate into the info required for the HAL
- * structs.
+ * AP-side implementation to translate into the info required for the power
+ * stats service.
*/
-struct nugget_app_low_power_stats {
+#define NUGGET_APP_LOW_POWER_STATS_MAGIC 0xC0DEACE1
+struct nugget_app_low_power_stats { /* version 1 */
/* All times in usecs */
uint64_t hard_reset_count; /* Cleared by power loss */
uint64_t time_since_hard_reset;
@@ -428,6 +429,18 @@ struct nugget_app_low_power_stats {
uint64_t time_spent_in_deep_sleep;
uint64_t time_at_ap_reset;
uint64_t time_at_ap_bootloader_done;
+ /*
+ * New fields for v1, used by factory tests. The caller can tell whether the
+ * firmare supports these fields by checking the v1_magic value.
+ */
+ uint32_t v1_magic; /* NUGGET_APP_LOW_POWER_STATS_MAGIC */
+ uint32_t temp;
+ struct {
+ unsigned int phone_on_l : 1;
+ unsigned int vol_up_l : 1;
+ unsigned int vol_dn_l : 1;
+ unsigned int _padding : 29; /* pad to 32 bits */
+ } signals;
} __packed;
#define NUGGET_PARAM_GET_LOW_POWER_STATS 0x200