blob: 31c9e574fda81690de225c06b9bd3504cba4dcde (
plain)
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
# PDBG
pdbg is a simple application to allow debugging of the host POWER
processors from the BMC. It works in a similar way to JTAG programmers
for embedded system development in that it allows you to access GPRs,
SPRs and system memory.
A remote gdb sever is under development to allow integration with
standard debugging tools.
## Usage
The BMC must first be put into debug mode to allow access to the
relevant GPIOs:
`ipmitool -H <host> -U <username> -P <password> raw 0x3a 0x01`
Usage is straight forward:
```
$ ./pdbg --help
Usage: ./pdbg [options] command ...
Options:
-c, --chip=chip
-t, --thread=thread
-h, --help
Commands:
getcfam <address>
putcfam <address> <value>
getscom <address>
putscom <address> <value>
getmem <address> <count>
getgpr <gpr>
getnia
getspr <spr>
stopchip
startchip <threads>
threadstatus
```
### Probe chip and processor numbers
```
$ ./pdbg probe
Probing for valid processors...
Processor-ID 0: 0x220ea04980000000
Chiplet-ID 2 present
Chiplet-ID 3 present
Chiplet-ID 4 present
Chiplet-ID 5 present
Chiplet-ID 6 present
Chiplet-ID 8 present
Chiplet-ID 9 present
Chiplet-ID 10 present
Chiplet-ID 12 present
Chiplet-ID 13 present
Chiplet-ID 14 present
Processor-ID 3: 0x220ea04982000000
Chiplet-ID 1 present
Chiplet-ID 2 present
Chiplet-ID 5 present
Chiplet-ID 6 present
Chiplet-ID 9 present
Chiplet-ID 10 present
Chiplet-ID 11 present
Chiplet-ID 12 present
Chiplet-ID 13 present
Chiplet-ID 14 present
```
Chiplet-IDs are core/chip numbers which should be passed as arguments
to `-c` when performing operations such as getgpr that operate on
particular cores. Processor-IDs should be passed as arguments to `-p` to
operate on different processor chips.
### Read SCOM register
```
$ ./pdbg getscom 0xf000f
0xf000f: 0x220ea04980000000
```
### Write SCOM register on secondary processor
`$ ./pdbg -p 3 putscom 0x8013c02 0x0`
### Read GPR on core/chip 2
```
$ ./pdbg -c 2 getgpr 2
r2 = 0xc00000000174fd00
```
### Read SPR 8 (LR) on core/chip 2
```
$ ./pdbg -c 2 getspr 8
spr8 = 0xc000000000011824
```
### Stop thread execution on core/chip 2
```
$ ./pdbg -c 2 stopchip
Previously active thread mask: 0x00
Thread 0 is STOPPED
Thread 1 is STOPPED
Thread 2 is STOPPED
Thread 3 is STOPPED
Thread 4 is STOPPED
Thread 5 is STOPPED
Thread 6 is STOPPED
Thread 7 is STOPPED
```
### Get execution state on core/chip 2
```
$ ./pdbg -c 2 threadstatus
Thread 0 is STOPPED
Thread 1 is STOPPED
Thread 2 is STOPPED
Thread 3 is STOPPED
Thread 4 is STOPPED
Thread 5 is STOPPED
Thread 6 is STOPPED
Thread 7 is STOPPED
```
### Restart thread execution on core/chip 2
The first parameter is the active thread mask returned when stopping
the chip.
```
$ ./pdbg -c 2 startchip 0x00
Thread 0 is RUNNING
Thread 1 is RUNNING
Thread 2 is RUNNING
Thread 3 is RUNNING
Thread 4 is RUNNING
Thread 5 is RUNNING
Thread 6 is RUNNING
Thread 7 is RUNNING
```
|