Skip to content

Commit

Permalink
v0.8.7
Browse files Browse the repository at this point in the history
Board_id info
  • Loading branch information
andy-man committed Sep 5, 2023
1 parent b50780b commit efd84f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lang/_i18n_.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#==========================================================
import sys, os

APP_VERSION = '0.8.6'
APP_VERSION = '0.8.7'

# Colors stuff

Expand Down
12 changes: 11 additions & 1 deletion utils/sflash.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@

'ACT_SLOT': {'o':0x001000, 'l':1, 't':'b', 'n':'Active slot'}, # 0x00 - A 0x80 - B

'BOARD_ID': {'o':0x1C4000, 'l':8, 't':'b', 'n':'Board ID'}, # SAA-001, SAB-00, etc
'MAC': {'o':0x1C4021, 'l':6, 't':'b', 'n':'MAC Address'},
'MB_SN': {'o':0x1C8000, 'l':16, 't':'s', 'n':'Motherboard Serial'},
'SN': {'o':0x1C8030, 'l':17, 't':'s', 'n':'Console Serial'},
Expand Down Expand Up @@ -407,6 +408,15 @@ def getSFlashInfo(file = '-'):

samu = getNorData(f, 'SAMUBOOT')[0]
region = getConsoleRegion(f)
board = getNorData(f, 'BOARD_ID')

mb_codes = {
b'\x03\02': 'SA',
b'\x04\x01': 'HA',
b'\x05\x02': 'NV',
}

mobo = (mb_codes[board[0:2]] if board[0:2] in mb_codes else '??') + chr(ord('A')-1+board[2])

try:
hdd = (' / ').join(Utils.swapBytes(getNorData(f, 'HDD')).decode('utf-8').split())
Expand All @@ -416,7 +426,7 @@ def getSFlashInfo(file = '-'):
info = {
'FILE' : os.path.basename(file),
'MD5' : Utils.getFileMD5(file),
'SKU' : sku,
'SKU / Board ID': sku + ' [' + UI.highlight(Utils.hex(board, ':')) + '] ~' + mobo + '-00?',
'Region' : '[{}] {}'.format(region[0], region[1]),
'SN / Mobo SN' : getNorData(f, 'SN').decode('utf-8','ignore')+' / '+getNorData(f, 'MB_SN').decode('utf-8','ignore'),
'Southbridge' : southbridge if southbridge else STR_UNKNOWN,
Expand Down

0 comments on commit efd84f0

Please sign in to comment.