gooftool: Reset Cr50 state in finalize.

Add a gooftool subcommand 'cr50_reset_state' to reset Cr50 using
gsctool. This subcommand is also a part of 'finalize' process.

BUG=b:69060578
TEST=manually test on DUT

Change-Id: Idfe755900eb49a9d7148d0ca7d2d8cba0a743e86
Reviewed-on: https://chromium-review.googlesource.com/831787
Commit-Ready: Cheng-Han Yang <chenghan@chromium.org>
Tested-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Shen-En Shih <petershih@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index a4b12ac..ca074d2 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -448,6 +448,12 @@
   event_log.Log('cr50_set_board_id')
 
 
+@Command('cr50_reset_state')
+def Cr50ResetState(options):
+  """Reset Cr50 state back to default state after RMA."""
+  return GetGooftool(options).Cr50ResetState()
+
+
 @Command('enable_release_partition',
          CmdArg('--release_rootfs',
                 help=('path to the release rootfs device. If not specified, '
@@ -720,6 +726,7 @@
   """
   Verify(options)
   Cr50SetBoardId(options)
+  Cr50ResetState(options)
   LogSourceHashes(options)
   UntarStatefulFiles(options)
   if options.cros_core: