Write both SN Bits and Board ID during finalization.

The two are written in proper order: SN Bits first, then Board ID.
If the script to write SN Bits does not exist, only the Board ID is
written and a warning about the lack of the SN Bits setting script is
issued. This allows us to only set SN Bits for boards where we want
them.

BUG=chromium:939223
TEST=manual
CQ-DEPEND=CL:1507327

Change-Id: I978fedd788bba0dc19bcd319937164b40d973def
Reviewed-on: https://chromium-review.googlesource.com/1507414
Commit-Ready: Yves Arrouye <drcrash@chromium.org>
Tested-by: Yves Arrouye <drcrash@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index a58a35c..1717571 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -392,11 +392,11 @@
   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('cr50_set_sn_bits_and_board_id')
+def Cr50SetSnBitsAndBoardId(options):
+  """Set the serial number bits, board id and flags on the Cr50 chip."""
+  GetGooftool(options).Cr50SetSnBitsAndBoardId()
+  event_log.Log('cr50_set_sn_bits_and_board_id')
 
 
 @Command('cr50_disable_factory_mode')
@@ -720,7 +720,7 @@
   if not options.rma_mode:
     # Write VPD values related to RLZ ping into VPD.
     GetGooftool(options).WriteVPDForRLZPing(options.embargo_offset)
-  Cr50SetBoardId(options)
+  Cr50SetSnBitsAndBoardId(options)
   Cr50DisableFactoryMode(options)
   Verify(options)
   LogSourceHashes(options)