Skip to content
Snippets Groups Projects
Commit a66f79f9 authored by Tingwei Zhang's avatar Tingwei Zhang
Browse files

dcc_parser: Fix offset type descriptor parse issue

Write indicator only works for address type descriptor. Move the
checker into address type case. This fixes an issue in offset type
descriptor if len2 is above 64. Check empty indicator 0xdededede
before parsing the descriptor.

Change-Id: I49acf1a86f92965584b16348cb14cc453e1a3669
parent 837d31c1
No related branches found
No related tags found
No related merge requests found
...@@ -99,6 +99,8 @@ def read_config(config_pt): ...@@ -99,6 +99,8 @@ def read_config(config_pt):
on_zero_link_len = -1 on_zero_link_len = -1
#word size #word size
track_len = 4 track_len = 4
#empty SRAM is filled with 0xdededede
empty_ind = 0xdededede
if options.config_offset is not None: if options.config_offset is not None:
config_pt.seek(int(options.config_offset, 16), 1) config_pt.seek(int(options.config_offset, 16), 1)
...@@ -121,12 +123,15 @@ def read_config(config_pt): ...@@ -121,12 +123,15 @@ def read_config(config_pt):
descriptor = val & (0x3 << 30) descriptor = val & (0x3 << 30)
read_write_ind = val & (0x1 << 28) read_write_ind = val & (0x1 << 28)
if read_write_ind == dcc_write_ind: if val == empty_ind:
config_pt.seek(8, 1) config_pt.seek(8, 1)
elif descriptor == address_descriptor: elif descriptor == address_descriptor:
base = ((val & 0x0FFFFFFF) << 4) if read_write_ind == dcc_write_ind:
offset = 0 config_pt.seek(8, 1)
length = 1 else:
base = ((val & 0x0FFFFFFF) << 4)
offset = 0
length = 1
elif descriptor == link_descriptor: elif descriptor == link_descriptor:
for i in range(0, 2): for i in range(0, 2):
offset = offset + (val & 0xFF) * 4 + (length - 1) * track_len offset = offset + (val & 0xFF) * 4 + (length - 1) * track_len
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment