Andrew Jeffery | 7c92857 | 2023-08-14 13:00:06 +0930 | [diff] [blame] | 1 | From 680d5795bbd4e268c978d638a903fb3809e4b5c9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Andrew Jeffery <andrew@aj.id.au> |
| 3 | Date: Mon, 14 Aug 2023 12:33:04 +0930 |
| 4 | Subject: [PATCH] otptool: Define value_start in `rev_id` path |
| 5 | |
| 6 | See https://github.com/AspeedTech-BMC/socsec/pull/18 |
| 7 | |
| 8 | Upstream-Status: Accepted |
| 9 | Signed-off-by: Andrew Jeffery <andrew@aj.id.au> |
| 10 | --- |
| 11 | socsec/otptool.py | 1 + |
| 12 | 1 file changed, 1 insertion(+) |
| 13 | |
| 14 | diff --git a/socsec/otptool.py b/socsec/otptool.py |
| 15 | index efeab96dbd96..97da143723dd 100755 |
| 16 | --- a/socsec/otptool.py |
| 17 | +++ b/socsec/otptool.py |
| 18 | @@ -1039,6 +1039,7 @@ class OTP(object): |
| 19 | bit_offset = info['bit_offset'] |
| 20 | offset = dw_offset*32 + bit_offset |
| 21 | bit_length = info['bit_length'] |
| 22 | + value_start = info['value_start'] |
| 23 | offset_value = int(value, 16) - value_start |
| 24 | |
| 25 | if offset_value < 0 or offset_value > bit_length: |