增加所有文件
This commit is contained in:
1041
tools/genpac.py
Normal file
1041
tools/genpac.py
Normal file
File diff suppressed because it is too large
Load Diff
BIN
tools/genpac/dloader.bin
Normal file
BIN
tools/genpac/dloader.bin
Normal file
Binary file not shown.
95
tools/genpac/pac_config.json
Normal file
95
tools/genpac/pac_config.json
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"description": "e3 pac information file",
|
||||
"board": "e3_gateway",
|
||||
"project": "ref",
|
||||
"sf_path": "tools\genpac\sf.bin",
|
||||
"sp0_path": "tools\genpac\sp0.bin",
|
||||
"sp1_path": "tools\genpac\sp1.bin",
|
||||
"sx0_path": "tools\genpac\sx0.bin",
|
||||
"sx1_path": "tools\genpac\sx1.bin",
|
||||
"downloader_path": "tools\genpac\dloader.bin",
|
||||
"pac": [
|
||||
{
|
||||
"downloader_type": "dloader",
|
||||
"flash_type": "hyperflash",
|
||||
"type": "ospi",
|
||||
"sec_ver": "0",
|
||||
"partition": "false",
|
||||
"partition_file": "ospi_hyper.bpt",
|
||||
"xip_mode": "false",
|
||||
"sf_only_mode": "false",
|
||||
"boot_package_num": "3",
|
||||
"key": "TestRSA2048_ossl.pem",
|
||||
"ctl": "none",
|
||||
"uuid": "none",
|
||||
"dloader_entry": "0x404000",
|
||||
"core": {
|
||||
"sf_mode": "lockstep",
|
||||
"sp_mode": "split",
|
||||
"sx_mode": "split",
|
||||
"sf_entry": "0x404000",
|
||||
"sp0_entry": "0x600000",
|
||||
"sp1_entry": "0x680000",
|
||||
"sx0_entry": "0x500000",
|
||||
"sx1_entry": "0x580000",
|
||||
"sf_pad_size": "0x1000",
|
||||
"sp0_pad_size": "0x1000",
|
||||
"sp1_pad_size": "0x1000",
|
||||
"sx0_pad_size": "0x1000",
|
||||
"sx1_pad_size": "0x1000",
|
||||
"bootloader_mode": "false",
|
||||
"bootloader_entry": "0x404000",
|
||||
"bootloader_pad_size": "0x40000"
|
||||
},
|
||||
"sfs": {
|
||||
"name": "s26h-hyperflash.json",
|
||||
"boot0_addr": "0xc0000",
|
||||
"boot1_addr": "0x4c0000",
|
||||
"boot2_addr": "0x8c0000"
|
||||
},
|
||||
"encryption": {
|
||||
"encryption_on": "false",
|
||||
"rfd": [
|
||||
{
|
||||
"pvk3": "112233445566778899aabbccddeeff00",
|
||||
"iv": "0d090d09",
|
||||
"start": "0xc0000",
|
||||
"end": "0x4c0000",
|
||||
"boot":"true"
|
||||
}
|
||||
]
|
||||
},
|
||||
"rfd": "xspi_wrap_rfd_blk_pvk1_ks.rfd"
|
||||
},
|
||||
{
|
||||
"flash_type": "hyperflash",
|
||||
"type": "emmc",
|
||||
"sec_ver": "0",
|
||||
"partition": "false",
|
||||
"partition_file": "emmc.bpt",
|
||||
"sf_only_mode": "false",
|
||||
"boot_package_num": "3",
|
||||
"key": "none",
|
||||
"ctl": "none",
|
||||
"uuid": "none",
|
||||
"core": {
|
||||
"sf_mode": "lockstep",
|
||||
"sp_mode": "split",
|
||||
"sx_mode": "split",
|
||||
"sf_entry": "0x404000",
|
||||
"sp0_entry": "0x600000",
|
||||
"sp1_entry": "0x680000",
|
||||
"sx0_entry": "0x500000",
|
||||
"sx1_entry": "0x580000",
|
||||
"sf_pad_size": "0x1000",
|
||||
"sp0_pad_size": "0x1000",
|
||||
"sp1_pad_size": "0x1000",
|
||||
"sx0_pad_size": "0x1000",
|
||||
"sx1_pad_size": "0x1000",
|
||||
"bootloader_mode": "false",
|
||||
"bootloader_entry": "0x404000",
|
||||
"bootloader_pad_size": "0x40000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
tools/genpac/sf.bin
Normal file
BIN
tools/genpac/sf.bin
Normal file
Binary file not shown.
BIN
tools/genpac/sp0.bin
Normal file
BIN
tools/genpac/sp0.bin
Normal file
Binary file not shown.
BIN
tools/genpac/sp1.bin
Normal file
BIN
tools/genpac/sp1.bin
Normal file
Binary file not shown.
BIN
tools/genpac/sx0.bin
Normal file
BIN
tools/genpac/sx0.bin
Normal file
Binary file not shown.
BIN
tools/genpac/sx1.bin
Normal file
BIN
tools/genpac/sx1.bin
Normal file
Binary file not shown.
743
tools/misc/project_verify.py
Normal file
743
tools/misc/project_verify.py
Normal file
@@ -0,0 +1,743 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import argparse
|
||||
import traceback
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
|
||||
class ParserBase(object):
|
||||
def __init__(self):
|
||||
self.result = True
|
||||
|
||||
def __del__(self):
|
||||
pass
|
||||
|
||||
def get_result(self):
|
||||
return self.result
|
||||
|
||||
|
||||
class ParserBaseEx(ParserBase):
|
||||
def __init__(self, ssdk_dir, project):
|
||||
super().__init__()
|
||||
self.prj_dir, _ = os.path.split(project)
|
||||
self.prj_dir = self.prj_dir.replace("\\", '/')
|
||||
self.board_map = {
|
||||
"e3_gateway": "E3640",
|
||||
"e3_324_dev_kit": "E3640",
|
||||
"e3_display": "E3340",
|
||||
"e3_324_ref_display": "E3340",
|
||||
"d3_gateway": "D3248",
|
||||
"d3_display": "D3248",
|
||||
"e3_176_ref": "E3110",
|
||||
"e3_144_ref": "E3205",
|
||||
}
|
||||
|
||||
self.skip_boards = ["e3_master_slave"]
|
||||
|
||||
self.boards_dir = ssdk_dir.replace('\\', '/')
|
||||
if not self.boards_dir.endswith('/'):
|
||||
self.boards_dir += '/'
|
||||
self.boards_dir += 'boards/'
|
||||
self.board_name = self.prj_dir.replace(self.boards_dir, '').split('/')[0]
|
||||
|
||||
def __del__(self):
|
||||
pass
|
||||
|
||||
def is_skip_board(self):
|
||||
if self.board_name.lower() in self.skip_boards:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
class CustomArgvarsParser(ParserBaseEx):
|
||||
def __init__(self, ssdk_dir, custom_argvars):
|
||||
super().__init__(ssdk_dir, custom_argvars)
|
||||
self.custom_argvars = custom_argvars.replace("\\", '/')
|
||||
self.project_name = self.prj_dir.replace(self.boards_dir, '').split('/')[-2]
|
||||
self._load_xml()
|
||||
# print("project_name", self.project_name)
|
||||
# print("board_name=", self.board_name)
|
||||
|
||||
def __del__(self):
|
||||
pass
|
||||
|
||||
def check_part_id(self):
|
||||
part_id = self.get_part_id()
|
||||
if len(part_id) == 0:
|
||||
print(" [Error] '%s' : PART_ID macro is undefined" % self.custom_argvars)
|
||||
self.result = False
|
||||
elif self.board_name in self.board_map.keys()and not (part_id == self.board_map[self.board_name]):
|
||||
print(" [Error] '%s' : PART ID [%s] is invalid, it must be configured as '%s'" %
|
||||
(self.custom_argvars, part_id, self.board_map[self.board_name]))
|
||||
self.result = False
|
||||
return True
|
||||
|
||||
def _load_xml(self):
|
||||
data = open(self.custom_argvars).read()
|
||||
index = data.find('<?xml')
|
||||
if not index == -1:
|
||||
data = data[index:]
|
||||
self.root = ET.fromstring(data)
|
||||
# self.tree = ET.parse(custom_argvars)
|
||||
# self.root = self.tree.getroot()
|
||||
|
||||
def get_part_id(self):
|
||||
for variable in self.root.find("group"):
|
||||
# print(variable.find('name').text)
|
||||
# print(variable.find('value').text)
|
||||
if variable.find('name').text == 'PART_ID':
|
||||
return variable.find('value').text
|
||||
return ""
|
||||
|
||||
def get_board_name(self):
|
||||
return self.board_name
|
||||
|
||||
def get_cord_name(self):
|
||||
return self.project_name
|
||||
|
||||
|
||||
class EwpParser(ParserBase):
|
||||
def __init__(self, ewp, board, core, part_id):
|
||||
super().__init__()
|
||||
self.ewp = ewp.replace("\\", '/')
|
||||
self.board = board
|
||||
self.core = core
|
||||
self.part_id = part_id
|
||||
self.prj_dir, _ = os.path.split(self.ewp)
|
||||
self.tree = ET.parse(ewp)
|
||||
self.root = self.tree.getroot()
|
||||
self.sfs_map = {
|
||||
"e3_gateway": "sfs_s26h-hyperflash.img",
|
||||
"e3_324_dev_kit": "sfs_s26h-hyperflash.img",
|
||||
"e3_display": "sfs_mt35-1-1-1.img",
|
||||
"e3_324_ref_display": "sfs_mt35-1-1-1.img",
|
||||
"d3_display": "sfs_mt35-1-1-1.img",
|
||||
"d3_gateway": "sfs_mt35-1-1-1.img",
|
||||
"e3_176_ref": "sfs_mt35-1-1-1.img",
|
||||
"e3_144_ref": "sfs_mt35-1-1-1.img",
|
||||
}
|
||||
self.out_map = {
|
||||
'bootloader': 'bootloader.bin',
|
||||
"sf": "sf.bin",
|
||||
"sp0": "sp0.bin",
|
||||
"sp1": "sp1.bin",
|
||||
"sx0": "sx0.bin",
|
||||
"sx1": "sx1.bin",
|
||||
}
|
||||
|
||||
self.nor_flash_boards = [
|
||||
"d3_display",
|
||||
"d3_gateway",
|
||||
"e3_display",
|
||||
"e3_144_ref"
|
||||
]
|
||||
|
||||
def __del__(self):
|
||||
pass
|
||||
|
||||
def _is_sf_core(self):
|
||||
if self.core not in ["sp0", "sp1", "sx0", "sx1"]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def _is_xip_hyper_flash(self):
|
||||
if not -1 == self.ewp.lower().find('xip/') and -1 == self.ewp.lower().find('iar_norflash'):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _is_hyper_flash_driver(self):
|
||||
if not -1 == self.ewp.lower().find('hyperbus/'):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _is_nor_flash_driver(self):
|
||||
if not -1 == self.ewp.lower().find('spi_nor/'):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _is_xip_nor_flash(self):
|
||||
if not -1 == self.ewp.lower().find('xip/') and not -1 == self.ewp.lower().find('iar_norflash'):
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_options(self):
|
||||
# project/configuration/name
|
||||
_conditions = {
|
||||
'IlinkAutoLibEnable': '1',
|
||||
'GenLowLevelInterface': '0'
|
||||
}
|
||||
# 'OOCObjCopyEnable': 1 # debug
|
||||
# 'OOCObjCopyEnable': 0 # flashdebug
|
||||
for config in self.root.findall("configuration"):
|
||||
_config = config.find('name').text
|
||||
print(config.find('name').text, 'version')
|
||||
for setting in config.findall("settings"):
|
||||
# print(" ", setting.find('name').text)
|
||||
if setting.find('name').text.upper() == 'ILINK':
|
||||
for option in setting.findall("data/option"):
|
||||
if option.find('name').text == 'IlinkAutoLibEnable':
|
||||
'''
|
||||
<option>
|
||||
<name>IlinkAutoLibEnable</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
'''
|
||||
# print(" ", option.find('name').text)
|
||||
# print(" ", option.find('state').text)
|
||||
if not option.find('state').text == '1':
|
||||
print(" [Error] '%s' : IlinkAutoLibEnable is %s, it must be configured as 1" % (self.ewp, option.find('state').text))
|
||||
self.result = False
|
||||
|
||||
elif option.find('name').text == 'IlinkExtraOptions':
|
||||
'''
|
||||
<option>
|
||||
<name>IlinkExtraOptions</name>
|
||||
<state>--image_input $PROJ_DIR$\..\..\..\..\..\tools\sdtools\sfs\sfs_s26h-hyperflash.img,SFS_BIN,SFS_BIN,8</state>
|
||||
<state>--keep SFS_BIN</state>
|
||||
</option>
|
||||
'''
|
||||
error_des = ""
|
||||
if _config.lower() == 'flashdebug':
|
||||
if self.board not in self.sfs_map:
|
||||
sfs_result = True # skip undefined sfs map
|
||||
continue
|
||||
error_des = " [Error] '%s' : IlinkExtraOptions (sfs) is invalid, it must be configured as %s" % (self.ewp, self.sfs_map[self.board])
|
||||
sfs_result = False
|
||||
for state in option.findall('state'):
|
||||
# print(" ", state.text)
|
||||
if self._is_sf_core():
|
||||
if self._is_hyper_flash_driver():
|
||||
error_des = " [Error] '%s' : IlinkExtraOptions (sfs) is invalid, it must be configured as sfs_s26h-hyperflash.img" % self.ewp
|
||||
if state.text and len(state.text) and not -1 == state.text.find('sfs_s26h-hyperflash.img'):
|
||||
sfs_result = True
|
||||
error_des = ""
|
||||
break
|
||||
elif self._is_nor_flash_driver():
|
||||
error_des = " [Error] '%s' : IlinkExtraOptions (sfs) is invalid, it must be configured as sfs_mt35-1-1-1.img" % self.ewp
|
||||
if state.text and len(state.text) and not -1 == state.text.find('sfs_mt35-1-1-1.img'):
|
||||
sfs_result = True
|
||||
error_des = ""
|
||||
break
|
||||
elif self.board in self.nor_flash_boards:
|
||||
error_des = " [Error] '%s' : IlinkExtraOptions (sfs) is invalid, it must be configured as sfs_mt35-1-1-1.img" % self.ewp
|
||||
if state.text and len(state.text) and not -1 == state.text.find('sfs_mt35-1-1-1.img'):
|
||||
sfs_result = True
|
||||
error_des = ""
|
||||
break
|
||||
elif self._is_xip_hyper_flash():
|
||||
error_des = " [Error] '%s' : IlinkExtraOptions (sfs) is invalid, it must be configured as sfs_s26h-hyperflash.img" % self.ewp
|
||||
if state.text and len(state.text) and not -1 == state.text.find('sfs_s26h-hyperflash.img'):
|
||||
sfs_result = True
|
||||
error_des = ""
|
||||
break
|
||||
elif self._is_xip_nor_flash():
|
||||
error_des = " [Error] '%s' : IlinkExtraOptions (sfs) is invalid, it must be configured as sfs_mt35-1-1-1.img" % self.ewp
|
||||
if state.text and len(state.text) and not -1 == state.text.find('sfs_mt35-1-1-1.img'):
|
||||
sfs_result = True
|
||||
error_des = ""
|
||||
break
|
||||
else:
|
||||
if state.text and len(state.text) and not -1 == state.text.find(self.sfs_map[self.board]):
|
||||
sfs_result = True
|
||||
error_des = ""
|
||||
break
|
||||
else:
|
||||
sfs_result = True
|
||||
if state.text and len(state.text) and not (-1 == state.text.find('SFS_BIN,')):
|
||||
sfs_result = False
|
||||
error_des = " [Error] '%s' : IlinkExtraOptions (sfs) is invalid, does not need to configure sfs for %s core" % (self.ewp, self.core)
|
||||
break
|
||||
|
||||
else: # debug verison
|
||||
sfs_result = True
|
||||
for state in option.findall('state'):
|
||||
if state.text and len(state.text) and not (-1 == state.text.find('SFS_BIN,')):
|
||||
sfs_result = False
|
||||
error_des = " [Error] '%s' : IlinkExtraOptions (sfs) is invalid, does not need to configure sfs for debug version" % self.ewp
|
||||
break
|
||||
|
||||
if not sfs_result:
|
||||
print(" ", option.find('name').text)
|
||||
for state in option.findall('state'):
|
||||
print(" ", state.text)
|
||||
print(error_des)
|
||||
self.result = False
|
||||
elif setting.find('name').text == 'General':
|
||||
for option in setting.findall("data/option"):
|
||||
if option.find('name').text == 'GenLowLevelInterface':
|
||||
'''
|
||||
<option>
|
||||
<name>GenLowLevelInterface</name>
|
||||
<state>0</state>
|
||||
</option>
|
||||
'''
|
||||
# print(" ", option.find('name').text)
|
||||
# print(" ", option.find('state').text)
|
||||
if not option.find('state').text == '0':
|
||||
print(" [Error] '%s' : GenLowLevelInterface is %s, it must be configured as 0" % (self.ewp, option.find('state').text))
|
||||
self.result = False
|
||||
elif setting.find('name').text == 'OBJCOPY':
|
||||
for option in setting.findall("data/option"):
|
||||
if option.find('name').text == 'OOCObjCopyEnable' and _config.lower() == 'debug':
|
||||
'''
|
||||
<option>
|
||||
<name>OOCObjCopyEnable</name>
|
||||
<state>1</state>
|
||||
</option>
|
||||
'''
|
||||
# print(" ", option.find('name').text)
|
||||
# print(" ", option.find('state').text)
|
||||
if not option.find('state').text == '1':
|
||||
print(" [Error] '%s' : OOCObjCopyEnable is %s, it must be configured as 1 for Debug version" % (self.ewp, option.find('state').text))
|
||||
self.result = False
|
||||
|
||||
elif option.find('name').text == 'OOCOutputFile':
|
||||
'''
|
||||
<option>
|
||||
<name>OOCOutputFile</name>
|
||||
<state>sf.bin</state>
|
||||
</option>
|
||||
'''
|
||||
# print(" ", option.find('name').text)
|
||||
# print(" ", option.find('state').text)
|
||||
if not _config.lower() == 'flashdebug' and \
|
||||
option.find('state').text:
|
||||
if self.core in self.out_map.keys() and not option.find('state').text == self.out_map[self.core]:
|
||||
print(" [Error] '%s' : OOCOutputFile is %s, it must be configured as %s" %
|
||||
(self.ewp, option.find('state').text, self.out_map[self.core]))
|
||||
self.result = False
|
||||
elif self.core not in self.out_map.keys() and not option.find('state').text == self.out_map['sf']:
|
||||
print(" [Error] '%s' : OOCOutputFile is %s, it must be configured as %s" %
|
||||
(self.ewp, option.find('state').text, self.out_map['sf']))
|
||||
self.result = False
|
||||
|
||||
def check_files(self):
|
||||
for group in self.root.findall("group"):
|
||||
# print(group.find('name').text)
|
||||
self._enum_group(group)
|
||||
|
||||
def _check_file(self, file):
|
||||
if -1 == file.find('$PROJ_DIR$'):
|
||||
print(" [Error] \'%s\' is not a relative path" % file)
|
||||
self.result = False
|
||||
return False
|
||||
_file = file.replace('$PROJ_DIR$', self.prj_dir)
|
||||
_file = _file.replace('$PART_ID$', self.part_id)
|
||||
_file = _file.replace("\\", '/')
|
||||
if not os.path.exists(_file):
|
||||
print(" [Error] \'%s\' : \'%s\' don't exist" % (self.ewp, file))
|
||||
self.result = False
|
||||
return False
|
||||
match = re.search('^.+/devices/([DE]\d+)/.+$', file.replace("\\", '/'), re.I)
|
||||
if match:
|
||||
print(" [Error] \'%s\' - \'%s\' : The part id can not use fixed value [%s], must be used macro definition" %
|
||||
(self.ewp, file, match.group(1)))
|
||||
self.result = False
|
||||
return False
|
||||
return True
|
||||
|
||||
def _enum_group(self, parent):
|
||||
# print(">>>", parent.find('name').text)
|
||||
for file in parent.findall("file"):
|
||||
# print(" ", file.find('name').text)
|
||||
_file = file.find('name').text
|
||||
self._check_file(_file)
|
||||
for sub_group in parent.findall("group"):
|
||||
self._enum_group(sub_group)
|
||||
|
||||
|
||||
class EclipsePrjParser(ParserBaseEx):
|
||||
def __init__(self, ssdk_dir, project):
|
||||
super().__init__(ssdk_dir, project)
|
||||
self.project = project.replace("\\", '/')
|
||||
self.prj_dir, _ = os.path.split(self.project)
|
||||
self.tree = ET.parse(self.project)
|
||||
self.root = self.tree.getroot()
|
||||
self.PART_PATH = ""
|
||||
self.part_id = ""
|
||||
self.macro_map = {}
|
||||
|
||||
def __del__(self):
|
||||
pass
|
||||
|
||||
def check_project_name(self):
|
||||
# print(self.prj_dir.split('/'))
|
||||
if not self.prj_dir.split('/')[-2] == self.root.find('name').text:
|
||||
print(" [Error] '%s' : Project name is incorrect, please modify '%s' to '%s'" %
|
||||
(self.project, self.root.find('name').text, self.prj_dir.split('/')[-2]))
|
||||
self.result = False
|
||||
return False
|
||||
return True
|
||||
|
||||
def check_part_id(self):
|
||||
if self.root.find('variableList/variable') is None:
|
||||
print(" [Error] '%s' : Undefined PART_ID macro" % self.project)
|
||||
self.result = False
|
||||
return False
|
||||
has_part_id_macro = False
|
||||
has_part_path_macro = False
|
||||
for variable in self.root.findall("variableList/variable"):
|
||||
# print(variable.find('name').text)
|
||||
self.macro_map[variable.find('name').text] = variable.find('value').text
|
||||
if variable.find('name').text == 'PART_ID':
|
||||
has_part_id_macro = True
|
||||
self.part_id = variable.find('value').text
|
||||
elif variable.find('name').text == 'PART_PATH':
|
||||
self.PART_PATH = variable.find('value').text
|
||||
if not (-1 == variable.find('value').text.find('$%7BPART_ID%7D')):
|
||||
has_part_path_macro = True
|
||||
# print(self.macro_map)
|
||||
if not has_part_id_macro:
|
||||
print(" [Error] '%s' : PART_ID macro is undefined" % self.project)
|
||||
self.result = False
|
||||
return False
|
||||
|
||||
if not has_part_path_macro:
|
||||
print(" [Error] '%s' : PART_PATH macro is undefined" % self.project)
|
||||
self.result = False
|
||||
return False
|
||||
if len(self.part_id) == 0:
|
||||
print(" [Error] '%s' : PART_ID macro is undefined" % self.project)
|
||||
self.result = False
|
||||
return False
|
||||
elif self.board_name in self.board_map.keys() and not (self.part_id == self.board_map[self.board_name]):
|
||||
print(" [Error] '%s' : PART ID [%s] is invalid, it must be configured as '%s'" %
|
||||
(self.project, self.part_id, self.board_map[self.board_name]))
|
||||
self.result = False
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_part_id(self):
|
||||
return self.part_id
|
||||
|
||||
def get_depth(self):
|
||||
return self.PART_PATH
|
||||
|
||||
def check_files(self):
|
||||
for link_src in self.root.findall("linkedResources/link"):
|
||||
if link_src.find('type').text == '1':
|
||||
# print(link_src.find('name').text)
|
||||
# print(link_src.find('type').text)
|
||||
if link_src.find('locationURI') is None:
|
||||
# print('location', link_src.find('location').text)
|
||||
self._check_file(link_src.find('location').text)
|
||||
elif link_src.find('location') is None:
|
||||
# print('locationURI', link_src.find('locationURI').text)
|
||||
self._check_file(link_src.find('locationURI').text)
|
||||
|
||||
def _check_file(self, file):
|
||||
match = re.search('^.+/devices/([DE]\d+)/.+$', file.replace("\\", '/'), re.I)
|
||||
if match:
|
||||
print(" [Error] \'%s\' - \'%s\' : The part id can not use fixed value [%s], must be used macro definition" %
|
||||
(self.project, file, match.group(1)))
|
||||
self.result = False
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
class EclipseCprjParser(ParserBaseEx):
|
||||
def __init__(self, ssdk_dir, project):
|
||||
super().__init__(ssdk_dir, project)
|
||||
self.project = project.replace("\\", '/')
|
||||
self.prj_dir, _ = os.path.split(self.project)
|
||||
self.tree = ET.parse(self.project)
|
||||
self.root = self.tree.getroot()
|
||||
self.part_id = ""
|
||||
self.out_map = {
|
||||
'bootloader': 'bootloader',
|
||||
"sf": "sf",
|
||||
"sp0": "sp0",
|
||||
"sp1": "sp1",
|
||||
"sx0": "sx0",
|
||||
"sx1": "sx1",
|
||||
}
|
||||
|
||||
def __del__(self):
|
||||
pass
|
||||
|
||||
def check_macro(self):
|
||||
find = False
|
||||
for macro in self.root.findall("storageModule/cconfiguration/storageModule/macros"):
|
||||
# print(macro.find('stringMacro').attrib['name'])
|
||||
# print(macro.find('stringMacro').attrib['value'])
|
||||
self.part_id = macro.find('stringMacro').attrib['value']
|
||||
find = True
|
||||
if not find:
|
||||
self.result = False
|
||||
print(" [Error] '%s' : PART_ID macro is undefined" % self.project)
|
||||
return False
|
||||
if len(self.part_id) == 0:
|
||||
print(" [Error] '%s' : PART_ID macro is undefined" % self.project)
|
||||
self.result = False
|
||||
return False
|
||||
elif self.board_name in self.board_map.keys() and not (self.part_id == self.board_map[self.board_name]):
|
||||
print(" [Error] '%s' : PART ID [%s] is invalid, it must be configured as '%s'" %
|
||||
(self.project, self.part_id, self.board_map[self.board_name]))
|
||||
self.result = False
|
||||
return False
|
||||
return True
|
||||
|
||||
def check_includes(self):
|
||||
Assembler_tag = "GNU Arm Cross Assembler".lower()
|
||||
CC_tag = "GNU Arm Cross C Compiler".lower()
|
||||
CPP_tag = "GNU Arm Cross C++ Compiler".lower()
|
||||
Include_tag = "Include paths (-I)".lower()
|
||||
|
||||
Linker_tag = "GNU Arm Cross C Linker".lower()
|
||||
LD_tag = "Script files (-T)".lower()
|
||||
|
||||
Image_tag = "GNU Arm Cross Create Flash Image".lower()
|
||||
Type_tag = "Output file format (-O)".lower()
|
||||
superClass = "ilg.gnuarmeclipse.managedbuild.cross.tool.createflash".lower()
|
||||
Bin_tag = 'ilg.gnuarmeclipse.managedbuild.cross.option.createflash.choice.binary'.lower()
|
||||
|
||||
for tool in self.root.findall("storageModule/cconfiguration/storageModule/configuration/folderInfo/toolChain/"):
|
||||
if "name" not in tool.attrib.keys():
|
||||
continue
|
||||
if tool.attrib['name'].lower() in [Assembler_tag, CC_tag, CPP_tag, Linker_tag, Image_tag]:
|
||||
_tool_name = tool.attrib['name'].lower()
|
||||
if _tool_name == Image_tag:
|
||||
if 'superClass' in tool.attrib.keys() and tool.attrib['superClass'].lower() == superClass:
|
||||
_result = False
|
||||
_error = " [Error] '%s' : artifactName is empty, it must be configured as %s" % \
|
||||
(self.project, Bin_tag)
|
||||
for option_item in list(tool): # tool.getchildren():
|
||||
if "value" not in option_item.attrib.keys():
|
||||
continue
|
||||
if option_item.attrib['value'].lower() == Bin_tag:
|
||||
_result = True
|
||||
_error = ""
|
||||
break
|
||||
else:
|
||||
# print("_attr_name", option_item.attrib['value'])
|
||||
_error = " [Error] '%s' : artifactName is %s, it must be configured as %s" % \
|
||||
(self.project, option_item.attrib['value'], Bin_tag)
|
||||
_result = False
|
||||
if not _result and len(_error):
|
||||
print(_error)
|
||||
self.result = False
|
||||
continue
|
||||
for option_item in list(tool): # tool.getchildren():
|
||||
if "name" not in option_item.attrib.keys():
|
||||
continue
|
||||
_attr_name = option_item.attrib['name']
|
||||
if _attr_name.lower() in [Include_tag, LD_tag]:
|
||||
# print("_attr_name", _attr_name)
|
||||
for listOptionValue in list(option_item): # option_item.getchildren():
|
||||
# print(listOptionValue.attrib['value'])
|
||||
self._check_file(listOptionValue.attrib['value'])
|
||||
|
||||
def check_output(self):
|
||||
prj_name = self.prj_dir.split('/')[-2]
|
||||
for config in self.root.findall("storageModule/cconfiguration/storageModule/configuration"):
|
||||
if "artifactName" in config.attrib.keys():
|
||||
if prj_name in self.out_map.keys() and not config.attrib['artifactName'] == self.out_map[prj_name] and \
|
||||
not config.attrib['artifactName'] == '${ProjName}':
|
||||
print(" [Error] '%s' : artifactName is %s, it must be configured as %s" %
|
||||
(self.project, config.attrib['artifactName'], self.out_map[prj_name]))
|
||||
self.result = False
|
||||
elif prj_name not in self.out_map.keys() and not config.attrib['artifactName'] == self.out_map['sf'] and \
|
||||
not config.attrib['artifactName'] == '${ProjName}':
|
||||
print(" [Error] '%s' : artifactName is %s, it must be configured as %s" %
|
||||
(self.project, config.attrib['artifactName'], self.out_map['sf']))
|
||||
self.result = False
|
||||
elif config.attrib['artifactName'] == '${ProjName}' and prj_name not in self.out_map.keys():
|
||||
print(" [Error] '%s' : artifactName is %s, it must be configured as %s" %
|
||||
(self.project, config.attrib['artifactName'], self.out_map['sf']))
|
||||
self.result = False
|
||||
|
||||
def _check_file(self, file):
|
||||
match = re.search('^.+/devices/([DE]\d+)/.+$', file.replace("\\", '/'), re.I)
|
||||
if match:
|
||||
print(" [Error] \'%s\' - \'%s\' : The part id can not use fixed value [%s], must be used macro definition" %
|
||||
(self.project, file, match.group(1)))
|
||||
self.result = False
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
class VerifyBase(object):
|
||||
def __init__(self, ssdk_dir, board_dir=''):
|
||||
self.ssdk_dir = ssdk_dir.replace("\\", '/')
|
||||
self.board_dir = board_dir.replace("\\", '/')
|
||||
self.ssdk_dir = self._rm_slash(self.ssdk_dir)
|
||||
self.board_dir = self._rm_slash(self.board_dir)
|
||||
if 0 == len(self.board_dir):
|
||||
self.board_dir = self.ssdk_dir + '/boards'
|
||||
self.result = True
|
||||
|
||||
def __del__(self):
|
||||
pass
|
||||
|
||||
def _rm_slash(self, src): # remove /slash
|
||||
if src.endswith('/'):
|
||||
return src[:-1]
|
||||
return src
|
||||
|
||||
def get_projects(self, project_type):
|
||||
# project_type in ['IAR', 'IAR_Norflash', 'Eclipse', 'Eclipse_Norflash']
|
||||
project_dir = []
|
||||
for path, subdirs, files in os.walk(self.board_dir):
|
||||
for sub_dir in subdirs:
|
||||
if sub_dir in project_type:
|
||||
_project = os.path.join(path, sub_dir)
|
||||
_project = _project.replace("\\", '/')
|
||||
project_dir.append(_project)
|
||||
return project_dir
|
||||
|
||||
def get_result(self):
|
||||
return self.result
|
||||
|
||||
|
||||
class IarVerify(VerifyBase):
|
||||
_iar_ext = [
|
||||
'custom_argvars',
|
||||
'ewd',
|
||||
'ewp',
|
||||
'eww'
|
||||
]
|
||||
|
||||
def verify(self):
|
||||
print("Start scanning and checking iar project ...")
|
||||
_projects = self.get_projects(['IAR', 'IAR_Norflash'])
|
||||
for proj in _projects:
|
||||
_project_name = proj.split('/')[-2]
|
||||
# print(proj, _project_name)
|
||||
_tmp_prj_files = []
|
||||
board = ""
|
||||
core = ""
|
||||
part_id = ""
|
||||
|
||||
# check *.custom_argvars
|
||||
skip_check = False
|
||||
for file in os.listdir(proj):
|
||||
if file.endswith('custom_argvars'):
|
||||
obj = CustomArgvarsParser(self.ssdk_dir, os.path.join(proj, file).replace("\\", '/'))
|
||||
if obj.is_skip_board():
|
||||
skip_check = True
|
||||
continue
|
||||
print("Check the custom_argvars file :", os.path.join(proj, file).replace("/", '\\'))
|
||||
obj.check_part_id()
|
||||
board = obj.get_board_name()
|
||||
core = obj.get_cord_name()
|
||||
part_id = obj.get_part_id()
|
||||
if self.result:
|
||||
self.result = obj.get_result()
|
||||
|
||||
# check *.ewp
|
||||
# print("board = ", board)
|
||||
# print("core = ", core)
|
||||
# print("part_id = ", part_id)
|
||||
if skip_check:
|
||||
continue
|
||||
for file in os.listdir(proj):
|
||||
_tmp_prj_files.append(file.split('.')[-1])
|
||||
if file.endswith('ewp'):
|
||||
print("Check the ewp file :", os.path.join(proj, file).replace("/", '\\'))
|
||||
obj = EwpParser(os.path.join(proj, file).replace("\\", '/'), board, core, part_id)
|
||||
obj.check_options()
|
||||
obj.check_files()
|
||||
if self.result:
|
||||
self.result = obj.get_result()
|
||||
|
||||
for item in self._iar_ext:
|
||||
if item not in _tmp_prj_files:
|
||||
print(" [Error] '%s' : Not find '%s' file" % (proj, item))
|
||||
self.result = False
|
||||
print('\n')
|
||||
print("Finished scanning and checking iar project")
|
||||
return self.result
|
||||
|
||||
|
||||
class EclipseVerify(VerifyBase):
|
||||
def verify(self):
|
||||
print("Start scanning and checking eclipse project ...")
|
||||
_projects = self.get_projects(['Eclipse', 'Eclipse_Norflash'])
|
||||
for proj in _projects:
|
||||
_project_name = proj.split('/')[-2]
|
||||
# print(proj, _project_name)
|
||||
|
||||
obj = EclipsePrjParser(self.ssdk_dir, os.path.join(proj, '.project'))
|
||||
if obj.is_skip_board():
|
||||
continue
|
||||
print("Check the .project file :", os.path.join(proj, '.project').replace("/", '\\'))
|
||||
obj.check_project_name()
|
||||
obj.check_part_id()
|
||||
obj.check_files()
|
||||
if self.result:
|
||||
self.result = obj.get_result()
|
||||
|
||||
print("Check the .cproject file :", os.path.join(proj, '.cproject').replace("/", '\\'))
|
||||
c_obj = EclipseCprjParser(self.ssdk_dir, os.path.join(proj, '.cproject'))
|
||||
c_obj.check_macro()
|
||||
c_obj.check_includes()
|
||||
c_obj.check_output()
|
||||
if self.result:
|
||||
self.result = c_obj.get_result()
|
||||
print("Finished scanning and checking eclipse project")
|
||||
return self.result
|
||||
|
||||
|
||||
class VerifyIdeProject(object):
|
||||
"""Object for command-line tool."""
|
||||
|
||||
def __init__(self):
|
||||
"""Initializer method."""
|
||||
pass
|
||||
|
||||
def version(self, _):
|
||||
"""Implements the 'version' sub-command."""
|
||||
print('1.23.1.1')
|
||||
|
||||
def verify(self, args):
|
||||
result = False
|
||||
try:
|
||||
iar = IarVerify(args.ssdk_dir, args.project_dir)
|
||||
eclipse = EclipseVerify(args.ssdk_dir, args.project_dir)
|
||||
result = iar.verify()
|
||||
eclipse_result = eclipse.verify()
|
||||
if result:
|
||||
result = eclipse_result
|
||||
except Exception:
|
||||
result = False
|
||||
print("[Error] %s" % traceback.format_exc())
|
||||
finally:
|
||||
if result:
|
||||
print('Successfully verified project files.')
|
||||
else:
|
||||
print('[Error] Invalid project configuration found.')
|
||||
sys.exit(1)
|
||||
return result
|
||||
|
||||
def run(self, argv):
|
||||
parser = argparse.ArgumentParser()
|
||||
subparsers = parser.add_subparsers(title='subcommands')
|
||||
sub_parser = subparsers.add_parser('version', help='Prints version of VerifyIdeProject.')
|
||||
sub_parser.set_defaults(func=self.version)
|
||||
|
||||
sub_parser = subparsers.add_parser('verify', help="Verify IDE project for ssdk's boards.")
|
||||
sub_parser.add_argument('--ssdk_dir',
|
||||
help='Path to ssdk project root directory.',
|
||||
type=str,
|
||||
required=True)
|
||||
sub_parser.add_argument('--project_dir',
|
||||
help='Path to ide project directory.',
|
||||
type=str,
|
||||
default="")
|
||||
sub_parser.set_defaults(func=self.verify)
|
||||
|
||||
args = parser.parse_args(argv[1:])
|
||||
try:
|
||||
func = args.func
|
||||
except AttributeError:
|
||||
parser.error("invalid arguments")
|
||||
return func(args)
|
||||
|
||||
|
||||
# python project_verify.py verify --ssdk_dir D:\SDRapidStudio\ide\workspace\2.1
|
||||
# python project_verify.py verify --ssdk_dir D:\SDRapidStudio\ide\workspace\2.1 --project_dir D:\SDRapidStudio\ide\workspace\2.1\boards\e3_gateway
|
||||
if __name__ == '__main__':
|
||||
tool = VerifyIdeProject()
|
||||
tool.run(sys.argv)
|
||||
BIN
tools/sdtools/bin/data.bin
Normal file
BIN
tools/sdtools/bin/data.bin
Normal file
Binary file not shown.
BIN
tools/sdtools/bin/downloader_e3_176_ref.bin
Normal file
BIN
tools/sdtools/bin/downloader_e3_176_ref.bin
Normal file
Binary file not shown.
BIN
tools/sdtools/bin/fat.img
Normal file
BIN
tools/sdtools/bin/fat.img
Normal file
Binary file not shown.
BIN
tools/sdtools/bin/fat_disp.img
Normal file
BIN
tools/sdtools/bin/fat_disp.img
Normal file
Binary file not shown.
BIN
tools/sdtools/bin/lut.img
Normal file
BIN
tools/sdtools/bin/lut.img
Normal file
Binary file not shown.
BIN
tools/sdtools/bin/sf.bin
Normal file
BIN
tools/sdtools/bin/sf.bin
Normal file
Binary file not shown.
26
tools/sdtools/bin2c_tool/README.md
Normal file
26
tools/sdtools/bin2c_tool/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# 使用步骤
|
||||
* version:20221013
|
||||
1. 把文件夹添加到环境变量(可选)
|
||||
|
||||
2. 在当前目录打开命令行,在命令行中输入"bin2c.exe input_img_dir output_c_dir"
|
||||
|
||||
3. input_img_dir: 图片所在文件夹,如:D:\images,请确保images文件夹下都是需要转换的图片文件
|
||||
|
||||
4. output_c_dir: 目标c文件存放的文件夹,如:D:\c_files
|
||||
|
||||
5. 回车即可生成
|
||||
|
||||
备注:
|
||||
1. 如果图片名称带有空格或"-",在转成结构体时由于结构体名称不能有空格和"-",所以会自动转成"_"
|
||||
|
||||
2. 如果图片名称有中文或其它特殊字符,程序会停止
|
||||
|
||||
3. sd_res_template.c存放了模板文件,bin2c.exe会读取模板文件并替换模板文件中有{XXX}的部分,如果需要添加新的内容,你可以随时更改模板。
|
||||
模板文件中替换内容解释:
|
||||
* {NAME_LOWER}: 图片文件名(不带后缀)
|
||||
* {NAME_UPPER}: 图片文件名转大写(不带后缀)
|
||||
* {BIN_RAW}: 二进制图片数据
|
||||
* {DATA_RAW}: 本来想写成解码后的图片数据,但是这个功能暂时不需要,所以现在和{BIN_RAW}一样
|
||||
* {DATA_SIZE}: 图片(c结构体内数据)的大小
|
||||
|
||||
|
||||
BIN
tools/sdtools/bin2c_tool/README.pdf
Normal file
BIN
tools/sdtools/bin2c_tool/README.pdf
Normal file
Binary file not shown.
BIN
tools/sdtools/bin2c_tool/bin2c.exe
Normal file
BIN
tools/sdtools/bin2c_tool/bin2c.exe
Normal file
Binary file not shown.
121
tools/sdtools/bin2c_tool/bin2c.py
Normal file
121
tools/sdtools/bin2c_tool/bin2c.py
Normal file
@@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env python
|
||||
#-*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
import platform
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
|
||||
def _read_bin(filename):
|
||||
""" Read binary data from file and return as a C array
|
||||
:param filename: a filename of a file to read.
|
||||
"""
|
||||
if not os.path.isfile(filename):
|
||||
print('File "%s" is not found!' % filename)
|
||||
return -1
|
||||
with open(filename, 'rb') as input_file:
|
||||
data = input_file.read()
|
||||
out = ""
|
||||
line = ""
|
||||
count = 0
|
||||
for byte in data:
|
||||
count += 1
|
||||
# print(byte)
|
||||
line += '0x%02x, ' % (byte if PY3 else ord(byte))
|
||||
# print(line)
|
||||
out += line
|
||||
line = ""
|
||||
if count == 30: # change line every 30 data
|
||||
out += "\n"
|
||||
count = 0
|
||||
return (out, len(data))
|
||||
|
||||
|
||||
def _bin2c():
|
||||
name = imgname
|
||||
nameUpper = name.upper()
|
||||
(binRaw, data_size) = _read_bin(img_path)
|
||||
(dataRaw, data11_size) = _read_bin(img_path)
|
||||
print("read from %s" % img_path)
|
||||
# print(binRaw)
|
||||
|
||||
template_path = os.path.join(os.path.dirname(bin2c_path), "sd_res_template.c")
|
||||
with open(template_path, "r") as template_file:
|
||||
output_lines = []
|
||||
lines = template_file.readlines()
|
||||
for line in lines:
|
||||
# print(line)
|
||||
line = line.replace(r"{NAME_LOWER}", name)
|
||||
line = line.replace(r"{NAME_UPPER}", nameUpper)
|
||||
line = line.replace(r"{DATA_SIZE}", str(data_size))
|
||||
line = line.replace(r"{BIN_RAW}", binRaw)
|
||||
line = line.replace(r"{DATA_RAW}", dataRaw)
|
||||
output_lines += line
|
||||
with open(cfile, "w") as output_file:
|
||||
output_file.writelines(output_lines)
|
||||
print("generated: %s" % cfile)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("version: 20221013")
|
||||
# if platform.system()=="Windows":
|
||||
# bin2c_path = os.popen("where bin2c.exe").read().strip()
|
||||
# elif platform.system()=="Linux":
|
||||
# bin2c_path = os.popen("which bin2c.exe").read().strip()
|
||||
# else:
|
||||
# bin2c_path = sys.argv[0]
|
||||
# if not os.path.isfile(bin2c_path):
|
||||
# bin2c_path = sys.argv[0]
|
||||
bin2c_path = sys.executable
|
||||
# print(os.path.abspath(sys.argv[0]))
|
||||
print(bin2c_path)
|
||||
# print(sys.argv[0]) bin2c
|
||||
# print(__file__) C:\Users\new\AppData\Local\Temp\_MEI181202\bin2c.py
|
||||
# preprocess预处理
|
||||
args = sys.argv[1:]
|
||||
if len(args) != 2:
|
||||
raise ValueError("usage: %s input_img_dir output_c_dir" % sys.argv[0])
|
||||
img_dir, c_dir= args
|
||||
if(not os.path.isdir(img_dir)):
|
||||
raise IOError("文件夹不存在,请重新输入图片所在文件夹: ")
|
||||
if(not os.path.isdir(c_dir)):
|
||||
raise IOError("文件夹不存在,请重新输入图片所在文件夹: ")
|
||||
# img_dir = input("请输入图片所在文件夹: ")
|
||||
# while(not os.path.isdir(img_dir)):
|
||||
# img_dir = input("文件夹不存在,请重新输入图片所在文件夹: ")
|
||||
# c_dir = input("请输入目标c文件存放的文件夹: ")
|
||||
# while(not os.path.isdir(c_dir)):
|
||||
# c_dir = input("文件夹不存在,请重新输入目标c文件存放的文件夹: ")
|
||||
img_paths = os.listdir(img_dir)
|
||||
for img_path in img_paths:
|
||||
if '.c' in img_path or os.path.isdir(img_path):
|
||||
print("skip: %s" % img_path)
|
||||
continue
|
||||
imgname = img_path.split('.')[0]
|
||||
img_path = os.path.join(img_dir, img_path)
|
||||
cfile = os.path.join(c_dir, imgname+".c")
|
||||
# 结构体名称判断
|
||||
if '-' in imgname:
|
||||
print("%s 存在\"-\"字符,c结构体名称将\"-\"改为\"_\"" % img_path)
|
||||
imgname = imgname.replace("-", "_")
|
||||
if ' ' in imgname:
|
||||
print("%s 存在空格,c结构体名称将空格改为\"_\"" % img_path)
|
||||
imgname = imgname.replace(" ", "_")
|
||||
if re.search(r"\W", imgname):
|
||||
print("%s 存在除字母数字下划线以外的特殊字符,程序中断" % img_path)
|
||||
os.system("pause")
|
||||
sys.exit(1)
|
||||
for char in imgname:
|
||||
if u'\u4e00' <= char <= u'\u9fff':
|
||||
print("%s 存在中文,程序中断" % img_path)
|
||||
os.system("pause")
|
||||
sys.exit(1)
|
||||
|
||||
_bin2c()
|
||||
|
||||
print("Finished!")
|
||||
# os.system("pause")
|
||||
|
||||
28
tools/sdtools/bin2c_tool/sd_res_template.c
Normal file
28
tools/sdtools/bin2c_tool/sd_res_template.c
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "sdrv_res.h"
|
||||
|
||||
#ifndef SDRV_RES_ATTRIBUTE_MEM_ALIGN
|
||||
#define SDRV_RES_ATTRIBUTE_MEM_ALIGN
|
||||
#endif
|
||||
|
||||
#define SDRV_RES_{NAME_UPPER}_RF SDRV_RES_FORMAT_BIN_RAW //SDRV_RES_FORMAT_DATA_RAW
|
||||
|
||||
const SDRV_RES_ATTRIBUTE_MEM_ALIGN uint8_t sdrv_res_{NAME_LOWER}_map[] = {
|
||||
#if SDRV_RES_{NAME_UPPER}_RF == SDRV_RES_FORMAT_BIN_RAW
|
||||
{BIN_RAW}
|
||||
#endif
|
||||
#if SDRV_RES_{NAME_UPPER}_RF == SDRV_RES_FORMAT_DATA_RAW
|
||||
{DATA_RAW}
|
||||
#endif
|
||||
};
|
||||
|
||||
const sdrv_res_dsc_t sdrv_res_{NAME_LOWER} = {
|
||||
.header.always_zero = SDRV_RES_{NAME_UPPER}_RF,
|
||||
.header.rf = 0,
|
||||
#if SDRV_RES_{NAME_UPPER}_RF == SDRV_RES_FORMAT_BIN_RAW
|
||||
.data_size = {DATA_SIZE},
|
||||
#endif
|
||||
#if SDRV_RES_{NAME_UPPER}_RF == SDRV_RES_FORMAT_DATA_RAW
|
||||
.data_size = {DATA_SIZE},
|
||||
#endif
|
||||
.data = sdrv_res_{NAME_LOWER}_map,
|
||||
};
|
||||
78
tools/sdtools/bin2c_tool/sdrv_res.h
Normal file
78
tools/sdtools/bin2c_tool/sdrv_res.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* @file sdrv_res.h
|
||||
*
|
||||
* Copyright (c) 2020 Semidrive Semiconductor.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Description: sdrv res header.
|
||||
*
|
||||
* Revision History:
|
||||
* -----------------
|
||||
*/
|
||||
|
||||
#ifndef SDRV_RES_H
|
||||
#define SDRV_RES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/*sdrv res format*/
|
||||
enum {
|
||||
SDRV_RES_FORMAT_UNKNOWN = 0,
|
||||
|
||||
SDRV_RES_FORMAT_BIN_RAW, /**< Contains the file as it is. Needs custom decoder function*/
|
||||
SDRV_RES_FORMAT_DATA_RAW, /**< Contains the data as it is. NO Needs custom decoder function*/
|
||||
|
||||
};
|
||||
typedef uint8_t sdrv_res_format_t;
|
||||
|
||||
/**
|
||||
* sdrv res header
|
||||
*/
|
||||
/* The first 8 bit is very important to distinguish the different source types.
|
||||
* For more info see `lv_img_get_src_type()` in lv_img.c
|
||||
* On big endian systems the order is reversed so cf and always_zero must be at
|
||||
* the end of the struct.
|
||||
* */
|
||||
typedef struct {
|
||||
|
||||
uint32_t rf : 5; /* res format: See `sdrv_res_format_t`*/
|
||||
uint32_t always_zero : 3; /*It the upper bits of the first byte. Always zero to look like a
|
||||
non-printable character*/
|
||||
|
||||
uint32_t reserved : 24; /*Reserved to be used later*/
|
||||
} sdrv_res_header_t;
|
||||
|
||||
/** sdrv res header it is compatible with
|
||||
* the result from sdrv res converter utility*/
|
||||
typedef struct {
|
||||
sdrv_res_header_t header;
|
||||
uint32_t data_size;
|
||||
const uint8_t * data;
|
||||
} sdrv_res_dsc_t;
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /*SDRV_RES_H*/
|
||||
31
tools/sdtools/bpt/emmc.bpt
Normal file
31
tools/sdtools/bpt/emmc.bpt
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "65528 KiB",
|
||||
"partitions_offset_begin": "20 KiB",
|
||||
"disk_alignment": 4096
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot2",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "24 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "512 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
59
tools/sdtools/bpt/emmc_sf_only.bpt
Normal file
59
tools/sdtools/bpt/emmc_sf_only.bpt
Normal file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "65528 KiB",
|
||||
"partitions_offset_begin": "20 KiB",
|
||||
"disk_alignment": 4096
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot2",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sp0",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sp1",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sx0",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sx1",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "24 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "512 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
45
tools/sdtools/bpt/ospi.bpt
Normal file
45
tools/sdtools/bpt/ospi.bpt
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "32760 KiB",
|
||||
"disk_alignment":4096,
|
||||
"partitions_offset_begin": "0"
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot0",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39d"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot1",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39a"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot2",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39b"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "12 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "512 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
38
tools/sdtools/bpt/ospi_disp.bpt
Normal file
38
tools/sdtools/bpt/ospi_disp.bpt
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "8184 KiB",
|
||||
"disk_alignment": 4096,
|
||||
"partitions_offset_begin": "0"
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot0",
|
||||
"size": "3072 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39d"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot1",
|
||||
"size": "3072 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39a"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "1 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "128 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
45
tools/sdtools/bpt/ospi_disp_lut.bpt
Normal file
45
tools/sdtools/bpt/ospi_disp_lut.bpt
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "8184 KiB",
|
||||
"disk_alignment": 4096,
|
||||
"partitions_offset_begin": "0"
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot0",
|
||||
"size": "3072 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39d"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot1",
|
||||
"size": "3072 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39a"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "1 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "lut",
|
||||
"size": "64 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "128 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
45
tools/sdtools/bpt/ospi_hyper.bpt
Normal file
45
tools/sdtools/bpt/ospi_hyper.bpt
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "32760 KiB",
|
||||
"disk_alignment":262144,
|
||||
"partitions_offset_begin": "0"
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot0",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39d"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot1",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39a"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot2",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39b"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "12 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "512 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
38
tools/sdtools/bpt/ospi_inner_16m.bpt
Normal file
38
tools/sdtools/bpt/ospi_inner_16m.bpt
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "16376 KiB",
|
||||
"disk_alignment": 4096,
|
||||
"partitions_offset_begin": "0"
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot0",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39d"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot1",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39a"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "128 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
73
tools/sdtools/bpt/ospi_sf_only.bpt
Normal file
73
tools/sdtools/bpt/ospi_sf_only.bpt
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "32760 KiB",
|
||||
"disk_alignment":4096,
|
||||
"partitions_offset_begin": "0"
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot0",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39d"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot1",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39a"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot2",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39b"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sp0",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sp1",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sx0",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sx1",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "12 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "512 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
73
tools/sdtools/bpt/ospi_sf_only_hyper.bpt
Normal file
73
tools/sdtools/bpt/ospi_sf_only_hyper.bpt
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"settings": {
|
||||
"disk_size": "32760 KiB",
|
||||
"disk_alignment":262144,
|
||||
"partitions_offset_begin": "0"
|
||||
},
|
||||
"partitions": [
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot0",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39d"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot1",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39a"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "boot2",
|
||||
"size": "4 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "cc0cb090-a2e4-459f-9f5f-b61daf95e39b"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sp0",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sp1",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sx0",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": true,
|
||||
"label": "sx1",
|
||||
"size": "512 KiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "dbedab9e-8519-44d1-bf68-694ffb27d780"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "res",
|
||||
"size": "12 MiB",
|
||||
"guid": "auto",
|
||||
"type_guid": "EBD0A0A2-B9E5-4433-87C0-68B6B72699C7"
|
||||
},
|
||||
{
|
||||
"ab": false,
|
||||
"label": "data",
|
||||
"size": "512 KiB",
|
||||
"grow": true,
|
||||
"guid": "auto",
|
||||
"type_guid": "2568845D-2332-4675-BC39-8FA5A4748D15"
|
||||
}
|
||||
]
|
||||
}
|
||||
BIN
tools/sdtools/pac/e3_176_ref/gpio/ospi_e3_176_ref.pac
Normal file
BIN
tools/sdtools/pac/e3_176_ref/gpio/ospi_e3_176_ref.pac
Normal file
Binary file not shown.
12
tools/sdtools/package.bat
Normal file
12
tools/sdtools/package.bat
Normal file
@@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
|
||||
set PYTHON3=%~dp0\..\..\prebuilts\windows\python-3.7.0\python.exe
|
||||
set ROOTDIR=%~dp0\..\..\
|
||||
cd /d %ROOTDIR%
|
||||
|
||||
echo "project path:"%1
|
||||
|
||||
%PYTHON3% tools\sdtools\package.py %1
|
||||
|
||||
|
||||
|
||||
39
tools/sdtools/package.py
Normal file
39
tools/sdtools/package.py
Normal file
@@ -0,0 +1,39 @@
|
||||
# coding=UTF-8
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
import subprocess
|
||||
import shlex
|
||||
|
||||
|
||||
project_path = sys.argv[1]
|
||||
if getattr(sys, 'frozen', False):
|
||||
current_path = os.path.dirname(os.path.abspath(sys.executable))
|
||||
elif __file__:
|
||||
current_path = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
BOARD = re.search(r"boards\\(.*?)\\", project_path).group(1)
|
||||
PROJECT_TMP = re.search(r".*\\(.*?)\\IAR", project_path).group(1)
|
||||
|
||||
if PROJECT_TMP == "sf" or PROJECT_TMP == "sp0" or PROJECT_TMP == "sp1" or PROJECT_TMP == "sx0" or PROJECT_TMP == "sx1":
|
||||
PROJECT = re.search(r".*\\(.*?)\\{0}\\IAR".format(PROJECT_TMP), project_path).group(1)
|
||||
else:
|
||||
PROJECT = PROJECT_TMP
|
||||
|
||||
os.chdir(os.path.join(current_path, "..", ".."))
|
||||
|
||||
PYTHON3 = current_path + "\\..\\..\\prebuilts\\windows\\python-3.7.0\\python.exe "
|
||||
genpac_file = os.getcwd() + "\\tools\\genpac.py "
|
||||
genpac_cmd = PYTHON3 + genpac_file + " -b " + BOARD + " -p " + PROJECT + " -v IAR "
|
||||
genpac_cmd_query = genpac_cmd + " -q"
|
||||
|
||||
cmd = shlex.split(genpac_cmd_query, posix=0)
|
||||
ret = subprocess.run(cmd)
|
||||
if ret.returncode != 0:
|
||||
print("Some images don't be built!")
|
||||
sys.exit(0)
|
||||
|
||||
cmd = shlex.split(genpac_cmd, posix=0)
|
||||
ret = subprocess.run(cmd)
|
||||
BIN
tools/sdtools/pactool/__pycache__/sfs_module.cpython-37.pyc
Normal file
BIN
tools/sdtools/pactool/__pycache__/sfs_module.cpython-37.pyc
Normal file
Binary file not shown.
1841
tools/sdtools/pactool/bpttool
Normal file
1841
tools/sdtools/pactool/bpttool
Normal file
File diff suppressed because it is too large
Load Diff
BIN
tools/sdtools/pactool/gen_pack_crc
Normal file
BIN
tools/sdtools/pactool/gen_pack_crc
Normal file
Binary file not shown.
247
tools/sdtools/pactool/gen_sfs_binary.py
Normal file
247
tools/sdtools/pactool/gen_sfs_binary.py
Normal file
@@ -0,0 +1,247 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.join(os.getcwd(), 'pactool'))
|
||||
import json
|
||||
import traceback
|
||||
import getopt
|
||||
import struct
|
||||
from ctypes import create_string_buffer
|
||||
from sfs_module import sfs_crc32
|
||||
|
||||
class GenSFS(object):
|
||||
|
||||
def __init__(self):
|
||||
self.tag = 0x53465301
|
||||
# self.init_act_data = struct.pack("60x")
|
||||
self.init_act_data = create_string_buffer(60)
|
||||
self.xfer_data = struct.pack("16x")
|
||||
self.ip_data = struct.pack("16x")
|
||||
self.freq = 0
|
||||
self.sw_reset_info = 0 # 1bytes
|
||||
self.training_pattern = struct.pack("8x")
|
||||
|
||||
def parse_value(self, arg):
|
||||
if sys.version_info[0] == 3 and isinstance(arg, str):
|
||||
return int(eval(str(arg)))
|
||||
elif sys.version_info[0] == 2 and (isinstance(arg, str) or isinstance(arg, unicode)):
|
||||
return int(eval(str(arg)))
|
||||
else:
|
||||
return int(arg)
|
||||
|
||||
def generate_sfs(self, jason_file, sfs_file, normal_img_addr, backup_img_addr, third_img_addr):
|
||||
try:
|
||||
self.load_json(jason_file)
|
||||
buffer = struct.pack('<I'
|
||||
'60s'
|
||||
'16s'
|
||||
'16s'
|
||||
'B'
|
||||
'6x' # change reserved[7] to reserved[6]
|
||||
'B' # sw_reset_info, change 'reseraved' to 'sw_reset_info'
|
||||
'8s'
|
||||
'I' # normal_img_addr
|
||||
'I' # backup_img_addr
|
||||
'I', # third_img_addr, change 'reseraved' to 'third_img_addr'
|
||||
self.tag,
|
||||
self.init_act_data.raw,
|
||||
self.xfer_data,
|
||||
self.ip_data,
|
||||
self.freq,
|
||||
self.sw_reset_info,
|
||||
self.training_pattern,
|
||||
normal_img_addr,
|
||||
backup_img_addr,
|
||||
third_img_addr
|
||||
)
|
||||
|
||||
crc32 = sfs_crc32(0, buffer, 124)
|
||||
# print(repr(buffer))
|
||||
# print("crc32=0x%X" % crc32)
|
||||
|
||||
data = struct.pack('<124sI',
|
||||
buffer,
|
||||
crc32)
|
||||
|
||||
image = open(sfs_file, 'wb')
|
||||
image.write(data)
|
||||
return True
|
||||
except ValueError as e:
|
||||
# error occurred.
|
||||
raise Exception("Failed to generate sfs file.")
|
||||
|
||||
def load_json(self, jason_file):
|
||||
try:
|
||||
load_f = open(jason_file, 'r')
|
||||
obj = json.loads(load_f.read())
|
||||
|
||||
# parse tag
|
||||
tag_obj = obj.get("tag")
|
||||
if tag_obj:
|
||||
self.tag = self.parse_value(tag_obj)
|
||||
|
||||
# parse init_act_t
|
||||
init_act_t = obj.get("init_act_t")
|
||||
if init_act_t:
|
||||
count = 0
|
||||
for item in init_act_t:
|
||||
struct.pack_into("BBHBB",
|
||||
self.init_act_data,
|
||||
count*6,
|
||||
self.parse_value(item["header"]),
|
||||
self.parse_value(item["command"]),
|
||||
self.parse_value(item["addr"]),
|
||||
self.parse_value(item["data0"]),
|
||||
self.parse_value(item["data1"]))
|
||||
count += 1
|
||||
# print(repr(self.init_act_data.raw ))
|
||||
|
||||
# parse xfer_attr_t
|
||||
xfer_obj = obj.get("xfer_attr_t")
|
||||
if xfer_obj:
|
||||
self.xfer_data = struct.pack("16B",
|
||||
self.parse_value(xfer_obj["cmd"]),
|
||||
self.parse_value(xfer_obj["cinst_type"]),
|
||||
self.parse_value(xfer_obj["caddr_type"]),
|
||||
self.parse_value(xfer_obj["cdata_type"]),
|
||||
self.parse_value(xfer_obj["caddr_size"]),
|
||||
self.parse_value(xfer_obj["cmode"]),
|
||||
self.parse_value(xfer_obj["cdummy_size"]),
|
||||
self.parse_value(xfer_obj["cflag"]),
|
||||
self.parse_value(xfer_obj["rsvd"][0]),
|
||||
self.parse_value(xfer_obj["rsvd"][1]),
|
||||
self.parse_value(xfer_obj["rsvd"][2]),
|
||||
self.parse_value(xfer_obj["rsvd"][3]),
|
||||
self.parse_value(xfer_obj["rsvd"][4]),
|
||||
self.parse_value(xfer_obj["rsvd"][5]),
|
||||
self.parse_value(xfer_obj["rsvd"][6]),
|
||||
self.parse_value(xfer_obj["rsvd"][7]),
|
||||
)
|
||||
# print(repr(self.xfer_data))
|
||||
|
||||
# parse ip_settings_t
|
||||
ip_setting_obj = obj.get("ip_settings_t")
|
||||
if ip_setting_obj:
|
||||
self.ip_data = struct.pack("H14B",
|
||||
self.parse_value(ip_setting_obj["flags"]),
|
||||
self.parse_value(ip_setting_obj["rx_delay"]),
|
||||
self.parse_value(ip_setting_obj["tx_delay"]),
|
||||
self.parse_value(ip_setting_obj["csda"]),
|
||||
self.parse_value(ip_setting_obj["csdada"]),
|
||||
self.parse_value(ip_setting_obj["cseot"]),
|
||||
self.parse_value(ip_setting_obj["cssot"]),
|
||||
self.parse_value(ip_setting_obj["min_rx_win"]),
|
||||
self.parse_value(ip_setting_obj["rx_training_step"]),
|
||||
self.parse_value(ip_setting_obj["ctrl_misc"]),
|
||||
self.parse_value(ip_setting_obj["rsvd"][0]),
|
||||
self.parse_value(ip_setting_obj["rsvd"][1]),
|
||||
self.parse_value(ip_setting_obj["rsvd"][2]),
|
||||
self.parse_value(ip_setting_obj["rsvd"][3]),
|
||||
self.parse_value(ip_setting_obj["rsvd"][4])
|
||||
)
|
||||
# print(repr(self.ip_data))
|
||||
|
||||
# parse freq
|
||||
freq_obj = obj.get("freq")
|
||||
if freq_obj:
|
||||
self.freq = self.parse_value(freq_obj)
|
||||
|
||||
# parse sw_reset_info
|
||||
freq_obj = obj.get("sw_reset_info")
|
||||
if freq_obj:
|
||||
self.sw_reset_info = self.parse_value(freq_obj)
|
||||
|
||||
# parse training_pattern
|
||||
training_obj = obj.get("training_pattern")
|
||||
if training_obj:
|
||||
self.training_pattern = struct.pack("8B",
|
||||
self.parse_value(training_obj[0]),
|
||||
self.parse_value(training_obj[1]),
|
||||
self.parse_value(training_obj[2]),
|
||||
self.parse_value(training_obj[3]),
|
||||
self.parse_value(training_obj[4]),
|
||||
self.parse_value(training_obj[5]),
|
||||
self.parse_value(training_obj[6]),
|
||||
self.parse_value(training_obj[7])
|
||||
)
|
||||
# print(repr(self.training_pattern))
|
||||
|
||||
except ValueError as e:
|
||||
# Unfortunately we can't easily get the line number where the
|
||||
# error occurred.
|
||||
raise Exception("Failed to Load jason file.")
|
||||
|
||||
|
||||
def show_usage():
|
||||
print("gen_sfs_binary version: 1.21.50.1")
|
||||
print("usage: gen_sfs_binary.py <--json file> <--out file> [--normal_img_off offset] [--backup_img_off offset] [--third_img_off offset] [-h]")
|
||||
print("options:")
|
||||
print("--json file Specify nor flash configuration")
|
||||
print("--out file Output specify sfs binary file")
|
||||
print("--normal_img_off Normal image address")
|
||||
print("--backup_img_off Backup image address")
|
||||
print("--third_img_off Third image address")
|
||||
print("-h Help")
|
||||
print("e.g.: gen_sfs_binary.py --json sfs.json --out ./sfs.img")
|
||||
|
||||
|
||||
def main(argv):
|
||||
"""
|
||||
主函数
|
||||
:param argv: <--out file> [-h]
|
||||
:return: 0:pass; other:fail
|
||||
"""
|
||||
exit_code = 1
|
||||
try:
|
||||
opts, args = getopt.getopt(argv, "-h", ["help", "json=", "out=", "normal_img_off=", "backup_img_off=", "third_img_off="])
|
||||
out_sfs_file = ""
|
||||
json_file = ""
|
||||
normal_img_addr = 0x7000
|
||||
backup_img_addr = 0x27000
|
||||
third_img_addr = 0x0
|
||||
for opt, arg in opts:
|
||||
if opt == '-h':
|
||||
show_usage()
|
||||
sys.exit(0)
|
||||
elif opt == "--out":
|
||||
out_sfs_file = arg
|
||||
elif opt == "--json":
|
||||
json_file = arg
|
||||
elif opt == "--normal_img_off":
|
||||
normal_img_addr = int(arg, 16)
|
||||
if len(arg) < 2 or not arg[:2].lower() == '0x':
|
||||
normal_img_addr = int(arg, 10)
|
||||
elif opt == "--backup_img_off":
|
||||
backup_img_addr = int(arg, 16)
|
||||
if len(arg) < 2 or not arg[:2].lower() == '0x':
|
||||
backup_img_addr = int(arg, 10)
|
||||
elif opt == "--third_img_off":
|
||||
third_img_addr = int(arg, 16)
|
||||
if len(arg) < 2 or not arg[:2].lower() == '0x':
|
||||
third_img_addr = int(arg, 10)
|
||||
print("normal image address = 0x%08X" % normal_img_addr)
|
||||
print("backup image address = 0x%08X" % backup_img_addr)
|
||||
print(" third image address = 0x%08X" % third_img_addr)
|
||||
if len(out_sfs_file) == 0:
|
||||
show_usage()
|
||||
raise Exception("Not specify output sfs binary file info is empty.")
|
||||
|
||||
if len(json_file) == 0:
|
||||
show_usage()
|
||||
raise Exception("Not input nor flash jason configuration file.")
|
||||
|
||||
obj = GenSFS()
|
||||
if not obj.generate_sfs(json_file, out_sfs_file, normal_img_addr, backup_img_addr, third_img_addr):
|
||||
raise Exception("[Error] Failed to sfs binary file.")
|
||||
|
||||
except Exception:
|
||||
print("[Error] %s" % traceback.format_exc())
|
||||
else:
|
||||
print("Successfully generated sfs binary file!")
|
||||
exit_code = 0
|
||||
|
||||
return exit_code
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[1:])
|
||||
349
tools/sdtools/pactool/msfstool.py
Normal file
349
tools/sdtools/pactool/msfstool.py
Normal file
@@ -0,0 +1,349 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import sys
|
||||
import struct
|
||||
import traceback
|
||||
import argparse
|
||||
|
||||
|
||||
class MULTI_SFS_HEADER_T(object):
|
||||
MAGIC = 0x5346534D # which means "MSFS"
|
||||
VERSION = 0
|
||||
FORMAT_STRING = "<4I16x"
|
||||
|
||||
def __init__(self):
|
||||
self.magic = self.MAGIC # 0x5346534D
|
||||
self.version = self.VERSION # structure version
|
||||
self.fs_count = "" # flash sequence count
|
||||
self.fs_offset = struct.calcsize(self.FORMAT_STRING) # flash sequence offset, default is 32
|
||||
self.reserved = "" # reserved 16 bytes
|
||||
|
||||
|
||||
class FLASH_SEQ_INFO_T(object):
|
||||
VERSION = 0
|
||||
FORMAT_STRING = "<3IQ12x"
|
||||
|
||||
def __init__(self):
|
||||
self.version = self.VERSION # structure version
|
||||
self.offset = 0 # data offset
|
||||
self.size = 0 # data size
|
||||
self.flash_id = 0 # Memory Type (1 Byte) <<8 | Manufacturer ID (1 Byte),e.g. "gd25q32/16" -> 0x40C8
|
||||
self.reserved = "" # reserved 16 bytes
|
||||
# image data
|
||||
self.image_data = None
|
||||
|
||||
|
||||
class PackError(Exception):
|
||||
"""Application-specific errors.
|
||||
|
||||
These errors represent issues for which a stack-trace should not be
|
||||
presented.
|
||||
|
||||
Attributes:
|
||||
message: Error message.
|
||||
"""
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
Exception.__init__(self, message)
|
||||
|
||||
|
||||
class SaveImage(object):
|
||||
def __init__(self, filename):
|
||||
self.file = None
|
||||
self.filename = filename
|
||||
self._initialize()
|
||||
|
||||
def _initialize(self):
|
||||
self.file = open(self.filename, 'wb+')
|
||||
|
||||
def write(self, data):
|
||||
if self.file:
|
||||
self.file.write(data)
|
||||
else:
|
||||
raise Exception("Failed to create binary file.")
|
||||
|
||||
def __del__(self):
|
||||
if self.file:
|
||||
self.file.flush()
|
||||
self.file.close()
|
||||
|
||||
|
||||
class ReadImage(object):
|
||||
|
||||
def __init__(self, image_filename):
|
||||
"""Initializes an image handler.
|
||||
|
||||
Arguments:
|
||||
image_filename: The name of the file to operate on.
|
||||
|
||||
Raises:
|
||||
ValueError: If data in the file is invalid.
|
||||
"""
|
||||
self.file = None
|
||||
self.image_size = 0
|
||||
self._file_pos = 0
|
||||
self.filename = image_filename
|
||||
self._initialize()
|
||||
|
||||
def _initialize(self):
|
||||
try:
|
||||
self._file_pos = 0
|
||||
self.file = open(self.filename, 'rb')
|
||||
self.file.seek(0, os.SEEK_END)
|
||||
self.image_size = self.file.tell()
|
||||
self.file.seek(0, os.SEEK_SET)
|
||||
except IOError as e:
|
||||
# print("Failed to open %s" % self.filename)
|
||||
self.file = None
|
||||
|
||||
def seek(self, offset):
|
||||
"""Sets the cursor position for reading from unsparsified file.
|
||||
|
||||
Arguments:
|
||||
offset: Offset to seek to from the beginning of the file.
|
||||
"""
|
||||
self._file_pos = offset
|
||||
|
||||
def read(self, size):
|
||||
"""Reads data from the unsparsified file.
|
||||
|
||||
This method may return fewer than |size| bytes of data if the end
|
||||
of the file was encountered.
|
||||
|
||||
The file cursor for reading is advanced by the number of bytes
|
||||
read.
|
||||
|
||||
Arguments:
|
||||
size: Number of bytes to read.
|
||||
|
||||
Returns:
|
||||
The data.
|
||||
|
||||
"""
|
||||
self.file.seek(self._file_pos)
|
||||
data = self.file.read(size)
|
||||
self._file_pos += len(data)
|
||||
return data
|
||||
|
||||
def tell(self):
|
||||
"""Returns the file cursor position for reading from unsparsified file.
|
||||
|
||||
Returns:
|
||||
The file cursor position for reading.
|
||||
"""
|
||||
return self._file_pos
|
||||
|
||||
|
||||
class Packet(object):
|
||||
"""Business logic for msfstool command-line tool."""
|
||||
|
||||
def make_msfs_image(self, output, images):
|
||||
"""Implementation of the 'make_msfs_image' command.
|
||||
|
||||
Arguments:
|
||||
output: Output file where disk image is to be written to.
|
||||
images: List of partition image paths to be combined (as specified by
|
||||
bpt). Each element is of the form.
|
||||
'FLASH_ID@/PATH/TO/SFS_IMAGE'
|
||||
|
||||
Raises:
|
||||
PackError: If application-specific error occurs.
|
||||
"""
|
||||
# Create mapping of partition name to partition image file.
|
||||
image_file_names = {}
|
||||
try:
|
||||
if images:
|
||||
for item in images:
|
||||
flash_id, path = item.split("@")
|
||||
flash_id = flash_id.lower()
|
||||
if 0 == flash_id.find("0x"):
|
||||
id = int(flash_id, 16)
|
||||
else:
|
||||
id = int(flash_id, 10)
|
||||
image_file_names[id] = path
|
||||
if not os.path.exists(path):
|
||||
raise PackError('image file do not exist: {}.'.format(item))
|
||||
except ValueError as e:
|
||||
raise PackError('Bad image argument {}.'.format(images))
|
||||
|
||||
_ids = []
|
||||
for k, v in image_file_names.items():
|
||||
print("Flash sequence info :0x%X : %s" % (k, v))
|
||||
_ids.append(k)
|
||||
_ids.sort(reverse=False)
|
||||
_fs_infos = []
|
||||
for k in _ids:
|
||||
_image = ReadImage(image_file_names[k])
|
||||
if _image.file is None:
|
||||
raise PackError('Failed to open sfs fie: {}.'.format(image_file_names[k]))
|
||||
_info = FLASH_SEQ_INFO_T()
|
||||
_info.version = FLASH_SEQ_INFO_T.VERSION
|
||||
_info.size = _image.image_size
|
||||
_info.flash_id = k
|
||||
_info.image_data = _image.read(_image.image_size)
|
||||
_fs_infos.append(_info)
|
||||
|
||||
# make image
|
||||
_header = MULTI_SFS_HEADER_T()
|
||||
_header.fs_count = len(_ids)
|
||||
_header.fs_offset = struct.calcsize(MULTI_SFS_HEADER_T.FORMAT_STRING)
|
||||
_header_data = struct.pack(MULTI_SFS_HEADER_T.FORMAT_STRING,
|
||||
_header.magic,
|
||||
_header.version,
|
||||
_header.fs_count,
|
||||
_header.fs_offset)
|
||||
|
||||
# create output image file
|
||||
_s_file = SaveImage(output)
|
||||
_s_file.write(_header_data)
|
||||
|
||||
# info
|
||||
offset = struct.calcsize(MULTI_SFS_HEADER_T.FORMAT_STRING) + \
|
||||
_header.fs_count*struct.calcsize(FLASH_SEQ_INFO_T.FORMAT_STRING)
|
||||
for item in _fs_infos:
|
||||
item.offset = offset
|
||||
_info_data = struct.pack(FLASH_SEQ_INFO_T.FORMAT_STRING,
|
||||
item.version,
|
||||
item.offset,
|
||||
item.size,
|
||||
item.flash_id)
|
||||
_s_file.write(_info_data)
|
||||
offset += item.size
|
||||
|
||||
for item in _fs_infos:
|
||||
_s_file.write(item.image_data)
|
||||
return True
|
||||
|
||||
def extract_msfs(self, output_path, image_file):
|
||||
output_path = output_path.replace('\\', '/')
|
||||
os.makedirs(output_path, exist_ok=True)
|
||||
_image = ReadImage(image_file)
|
||||
if _image.file is None:
|
||||
raise PackError('Failed to open msfs fie: {}.'.format(image_file))
|
||||
if _image.image_size < struct.calcsize(MULTI_SFS_HEADER_T.FORMAT_STRING):
|
||||
raise PackError('Invalid size of the msfs fie: {}.'.format(image_file))
|
||||
_header_bin = _image.read(struct.calcsize(MULTI_SFS_HEADER_T.FORMAT_STRING))
|
||||
_header = MULTI_SFS_HEADER_T()
|
||||
(_header.magic,
|
||||
_header.version,
|
||||
_header.fs_count,
|
||||
_header.fs_offset) = struct.unpack(MULTI_SFS_HEADER_T.FORMAT_STRING, _header_bin)
|
||||
if not _header.magic == MULTI_SFS_HEADER_T.MAGIC:
|
||||
raise PackError('Invalid msfs fie: {}.'.format(image_file))
|
||||
print("msfs summary information :")
|
||||
print(" magic: 0x%X" % _header.magic)
|
||||
print(" version: 0x%X" % _header.version)
|
||||
print(" fs count: 0x%X" % _header.fs_count)
|
||||
print(" fs offset: 0x%X" % _header.fs_offset)
|
||||
|
||||
_fs_infos = []
|
||||
for i in range(_header.fs_count):
|
||||
_info_bin = _image.read(struct.calcsize(FLASH_SEQ_INFO_T.FORMAT_STRING))
|
||||
_info = FLASH_SEQ_INFO_T()
|
||||
(_info.version,
|
||||
_info.offset,
|
||||
_info.size,
|
||||
_info.flash_id) = struct.unpack(FLASH_SEQ_INFO_T.FORMAT_STRING, _info_bin)
|
||||
_fs_infos.append(_info)
|
||||
|
||||
for item in _fs_infos:
|
||||
_sfs = "%s/FlashID_0x%X.img" % (output_path, item.flash_id)
|
||||
_file = SaveImage(_sfs)
|
||||
_image.seek(item.offset)
|
||||
_file.write(_image.read(item.size))
|
||||
|
||||
print("\nextracted sfs information : %s" % _sfs)
|
||||
print(" version: 0x%X" % item.version)
|
||||
print(" offset: 0x%X" % item.offset)
|
||||
print(" size: 0x%X" % item.size)
|
||||
print(" flash id: 0x%X" % item.flash_id)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
class MsfsTool(object):
|
||||
"""Object for command-line tool."""
|
||||
|
||||
def __init__(self):
|
||||
"""Initializer method."""
|
||||
self.packet = Packet()
|
||||
pass
|
||||
|
||||
def version(self, _):
|
||||
"""Implements the 'version' sub-command."""
|
||||
print('1.21.32.1')
|
||||
|
||||
def make_msfs(self, args):
|
||||
"""Implements the 'make_msfs' sub-command."""
|
||||
if 0 == len(args.output):
|
||||
print('Option --ouptut parameter is required.')
|
||||
return False
|
||||
result = False
|
||||
try:
|
||||
result = self.packet.make_msfs_image(args.output, args.image)
|
||||
except PackError as e:
|
||||
print('Error : {}'.format(e.message))
|
||||
finally:
|
||||
if result:
|
||||
print('Successfully generated msfs file.')
|
||||
else:
|
||||
os.remove(args.output)
|
||||
print('Failed to generate msfs file.')
|
||||
return result
|
||||
|
||||
def extract_msfs(self, args):
|
||||
"""Implements the 'extract_msfs' sub-command."""
|
||||
result = False
|
||||
try:
|
||||
result = self.packet.extract_msfs(args.output, args.image)
|
||||
except PackError as e:
|
||||
print('Error : {}'.format(e.message))
|
||||
finally:
|
||||
if result:
|
||||
print('Successfully extracted msfs file.')
|
||||
else:
|
||||
print('Failed to extract msfs file.')
|
||||
return result
|
||||
|
||||
def run(self, argv):
|
||||
parser = argparse.ArgumentParser()
|
||||
subparsers = parser.add_subparsers(title='subcommands')
|
||||
sub_parser = subparsers.add_parser('version', help='Prints version of MsfsTool.')
|
||||
sub_parser.set_defaults(func=self.version)
|
||||
|
||||
sub_parser = subparsers.add_parser('make_msfs', help='Create multi sfs image file.')
|
||||
sub_parser.add_argument('--output',
|
||||
help='Path to image output.',
|
||||
type=str,
|
||||
required=True)
|
||||
sub_parser.add_argument('--image',
|
||||
help='Flash ID and path to sfs/nfs image file.',
|
||||
metavar='FLASH_ID@SFS_FILE',
|
||||
action='append',
|
||||
required=True)
|
||||
sub_parser.set_defaults(func=self.make_msfs)
|
||||
|
||||
sub_parser = subparsers.add_parser('extract_msfs', help='Extract multi sfs image file.')
|
||||
sub_parser.add_argument('--output',
|
||||
help='Path to extract sfs.',
|
||||
type=str,
|
||||
required=True)
|
||||
sub_parser.add_argument('--image',
|
||||
help='Path to msfs file.',
|
||||
type=str,
|
||||
required=True)
|
||||
sub_parser.set_defaults(func=self.extract_msfs)
|
||||
|
||||
args = parser.parse_args(argv[1:])
|
||||
try:
|
||||
func = args.func
|
||||
except AttributeError:
|
||||
parser.error("invalid arguments")
|
||||
return func(args)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
obj = MsfsTool()
|
||||
obj.run(sys.argv)
|
||||
1688
tools/sdtools/pactool/pactool
Normal file
1688
tools/sdtools/pactool/pactool
Normal file
File diff suppressed because it is too large
Load Diff
152
tools/sdtools/pactool/sfs_module.py
Normal file
152
tools/sdtools/pactool/sfs_module.py
Normal file
@@ -0,0 +1,152 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import sys
|
||||
import os
|
||||
import struct
|
||||
|
||||
|
||||
# CRC table for the CRC-32. The poly isPoly : 0x04C11DB7
|
||||
SFS_CRC32_TABLE = [
|
||||
0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9,
|
||||
0x130476DC, 0x17C56B6B, 0x1A864DB2, 0x1E475005,
|
||||
0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61,
|
||||
0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD,
|
||||
0x4C11DB70, 0x48D0C6C7, 0x4593E01E, 0x4152FDA9,
|
||||
0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
|
||||
0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011,
|
||||
0x791D4014, 0x7DDC5DA3, 0x709F7B7A, 0x745E66CD,
|
||||
0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039,
|
||||
0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5,
|
||||
0xBE2B5B58, 0xBAEA46EF, 0xB7A96036, 0xB3687D81,
|
||||
0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D,
|
||||
0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49,
|
||||
0xC7361B4C, 0xC3F706FB, 0xCEB42022, 0xCA753D95,
|
||||
0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1,
|
||||
0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D,
|
||||
0x34867077, 0x30476DC0, 0x3D044B19, 0x39C556AE,
|
||||
0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072,
|
||||
0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16,
|
||||
0x018AEB13, 0x054BF6A4, 0x0808D07D, 0x0CC9CDCA,
|
||||
0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE,
|
||||
0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02,
|
||||
0x5E9F46BF, 0x5A5E5B08, 0x571D7DD1, 0x53DC6066,
|
||||
0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA,
|
||||
0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E,
|
||||
0xBFA1B04B, 0xBB60ADFC, 0xB6238B25, 0xB2E29692,
|
||||
0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6,
|
||||
0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A,
|
||||
0xE0B41DE7, 0xE4750050, 0xE9362689, 0xEDF73B3E,
|
||||
0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2,
|
||||
0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686,
|
||||
0xD5B88683, 0xD1799B34, 0xDC3ABDED, 0xD8FBA05A,
|
||||
0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637,
|
||||
0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB,
|
||||
0x4F040D56, 0x4BC510E1, 0x46863638, 0x42472B8F,
|
||||
0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53,
|
||||
0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47,
|
||||
0x36194D42, 0x32D850F5, 0x3F9B762C, 0x3B5A6B9B,
|
||||
0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF,
|
||||
0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623,
|
||||
0xF12F560E, 0xF5EE4BB9, 0xF8AD6D60, 0xFC6C70D7,
|
||||
0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B,
|
||||
0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F,
|
||||
0xC423CD6A, 0xC0E2D0DD, 0xCDA1F604, 0xC960EBB3,
|
||||
0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7,
|
||||
0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B,
|
||||
0x9B3660C6, 0x9FF77D71, 0x92B45BA8, 0x9675461F,
|
||||
0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3,
|
||||
0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640,
|
||||
0x4E8EE645, 0x4A4FFBF2, 0x470CDD2B, 0x43CDC09C,
|
||||
0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8,
|
||||
0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24,
|
||||
0x119B4BE9, 0x155A565E, 0x18197087, 0x1CD86D30,
|
||||
0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC,
|
||||
0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088,
|
||||
0x2497D08D, 0x2056CD3A, 0x2D15EBE3, 0x29D4F654,
|
||||
0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0,
|
||||
0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C,
|
||||
0xE3A1CBC1, 0xE760D676, 0xEA23F0AF, 0xEEE2ED18,
|
||||
0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4,
|
||||
0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0,
|
||||
0x9ABC8BD5, 0x9E7D9662, 0x933EB0BB, 0x97FFAD0C,
|
||||
0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668,
|
||||
0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
|
||||
]
|
||||
|
||||
|
||||
def sfs_crc32(crc, data, len):
|
||||
crc ^= 0xFFFFFFFF
|
||||
for i in range(len):
|
||||
if sys.version_info[0] == 3:
|
||||
crc = ((crc << 8) & 0xFFFFFF00) ^ SFS_CRC32_TABLE[((crc >> 24) & 0xFF) ^ data[i]]
|
||||
else:
|
||||
crc = ((crc << 8) & 0xFFFFFF00) ^ SFS_CRC32_TABLE[((crc >> 24) & 0xFF) ^ (struct.unpack('B', data[i])[0])]
|
||||
return crc ^ 0xFFFFFFFF
|
||||
|
||||
|
||||
class SFSImageHandler(object):
|
||||
# msfs define
|
||||
MSFS_MAGIC = 0x5346534D # "MSFS"
|
||||
MSFS_HEADER_FORMAT = '<4I16x'
|
||||
MSFS_ITEM_INFO_FORMAT = '<3I20s'
|
||||
MSFS_HEADE_SIZE = struct.calcsize(MSFS_HEADER_FORMAT)
|
||||
MSFS_ITEM_INFO_SIZE = struct.calcsize(MSFS_ITEM_INFO_FORMAT)
|
||||
|
||||
# sfs define
|
||||
SFS_MAGIC = 0x534653 # "SFS"
|
||||
SFS_FORMAT = '<I108s4I'
|
||||
SFS_STRUCTURE_SIZE = struct.calcsize(SFS_FORMAT)
|
||||
|
||||
def __init__(self, image_filename):
|
||||
self._file_name = image_filename
|
||||
self._normal_addr = 0
|
||||
self._backup_addr = 0
|
||||
self._third_addr = 0
|
||||
self._read_file()
|
||||
|
||||
def _read_file(self):
|
||||
self._image = open(self._file_name, 'r+b')
|
||||
self._image.seek(0, os.SEEK_END)
|
||||
self.image_size = self._image.tell()
|
||||
if self.image_size < 4:
|
||||
raise ValueError('Invalid msfs/sfs size.')
|
||||
# read magic
|
||||
self._image.seek(0, os.SEEK_SET)
|
||||
data = self._image.read(4)
|
||||
self._image.seek(0, os.SEEK_SET)
|
||||
magic, = struct.unpack('<I', data)
|
||||
if magic == self.MSFS_MAGIC:
|
||||
self._parser_msfs()
|
||||
elif (magic >> 8) == self.SFS_MAGIC:
|
||||
data = self._image.read(self.SFS_STRUCTURE_SIZE)
|
||||
self._parser_sfs(data)
|
||||
else:
|
||||
self._image.close()
|
||||
raise ValueError('Invalid msfs/sfs image.')
|
||||
self._image.close()
|
||||
|
||||
def _parser_sfs(self, data):
|
||||
(magic, _, self._normal_addr, self._backup_addr, self._third_addr, crc) = struct.unpack(self.SFS_FORMAT, data)
|
||||
if not ((magic >> 8) == self.SFS_MAGIC):
|
||||
raise ValueError('Invalid magic,sfs magic must be equal 0x534653 bytes.')
|
||||
|
||||
calc_crc32 = sfs_crc32(0, data, self.SFS_STRUCTURE_SIZE - 4)
|
||||
if not (calc_crc32 == crc):
|
||||
raise ValueError('Invalid crc,failed to check sfs crc.')
|
||||
|
||||
def _parser_msfs(self):
|
||||
self._image.seek(self.MSFS_HEADE_SIZE, os.SEEK_SET)
|
||||
# read first sfs info
|
||||
data = self._image.read(self.MSFS_ITEM_INFO_SIZE)
|
||||
(version, sfs_offset, sfs_size, _) = struct.unpack(self.MSFS_ITEM_INFO_FORMAT, data)
|
||||
|
||||
# read first sfs
|
||||
self._image.seek(sfs_offset, os.SEEK_SET)
|
||||
data = self._image.read(self.SFS_STRUCTURE_SIZE)
|
||||
self._parser_sfs(data)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sfs_file = sys.argv[1]
|
||||
obj = SFSImageHandler(sfs_file)
|
||||
# file = open("d:\\t.img", 'wb+')
|
||||
# file.write(obj.update_image_address(0x2000, 0x12000))
|
||||
1152
tools/sdtools/part/part.json
Normal file
1152
tools/sdtools/part/part.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
tools/sdtools/rfd/xspi_wrap_rfd_blk_pvk1_ks.rfd
Normal file
BIN
tools/sdtools/rfd/xspi_wrap_rfd_blk_pvk1_ks.rfd
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/gpio.out
Normal file
BIN
tools/sdtools/sfs/gpio.out
Normal file
Binary file not shown.
224
tools/sdtools/sfs/is25-1-1-4-dummy-dqs-100MHz.json
Normal file
224
tools/sdtools/sfs/is25-1-1-4-dummy-dqs-100MHz.json
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 0,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0x6B",
|
||||
"cinst_type": 0,
|
||||
"caddr_type": 0,
|
||||
"cdata_type": 2,
|
||||
"caddr_size": 3,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 8,
|
||||
"cflag": "0x0",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x1",
|
||||
"rx_delay": "0x1",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 2,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 3,
|
||||
"sw_reset_info": 36,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
224
tools/sdtools/sfs/is25-1-1-4-no-dqs-50MHz.json
Normal file
224
tools/sdtools/sfs/is25-1-1-4-no-dqs-50MHz.json
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 0,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0x6B",
|
||||
"cinst_type": 0,
|
||||
"caddr_type": 0,
|
||||
"cdata_type": 2,
|
||||
"caddr_size": 3,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 8,
|
||||
"cflag": "0x0",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x0",
|
||||
"rx_delay": "0x0",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 1,
|
||||
"sw_reset_info": 36,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
224
tools/sdtools/sfs/is25-1-1-4.json
Normal file
224
tools/sdtools/sfs/is25-1-1-4.json
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 0,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0x6B",
|
||||
"cinst_type": 0,
|
||||
"caddr_type": 0,
|
||||
"cdata_type": 2,
|
||||
"caddr_size": 3,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 8,
|
||||
"cflag": "0x0",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x0",
|
||||
"rx_delay": "0xF",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 3,
|
||||
"sw_reset_info": 36,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
231
tools/sdtools/sfs/is25-4-4-4-100MHz.json
Normal file
231
tools/sdtools/sfs/is25-4-4-4-100MHz.json
Normal file
@@ -0,0 +1,231 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0x1) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 6,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0x1) << 6) | ((0x0) << 3) | ((0x1) << 0))",
|
||||
"command": "0xc0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x50",
|
||||
"data1": "0"
|
||||
},
|
||||
{
|
||||
"header": "(((0x1) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x35",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0xEB",
|
||||
"cinst_type": 2,
|
||||
"caddr_type": 2,
|
||||
"cdata_type": 2,
|
||||
"caddr_size": 3,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 10,
|
||||
"cflag": "0x0",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x0",
|
||||
"rx_delay": "0xf",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 3,
|
||||
"sw_reset_info": 36,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
224
tools/sdtools/sfs/mt35-1-1-1-2.json
Normal file
224
tools/sdtools/sfs/mt35-1-1-1-2.json
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 0,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0x0B",
|
||||
"cinst_type": 0,
|
||||
"caddr_type": 0,
|
||||
"cdata_type": 0,
|
||||
"caddr_size": 3,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 8,
|
||||
"cflag": "0x0",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x0",
|
||||
"rx_delay": "0x0",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 0,
|
||||
"sw_reset_info": 36,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
224
tools/sdtools/sfs/mt35-1-1-1.json
Normal file
224
tools/sdtools/sfs/mt35-1-1-1.json
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 0,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0x0B",
|
||||
"cinst_type": 0,
|
||||
"caddr_type": 0,
|
||||
"cdata_type": 0,
|
||||
"caddr_size": 3,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 8,
|
||||
"cflag": "0x0",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x0",
|
||||
"rx_delay": "0x0",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 0,
|
||||
"sw_reset_info": 39,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
224
tools/sdtools/sfs/mt35-1-8d-8d-dqs-100MHz.json
Normal file
224
tools/sdtools/sfs/mt35-1-8d-8d-dqs-100MHz.json
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 0,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0xFD",
|
||||
"cinst_type": 0,
|
||||
"caddr_type": 3,
|
||||
"cdata_type": 3,
|
||||
"caddr_size": 4,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 16,
|
||||
"cflag": "0x3",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x0",
|
||||
"rx_delay": "0xF",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 3,
|
||||
"sw_reset_info": 39,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
224
tools/sdtools/sfs/mt35-1-8d-8d-nodqs-66MHz.json
Normal file
224
tools/sdtools/sfs/mt35-1-8d-8d-nodqs-66MHz.json
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 0,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0xFD",
|
||||
"cinst_type": 0,
|
||||
"caddr_type": 3,
|
||||
"cdata_type": 3,
|
||||
"caddr_size": 4,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 16,
|
||||
"cflag": "0x1",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x0",
|
||||
"rx_delay": "0xF",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 2,
|
||||
"sw_reset_info": 39,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
224
tools/sdtools/sfs/mt35_ospi_fast_read.json
Normal file
224
tools/sdtools/sfs/mt35_ospi_fast_read.json
Normal file
@@ -0,0 +1,224 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0x1) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 6,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0x1) << 6) | ((0x3) << 3) | ((0x1) << 0))",
|
||||
"command": "0x81",
|
||||
"addr": "0x0",
|
||||
"data0": "0xe7",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0x0C",
|
||||
"cinst_type": 3,
|
||||
"caddr_type": 3,
|
||||
"cdata_type": 3,
|
||||
"caddr_size": 4,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 16,
|
||||
"cflag": "0x06",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x0",
|
||||
"rx_delay": "0xF",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 4,
|
||||
"sw_reset_info": 39,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
226
tools/sdtools/sfs/s26h-hyperflash.json
Normal file
226
tools/sdtools/sfs/s26h-hyperflash.json
Normal file
@@ -0,0 +1,226 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 0,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0x0",
|
||||
"cinst_type": 3,
|
||||
"caddr_type": 3,
|
||||
"cdata_type": 3,
|
||||
"caddr_size": 4,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 15,
|
||||
"cflag": "0x06",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x8008",
|
||||
"rx_delay": "0x0C",
|
||||
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
|
||||
"ctrl_misc": 0,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 4,
|
||||
"sw_reset_info": 0,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
BIN
tools/sdtools/sfs/sfs.img
Normal file
BIN
tools/sdtools/sfs/sfs.img
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_is25-1-1-4.bin
Normal file
BIN
tools/sdtools/sfs/sfs_is25-1-1-4.bin
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_is25-1-1-4.img
Normal file
BIN
tools/sdtools/sfs/sfs_is25-1-1-4.img
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_mt35-1-1-1-2.img
Normal file
BIN
tools/sdtools/sfs/sfs_mt35-1-1-1-2.img
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_mt35-1-1-1.bin
Normal file
BIN
tools/sdtools/sfs/sfs_mt35-1-1-1.bin
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_mt35-1-1-1.img
Normal file
BIN
tools/sdtools/sfs/sfs_mt35-1-1-1.img
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_mt35_ospi_fast_read.bin
Normal file
BIN
tools/sdtools/sfs/sfs_mt35_ospi_fast_read.bin
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_mt35_ospi_fast_read.img
Normal file
BIN
tools/sdtools/sfs/sfs_mt35_ospi_fast_read.img
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_s26h-hyperflash.bin
Normal file
BIN
tools/sdtools/sfs/sfs_s26h-hyperflash.bin
Normal file
Binary file not shown.
BIN
tools/sdtools/sfs/sfs_s26h-hyperflash.img
Normal file
BIN
tools/sdtools/sfs/sfs_s26h-hyperflash.img
Normal file
Binary file not shown.
231
tools/sdtools/sfs/sip-4-4-4-125MHz.json
Normal file
231
tools/sdtools/sfs/sip-4-4-4-125MHz.json
Normal file
@@ -0,0 +1,231 @@
|
||||
{
|
||||
"tag": "0x53465301",
|
||||
"init_act_t": [{
|
||||
"header": "(((0x1) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": 6,
|
||||
"addr": "0x0",
|
||||
"data0": 0,
|
||||
"data1": 0
|
||||
},
|
||||
{
|
||||
"header": "(((0x1) << 6) | ((0x0) << 3) | ((0x1) << 0))",
|
||||
"command": "0xc0",
|
||||
"addr": "0x0",
|
||||
"data0": "0x50",
|
||||
"data1": "0"
|
||||
},
|
||||
{
|
||||
"header": "(((0x1) << 6) | ((0) << 3) | ((0) << 0))",
|
||||
"command": "0x35",
|
||||
"addr": "0x0",
|
||||
"data0": "0x0",
|
||||
"data1": 0
|
||||
}
|
||||
],
|
||||
|
||||
"xfer_attr_t": {
|
||||
"cmd": "0xEB",
|
||||
"cinst_type": 2,
|
||||
"caddr_type": 2,
|
||||
"cdata_type": 2,
|
||||
"caddr_size": 3,
|
||||
"cmode": 0,
|
||||
"cdummy_size": 10,
|
||||
"cflag": "0x0",
|
||||
"rsvd": [0, 0, 0, 0, 0, 0, 0, 0]
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"flags": "0x21",
|
||||
"rx_delay": "0x00",
|
||||
"kunlun": "+++",
|
||||
"tx_delay": 0,
|
||||
"csda": 0,
|
||||
"csdada": 0,
|
||||
"cseot": 0,
|
||||
"cssot": 0,
|
||||
"min_rx_win": 0,
|
||||
"rx_training_step": 0,
|
||||
"kunlun": "---",
|
||||
"ctrl_misc": 2,
|
||||
"rsvd": [0, 0, 0, 0, 0]
|
||||
},
|
||||
"freq": 4,
|
||||
"sw_reset_info": 36,
|
||||
"training_pattern": ["0x5a", "0xa5", "0xf0", "0x0f", "0x0f", "0xf0", "0xa5", "0x5a"],
|
||||
|
||||
"_comments": {
|
||||
"init_act_t": {
|
||||
"des": "INIT_ACT array, Initialization action array which includes 10 INIT_ACT at most.",
|
||||
"size": "6*10 bytes, below is valid defined",
|
||||
"header": "(((act_type) << 6) | ((a_sz) << 3) | ((d_sz) << 0))",
|
||||
"command": "1byte",
|
||||
"addr": "2bytes",
|
||||
"data0": "1byte",
|
||||
"data1": "1byte",
|
||||
"act_type": {
|
||||
"REG_WR(0x01)": "ACT_REG_WR(cmd, a_sz, d_sz, a, d) : (ACT_HDR(1, a_sz, d_sz), cmd, a, (d)&0xff, ((d)>>8)&0xff)); e.g. ACT_REG_WR(0x81, 3, 1, 0, 0xe7)",
|
||||
"REG_POLL(0x02)": "ACT_REG_POLL(cmd, bit, v) : (ACT_HDR(2, 0, 1), cmd, 0, bit, v); e.g. ACT_REG_POLL(0x05, 0, 0)",
|
||||
"CTL_SYNC(0x03)": "ACT_SYNC(io, edge) : (ACT_HDR(3, 0, 0), 0, 0, io, edge); e.g. ACT_SYNC(2, 0)"
|
||||
}
|
||||
},
|
||||
|
||||
"xfer_attr_t": {
|
||||
"des": "Read XFER Configuration",
|
||||
"size": "16 bytes",
|
||||
"cmd": {
|
||||
"des": "The command code for read",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cinst_type": {
|
||||
"des": "IO type of CMD",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_type": {
|
||||
"des": "IO type of Adress",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"cdata_type": {
|
||||
"des": "IO type of Data",
|
||||
"size": "1byte, below is valid data",
|
||||
"0": "Single IO",
|
||||
"1": "Dual IO",
|
||||
"2": "Quad IO",
|
||||
"3": "Octal IO"
|
||||
},
|
||||
"caddr_size": {
|
||||
"des": "Address size",
|
||||
"size": "1byte, below is valid data",
|
||||
"3": "3bytes addressing",
|
||||
"4": "4bytes addressing"
|
||||
},
|
||||
"cmode": {
|
||||
"des": "Mode, The Mode value to be sent, Valid only if MODE_VALID set in Flag",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cdummy_size": {
|
||||
"des": "Dummy size, The number of the dummy cycles",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cflag": {
|
||||
"des": "Flag",
|
||||
"size": "1byte, below is valid defined",
|
||||
"Bit0": "DDR, indicating this read xfer is in DDR mode",
|
||||
"Bit1": "DQS, indicating this read xfer shall use DQS",
|
||||
"Bit2": "DTR, indicating this read xfer is in DTR(Double Data Rate) protocol",
|
||||
"Bit3": "DUAL_OPCODE_INV",
|
||||
"Bit4": "Data Flip",
|
||||
"Bit5": "MODE_VALID",
|
||||
"Bit6": "ECC_EN,For safety ROM only,If set, Rom code setup ECC_FAIL pad and enbale ECC_FAIL IRQ",
|
||||
"Bit7": "CRC_EN,For safety ROM only,If set, Rom code enables CRC feature of OSPI controller and also enable RX_CRC_MASK_IRQ"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "8bytes, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"ip_settings_t": {
|
||||
"des": "IP(XSPI controller) specific settings",
|
||||
"size": "16 bytes",
|
||||
"flags": {
|
||||
"des": "IPS_FLAG",
|
||||
"size": "2bytes, below is valid defined",
|
||||
"taishan": {
|
||||
"Bit0": "IPS_LPBK,If set, SCLK loopback is desired as sample clock",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS,map to (RX DLL Bypass bit) of PHY_CONFIGURATION register"
|
||||
},
|
||||
"kunlun": {
|
||||
"Bit0": "IPS_LPBK",
|
||||
"Bit1": "IPS_DLL_BYPASS_MODE",
|
||||
"Bit2": "IPS_TAPMODE",
|
||||
"Bit3": "IPS_PHY_TRAINING",
|
||||
"Bit4": "IPS_PHY_FIFO_POP_DELAY",
|
||||
"Bit5": "IPS_RX_DLL_BYPASS",
|
||||
"Bit10-8": "IPS_PHY_DLL_PHASE_DETECT_SEL Map to bit[22:20] of register PHY_DLL_MASTER_CONTROL register, Valid for phy mode only",
|
||||
"Bit14": "IPS_DEVDLY_VALID",
|
||||
"Bit15": "IPS_RXTX_DELAY_VALID. indicating RX delay and TX delay are valid"
|
||||
}
|
||||
},
|
||||
"rx_delay": {
|
||||
"des": "RX delay, if non-zero, used to override DLL_CTRL and DLL1_CTRL SLV_TARGET",
|
||||
"size": "1byte"
|
||||
},
|
||||
|
||||
"kunlun": {
|
||||
"tx_delay": {
|
||||
"des": "TX delay, Valid if IPS_RXTX_DELAY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csda": {
|
||||
"des": "CSDA, Mapped to OSPI device delay register CSDA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"csdada": {
|
||||
"des": "CSDADA, Mapped to OSPI device delay register CSDADA field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cseot": {
|
||||
"des": "CSEOT, Mapped to OSPI device delay register CSEOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"cssot": {
|
||||
"des": "CSSOT, Mapped to OSPI device delay register CSSOT field,Valid if IPS_DEVDLY_VALID set",
|
||||
"size": "1byte"
|
||||
},
|
||||
"min_rx_win": {
|
||||
"des": "Mininum RX Delay valid window size for PHY training",
|
||||
"size": "1byte"
|
||||
},
|
||||
"rx_training_step": {
|
||||
"des": "RX DLY Training Step, The step used for phy training, Shall <=4, if 0, ROM set traning step as 1",
|
||||
"size": "1byte"
|
||||
}
|
||||
},
|
||||
|
||||
"ctrl_misc": {
|
||||
"des": "Valid if LPS_LPBK of IPS_FLAG set",
|
||||
"size": "1byte",
|
||||
"0": "SCLK loopback",
|
||||
"2": "DQS loopback"
|
||||
},
|
||||
"rsvd": {
|
||||
"des": "Reserved",
|
||||
"size": "5byte, Shall be 0"
|
||||
}
|
||||
},
|
||||
|
||||
"freq": {
|
||||
"des": "Freq, The SCLK frequency desired",
|
||||
"size": "1byte, below is valid data",
|
||||
"taishan": {
|
||||
"0": "Freq0,25MHz on Taishan",
|
||||
"1": "Freq1,50MHz on Taishan",
|
||||
"2": "Freq2,66MHz on Taishan",
|
||||
"3": "Freq3,100MHz on Taishan",
|
||||
"4": "Freq4,125MHz on Taishan"
|
||||
},
|
||||
"kunlun": {
|
||||
"0": "Freq0,25MHz",
|
||||
"1": "Freq1,50MHz",
|
||||
"2": "Freq2,100MHz",
|
||||
"3": "Freq3,133MHz"
|
||||
}
|
||||
},
|
||||
"reserved": "reserved 6 bytes",
|
||||
"sw_reset_info": "1byte, if valid, Boot ROM write this value info Boot ROM Flag resgister and Boot ROM will issue SW reset to NOR flash if (HW reset) fuse was not blown",
|
||||
"training_pattern": "8bytes, 0x5AA5F00F_0FF0A55A is recommended",
|
||||
"normal_iamge_addr": "4bytes, shall be 4KB aligned",
|
||||
"backup_image_addr": "4bytes, shall be 4KB aligned",
|
||||
"third_image_addr": "4bytes, shall be 4KB aligned, just for taishan",
|
||||
"crc": "4bytes, bytes, automatic calculation"
|
||||
}
|
||||
}
|
||||
BIN
tools/sdtools/sign_tool/atb_fuse_ecc
Normal file
BIN
tools/sdtools/sign_tool/atb_fuse_ecc
Normal file
Binary file not shown.
4477
tools/sdtools/sign_tool/avbtool
Normal file
4477
tools/sdtools/sign_tool/avbtool
Normal file
File diff suppressed because it is too large
Load Diff
BIN
tools/sdtools/sign_tool/bin2hex
Normal file
BIN
tools/sdtools/sign_tool/bin2hex
Normal file
Binary file not shown.
18
tools/sdtools/sign_tool/keys/TestECDSAp256r1v1_ossl.pem
Normal file
18
tools/sdtools/sign_tool/keys/TestECDSAp256r1v1_ossl.pem
Normal file
@@ -0,0 +1,18 @@
|
||||
-----BEGIN EC PARAMETERS-----
|
||||
MIH3AgEBMCwGByqGSM49AQECIQD/////AAAAAQAAAAAAAAAAAAAAAP//////////
|
||||
/////zBbBCD/////AAAAAQAAAAAAAAAAAAAAAP///////////////AQgWsY12Ko6
|
||||
k+ez671VdpiGvGUdBrDMU7D2O848PifSYEsDFQDEnTYIhucEk2pmeOETnSa3gZ9+
|
||||
kARBBGsX0fLhLEJH+Lzm5WOkQPJ3A32BLeszoPShOUXYmMKWT+NC4v4af5uO5+tK
|
||||
fA+eFivOM1drMV7Oy7ZAaDe/UfUCIQD/////AAAAAP//////////vOb6racXnoTz
|
||||
ucrC/GMlUQIBAQ==
|
||||
-----END EC PARAMETERS-----
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MIIBaAIBAQQgdrUAa2PiBpc0AtzHoYR3CxwYrg4CoXVlJvOnjR49o2aggfowgfcC
|
||||
AQEwLAYHKoZIzj0BAQIhAP////8AAAABAAAAAAAAAAAAAAAA////////////////
|
||||
MFsEIP////8AAAABAAAAAAAAAAAAAAAA///////////////8BCBaxjXYqjqT57Pr
|
||||
vVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMVAMSdNgiG5wSTamZ44ROdJreBn36QBEEE
|
||||
axfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54W
|
||||
K84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8
|
||||
YyVRAgEBoUQDQgAEFcReClbX5KPRtAphtDqUT73KgZ6S3R1cmDPKeT1UpPipSvAh
|
||||
ZVFdhggPKizVsjEfuMBISp4kR4moKaSpcUTgJQ==
|
||||
-----END EC PRIVATE KEY-----
|
||||
37
tools/sdtools/sign_tool/keys/TestECDSAp256r1v1_ossl.pem.c
Normal file
37
tools/sdtools/sign_tool/keys/TestECDSAp256r1v1_ossl.pem.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/********************************************************
|
||||
* Copyright(c) 2019 Semidrive Semiconductor *
|
||||
********************************************************/
|
||||
|
||||
#include <atb_crypto.h>
|
||||
|
||||
const ecdsa_key_t TestECDSAp256r1v1_ossl = {
|
||||
32, /* prime_sz */
|
||||
/* x */
|
||||
{
|
||||
0x15, 0xc4, 0x5e, 0x0a, 0x56, 0xd7, 0xe4, 0xa3,
|
||||
0xd1, 0xb4, 0x0a, 0x61, 0xb4, 0x3a, 0x94, 0x4f,
|
||||
0xbd, 0xca, 0x81, 0x9e, 0x92, 0xdd, 0x1d, 0x5c,
|
||||
0x98, 0x33, 0xca, 0x79, 0x3d, 0x54, 0xa4, 0xf8,
|
||||
},
|
||||
/* y */
|
||||
{
|
||||
0xa9, 0x4a, 0xf0, 0x21, 0x65, 0x51, 0x5d, 0x86,
|
||||
0x08, 0x0f, 0x2a, 0x2c, 0xd5, 0xb2, 0x31, 0x1f,
|
||||
0xb8, 0xc0, 0x48, 0x4a, 0x9e, 0x24, 0x47, 0x89,
|
||||
0xa8, 0x29, 0xa4, 0xa9, 0x71, 0x44, 0xe0, 0x25,
|
||||
},
|
||||
/* d */
|
||||
{
|
||||
0x76, 0xb5, 0x00, 0x6b, 0x63, 0xe2, 0x06, 0x97,
|
||||
0x34, 0x02, 0xdc, 0xc7, 0xa1, 0x84, 0x77, 0x0b,
|
||||
0x1c, 0x18, 0xae, 0x0e, 0x02, 0xa1, 0x75, 0x65,
|
||||
0x26, 0xf3, 0xa7, 0x8d, 0x1e, 0x3d, 0xa3, 0x66,
|
||||
},
|
||||
/* k */
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
},
|
||||
};
|
||||
15
tools/sdtools/sign_tool/keys/TestRSA1024_ossl.pem
Normal file
15
tools/sdtools/sign_tool/keys/TestRSA1024_ossl.pem
Normal file
@@ -0,0 +1,15 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXAIBAAKBgQDYAHMQQv5XNT2NDqErEhxbMNidtftxhuYV4QQo2enHPHfpcnj1
|
||||
iRK2i9l9NGO6hXkIN59DttKaltvhNZH4g6WoA6LgafhfmkxlDHW3l1FmZDXfCaBS
|
||||
K8X9ETO7wx8P1S5ADD+InbFIlPVZK1nRBjMFlBhSxPm1WOpT5+QAksj/uQIDAQAB
|
||||
AoGAMXfA4kuFdjFyPDjKflOyfMvuAAhqYnCThxU2X6iwWnmluKgHvau7xmS21W7H
|
||||
HDNvKYubhOV8y/yatLQRDwoPSMRyXxQoSsI0M4PL1A6WzNbDgUIGDg3Y8XGsIBsF
|
||||
KNHhhcY1ElKLsuf02w3q6R7EWIVBRon2B9oIs+sU7dOh4aUCQQDyYciPiLP8uwzG
|
||||
29LFPyZxYpYpHzLQA6y9v2Ogn240uDPn0ugIKz+dENEPdwIsxeVeXo7WeTFtwI41
|
||||
G12ER1XjAkEA5CM8RtuNwh7Qz0q4amM+VerW2H/kooJY4Lki/APFMFOH9aQjDiV0
|
||||
LIQPcEPF7y6tZIyNYZJx3y4a+/VcR6rmswJAdea4z5EYtDwsl+LAIPB5+7eQAYrK
|
||||
hcLz2QzrImvLCNv9a6v88FRRSk6u0w35wdu1mfT3GD61m4SJ6C1ajQjCLwJBAIUr
|
||||
zFPQdb+LHXjjtSLlK84bd66JeX0jeZ40dCeIS+MZ35OUbKIlWtthe2GdLj2gkbbQ
|
||||
FPeP9MjCsR3C7Esph+ECQA0G8WSTun8PAMDEa/15mQ/y59TVYRz3isRpoJIWNyN3
|
||||
gpG8vSbzBGOC3G4aIxMUyADXKvarOYSKFhRY40kcPFM=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
27
tools/sdtools/sign_tool/keys/TestRSA2048_ossl.pem
Normal file
27
tools/sdtools/sign_tool/keys/TestRSA2048_ossl.pem
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAzOcIJRw4lD4f8Y1levlFyofB/hQklI+OjhAErbNINlG7KKvP
|
||||
Hoda1xL5oinAHuRC8dfx93i1xKhHOWw5+UhDln7HtHixmkdTD7zG1mfb40NjPV6x
|
||||
XuClYa7fxP6gsqBVCMozfr6PAvB6jWk71JLtxnxT+NP4sOPSeib7KOYBy/PDeCcM
|
||||
oZZkFMDAYpBjLW0KtAfwmuzrja654qwNLtp2u3KYIzu8fRCmRho7KGTfYXnC57Ih
|
||||
AqrYc4fI51DkAJjeS8486GpVFU1h5adrmIxCvToqJhyVX3str1zhY0NIuNn64vEn
|
||||
89SPvmaLcFNYC1v36KCNrsbuf8d4oyHbhodVAwIDAQABAoIBAERjsDJCsxe3jI3g
|
||||
9cgPvx2UJkmZi4QSTjBYZFddiXKn4OH4Rk8YOleiu7NGYBtvcHCr9NT2cyTKTct6
|
||||
tfbgCb8HXbx8tDqcJ7sO9QbG73txGIR5QJY8QLbT2Vg07InyPa+LXZimHbGLdjwQ
|
||||
ramLyNUA1j4s8cqIn82piRbjfiIGB4hpWMy7C+Ol4e7fvbFstbBMFkNd34Wf8oY9
|
||||
yPGTyrmy0viormyhRnypaVSbTH+qaSqs3SisbjfBLFqs0ZTQXXaDX8qUFTtvwkGA
|
||||
yfGqLuVuhjILejM5aG+ICJIwXtOPvfNwM/jAFg3StPnBvMDL+oeV87B7xhegoRUI
|
||||
HHo2s3ECgYEA54hUYN5Fa66xRmvGm22pa5b3k8/lBMz4e+KC/eHRJ22+HyCw7z+/
|
||||
CyWLPXPAqmr3uv0X2WhNuig5thj9V1Wn8hVqOHp4Cltc238Pj39e3oyzIr4NXKC2
|
||||
BzGJnslO5fZL5jH5gtjbKQaVLgRDVTblFvtuCFMmEfUO4Tyna2DjkzUCgYEA4o5G
|
||||
zR3hAiazciMl2x3C1gmXk7A6fxcK1SLSfNQnti6sP8NTFLVgLOHIYnK+dNQo12Gm
|
||||
Mhj50Pq4+JGYbsIXTny931SNM0FEF0AlpCCegoF/kQgebuZ4/RjpwLzp0UOjAx9U
|
||||
G9A8VdHEXWSuWhuKzkDG/6c9ElZx/P1eKx3a1lcCgYAyoRoqcJBnorS7PHgaptlE
|
||||
YKfU18Ix0YyIspiIYef1okbP0bs/JgZlrpkLIBPCcE+pwQyFCwzsJz2vdzl27pEi
|
||||
G9K1dPpo8V+V0+wYKfcZ3VSSxVJwregAHLIGWej52mjwdn8kQL1z9C+M93ut16oy
|
||||
41pFUcFibd8KG9RUY8R//QKBgQDERtMcHYi03maUudKwNOZ5nLHPZ9wmAwaFhLer
|
||||
IfqNoX3leAlgZYq/F5UNha9vc+c2QglEWdMEtFLQNwNC4bBjdTriY1Q5VY/yPMbf
|
||||
nMr28c5dDhWfqtijHZRWQNSpUdnGeLvbpNrA1w0yhGlw82+cJQ7CqlcErhPvRGrz
|
||||
G9hd3QKBgGD9i0roY8iozSQ5VlAGbMHY89bverIO6J/fKAr1AA1ExogMwu59PW+j
|
||||
HTuZy9aQEpmNqAImUOb16O3sLhFgcSi7PU/w+GqfZygySIjf+KVZdNy0NJYoDw+m
|
||||
7/rBQbAKodWtxTRSO8KS4Ew2pxgW9z30NwZLx/uNnTPOiJ4aOOQc
|
||||
-----END RSA PRIVATE KEY-----
|
||||
39
tools/sdtools/sign_tool/keys/TestRSA3072_ossl.pem
Normal file
39
tools/sdtools/sign_tool/keys/TestRSA3072_ossl.pem
Normal file
@@ -0,0 +1,39 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIG5AIBAAKCAYEA5cJQy/aElQ0BGQUOuN0fkqUrmuUFwklQwU6yvpxMet5njLin
|
||||
2fO39D+0417zj23/7jkep25adJ+XXo68rFhbddm+qIHj2wO9rL6A1y1EY0PFn654
|
||||
0lYt4EJtZLNMk3CukepvapjSGQxPIJtkPNJ0+pr/6Zhywi/bXXY6n7N5K2AW7J7L
|
||||
H9GCtM5I+xZujs3iEC6WSIZkOEf7zBZk79AGNzmG56szfN2fAA6eh5Xelf5g73R9
|
||||
qzT7f4eJdTx3ZUyRJyerEVq3WZc4XbN1q3lJM+PAu40Lf2fhs7ZGbLt0YuoCYqsL
|
||||
St//yb3f0qrvCnYDq0E0cv1gHwx3bSyZCFiL6afYpiCK3pW/ZUZyKJbVUwi/Ewde
|
||||
mYe2Q7g6v5PRmzj6tbk7e5dZ09wPkaG+SFqQ3P55mcPkzRKtIY0DUQiw8nU9l8SZ
|
||||
8LjJHMvRCrTilSEjM6EYIakv6ci1yHrG+Huvs8vaXadBZLC1MN6lSrAUSmGDE9ai
|
||||
Igj5zTGLNnT4cj17AgMBAAECggGAYhBh8+wwAn4ebdNeyUB37VtaFS6TGq24Lgms
|
||||
+PY1Hmw2vjVCTyBa74ERb8pjImDMz5zJnKTZLtW/AbjihpzfzJk3ayylWCFsn4Jf
|
||||
83d6rPOMMe+B2iS2R/WSQ1zT3kpF+DmbfF/lrJM4Yq5wRhV9oEjv2YAb2w4aDvYb
|
||||
Z3ZuzTiiEDRmdhoyM4GoXKLiZUkyp716n1HdDLiMnDsisciUHpYLIm5L94uQBbI3
|
||||
r58j9dkw/oM18BEZFwF+he9c9nuK2aQUiSVNKQNzn0ieFqHaXZp6ihLgD/hGtlZT
|
||||
H1Xj40nHlxRC8C0kGINhlJE3QcukbXI7vnG08c2FI787wTZYkN8UUcgsKKy8qAoh
|
||||
vpWUoFCVu0gY8kVRLFs7G3bfMqYCL9opk01jQrwwQPCdo921Dtxp08GgxaoEA3Pv
|
||||
+8jLp3fAxvCp+0mqqi4M6ABllsmKJOe7UVJf6ZCbjWI/edxiSE9/K2XxyrL/wp3Z
|
||||
9kvHiH0yYgKsGC8fpjGqmxPEHHAhAoHBAPWPDU/fS9TEq6+qn0Q4dK7MsGoOcsju
|
||||
75VdxIMuV//Jxr8n3d8ske5jTpIdNzMzWiJGQ5LSQM7KemKv/Au2gnrQsgpMBsrH
|
||||
a2wmESeQceYb5U1NXmWZpDw7pdWVD3GUsdJyg/OltpFoeRNCzqBT1HOXkwA/gjtL
|
||||
0MLq5k/ZLWtKSbEXWavAiEEJ0KYWTFe0UqrPEhd2ATfmz04ERdLmU8OSDTQEsLIV
|
||||
0WJqC9urLNyR0gehQwNQ/u6BqS7DIYwA7QKBwQDvh0fcs6D7Y+oKuU/y6dcfwFaH
|
||||
CgRZ2dv7vdycoOLm3OvJ6mTEnv/VpdB5htZhif2v3sdIYNT3kg9VWMdNOYEvXYcs
|
||||
Po04vDtBcD3H0BG8USNRsu7wVLAWYeY7gM1sjNkR4ASv90nck45R2Pa3oJdSlOkp
|
||||
Iqxgsk7weulHr4AoW7+/IHwWXvUnh6gcvvhuHykRIa4+f1DZx8neiGXfcZd+SQj9
|
||||
gxun6INUWliZd/JDMV9FyIRAQkACqSPFcvRLMwcCgcEA56OgTR45LGayBi4Pu4z+
|
||||
FP6l1AX5Ja6vdtlTTOPkwzgWMbBrzeD/cD9hmNfSgIwKlJZvnAqWc/vw4zNbsbji
|
||||
8PP5X1lEdvkTTpvCRu4tY4IhFoDLcVAz61XhI89PGDfKXtkDvE0wIY7J1++Hdxpd
|
||||
KQVs+Cjwsvrb3WM1C1G1VKZpSZLbVfdzENcvad1S+tDxwos/Z747e/5QxCmnrED1
|
||||
92DI768U94k5UXrz4K5izVcJJ4Vp77DyKw9JBwGvnaApAoHBAL8ibC2pCSSRLgkw
|
||||
pqNoBcnIaUOIssAgIHJZptk1aNpgH6cX6yEa33tUvW68MgXTXyQf2VXgLxD+9E1e
|
||||
cmslH/jz4RFlOLu1OHOXZTU0y3JCLLTc293bNkgmBtokhcfA/NZOtG7WHZJuDHsz
|
||||
bmxJMXcsbIHusS7YGjW7XrtdSB7sV63j9iDD1Uyd64BEw2jcZKDPB4PHhHTEAEoa
|
||||
/W+37PNQxGPHYyIxX9rH3TtZg3AqzaOZxi6grwNwhKLigB4hsQKBwAh4AOE0Lkb1
|
||||
bUPHPNnvMnmXqkGkT1gRKXbwer2u8zH5jK9G3sg1C4uT/HQZxUD67ENHLE67ZxHb
|
||||
nA8OVB/8cS5Y7dAIievG/LucNRGjcQqCsrYRPk5AseTugH4h9sphhLJPuYgYUY+K
|
||||
Soa7arobrWPHYf6LnDWtLHdLGtUzEvxqD5519Jz4AvWya7fHPUuKxBnZ7XEHn0j8
|
||||
60/D5Hg4NU0kgfE/aIgN4SzpFiJXOkc+PeaOxgX9E4lT1Y4mo40vKQ==
|
||||
-----END RSA PRIVATE KEY-----
|
||||
51
tools/sdtools/sign_tool/keys/TestRSA4096_ossl.pem
Normal file
51
tools/sdtools/sign_tool/keys/TestRSA4096_ossl.pem
Normal file
@@ -0,0 +1,51 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIJKAIBAAKCAgEA2Oj1Xf5i/UI5cT2ZrFI1wQT3GperFi+kJLlTNkpjhfxRJVuE
|
||||
IjWSmppDrO1PE3258m7aJ/QEGh+OdMu//8kCg260VrfyreXWCnM5NhIuJrtIBjHs
|
||||
LO+RT+mYjrGpLUNOpCADhEfcREjsKLJlJQW99n4wpKvWlpQgfxJld/IenfXJZaeu
|
||||
r2jdgW094FHJcIjFFH6luSsYBKj12D+orLD+Ehxvw3yqhmEknGeXyUlGZOK6pXdC
|
||||
oAMsoBHBDRbsrsCBHPlgTWd2vc1hCgOZY9yvRsp9CFu05YX+30MO0XkOWOu1f/bt
|
||||
XeLvMdh/ctwTlEl+7NqVxZV7gyrkEo/AaCDpqbBCRm6PgyicuH5oh6PXVKr5ZJ8H
|
||||
YuO+GrM5Y33yUucsRrHfaEdyRugCUKK6PwLH3OJtNGj73UNQXx1H+jVnbp20yh0Y
|
||||
8hvT+j6yM9WixH2tUN2cEmOSkikxgnhDgXJd1Z6BYja0h3C5Ikys/xtW/HGv166l
|
||||
ht+7ZcJW+wjkTqxnlsRXKVeU52OyKuQfpQCzS9szPPEYmfapBoD4Tnc97lbXEgKx
|
||||
Um/WmESaKsj8HXZueYtW1R6gfTMrMc6L5EmK/uX8S7B3ohelwytDW9FanXmxZGPm
|
||||
1dBD2xTonOHxP+jOUadms/cWE+D9xQXqw3R0pGmbXG2d+Jg+UAxaMtxVT+0CAwEA
|
||||
AQKCAgBV+vHYElA2x5txcdOKZQP9wPQaTGh64OOV0whTCuWsZLndrwsPbGDye5e7
|
||||
4k1oEnw0xxAeqjE+EagsT9+Jiqo+YxGFFmFR4TsY5VeWQVqd67q/CebuYQAexx+7
|
||||
4FyJHpb7o90BAGMlhipmb2B8bmxAWwD5JUxoX8sJ08b45raQMq9kZjVuPokfFqhi
|
||||
VMkenHhSiWkznwtkPX1F/OXlnjr3/uGmgbIuli8m+EFIfo0yzFTj5gQ43UlBIgh+
|
||||
Icor8w6653bu98Yvskt25rpUxVONIhKxz3hDSvwej7w9+Fhhkv1c/gpVHvFltsW+
|
||||
R9JTA1cWmAaqTXiqI8RIP0crf3BfIiZ0wE7FSeFzmd5u+RvlnSLZnyCVloVZL43q
|
||||
nTGCEUW6VbUH8yIKSwihSZvMrrEkE0Vn6PuPw9qqWzWTWhN3z7aGRgsC5ytLqVAX
|
||||
8K3WyTDqIx4oufcSlRTTF4JUk12D7IVBf7iJ5t5RBTrQymaftkGWCRv/6+T2PvJ3
|
||||
hrfgjRmcEM/ZI5mSGpKe6DMgKyT6TrEtDQWIBfbwHaCm2Thxz01TFqsiUgFtPdbD
|
||||
DiXlepA51oe6q4RsPO5F826KzBX4bFgW2koaCyN1pboEmH/2H5LshmnsGxiw/H9A
|
||||
joNz2OAalrnCMbmxqiVPb9UESC4nAlNeJWpVRwV+DaZy3rKgmQKCAQEA8httEO8s
|
||||
ph/IqSS+y7t0ScCs0m0v8LtorL3OEQ9uMqTeYxUSSKpd/D6eNhAXUQpooVGmE4cf
|
||||
ON3LFXS7WzR+7Rei8fzUyWuILQFNOSVRIJxNG3HvX6W9ZJWiIMy4KvOuFm74X3Z6
|
||||
LOR+OLzg2sM+cm+SWRpHYXetmGGL7DNQp13yoFF670THdWKUZbqq0Z1Cm5m3rgYQ
|
||||
F/GMnlKIsX2VbdC0TW880QqLZq+ceuT1h9e8wMD3BWRafqLD62LOHOL57Lu2sTBp
|
||||
An7iTtgQxRRFF1C1zKUaviTCYS5OwW+lJIS725pl7axBq01mxdmCgScv2PIlZk6V
|
||||
611Mok89gQ/MWwKCAQEA5VtiZQ+ymndxci/3/hln3m2cAoEfRNA0Mbus93V+/8ek
|
||||
lVrTa+3qF8kD5ijrndDmOjHk83LNsgxsrEcR1yfcZyKudwkvQVuWTtSpCGYe110Z
|
||||
FVBaogNLQcRMObB+Sg4FnK0HvVMf2zufGJI5cExf9PM+yK74Yl4bvA3teXKe2uX0
|
||||
2EgKutPXwVPt0O9y8C70JLO3YUfSRBwmGMze1/MgkJRYgUN+ZtiDha3X6LzLQXzb
|
||||
CYU9tttJvED5uboznQyR1KXLqoo15bKRYfhyGyZK1D7wcfF4e9oxbNUKNk3ngqMl
|
||||
5mbahwoezOgHy59LlNpSzINyqQSBEqsUNvjNI48nVwKCAQEAjLCrXJ/gTllB/ijA
|
||||
RxwTo5g31cBlj3sYhOl3iipxWzS7ltBz4449N4wb3EbVhd6KltQfslFfL2iTz1Aa
|
||||
YBHNgHGv2veVn8bBR4XuHjs1PcIWfNBkziw+NulNYcoVa8BXdeneo3rx3IybXNVF
|
||||
xVqYO1/ip6zBtj4ZvudQrF3VjKznhYpT6h8J2YkDu2oSQeUlA878EkCrsX5IvOgx
|
||||
TxMvdrVFUYpGySNbhryeLjxHAj24DjsUUSnT/KsRNwQfymGL4qnirGz5WN3rHO4q
|
||||
MJxq2fWo79cyBzTNUDPcyEPcr7ACisbaXJcxQh6kjmyrjen7wBJW8XDRZgi9s8Rg
|
||||
dVN86QKCAQBezVwpa8imYnKpATzfcf7mCKZwvpB/MBQy7mE7U/yvmwTjm0xCk2+s
|
||||
bzFGZGmnrN5M9ayuGCj/zHTq7OFp7pcCpmo417oJqOLDKNHJn/Rljpy8m58q0nO7
|
||||
9niPa+13jL4zGa5WSlKjmsxTKrXFPjx3kkfESdZvSnjqTVN4XLFex6hh8b1FpiTL
|
||||
S3bEYwU+VBokRYiqFDbMYlo47A28c0llmXvPymcn+Zy7l7TkBY16PzKGh+WPfKrI
|
||||
vo66f0WwR67Ll9BMaJ6ImDvRpBD+OeC6RF28q1Pi1biSRKjY83CbJfaXerIfGUbL
|
||||
6ai3ONvT5j5NPJQbWrpDTiWn50VbymM3AoIBADu2FiK5woDvf14oK+oXsexlRP9r
|
||||
ADdbNJqxYiCFrLfOzjUqiCHlcMOG9FuZsq4r1GI884QHeNXEtBt96HF5vjv3PyMG
|
||||
+OUCWeohFiYvk4EZvdXU7UjPznjmQrgZjFKAk52VINQF1Z18WAwdvNolBhe8USW+
|
||||
fMsMVkhY7mivicOrHJd+5U5BiueKUq0PdSLRaJgmPeSaJq6ilIia1CRhIxb4AgrH
|
||||
zSiP09j4t/1xiCS+ve0e/PyLFRHRZHB/hxTbkzfPrLLWgbNXjMrdJSf9qaaVepZr
|
||||
jVMoqdnX16ivavZAGcBp1mk3FR4KqEiKL3P1+Uhu4D39kX9NbOueFuxBC7U=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
9
tools/sdtools/sign_tool/keys/TestRSA512_ossl.pem
Normal file
9
tools/sdtools/sign_tool/keys/TestRSA512_ossl.pem
Normal file
@@ -0,0 +1,9 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIBOQIBAAJBAOEjGP7tNHxubh20ZGQE7MHCJDeiM46C4CeUPt2WnC2FZZrkQq72
|
||||
Q6NeSo8jxYtMeV27/d705Zad51ZdeEmmyCkCAwEAAQJAXZgGsywPjs8lzgmJVp9J
|
||||
gb9g6RPwVQWJhEq328zZ/n3Xuj0PNXajKQsx6dS8C36qIftBe0A30JMrZQOUks/I
|
||||
RQIhAPT18udqax/8dwapaYb+vS9Rih6+aA16wJ8Hr9FKWZrvAiEA60hyy2zuDoqq
|
||||
FjtDvYlskt8lS4udD7odm/g0hShlrmcCIDNeLAzJLSOs/ozAE+gCHUwB7lPaG9nP
|
||||
xvrSUtUxoS6zAiAZiUZ0T8FSsLgfK5WBl83B7xg0J9YHI/Mcv4arwSOwFwIgMmaT
|
||||
WWspG789X/Bo/3+kKClnnxAra4uPGx4CceEsqBE=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
13
tools/sdtools/sign_tool/keys/Test_secp384r1_ossl.pem
Normal file
13
tools/sdtools/sign_tool/keys/Test_secp384r1_ossl.pem
Normal file
@@ -0,0 +1,13 @@
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MIIB+gIBAQQwmizBcSupTmCA7ozjkuF/i8X5Obd8MWrnlbVHiwaYXMo520AftRE7
|
||||
1qya3rV7StbzoIIBWzCCAVcCAQEwPAYHKoZIzj0BAQIxAP//////////////////
|
||||
///////////////////////+/////wAAAAAAAAAA/////zB7BDD/////////////
|
||||
/////////////////////////////v////8AAAAAAAAAAP////wEMLMxL6fiPufk
|
||||
mI4Fa+P4LRkYHZxu/oFBEgMUCI9QE4daxlY5jYou0Z0qhcjt0+wq7wMVAKM1kmqj
|
||||
GaJ6HQCJamdzpIJ6zaxzBGEEqofKIr6LBTeOscce8yCtdG4dO2KLp5uYWfdB4IJU
|
||||
KjhVAvJdv1UpbDpUXjhydgq3NhfeSpYmLG9dnpi/kpLcKfj0Hb0omhR86doxE7Xw
|
||||
uMAKYLHOHX6BnXpDHXyQ6g5fAjEA////////////////////////////////x2NN
|
||||
gfQ3Ld9YGg2ySLCneuzsGWrMxSlzAgEBoWQDYgAElSZ5eZpT1RM/FbN6Hk353xjw
|
||||
819C1pL3N9KDcY1XobIoYCJo74HaBOHSOF1uYSAb2pbn1y1FDRMMX1CpEu28950L
|
||||
S13gKdJ8t3ji+9RfeieXeXCEaBjaAQMpBw+25l1g
|
||||
-----END EC PRIVATE KEY-----
|
||||
17
tools/sdtools/sign_tool/keys/Test_secp521r1_ossl.pem
Normal file
17
tools/sdtools/sign_tool/keys/Test_secp521r1_ossl.pem
Normal file
@@ -0,0 +1,17 @@
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MIICngIBAQRCATKKtvXM6QU/97JG1T3HTgUTmRft/GzO6bHVJ8npWh9swCk3X/r9
|
||||
NmV01CIJFj1GJ+ki9UohNvN7QT1mVhog1tPzoIIBxzCCAcMCAQEwTQYHKoZIzj0B
|
||||
AQJCAf//////////////////////////////////////////////////////////
|
||||
////////////////////////////MIGfBEIB////////////////////////////
|
||||
//////////////////////////////////////////////////////////wEQgBR
|
||||
lT65YY4cmh+SmiGgtoVA7qLacluZsxXzuLSJkY7xCeFWGTlR7H6TexZSwL07sb8H
|
||||
NXPfiD0sNPHvRR/Ua1A/AAMVANCeiAApHLhTlsxnFzkyhKqg2mS6BIGFBADGhY4G
|
||||
twQE6c2ePstmI5W0QpxkgTkFP7Uh+CivYGtNPbqhS1537+dZKP4dwSei/6jeM0iz
|
||||
wYVqQpv5fn4xwuW9ZgEYOSlqeJo7wARcil+0LH0b2Zj1RElXm0RoF6+9Fyc+ZiyX
|
||||
7nKZXvQmQMVQuQE/rQdhNTxwhqJywkCIvpR2n9FmUAJCAf//////////////////
|
||||
////////////////////////+lGGh4O/L5Zrf8wBSPcJpdA7tcm4iZxHrrtvtx6R
|
||||
OGQJAgEBoYGJA4GGAAQAufCJo3EuOwL1ug68cq4juz82F85x7BK7dfVIkWcGOAvp
|
||||
DdZWUguZACSD80V4NhRXvguTx1R/+Y/seg/1cnkPnswB9hSsAxtB2KacucOQD4DQ
|
||||
VqQJQtKBu8VpGRoNbuUMCIcHcYFmcvFbM/WD4DzZMF0eI0bGL+uw+5+0DmlN20GJ
|
||||
Ch0=
|
||||
-----END EC PRIVATE KEY-----
|
||||
BIN
tools/sdtools/sign_tool/linux/atb_signer
Normal file
BIN
tools/sdtools/sign_tool/linux/atb_signer
Normal file
Binary file not shown.
133
tools/sdtools/sign_tool/make_vbmeta.sh
Normal file
133
tools/sdtools/sign_tool/make_vbmeta.sh
Normal file
@@ -0,0 +1,133 @@
|
||||
#!/bin/bash
|
||||
|
||||
usage()
|
||||
{
|
||||
echo -e "\nUsage: make_vbmeta.sh
|
||||
Optional parameters: [-f function] [-d image-description] [-b bpt file] [-s sign parameters]
|
||||
[-o output name] [-t bpttool path] [-i include description]"
|
||||
echo "
|
||||
* [-f function]: The function to be called,default make_vbmeta.
|
||||
The options are \"make_vbmeta\",\"image_max_size_hash\",\"image_max_size_hashtree\",\"sign_dloader\".
|
||||
* [-d image-description]: The description of the images to be signed.
|
||||
This parameter is for make_vbmeta and sign_dloader.
|
||||
* [-b bpt file]: The bpt file containing the images info,such as size,type .
|
||||
This parameter is for make_vbmeta,image_max_size_hash.
|
||||
* [-i include description]Included vbmeta description.
|
||||
This parameter is for make_vbmeta.
|
||||
The output vbmeta image includes this description.
|
||||
* [-s sign parameters]: The parameters of signer.
|
||||
This parameter is for make_vbmeta.
|
||||
* [-o output name]: The output file name.
|
||||
This parameter is for make_vbmeta.
|
||||
* [-t bpttool path]: The directory that contains bpttool file.
|
||||
* [-p partition_name]: The partition name in the bpt file.
|
||||
This parameter is for image_max_size_hash and image_max_size_hashtree.
|
||||
* [-h]: This help message.
|
||||
"
|
||||
}
|
||||
|
||||
clean_up()
|
||||
{
|
||||
unset make_help make_error args
|
||||
unset usage clean_up
|
||||
}
|
||||
|
||||
# get command line options
|
||||
OLD_OPTIND=$OPTIND
|
||||
|
||||
## set default configuration
|
||||
VBMTEA_DESCIPTOR=
|
||||
BPT_ORIG_FILE=
|
||||
VBMETA_IMAGE=
|
||||
VBMETA_SIGNED_ARGS=
|
||||
BPTTOOL_DIR=
|
||||
PARTITION_NAME=
|
||||
FUNC=make_vbmeta
|
||||
INCLUDE_DESC=
|
||||
while getopts "b:d:f:i:o:p:s:t:h" args
|
||||
do
|
||||
case $args in
|
||||
f) FUNC="$OPTARG";
|
||||
;;
|
||||
d) VBMTEA_DESCIPTOR="$OPTARG";
|
||||
;;
|
||||
b) BPT_ORIG_FILE="$OPTARG";
|
||||
;;
|
||||
i) INCLUDE_DESC="$OPTARG";
|
||||
;;
|
||||
s) VBMETA_SIGNED_ARGS="$OPTARG";
|
||||
;;
|
||||
o) VBMETA_IMAGE="$OPTARG";
|
||||
;;
|
||||
t) BPTTOOL_DIR="$OPTARG";
|
||||
;;
|
||||
p) PARTITION_NAME="$OPTARG";
|
||||
;;
|
||||
h) make_help='true';
|
||||
;;
|
||||
\?) make_error='true';
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((OPTIND-1))
|
||||
if [ $# -ne 0 ]; then
|
||||
echo -e "Invalid command line ending: '$@'"
|
||||
fi
|
||||
OPTIND=$OLD_OPTIND
|
||||
if test $make_help; then
|
||||
usage && clean_up && exit 1
|
||||
elif test $make_error; then
|
||||
clean_up && exit 1
|
||||
fi
|
||||
|
||||
function image_max_size_hash
|
||||
{
|
||||
res_img_size=$(get_image_max_size "${BPT_ORIG_FILE}" "${PARTITION_NAME}" "hash" )
|
||||
res_img_size=`expr ${res_img_size} / 1048576`
|
||||
echo "${res_img_size}"
|
||||
}
|
||||
|
||||
function image_max_size_hashtree
|
||||
{
|
||||
res_img_size=$(get_image_max_size "${BPT_ORIG_FILE}" "${PARTITION_NAME}" "hashtree" )
|
||||
res_img_size=`expr ${res_img_size} / 1048576`
|
||||
echo "${res_img_size}"
|
||||
}
|
||||
|
||||
function make_vbmeta
|
||||
{
|
||||
if [[ x${INCLUDE_DESC} != x ]];then
|
||||
INCLUDE_DESC=("${INCLUDE_DESC[@]/#/--include_descriptors_from_image }")
|
||||
fi
|
||||
|
||||
VBMTEA_DESCIPTOR=$(images_add_footer ${BPT_ORIG_FILE} "${VBMTEA_DESCIPTOR}")
|
||||
VBMTEA_DESCIPTOR+=" ${INCLUDE_DESC}"
|
||||
echo "VBMTEA_DESCIPTOR:"${VBMTEA_DESCIPTOR}
|
||||
echo "INCLUDE_DESC:"${INCLUDE_DESC}
|
||||
|
||||
make_vbmeta_image "${VBMTEA_DESCIPTOR}" "${VBMETA_SIGNED_ARGS}" "${VBMETA_IMAGE}"
|
||||
}
|
||||
|
||||
function sign_dloader
|
||||
{
|
||||
VBMTEA_DESCIPTOR=(`echo ${VBMTEA_DESCIPTOR}|tr ':' ' '`)
|
||||
local IMAGE=${VBMTEA_DESCIPTOR[0]}
|
||||
local PARTITION=${VBMTEA_DESCIPTOR[1]}
|
||||
local HASH_ALG=${VBMTEA_DESCIPTOR[2]}
|
||||
|
||||
image_add_hash_footer_no_bpt "$IMAGE" "${PARTITION}" "262144" "${HASH_ALG}" "${VBMETA_SIGNED_ARGS}"
|
||||
}
|
||||
|
||||
DIR=$(dirname $0)
|
||||
export PATH=.:${DIR}:${DIR}/fec:${BPTTOOL_DIR}:${PATH}
|
||||
export LD_LIBRARY_PATH=.:${DIR}/fec:${LD_LIBRARY_PATH}
|
||||
source ${DIR}/sign_helper.sh
|
||||
|
||||
if [[ x$FUNC == x ]];then
|
||||
echo "pls specify function to be called."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
$FUNC
|
||||
exit $?
|
||||
BIN
tools/sdtools/sign_tool/scb_seq_parser
Normal file
BIN
tools/sdtools/sign_tool/scb_seq_parser
Normal file
Binary file not shown.
154
tools/sdtools/sign_tool/sign_helper.sh
Normal file
154
tools/sdtools/sign_tool/sign_helper.sh
Normal file
@@ -0,0 +1,154 @@
|
||||
#!/bin/bash
|
||||
|
||||
function get_image_max_size()
|
||||
{
|
||||
BPT_FILE=$1
|
||||
PARTITION_NAME=$2
|
||||
TYPE=$3
|
||||
MAX_SIZE=0
|
||||
|
||||
if [[ $# != 3 ]];then
|
||||
echo "get_image_max_size error param:$#" > /dev/stderr
|
||||
return -1
|
||||
fi
|
||||
|
||||
IMAGE_SIZE=`bpttool query_partition --input ${BPT_FILE} --label ${PARTITION_NAME} --type size`
|
||||
IMAGE_SIZE=`avbtool add_hash_footer --calc_max_image_size --partition_size ${IMAGE_SIZE}`
|
||||
MAX_SIZE=${IMAGE_SIZE}
|
||||
echo ${MAX_SIZE}
|
||||
}
|
||||
|
||||
function get_partition_size()
|
||||
{
|
||||
PARTITION_NAME=$1
|
||||
BPT_FILE=$2
|
||||
if [ $# != 2 ];then
|
||||
echo "get_partition_size error param:$#" > /dev/stderr
|
||||
return -1
|
||||
fi
|
||||
|
||||
IMAGE_SIZE=`bpttool query_partition --input ${BPT_FILE} --label ${PARTITION_NAME} --type size`
|
||||
echo ${IMAGE_SIZE}
|
||||
}
|
||||
|
||||
function image_add_hash_footer_no_bpt()
|
||||
{
|
||||
IMAGE=$1
|
||||
PARTITION_NAME=$2
|
||||
PARTITION_SIZE=$3
|
||||
HASH_ALG=$4
|
||||
VBMETA_SIGNED_ARGS=$5
|
||||
if [ $# != 5 ];then
|
||||
echo "image_add_hash_footer_no_bpt error param:$#" > /dev/stderr
|
||||
return -1
|
||||
fi
|
||||
|
||||
avbtool erase_footer --image ${IMAGE}
|
||||
avbtool add_hash_footer --partition_name ${PARTITION_NAME} --partition_size ${PARTITION_SIZE} --image ${IMAGE} --hash_algorithm $HASH_ALG $VBMETA_SIGNED_ARGS
|
||||
|
||||
DESCIPTOR=" --include_descriptors_from_image ${IMAGE} "
|
||||
echo ${DESCIPTOR}
|
||||
}
|
||||
|
||||
function image_add_hash_footer()
|
||||
{
|
||||
IMAGE=$1
|
||||
PARTITION_NAME=$2
|
||||
BPT_FILE=$3
|
||||
HASH_ALG=$4
|
||||
if [ $# != 4 ];then
|
||||
echo "image_add_hash_footer error param:$#" > /dev/stderr
|
||||
return -1
|
||||
fi
|
||||
|
||||
VBMETA_BLOB_DIR=`dirname ${IMAGE}`
|
||||
VBMETA_BLOB_BASE=`basename ${IMAGE}`
|
||||
VBMETA_BLOB=${VBMETA_BLOB_DIR}/${VBMETA_BLOB_BASE}.vbmeta.blob
|
||||
|
||||
PARTITION_SIZE=`bpttool query_partition --input ${BPT_FILE} --label ${PARTITION_NAME} --type size`
|
||||
avbtool erase_footer --compact_footer --image ${IMAGE}
|
||||
avbtool add_hash_footer --partition_name ${PARTITION_NAME} \
|
||||
--partition_size ${PARTITION_SIZE} \
|
||||
--image ${IMAGE} \
|
||||
--compact_footer \
|
||||
--output_vbmeta_image ${VBMETA_BLOB} \
|
||||
--do_not_append_vbmeta_image \
|
||||
--hash_algorithm $HASH_ALG
|
||||
|
||||
DESCIPTOR=" --include_descriptors_from_image ${VBMETA_BLOB} "
|
||||
echo ${DESCIPTOR}
|
||||
}
|
||||
|
||||
function images_add_footer()
|
||||
{
|
||||
BPT_ORIG_FILE=$1
|
||||
ITEMS=$2
|
||||
IMAGE=
|
||||
PARTITION_NAME=
|
||||
HASH_ALG=
|
||||
FOOTER_TYPE=
|
||||
INFOS=
|
||||
VBMTEA_DESCIPTOR=
|
||||
for item in ${ITEMS};do
|
||||
INFOS=(`echo $item | tr ':' ' '`)
|
||||
IMAGE=${INFOS[0]}
|
||||
PARTITION_NAME=${INFOS[1]}
|
||||
HASH_ALG=${INFOS[2]}
|
||||
FOOTER_TYPE=${INFOS[3]}
|
||||
if [[ x"$FOOTER_TYPE" == x"hashtree" ]];then
|
||||
VBMTEA_DESCIPTOR+=" $(image_add_hashtree_footer "${IMAGE}" "${PARTITION_NAME}" "${BPT_ORIG_FILE}" "${HASH_ALG}")"
|
||||
elif [[ x"$FOOTER_TYPE" == x"hash" ]];then
|
||||
VBMTEA_DESCIPTOR+=" $(image_add_hash_footer "${IMAGE}" "${PARTITION_NAME}" "${BPT_ORIG_FILE}" "${HASH_ALG}")"
|
||||
else
|
||||
echo "unsupported hash algorithm"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo ${VBMTEA_DESCIPTOR}
|
||||
}
|
||||
|
||||
function image_add_hashtree_footer()
|
||||
{
|
||||
IMAGE=$1
|
||||
PARTITION_NAME=$2
|
||||
BPT_FILE=$3
|
||||
HASH_ALG=$4
|
||||
FILE_TYPE=
|
||||
if [ $# != 4 ];then
|
||||
echo "image_add_hashtree_footer error param:$#" > /dev/stderr
|
||||
return -1
|
||||
fi
|
||||
|
||||
IMAGE=$(realpath $IMAGE)
|
||||
FILE_TYPE=$(file ${IMAGE})
|
||||
PARTITION_SIZE=`bpttool query_partition --input ${BPT_FILE} --label ${PARTITION_NAME} --type size`
|
||||
IMAGE_MAX_SIZE=`avbtool add_hashtree_footer --calc_max_image_size --partition_size ${PARTITION_SIZE}`
|
||||
if [[ "${FILE_TYPE}" =~ "ext4 filesystem" ]];then
|
||||
IMAGE_MAX_SIZE=$((IMAGE_MAX_SIZE/1048576))
|
||||
resize2fs ${IMAGE} "${IMAGE_MAX_SIZE}M" > /dev/null
|
||||
fi
|
||||
|
||||
avbtool erase_footer --image ${IMAGE}
|
||||
avbtool add_hashtree_footer --partition_name ${PARTITION_NAME} --partition_size ${PARTITION_SIZE} --image ${IMAGE} --hash_algorithm $HASH_ALG
|
||||
if [[ $? -ne 0 ]];then
|
||||
echo "[ERROR] fail to add hashtree for ${IMAGE}" > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
DESCIPTOR=" --include_descriptors_from_image ${IMAGE} "
|
||||
echo ${DESCIPTOR}
|
||||
}
|
||||
|
||||
function make_vbmeta_image()
|
||||
{
|
||||
DESCIPTOR=$1
|
||||
VBMETA_SIGNED_ARGS=$2
|
||||
VBMETA_FILE=$3
|
||||
|
||||
if [ $# != 3 ];then
|
||||
echo "make_vbmeta_image error param:$#" > /dev/stderr
|
||||
return -1
|
||||
fi
|
||||
|
||||
avbtool make_vbmeta_image --output ${VBMETA_FILE} ${VBMETA_SIGNED_ARGS} ${DESCIPTOR}
|
||||
return $?
|
||||
}
|
||||
BIN
tools/sdtools/sign_tool/vbmeta/keys/ca.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ca.der
Normal file
Binary file not shown.
13
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/prime256v1/ca.csr
Normal file
13
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/prime256v1/ca.csr
Normal file
@@ -0,0 +1,13 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIB/TCCAaQCAQAwTjELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQH
|
||||
DAJOSjELMAkGA1UECgwCU0QxCzAJBgNVBAsMAkNBMQswCQYDVQQDDAJDQTCCAUsw
|
||||
ggEDBgcqhkjOPQIBMIH3AgEBMCwGByqGSM49AQECIQD/////AAAAAQAAAAAAAAAA
|
||||
AAAAAP///////////////zBbBCD/////AAAAAQAAAAAAAAAAAAAAAP//////////
|
||||
/////AQgWsY12Ko6k+ez671VdpiGvGUdBrDMU7D2O848PifSYEsDFQDEnTYIhucE
|
||||
k2pmeOETnSa3gZ9+kARBBGsX0fLhLEJH+Lzm5WOkQPJ3A32BLeszoPShOUXYmMKW
|
||||
T+NC4v4af5uO5+tKfA+eFivOM1drMV7Oy7ZAaDe/UfUCIQD/////AAAAAP//////
|
||||
////vOb6racXnoTzucrC/GMlUQIBAQNCAARspewmIVD/PQlWmjsFQc+FVSLuaq+i
|
||||
22Xo4AvqgNC/iNovsb4NarxkSH1q2ZDm1HEFeVCi7ahW14oud/WGOI6QoAAwCgYI
|
||||
KoZIzj0EAwIDRwAwRAIgPi9qx1S6mheB1nhauxm5VhuEZ3syXqaLKZr/jeG7L48C
|
||||
IAnOBssfur5VbS43pQetxyrGnxCKHDqdrtNn3R0ee1xd
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/prime256v1/ca.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/prime256v1/ca.der
Normal file
Binary file not shown.
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/prime256v1/chain.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/prime256v1/chain.der
Normal file
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
-----BEGIN EC PARAMETERS-----
|
||||
MIH3AgEBMCwGByqGSM49AQECIQD/////AAAAAQAAAAAAAAAAAAAAAP//////////
|
||||
/////zBbBCD/////AAAAAQAAAAAAAAAAAAAAAP///////////////AQgWsY12Ko6
|
||||
k+ez671VdpiGvGUdBrDMU7D2O848PifSYEsDFQDEnTYIhucEk2pmeOETnSa3gZ9+
|
||||
kARBBGsX0fLhLEJH+Lzm5WOkQPJ3A32BLeszoPShOUXYmMKWT+NC4v4af5uO5+tK
|
||||
fA+eFivOM1drMV7Oy7ZAaDe/UfUCIQD/////AAAAAP//////////vOb6racXnoTz
|
||||
ucrC/GMlUQIBAQ==
|
||||
-----END EC PARAMETERS-----
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MIIBaAIBAQQgTwkAGPXvIWlCcngpMgpgIyxgER1stZ3fQqvSClJYMJSggfowgfcC
|
||||
AQEwLAYHKoZIzj0BAQIhAP////8AAAABAAAAAAAAAAAAAAAA////////////////
|
||||
MFsEIP////8AAAABAAAAAAAAAAAAAAAA///////////////8BCBaxjXYqjqT57Pr
|
||||
vVV2mIa8ZR0GsMxTsPY7zjw+J9JgSwMVAMSdNgiG5wSTamZ44ROdJreBn36QBEEE
|
||||
axfR8uEsQkf4vOblY6RA8ncDfYEt6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54W
|
||||
K84zV2sxXs7LtkBoN79R9QIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8
|
||||
YyVRAgEBoUQDQgAEbKXsJiFQ/z0JVpo7BUHPhVUi7mqvottl6OAL6oDQv4jaL7G+
|
||||
DWq8ZEh9atmQ5tRxBXlQou2oVteKLnf1hjiOkA==
|
||||
-----END EC PRIVATE KEY-----
|
||||
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/prime256v1/user.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/prime256v1/user.der
Normal file
Binary file not shown.
17
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp384r1/ca.csr
Normal file
17
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp384r1/ca.csr
Normal file
@@ -0,0 +1,17 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIICnzCCAiUCAQAwTjELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQH
|
||||
DAJOSjELMAkGA1UECgwCU0QxCzAJBgNVBAsMAkNBMQswCQYDVQQDDAJDQTCCAcww
|
||||
ggFkBgcqhkjOPQIBMIIBVwIBATA8BgcqhkjOPQEBAjEA////////////////////
|
||||
//////////////////////7/////AAAAAAAAAAD/////MHsEMP//////////////
|
||||
///////////////////////////+/////wAAAAAAAAAA/////AQwszEvp+I+5+SY
|
||||
jgVr4/gtGRgdnG7+gUESAxQIj1ATh1rGVjmNii7RnSqFyO3T7CrvAxUAozWSaqMZ
|
||||
onodAIlqZ3OkgnrNrHMEYQSqh8oivosFN46xxx7zIK10bh07Younm5hZ90HgglQq
|
||||
OFUC8l2/VSlsOlReOHJ2Crc2F95KliYsb12emL+Sktwp+PQdvSiaFHzp2jETtfC4
|
||||
wApgsc4dfoGdekMdfJDqDl8CMQD////////////////////////////////HY02B
|
||||
9Dct31gaDbJIsKd67OwZaszFKXMCAQEDYgAER16dX4J+6CwK/KkWhcZ9/bz4/G3M
|
||||
+K7nIM1XJSJ5ea7gX+qIhnl/g3VZrFPd/e2wJsAKdOL+3yLKJsxqzC/qvsuv89hw
|
||||
QtWx2Kh8pU6XH0L7VDqzsm04aZyuI4tHY8PToAAwCgYIKoZIzj0EAwIDaAAwZQIx
|
||||
AKgsd4bvR3YAzgeTkYIHPjwEQdSuzCuH0zUWKmsrq8peB7J0yAtlWijr3sYou/HD
|
||||
nwIwbWRvwEcIP5Qi+4Ulz7XaxMEbQwr9AOx5QFfqKdUE3I3LOinWZ3xt+rCwVBv7
|
||||
6vIX
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp384r1/ca.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp384r1/ca.der
Normal file
Binary file not shown.
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp384r1/chain.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp384r1/chain.der
Normal file
Binary file not shown.
@@ -0,0 +1,23 @@
|
||||
-----BEGIN EC PARAMETERS-----
|
||||
MIIBVwIBATA8BgcqhkjOPQEBAjEA////////////////////////////////////
|
||||
//////7/////AAAAAAAAAAD/////MHsEMP//////////////////////////////
|
||||
///////////+/////wAAAAAAAAAA/////AQwszEvp+I+5+SYjgVr4/gtGRgdnG7+
|
||||
gUESAxQIj1ATh1rGVjmNii7RnSqFyO3T7CrvAxUAozWSaqMZonodAIlqZ3OkgnrN
|
||||
rHMEYQSqh8oivosFN46xxx7zIK10bh07Younm5hZ90HgglQqOFUC8l2/VSlsOlRe
|
||||
OHJ2Crc2F95KliYsb12emL+Sktwp+PQdvSiaFHzp2jETtfC4wApgsc4dfoGdekMd
|
||||
fJDqDl8CMQD////////////////////////////////HY02B9Dct31gaDbJIsKd6
|
||||
7OwZaszFKXMCAQE=
|
||||
-----END EC PARAMETERS-----
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MIIB+gIBAQQwojqiPx2iKkYisB84loxsTiNNURm34cZml2q2AKwSR34pRQGrwUYJ
|
||||
UKAp8PN+68eGoIIBWzCCAVcCAQEwPAYHKoZIzj0BAQIxAP//////////////////
|
||||
///////////////////////+/////wAAAAAAAAAA/////zB7BDD/////////////
|
||||
/////////////////////////////v////8AAAAAAAAAAP////wEMLMxL6fiPufk
|
||||
mI4Fa+P4LRkYHZxu/oFBEgMUCI9QE4daxlY5jYou0Z0qhcjt0+wq7wMVAKM1kmqj
|
||||
GaJ6HQCJamdzpIJ6zaxzBGEEqofKIr6LBTeOscce8yCtdG4dO2KLp5uYWfdB4IJU
|
||||
KjhVAvJdv1UpbDpUXjhydgq3NhfeSpYmLG9dnpi/kpLcKfj0Hb0omhR86doxE7Xw
|
||||
uMAKYLHOHX6BnXpDHXyQ6g5fAjEA////////////////////////////////x2NN
|
||||
gfQ3Ld9YGg2ySLCneuzsGWrMxSlzAgEBoWQDYgAER16dX4J+6CwK/KkWhcZ9/bz4
|
||||
/G3M+K7nIM1XJSJ5ea7gX+qIhnl/g3VZrFPd/e2wJsAKdOL+3yLKJsxqzC/qvsuv
|
||||
89hwQtWx2Kh8pU6XH0L7VDqzsm04aZyuI4tHY8PT
|
||||
-----END EC PRIVATE KEY-----
|
||||
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp384r1/user.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp384r1/user.der
Normal file
Binary file not shown.
20
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp521r1/ca.csr
Normal file
20
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp521r1/ca.csr
Normal file
@@ -0,0 +1,20 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIIDRzCCAqgCAQAwQTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQH
|
||||
DAJOSjELMAkGA1UECgwCQ0ExCzAJBgNVBAsMAkNBMIICXDCCAc8GByqGSM49AgEw
|
||||
ggHCAgEBME0GByqGSM49AQECQgH/////////////////////////////////////
|
||||
/////////////////////////////////////////////////zCBngRCAf//////
|
||||
////////////////////////////////////////////////////////////////
|
||||
///////////////8BEFRlT65YY4cmh+SmiGgtoVA7qLacluZsxXzuLSJkY7xCeFW
|
||||
GTlR7H6TexZSwL07sb8HNXPfiD0sNPHvRR/Ua1A/AAMVANCeiAApHLhTlsxnFzky
|
||||
hKqg2mS6BIGFBADGhY4GtwQE6c2ePstmI5W0QpxkgTkFP7Uh+CivYGtNPbqhS153
|
||||
7+dZKP4dwSei/6jeM0izwYVqQpv5fn4xwuW9ZgEYOSlqeJo7wARcil+0LH0b2Zj1
|
||||
RElXm0RoF6+9Fyc+ZiyX7nKZXvQmQMVQuQE/rQdhNTxwhqJywkCIvpR2n9FmUAJC
|
||||
Af//////////////////////////////////////////+lGGh4O/L5Zrf8wBSPcJ
|
||||
pdA7tcm4iZxHrrtvtx6ROGQJAgEBA4GGAAQAx3wHOHEZq05oMQdpwo5P/DmWlUN9
|
||||
OEhNzAxXsJCpHZ/rLRVVKIplZ3KI7S9FU26lbSqpZGKUPT8AbuJ2t02YvvwBHU/k
|
||||
L+kLtI8DmYQYpHuC+5BUzHpkmYfBtVoeZviosTyiKthNzefWRljQrHAXEozaXUpC
|
||||
vuk/+aSGFKZdx9aCPNGgADAKBggqhkjOPQQDAgOBjAAwgYgCQgG9EsP6bY2CzlTV
|
||||
ZPtnJt6AOFegloMYJXlCYx0U8noBxG541Vqmj4kNypr5Y8gRLkxofQqRPiA0NfIm
|
||||
PgVwOVmPGAJCAfvZKZvWgQTW1a2tnuMJiCL/Iku9xF64RtSCmMvrVN88Qmyt9gCW
|
||||
KWfkn4mGq1EfQ8c5Jfgmm4Q7N2fobKlT0obc
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp521r1/ca.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp521r1/ca.der
Normal file
Binary file not shown.
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp521r1/chain.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp521r1/chain.der
Normal file
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
-----BEGIN EC PARAMETERS-----
|
||||
MIIBwgIBATBNBgcqhkjOPQEBAkIB////////////////////////////////////
|
||||
//////////////////////////////////////////////////8wgZ4EQgH/////
|
||||
////////////////////////////////////////////////////////////////
|
||||
/////////////////ARBUZU+uWGOHJofkpohoLaFQO6i2nJbmbMV87i0iZGO8Qnh
|
||||
Vhk5Uex+k3sWUsC9O7G/BzVz34g9LDTx70Uf1GtQPwADFQDQnogAKRy4U5bMZxc5
|
||||
MoSqoNpkugSBhQQAxoWOBrcEBOnNnj7LZiOVtEKcZIE5BT+1Ifgor2BrTT26oUte
|
||||
d+/nWSj+HcEnov+o3jNIs8GFakKb+X5+McLlvWYBGDkpaniaO8AEXIpftCx9G9mY
|
||||
9URJV5tEaBevvRcnPmYsl+5ymV70JkDFULkBP60HYTU8cIaicsJAiL6Udp/RZlAC
|
||||
QgH///////////////////////////////////////////pRhoeDvy+Wa3/MAUj3
|
||||
CaXQO7XJuImcR667b7cekThkCQIBAQ==
|
||||
-----END EC PARAMETERS-----
|
||||
-----BEGIN EC PRIVATE KEY-----
|
||||
MIICnQIBAQRCAW0hGzEbWc1EdTZ7ZRDo/BumhSMWQKnxFAgoz6SFpRmBYsKam0eR
|
||||
ZfoeRK/PErucfXo4DDk+Ve7IYwznJqXPEvQxoIIBxjCCAcICAQEwTQYHKoZIzj0B
|
||||
AQJCAf//////////////////////////////////////////////////////////
|
||||
////////////////////////////MIGeBEIB////////////////////////////
|
||||
//////////////////////////////////////////////////////////wEQVGV
|
||||
PrlhjhyaH5KaIaC2hUDuotpyW5mzFfO4tImRjvEJ4VYZOVHsfpN7FlLAvTuxvwc1
|
||||
c9+IPSw08e9FH9RrUD8AAxUA0J6IACkcuFOWzGcXOTKEqqDaZLoEgYUEAMaFjga3
|
||||
BATpzZ4+y2YjlbRCnGSBOQU/tSH4KK9ga009uqFLXnfv51ko/h3BJ6L/qN4zSLPB
|
||||
hWpCm/l+fjHC5b1mARg5KWp4mjvABFyKX7QsfRvZmPVESVebRGgXr70XJz5mLJfu
|
||||
cple9CZAxVC5AT+tB2E1PHCGonLCQIi+lHaf0WZQAkIB////////////////////
|
||||
///////////////////////6UYaHg78vlmt/zAFI9wml0Du1ybiJnEeuu2+3HpE4
|
||||
ZAkCAQGhgYkDgYYABADHfAc4cRmrTmgxB2nCjk/8OZaVQ304SE3MDFewkKkdn+st
|
||||
FVUoimVncojtL0VTbqVtKqlkYpQ9PwBu4na3TZi+/AEdT+Qv6Qu0jwOZhBike4L7
|
||||
kFTMemSZh8G1Wh5m+KixPKIq2E3N59ZGWNCscBcSjNpdSkK+6T/5pIYUpl3H1oI8
|
||||
0Q==
|
||||
-----END EC PRIVATE KEY-----
|
||||
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp521r1/user.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/ecdsa/secp521r1/user.der
Normal file
Binary file not shown.
27
tools/sdtools/sign_tool/vbmeta/keys/root-key.pem
Normal file
27
tools/sdtools/sign_tool/vbmeta/keys/root-key.pem
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQEAzOcIJRw4lD4f8Y1levlFyofB/hQklI+OjhAErbNINlG7KKvP
|
||||
Hoda1xL5oinAHuRC8dfx93i1xKhHOWw5+UhDln7HtHixmkdTD7zG1mfb40NjPV6x
|
||||
XuClYa7fxP6gsqBVCMozfr6PAvB6jWk71JLtxnxT+NP4sOPSeib7KOYBy/PDeCcM
|
||||
oZZkFMDAYpBjLW0KtAfwmuzrja654qwNLtp2u3KYIzu8fRCmRho7KGTfYXnC57Ih
|
||||
AqrYc4fI51DkAJjeS8486GpVFU1h5adrmIxCvToqJhyVX3str1zhY0NIuNn64vEn
|
||||
89SPvmaLcFNYC1v36KCNrsbuf8d4oyHbhodVAwIDAQABAoIBAERjsDJCsxe3jI3g
|
||||
9cgPvx2UJkmZi4QSTjBYZFddiXKn4OH4Rk8YOleiu7NGYBtvcHCr9NT2cyTKTct6
|
||||
tfbgCb8HXbx8tDqcJ7sO9QbG73txGIR5QJY8QLbT2Vg07InyPa+LXZimHbGLdjwQ
|
||||
ramLyNUA1j4s8cqIn82piRbjfiIGB4hpWMy7C+Ol4e7fvbFstbBMFkNd34Wf8oY9
|
||||
yPGTyrmy0viormyhRnypaVSbTH+qaSqs3SisbjfBLFqs0ZTQXXaDX8qUFTtvwkGA
|
||||
yfGqLuVuhjILejM5aG+ICJIwXtOPvfNwM/jAFg3StPnBvMDL+oeV87B7xhegoRUI
|
||||
HHo2s3ECgYEA54hUYN5Fa66xRmvGm22pa5b3k8/lBMz4e+KC/eHRJ22+HyCw7z+/
|
||||
CyWLPXPAqmr3uv0X2WhNuig5thj9V1Wn8hVqOHp4Cltc238Pj39e3oyzIr4NXKC2
|
||||
BzGJnslO5fZL5jH5gtjbKQaVLgRDVTblFvtuCFMmEfUO4Tyna2DjkzUCgYEA4o5G
|
||||
zR3hAiazciMl2x3C1gmXk7A6fxcK1SLSfNQnti6sP8NTFLVgLOHIYnK+dNQo12Gm
|
||||
Mhj50Pq4+JGYbsIXTny931SNM0FEF0AlpCCegoF/kQgebuZ4/RjpwLzp0UOjAx9U
|
||||
G9A8VdHEXWSuWhuKzkDG/6c9ElZx/P1eKx3a1lcCgYAyoRoqcJBnorS7PHgaptlE
|
||||
YKfU18Ix0YyIspiIYef1okbP0bs/JgZlrpkLIBPCcE+pwQyFCwzsJz2vdzl27pEi
|
||||
G9K1dPpo8V+V0+wYKfcZ3VSSxVJwregAHLIGWej52mjwdn8kQL1z9C+M93ut16oy
|
||||
41pFUcFibd8KG9RUY8R//QKBgQDERtMcHYi03maUudKwNOZ5nLHPZ9wmAwaFhLer
|
||||
IfqNoX3leAlgZYq/F5UNha9vc+c2QglEWdMEtFLQNwNC4bBjdTriY1Q5VY/yPMbf
|
||||
nMr28c5dDhWfqtijHZRWQNSpUdnGeLvbpNrA1w0yhGlw82+cJQ7CqlcErhPvRGrz
|
||||
G9hd3QKBgGD9i0roY8iozSQ5VlAGbMHY89bverIO6J/fKAr1AA1ExogMwu59PW+j
|
||||
HTuZy9aQEpmNqAImUOb16O3sLhFgcSi7PU/w+GqfZygySIjf+KVZdNy0NJYoDw+m
|
||||
7/rBQbAKodWtxTRSO8KS4Ew2pxgW9z30NwZLx/uNnTPOiJ4aOOQc
|
||||
-----END RSA PRIVATE KEY-----
|
||||
9
tools/sdtools/sign_tool/vbmeta/keys/user-key.pub
Normal file
9
tools/sdtools/sign_tool/vbmeta/keys/user-key.pub
Normal file
@@ -0,0 +1,9 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA15Q1flMmMtIBd1QZ3nkG
|
||||
DXZk2yfXTv4Di4w4P/+kI0LyPIGDKCAKXXP4uCfR4Sz4dDGNjVFAKJm6/3NXJyY1
|
||||
uZ5kO10HBVuZ0CbDde06tYh2qTUgxV6yf2PXMt1DdvvcI0V+k81jMxn838sjLWq2
|
||||
zhUfyawZeOLgsr93IrByP8tt2z1F5acvazsVxCiEOzji4hzUBB32AL0L+m+ecQPL
|
||||
TO1p40kLFp6NVfl5cPinynJhRIwvOkl3Sra3r+FkXa0PeNU3M5hdJ9Jsbw8j2RDN
|
||||
7MisOh0Cjqb3m4tasF9iE6iuT5PctVUJBdBJuwt7LZCC5TmxwVvgL7fsXaokA5PU
|
||||
SQIDAQAB
|
||||
-----END PUBLIC KEY-----
|
||||
16
tools/sdtools/sign_tool/vbmeta/keys/user.csr
Normal file
16
tools/sdtools/sign_tool/vbmeta/keys/user.csr
Normal file
@@ -0,0 +1,16 @@
|
||||
-----BEGIN CERTIFICATE REQUEST-----
|
||||
MIICkzCCAXsCAQAwTjELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkpTMQswCQYDVQQH
|
||||
DAJOSjELMAkGA1UECgwCU0QxCzAJBgNVBAsMAlNXMQswCQYDVQQDDAJTVzCCASIw
|
||||
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANeUNX5TJjLSAXdUGd55Bg12ZNsn
|
||||
107+A4uMOD//pCNC8jyBgyggCl1z+Lgn0eEs+HQxjY1RQCiZuv9zVycmNbmeZDtd
|
||||
BwVbmdAmw3XtOrWIdqk1IMVesn9j1zLdQ3b73CNFfpPNYzMZ/N/LIy1qts4VH8ms
|
||||
GXji4LK/dyKwcj/Lbds9ReWnL2s7FcQohDs44uIc1AQd9gC9C/pvnnEDy0ztaeNJ
|
||||
CxaejVX5eXD4p8pyYUSMLzpJd0q2t6/hZF2tD3jVNzOYXSfSbG8PI9kQzezIrDod
|
||||
Ao6m95uLWrBfYhOork+T3LVVCQXQSbsLey2QguU5scFb4C+37F2qJAOT1EkCAwEA
|
||||
AaAAMA0GCSqGSIb3DQEBCwUAA4IBAQBZ4+Onu7Mw16vYzoh2D8ofqfvUdov05T1O
|
||||
grWxOyc1JHdc9u5YDyBiKVTWgtrz6EwcKtC1BUbFc2eOd5uiB550fv4w/Ummb3OW
|
||||
PhZ92zek0nfqzjaGa1UtYvwxYAx7ZSRBtH98vbchCtHqyPAqlRTm2BGaPRxutLl6
|
||||
b4FYTQOPH/nEC9Bmf6enrioUUY92uAAi291BpXCAdrEn3u9i+EV+xAKKcv3Fby8b
|
||||
KOGEOxEMw+/ORQ40M3C0DLsYeFu0vX9YhCX7NZjE2jimB316L72NfCir0Kk8l5Qg
|
||||
k56Ismz1cI606deonpz17LqzZfhOZ6v6TzXokq9b8in0GcBb9wMh
|
||||
-----END CERTIFICATE REQUEST-----
|
||||
BIN
tools/sdtools/sign_tool/vbmeta/keys/user.der
Normal file
BIN
tools/sdtools/sign_tool/vbmeta/keys/user.der
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user