From 9ef91389ca20f0dc50c2ab0d6d231ec6feb2802b Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 27 Sep 2018 19:26:30 -0700 Subject: rma: when processing 'RMA open' do not reboot the device Once RMA open is processed and CCD state is updated, the AP still might require to perform some operations, even if TPM is not available any more. With this patch enable_ccd_factory_mode() does not trigger device reset, if invoked by the RMA open handler. Another modification is that WP is disabled immediately when factory mode is enabled, there is no need to reset the H1 for WP status to change. BRANCH=cr50, cr50-mp BUG=b:115495431 TEST=verified that running 'gsctool -a -r ' sets to 'Y' all CCD properties, disables write protection, but does not reboot the device. Change-Id: I834a9e4b5ebbe4aaaf1caafad9c82424087d01f7 Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/1250037 Reviewed-by: Randall Spangler Reviewed-by: Mary Ruthven --- include/ccd_config.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'include/ccd_config.h') diff --git a/include/ccd_config.h b/include/ccd_config.h index fdcb1e20ff..7c377f394f 100644 --- a/include/ccd_config.h +++ b/include/ccd_config.h @@ -301,8 +301,16 @@ void ccd_tpm_reset_callback(void); int ccd_has_password(void); /** - * Enter CCD factory mode. This will clear the TPM and do a hard reboot after - * updating the ccd config. + * Enter CCD factory mode. This will clear the TPM, update the ccd config, and + * then do a hard reboot if 'reset_required' is True. */ -void enable_ccd_factory_mode(void); +void enable_ccd_factory_mode(int reset_required); + +/* + * Enable factory mode but not necessarily rebooting the device. This will + * clear the TPM and disable flash write protection. Will trigger system reset + * only if 'reset_required' is True. + */ +void factory_enable(int reset_required); + #endif /* __CROS_EC_CCD_CONFIG_H */ -- cgit v1.2.1