gooftool: don't set cr50 sn bits in RMA mode

Devices that have been RMAed won't support ZeroTouch enrollment.

BUG=b:129965240
TEST=None

Change-Id: I53d0f7356315904d5695686c4011c18e4af52f29
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/factory/+/2200480
Reviewed-by: Stimim Chen <stimim@chromium.org>
Commit-Queue: Stimim Chen <stimim@chromium.org>
Tested-by: Stimim Chen <stimim@chromium.org>
diff --git a/py/gooftool/commands.py b/py/gooftool/commands.py
index 162bf74..2f45eb2 100755
--- a/py/gooftool/commands.py
+++ b/py/gooftool/commands.py
@@ -453,7 +453,8 @@
   event_log.Log('generate_stable_device_secret')
 
 
-@Command('cr50_set_sn_bits_and_board_id')
+@Command('cr50_set_sn_bits_and_board_id',
+         _rma_mode_cmd_arg)
 def Cr50SetSnBitsAndBoardId(options):
   """Deprecated: use Cr50WriteFlashInfo instead."""
   logging.warning('This function is renamed to Cr50WriteFlashInfo')
@@ -461,6 +462,7 @@
 
 
 @Command('cr50_write_flash_info',
+         _rma_mode_cmd_arg,
          CmdArg('--expect_zero_touch', action='store_true',
                 help='zero touch feature is expected, the command will fail '
                      'immediately if required dependencies are not found.'))
@@ -471,7 +473,7 @@
   # subcommand.  And the `expect_zero_touch` attribute won't exist when this
   # function is invoked by other subcommands, e.g. `finalize`.
   expect_zero_touch = getattr(options, 'expect_zero_touch', False)
-  GetGooftool(options).Cr50WriteFlashInfo(expect_zero_touch)
+  GetGooftool(options).Cr50WriteFlashInfo(expect_zero_touch, options.rma_mode)
   event_log.Log('cr50_write_flash_info')