Add option for --uartloglevel

This commit is contained in:
Bjoern Kerler 2023-06-11 20:12:39 +02:00
parent 66d91f0669
commit e8d1827eff
No known key found for this signature in database
GPG key ID: 52E823BB96A55380
4 changed files with 28 additions and 1 deletions

20
mtk
View file

@ -826,6 +826,26 @@ if __name__ == '__main__':
da_dump.add_argument('--noreconnect', action="store_true", help='Disable reconnect')
da_rpmb.add_argument('--noreconnect', action="store_true", help='Disable reconnect')
parser_script.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_printgpt.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_footer.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_e.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_es.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_wl.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_wf.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_w.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_rs.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_rf.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_rl.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_gpt.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
parser_r.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
da_keys.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
da_unlock.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
da_peek.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
da_poke.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
da_dump.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
da_rpmb.add_argument('--uartloglevel', help='Set uart log level (0=Trace, 2=Normal)')
args = parser.parse_args()
cmd = args.cmd
if cmd not in cmds:

View file

@ -124,6 +124,7 @@ class DAconfig(metaclass=LogBase):
self.boot2size = 0
self.flashtype = "emmc"
self.reconnect = self.config.reconnect
self.uartloglevel = self.config.uartloglevel
self.sparesize = 0
self.readsize = 0
self.pagesize = 512

View file

@ -1046,7 +1046,7 @@ class DAXFlash(metaclass=LogBase):
def setup_env(self):
if self.xsend(self.Cmd.SETUP_ENVIRONMENT):
da_log_level = 0
da_log_level = int(self.daconfig.uartloglevel)
log_channel = 1
system_os = self.FtSystemOSE.OS_LINUX
ufs_provision = 0x0

View file

@ -44,6 +44,12 @@ class ArgHandler(metaclass=LogBase):
config.reconnect = not args.noreconnect
except AttributeError:
pass
config.uartloglevel = 2
try:
if args.uartloglevel is not None:
config.uartloglevel = args.uartloglevel
except AttributeError:
pass
try:
if args.payload is not None:
config.payloadfile = args.payload