summaryrefslogtreecommitdiff
path: root/common/ccd_config.c
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@google.com>2018-08-27 11:35:03 -0700
committerMary Ruthven <mruthven@chromium.org>2018-08-29 04:20:29 +0000
commit5496a29d847d4fc2383ec68a6b371b3fa0e445e0 (patch)
tree19b0f2e7902f456af729a0efc8ff8568dc5fc2df /common/ccd_config.c
parent129807aa19f5d375f8574438d37b729c709f4cf2 (diff)
downloadchrome-ec-5496a29d847d4fc2383ec68a6b371b3fa0e445e0.tar.gz
cr50: add more ccd open capabilities
Add a capability for opening cr50 without dev mode and a capability for opening cr50 from the console. This will make it so cr50 can easily be opened from the console after RMA open. BUG=b:113266255,b:113267161 BRANCH=cr50 TEST=verify OpenFromConsole and OpenW/ODevMode are set to IfOpened with CCD_OPEN_PREPVT isn't defined and set to Always when it is defined. Make sure they are set to Always after factory mode is enabled. Change-Id: Ic149b4163ee9a3ce5e0c051dc42634a31a4a0a7e Signed-off-by: Mary Ruthven <mruthven@google.com> Reviewed-on: https://chromium-review.googlesource.com/1191386 Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'common/ccd_config.c')
-rw-r--r--common/ccd_config.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/common/ccd_config.c b/common/ccd_config.c
index a0f1ffe3e9..28262562e7 100644
--- a/common/ccd_config.c
+++ b/common/ccd_config.c
@@ -880,14 +880,16 @@ static enum vendor_cmd_rc ccd_open(struct vendor_cmd_params *p)
}
} else if (!board_battery_is_present()) {
/* Open allowed with no password if battery is removed */
- } else if (board_vboot_dev_mode_enabled() &&
- !(p->flags & VENDOR_CMD_FROM_USB)) {
+ } else if ((ccd_is_cap_enabled(CCD_CAP_OPEN_WITHOUT_DEV_MODE) ||
+ (board_vboot_dev_mode_enabled())) &&
+ (ccd_is_cap_enabled(CCD_CAP_OPEN_FROM_USB) ||
+ !(p->flags & VENDOR_CMD_FROM_USB))) {
/*
* Open allowed with no password if dev mode enabled and
- * command came from the AP.
+ * command came from the AP. CCD capabilities can be used to
+ * bypass these checks.
*/
} else {
-#ifndef CONFIG_CCD_OPEN_PREPVT
/*
* - Password not set
* - Battery is present
@@ -895,7 +897,6 @@ static enum vendor_cmd_rc ccd_open(struct vendor_cmd_params *p)
*/
why_denied = "nopwd";
goto denied;
-#endif
}
/* Fail and abort if already checking physical presence */