summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@google.com>2018-04-27 10:37:36 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-02 22:21:18 -0700
commit9d4846a292fbb724617c3b63f6be79a7b8a747be (patch)
treea06b644e4dafd9a9a83f9fd14979bc9cbc7f1f10 /extra
parentdb55f6866bc33f740761f642c2b0138f4dd6fa2d (diff)
downloadchrome-ec-9d4846a292fbb724617c3b63f6be79a7b8a747be.tar.gz
cr50_rma_open: add support for checking prepvt and prod versions
RMA support through the cr50 console is only a part images starting with 0.4.5. Check that the prepvt version is greater than or equal to 0.4.5. Versions 0.4.4 are greater than the prod version 0.3.3, but you can't use it to do RMA open through the console. It can only be done through the AP. BUG=none BRANCH=none TEST=none Change-Id: I7e08cc5dbc9f910686ea5917be755170c0587ee4 Signed-off-by: Mary Ruthven <mruthven@google.com> Reviewed-on: https://chromium-review.googlesource.com/1040356 Commit-Ready: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'extra')
-rw-r--r--extra/cr50_rma_open/cr50_rma_open.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/extra/cr50_rma_open/cr50_rma_open.py b/extra/cr50_rma_open/cr50_rma_open.py
index 2324677924..caddcb2f54 100644
--- a/extra/cr50_rma_open/cr50_rma_open.py
+++ b/extra/cr50_rma_open/cr50_rma_open.py
@@ -19,7 +19,8 @@ WP_IS_DISABLED = 1 << 1
RMA_OPENED = CCD_IS_UNRESTRICTED | WP_IS_DISABLED
URL = 'https://www.google.com/chromeos/partner/console/cr50reset?' \
'challenge=%s&hwid=%s'
-RMA_SUPPORT = '0.3.3'
+RMA_SUPPORT_PROD = '0.3.3'
+RMA_SUPPORT_PREPVT = '0.4.5'
CR50_USB = '18d1:5014'
ERASED_BID = 'ffffffff'
@@ -343,14 +344,20 @@ class RMAOpen(object):
raise ValueError('Could not communicate with %s' % self.device)
version = re.search('RW.*\* ([\d\.]+)/', output).group(1)
- print 'RMA support added in:', RMA_SUPPORT
print 'Running Cr50 Version:', version
fields = [int(field) for field in version.split('.')]
- rma_fields = [int(field) for field in RMA_SUPPORT.split('.')]
+
+ # prePVT images have even major versions. Prod have odd
+ self.is_prepvt = fields[1] % 2 == 0
+ rma_support = RMA_SUPPORT_PREPVT if self.is_prepvt else RMA_SUPPORT_PROD
+
+ print 'prePVT' if self.is_prepvt else 'prod',
+ print 'RMA support added in:', rma_support
+ rma_fields = [int(field) for field in rma_support.split('.')]
for i, field in enumerate(fields):
if field < int(rma_fields[i]):
raise ValueError('%s does not have RMA support. Update to at '
- 'least %s' % (version, RMA_SUPPORT))
+ 'least %s' % (version, rma_support))
def device_matches_devid(self, devid, device):