mirror of
https://github.com/bkerler/mtkclient.git
synced 2024-11-14 19:25:05 -05:00
Improve memdump command
This commit is contained in:
parent
1c935b2776
commit
c407dd79cc
3 changed files with 28 additions and 4 deletions
|
@ -677,10 +677,32 @@ class DA_handler(metaclass=LogBase):
|
|||
directory = args.directory
|
||||
if not os.path.exists(directory):
|
||||
os.mkdir(directory)
|
||||
self.da_peek(addr=0, length=0x11200000,
|
||||
dramaddr = 0x20000000
|
||||
dramsize = 0xE0000000
|
||||
bromaddr = 0
|
||||
bromsize = 0x200000
|
||||
sramaddr = 0x200000
|
||||
sramsize = 0x11200000
|
||||
efuseaddr = 0x11C10000
|
||||
efusesize = 0x10000
|
||||
if self.mtk.config.dram is not None:
|
||||
dramaddr = self.mtk.config.dram.base_address
|
||||
dramsize = self.mtk.config.dram.size
|
||||
if self.mtk.config.sram is not None:
|
||||
sramaddr = self.mtk.config.sram.base_address
|
||||
sramsize = self.mtk.config.sram.size
|
||||
self.info("Dumping brom...")
|
||||
self.da_peek(addr=bromaddr, length=bromsize,
|
||||
filename=os.path.join(directory, "dump_brom.bin"))
|
||||
self.da_peek(addr=0x20000000, length=0xE0000000,
|
||||
filename=os.path.join(directory, "dump_ram.bin"))
|
||||
self.info("Dumping sram...")
|
||||
self.da_peek(addr=sramaddr, length=sramsize,
|
||||
filename=os.path.join(directory, "dump_sram.bin"))
|
||||
self.info("Dumping dram...")
|
||||
self.da_peek(addr=dramaddr, length=dramsize,
|
||||
filename=os.path.join(directory, "dump_dram.bin"))
|
||||
self.info("Dumping efuse...")
|
||||
self.da_peek(addr=efuseaddr, length=efusesize,
|
||||
filename=os.path.join(directory, "dump_efuse.bin"))
|
||||
elif subcmd == "poke":
|
||||
addr = getint(args.address)
|
||||
filename = args.filename
|
||||
|
|
|
@ -1056,7 +1056,7 @@ class DAXFlash(metaclass=LogBase):
|
|||
return False
|
||||
|
||||
def reinit(self, display=False):
|
||||
self.sram, self.dram = self.get_ram_info()
|
||||
self.config.sram, self.config.dram = self.get_ram_info()
|
||||
self.emmc = self.get_emmc_info(display)
|
||||
self.nand = self.get_nand_info(display)
|
||||
self.nor = self.get_nor_info(display)
|
||||
|
|
|
@ -60,6 +60,8 @@ class Mtk_Config(metaclass=LogBase):
|
|||
self.gpt_settings = None
|
||||
self.hwparam = None
|
||||
self.hwparam_path = "logs"
|
||||
self.sram = None
|
||||
self.dram = None
|
||||
if loglevel == logging.DEBUG:
|
||||
logfilename = os.path.join("logs", "log.txt")
|
||||
fh = logging.FileHandler(logfilename)
|
||||
|
|
Loading…
Reference in a new issue