summaryrefslogtreecommitdiff
path: root/board/cr50/wp.c
diff options
context:
space:
mode:
authorLouis Collard <louiscollard@chromium.org>2018-07-06 16:38:38 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-05 16:11:01 -0700
commit98045b7fa94ad11803af540677b2cde5a337be80 (patch)
tree5f4e14722e93d57e501f64559afadae2de1f3e49 /board/cr50/wp.c
parent87b6fed80dbb08e548105c6f2019b1d57c598ea7 (diff)
downloadchrome-ec-98045b7fa94ad11803af540677b2cde5a337be80.tar.gz
cr50: Add commands to get/set serial number bits.
Allocates 16 bytes of INFO1 space, in the 'board' section, and after the current Board ID data, to store the serial number data for use by zero-touch enrollment. Adds a console command to read / set this data. Adds TPM vendor commands to set initial sn data, and update it during RMA. CQ-DEPEND=CL:*657450 BUG=b:111195266 TEST=tested locally on soraka BRANCH=none Change-Id: I752aefad9654742b7719156202f29d635d2306df Signed-off-by: Louis Collard <louiscollard@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1127574 Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'board/cr50/wp.c')
-rw-r--r--board/cr50/wp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/board/cr50/wp.c b/board/cr50/wp.c
index 83b666c0fc..f4359aa170 100644
--- a/board/cr50/wp.c
+++ b/board/cr50/wp.c
@@ -57,7 +57,7 @@ static void set_wp_state(int asserted)
*
* @return 0 if WP deasserted, 1 if WP asserted
*/
-static int get_wp_state(void)
+int wp_is_asserted(void)
{
/* Signal is active low, so invert */
return !GREG32(RBOX, EC_WP_L);
@@ -72,7 +72,7 @@ static void check_wp_battery_presence(void)
return;
/* Otherwise, mirror battery */
- if (bp != get_wp_state()) {
+ if (bp != wp_is_asserted()) {
CPRINTS("WP %d", bp);
set_wp_state(bp);
}
@@ -123,7 +123,7 @@ static enum vendor_cmd_rc vc_set_wp(enum vendor_cmd_cc code,
/* Get current wp settings */
if (GREG32(PMU, LONG_LIFE_SCRATCH1) & BOARD_FORCING_WP)
response |= WPV_FORCE;
- if (get_wp_state())
+ if (wp_is_asserted())
response |= WPV_ENABLE;
/* Get atboot wp settings */
if (ccd_get_flag(CCD_FLAG_OVERRIDE_WP_AT_BOOT)) {
@@ -166,7 +166,7 @@ static int command_wp(int argc, char **argv)
forced = GREG32(PMU, LONG_LIFE_SCRATCH1) & BOARD_FORCING_WP;
ccprintf("Flash WP: %s%s\n", forced ? "forced " : "",
- get_wp_state() ? "enabled" : "disabled");
+ wp_is_asserted() ? "enabled" : "disabled");
ccprintf(" at boot: ");
if (ccd_get_flag(CCD_FLAG_OVERRIDE_WP_AT_BOOT))