Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tools
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
vendor
qcom-opensource
tools
Commits
678f4213
Commit
678f4213
authored
5 years ago
by
qctecmdr
Committed by
Gerrit - the friendly Code Review server
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "dcc_parser: Print DCC data from SRAM even if APB file is missing"
parents
498b775b
f9a2adc5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dcc_parser/dcc_parser.py
+45
-26
45 additions, 26 deletions
dcc_parser/dcc_parser.py
with
45 additions
and
26 deletions
dcc_parser/dcc_parser.py
+
45
−
26
View file @
678f4213
...
...
@@ -15,6 +15,7 @@ import logging.handlers
import
os
import
struct
import
sys
import
re
from
optparse
import
OptionParser
...
...
@@ -72,12 +73,12 @@ def read_data(data_pt):
return
nr
list_nr
=
[]
def
read_config
(
config_pt
):
list_nr
=
[]
list_nr
.
append
(
0
)
offset
=
0
base
=
0
list_nr
.
append
(
0
)
if
options
.
version
is
None
:
address_descriptor
=
0x1
<<
31
link_descriptor
=
0
...
...
@@ -102,9 +103,6 @@ def read_config(config_pt):
#empty SRAM is filled with 0xdededede
empty_ind
=
0xdededede
if
options
.
config_offset
is
not
None
:
config_pt
.
seek
(
int
(
options
.
config_offset
,
16
),
1
)
if
options
.
config_loopoffset
is
not
None
:
config_loopoffset
=
int
(
options
.
config_loopoffset
)
else
:
...
...
@@ -139,7 +137,6 @@ def read_config(config_pt):
length
=
(
val
&
0x7f
)
val
=
val
>>
link_second_arg
if
length
!=
0
:
list_nr
.
append
(
length
+
list_nr
[
-
1
])
add_addr
(
base
,
offset
,
length
)
...
...
@@ -227,6 +224,23 @@ def dump_regs(options):
dump_regs_xml
(
options
)
def
read_data_atb
(
atb_data_pt
):
for
line
in
atb_data_pt
:
if
"
ATID
\"
: 65,
\"
OpCode
\"
:
\"
D8
\"
"
in
line
:
data1
=
""
for
i
in
range
(
4
):
data_byte_re
=
re
.
match
(
"
\{
\"
ATID
\"
: 65,
\"
OpCode
\"
:
\"
D8
\"
,
\"
Payload
\"
:
"
"
\"
0x([0-9A-Fa-f][0-9A-Fa-f])
\"
\}
"
,
line
)
if
data_byte_re
:
data1
=
(
data_byte_re
.
group
(
1
))
+
data1
else
:
log
.
error
(
"
ATB file format wrong
"
)
exit
(
1
)
if
i
<
3
:
line
=
atb_data_pt
.
next
()
data
.
append
(
int
(
data1
,
16
))
if
__name__
==
'
__main__
'
:
usage
=
'
usage: %prog [options to print]. Run with --help for more details
'
parser
=
OptionParser
(
usage
)
...
...
@@ -290,29 +304,34 @@ if __name__ == '__main__':
log
.
error
(
"
Do you have read permissions on the path?
"
)
sys
.
exit
(
1
)
if
options
.
atbfile
is
not
None
:
try
:
atb_file
=
open
(
options
.
atbfile
,
'
rb
'
)
except
:
log
.
error
(
"
could not open path {0}
"
.
format
(
options
.
atbfile
))
log
.
error
(
"
Do you have read permissions on the path?
"
)
sys
.
exit
(
1
)
count
=
0
while
True
:
count
=
read_config
(
sram_file
)
if
options
.
atbfile
is
None
:
atb_file
=
sram_file
if
options
.
config_offset
is
not
None
:
sram_file
.
seek
(
int
(
options
.
config_offset
,
16
),
1
)
if
read_data
(
sram_file
):
log
.
error
(
'
Couldn
\'
t read complete data.
'
)
break
count
=
read_config
(
sram_file
)
if
new_linked_list
(
sram_file
)
is
False
:
parsed_data
=
log_init
(
'
PARSED_DATA
'
,
options
.
outdir
,
options
.
outfile
)
dump_regs
(
options
)
break
if
options
.
atbfile
is
None
:
atb_file
=
sram_file
if
read_data
(
sram_file
):
log
.
error
(
'
Couldn
\'
t read complete data.
'
)
sys
.
exit
(
1
)
parsed_data
=
log_init
(
'
PARSED_DATA
'
,
options
.
outdir
,
options
.
outfile
)
if
new_linked_list
(
sram_file
):
if
options
.
atbfile
is
not
None
:
try
:
atb_file
=
open
(
options
.
atbfile
,
'
rb
'
)
read_config
(
sram_file
)
read_data_atb
(
atb_file
)
except
:
log
.
error
(
"
could not open path {0}
"
.
format
(
options
.
atbfile
))
log
.
error
(
"
Do you have read permissions on the path?
"
)
dump_regs
(
options
)
sys
.
exit
(
1
)
dump_regs
(
options
)
sram_file
.
close
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment