From 746b85abc372eb625f1aafc60652f4d4c2b4d154 Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Mon, 26 Feb 2024 14:53:05 -0500 Subject: [PATCH] 608C support --- shared/callgate.py | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/shared/callgate.py b/shared/callgate.py index bdd30758..8ec36e66 100644 --- a/shared/callgate.py +++ b/shared/callgate.py @@ -86,10 +86,17 @@ def set_highwater(ts): def has_608(): return ckcc.gate(6, None, 0) == 0 -def has_608b(): +def get_608_rev(): + # return A, B, C and so on config = bytearray(128) ckcc.gate(20, config, 0) - return (config[7] >= 0x3) + if config[7] < 0x3: + return 'A' + if config[7] == 0x3: + return 'B' + if config[7] == 0x4: + return 'C' + return '?' def fast_wipe(silent=True): # mk4: wipe seed, also reboots immediately: can stop and show a screen or not @@ -115,15 +122,18 @@ def read_rng(source=2): return arg[1:1+arg[0]] def get_se_parts(): - # mk4: report part names - # - gets a nul-terminated string, w/ newline between them - arg = bytearray(80) - rv = ckcc.gate(27, arg, 0) - if rv: - # happens w/ obsolete versions of bootrom that never left Toronto - return ['SE1', 'SE2'] - ln = bytes(arg).find(b'\0') - return arg[0:ln].decode().split('\n') - + # we know better than bootrom + return ['ATECC608'+get_608_rev(), 'DS28C36B'] + if 0: + # mk4: report part names + # - gets a nul-terminated string, w/ newline between them + arg = bytearray(80) + rv = ckcc.gate(27, arg, 0) + if rv: + # happens w/ obsolete versions of bootrom that never left Toronto + return ['SE1', 'SE2'] + ln = bytes(arg).find(b'\0') + return arg[0:ln].decode().split('\n') + # EOF