summaryrefslogtreecommitdiff
path: root/common/ccd_config.c
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2018-10-09 18:23:09 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-11 17:33:49 -0700
commita313e2fe2c78de8c2270483a1654ebd0f6530ccd (patch)
treea76e9cf355f325a4d78afa79fe25755221905dbe /common/ccd_config.c
parent3edb1220d1ef859df4ff4c7f2dece30d763deb6f (diff)
downloadchrome-ec-a313e2fe2c78de8c2270483a1654ebd0f6530ccd.tar.gz
cr50: CCD Info indicates whether all CCD capabilities are default.
CR50 provides whether CCD capabilities are default or not. Factory process can utilize this value instead of CCD cap bitmap information. Users can use either 'gsctool -I' or CR50 console command 'ccd'. BRANCH=cr50_tools BUG=b:117200472 TEST=manually set and clear the password using gsctool -a -F and check the result of gsctool -I. Change-Id: Ic6be2ce880476c3a73150fe0e29007dd6a7e328f Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1272190 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/ccd_config.c')
-rw-r--r--common/ccd_config.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/common/ccd_config.c b/common/ccd_config.c
index fa7c1cb133..c6946522c5 100644
--- a/common/ccd_config.c
+++ b/common/ccd_config.c
@@ -193,6 +193,23 @@ static void raw_set_cap(enum ccd_capability cap,
}
/**
+ * Check CCD configuration is reset to default value.
+ *
+ * @return 1 if it is in default mode.
+ * 0 otherwise.
+ */
+static int raw_check_all_caps_default(void)
+{
+ uint32_t i;
+
+ for (i = 0; i < CCD_CAP_COUNT; i++)
+ if (raw_get_cap(i, 0) != CCD_CAP_STATE_DEFAULT)
+ return 0;
+
+ return 1;
+}
+
+/**
* Check if a password is set.
* @return 1 if password is set, 0 if it's not
*/
@@ -693,6 +710,9 @@ static int command_ccd_info(void)
board_fwmp_allows_unlock() ? "" : " fwmp_lock",
board_vboot_dev_mode_enabled() ? " dev_mode" : "");
+ ccprintf("Capabilities are %s.\n", raw_check_all_caps_default() ?
+ "default" : "modified");
+
ccputs("Use 'ccd help' to print subcommands\n");
return EC_SUCCESS;
}
@@ -1327,7 +1347,10 @@ static enum vendor_cmd_rc ccd_get_info(struct vendor_cmd_params *p)
response.ccd_flags = htobe32(raw_get_flags());
response.ccd_state = ccd_get_state();
- response.ccd_has_password = raw_has_password();
+ response.ccd_indicator_bitmap = raw_has_password() ?
+ CCD_INDICATOR_BIT_HAS_PASSWORD : 0;
+ response.ccd_indicator_bitmap |= raw_check_all_caps_default() ?
+ CCD_INDICATOR_BIT_ALL_CAPS_DEFAULT : 0;
response.ccd_force_disabled = force_disabled;
for (i = 0; i < ARRAY_SIZE(response.ccd_caps_current); i++) {
response.ccd_caps_current[i] =