gooftool: Set cr50 board id in finalize

Set the board ID and flag to the Cr50 during the factory
finalization step.

BUG=chromium:724527
TEST=make test

Change-Id: I3ab7ec247f84a0c4db68cfe696c1cc6e71469516
Reviewed-on: https://chromium-review.googlesource.com/601774
Commit-Ready: Shen-En Shih <petershih@chromium.org>
Tested-by: Shen-En Shih <petershih@chromium.org>
Reviewed-by: Shen-En Shih <petershih@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 25ced64..e21908c 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -438,6 +438,13 @@
   event_log.Log('generate_stable_device_secret')
 
 
+@Command('cr50_set_board_id')
+def Cr50SetBoardId(options):
+  """Set the board id and flag in the Cr50 chip."""
+  GetGooftool(options).Cr50SetBoardId()
+  event_log.Log('cr50_set_board_id')
+
+
 @Command('enable_release_partition',
          CmdArg('--release_rootfs',
                 help=('path to the release rootfs device. If not specified, '
@@ -712,6 +719,7 @@
   ClearGBBFlags(options)
   ClearFactoryVPDEntries(options)
   GenerateStableDeviceSecret(options)
+  Cr50SetBoardId(options)
   if options.no_write_protect:
     logging.warn('WARNING: Firmware Write Protection is SKIPPED.')
     event_log.Log('wp', fw='both', status='skipped')