-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathREADME
More file actions
124 lines (98 loc) · 2.96 KB
/
README
File metadata and controls
124 lines (98 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
regdump is a simple program, which dumps registers bit meanings.
It growed while porting U-Boot and Linux to a lot of boards,
and it is not best c code ... maybe it is worth to recode it,
or better use another language then C ... but the benefit
from C is, that regdump can be compiled on the target which
running linux, and regdump can read the register values
through /dev/mem ... not all embedded targets have for
example a phyton compiler ... which I nowadys would prefer
for recoding regdump ...
Regdump needs 2 files:
- registerdescription file:
contains the register descriptions for the cpu/soc
structure:
SOC_Name
{
register_name register_address register_bit_size
{
BIT_name BIT_start BIT_stop defaultvalue
}
}
comment are marked with a previous '#' and allowed at a start of line, or at
end of a line.
Example:
AM1808
{
CE3CFG 0x68000014 32
CE4CFG 0x68000018 32
CE5CFG 0x6800001c 32
CE2CFG 0x68000010 32
{
SS 31 31 0
EW 30 30 0
W_SETUP 29 26 f
W_STROBE 25 20 3f
W_HOLD 19 17 7
R_SETUP 16 13 f
R_STROBE 12 7 3f
R_HOLD 6 4 7
TA 3 2 3
ASIZE 1 0 0
}
}
You can add a description of each register field, for example
SS 31 31 0 0=this is a comment 1=this another comment
Which gets printed.
- register file:
a simple list of register/value pairs, which get parsed from the program.
structure:
registername value comment
with
registername: name of the register defined in the
registerdescription file
value: value of the register
remark:
if the regdump program gets a third commandline parameter
the value gets ignored, and instead the regdump program
reads the content of the registers address through /dev/mem.
If this parameter is 8, the program instead prints a list
of all registers, with the format regname register_address register_size
(This file can used in u-boot to create a register dump with u-boot
with the regdump command in u-boot (Todo!). U-Boot should
print register_name register_value file, which then can be
passed to the regdump program ... So it is possible to
compare a U-Boot register setting with a Linux register setting.
If it contains only one column, the registervalue
gets read through /dev/mem.
Example:
CE3CFG 04222310
CE2CFG 08624311
With the above two example files, a regdump prints:
$ ./regdump am1808.reg cmc_reg.reg
--------------------------------------
CE3CFG@68000014 32 bit val: 4222310
SS 0 : 1=look into manual 0=look also into the manual
EW 0
W_SETUP 1
W_STROBE 2
W_HOLD 1
R_SETUP 1
R_STROBE 6
R_HOLD 1
TA 0
ASIZE 0
--------------------------------------
CE2CFG@68000010 32 bit val: 8624311
SS 0 : 1=look into manual 0=look also into the manual
EW 0
W_SETUP 2
W_STROBE 6
W_HOLD 1
R_SETUP 2
R_STROBE 6
R_HOLD 1
TA 0
ASIZE 1
- in testout directory are examples from some boards
- regdump has a self test script, called validate_regdump.sh
if you change something, please run it!