mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 23:08:14 +00:00
tools: add vtrust parsing to binctl
This commit is contained in:
parent
1b712a0446
commit
7bbcd99d53
13
tools/binctl
13
tools/binctl
@ -18,7 +18,18 @@ def format_sigmask(sigmask):
|
||||
|
||||
def format_vtrust(vtrust):
|
||||
bits = [str(b) if vtrust & (1 << b) == 0 else '.' for b in range(16)]
|
||||
return '%d = [%s]' % (vtrust, ' '.join(bits))
|
||||
# see docs/bootloader.md for vtrust constants
|
||||
desc = ''
|
||||
wait = (vtrust & 0x000F) ^ 0x000F
|
||||
if wait > 0:
|
||||
desc = 'WAIT_%d' % wait
|
||||
if vtrust & 0x0010 == 0:
|
||||
desc += ' RED'
|
||||
if vtrust & 0x0020 == 0:
|
||||
desc += ' CLICK'
|
||||
if vtrust & 0x0040 == 0:
|
||||
desc += ' STRING'
|
||||
return '%d = [%s] = [%s]' % (vtrust, ' '.join(bits), desc)
|
||||
|
||||
|
||||
# bootloader/firmware headers specification: https://github.com/trezor/trezor-core/blob/master/docs/bootloader.md
|
||||
|
Loading…
Reference in New Issue
Block a user