Skip to content
Snippets Groups Projects
Commit 9e570006 authored by Laura Abbott's avatar Laura Abbott
Browse files

linux-ramdump-parser-v2: Conditionally add phys offset for socinfo

Commit 3d6a90bd
(linux-ramdump-parser-v2: Don't use ram start address in socinfo)
corrected the case for --auto-dump detection but broke the case of
specifying ram files manually with addresses. When specifying the
addresses manually, the addresses given are correct so the ram start
does need to be added. Correct the code to add the offset by default
but not add when doing autodetection.

Change-Id: I50d54a932210afeace49a898dd819dc46c3e3aa1
parent def47c54
Branches
No related tags found
No related merge requests found
......@@ -612,7 +612,7 @@ class RamDump():
first_mem = open(first_mem_path, 'rb')
# put some dummy data in for now
self.ebi_files = [(first_mem, 0, 0xffff0000, first_mem_path)]
if not self.get_hw_id():
if not self.get_hw_id(add_offset=False):
return False
first_mem_end = self.ebi_start + os.path.getsize(first_mem_path) - 1
self.ebi_files = [
......@@ -705,7 +705,7 @@ class RamDump():
else:
return self.read_word(self.tz_addr, False)
def get_hw_id(self):
def get_hw_id(self, add_offset=True):
heap_toc_offset = self.field_offset('struct smem_shared', 'heap_toc')
if heap_toc_offset is None:
print_out_str(
......@@ -734,6 +734,8 @@ class RamDump():
print_out_str('smem_addr = {0:x}'.format(board.smem_addr))
socinfo_start_addr = board.smem_addr + heap_toc_offset + smem_heap_entry_size * SMEM_HW_SW_BUILD_ID + offset_offset
if add_offset:
socinfo_start_addr += board.ram_start
soc_start = self.read_int(socinfo_start_addr, False)
if trace is True:
print_out_str('Read from {0:x}'.format(socinfo_start_addr))
......@@ -745,6 +747,8 @@ class RamDump():
continue
socinfo_start = board.smem_addr + soc_start
if add_offset:
socinfo_start += board.ram_start
if trace:
print_out_str('socinfo_start {0:x}'.format(socinfo_start))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment