Skip to content

Commit e240ea5

Browse files
krystian-hebelIgor BagnuckimacpijanSergiiDmytruk
authored
devnotes/power9_core_starting.md: initial version (#39)
* devnotes/power9_core_starting.md: initial version Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: initial description Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: further progress Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: more of the same Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: hostbug Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.4: first part of analysis Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.4: finish analysis Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: few more functions Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: start analyzing Pstate structures Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: parse #W Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: further function analysis Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: parse gppb_init() Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: LPPB and WOF data Signed-off-by: Krystian Hebel <[email protected]> * isteps/15.1: OCC PPB, CME Pstate info and headers Signed-off-by: Krystian Hebel <[email protected]> * devnotes/homer.md: describe sources of data in HOMER Signed-off-by: Krystian Hebel <[email protected]> * Analysis of _fetch_and_insert_vpd_rings (#44) * documentation.md: Update flashing instructions * Add extracted /proc/config.gz from original image * Add readme * Add date of dump * Document power management (#43) * Document power management Signed-off-by: Igor Bagnucki <[email protected]> * Add pnor layout doc (#42) * Add pnor layout doc * Visual changes * Add known informations about partitions * Add information about usage in coreboot * Add info about units used * Review fixes and more info about partitions * Verify what partitions are required by coreboot * fix formatting Signed-off-by: Igor Bagnucki <[email protected]> * review fixes Signed-off-by: Igor Bagnucki <[email protected]> * fix MEMD description Signed-off-by: Igor Bagnucki <[email protected]> * Fix MEMD description in partition layout table * Start analysis of _fetch_and_insert_vpd_rings Signed-off-by: Igor Bagnucki <[email protected]> * More analysis of fetch_and_insert Signed-off-by: Igor Bagnucki <[email protected]> * Next part of analysis Signed-off-by: Igor Bagnucki <[email protected]> * Analysis of reading MVPD from PNOR Signed-off-by: Igor Bagnucki <[email protected]> * Start decoding vpd structure Signed-off-by: Igor Bagnucki <[email protected]> * Remove accidental changes Signed-off-by: Igor Bagnucki <[email protected]> * Remove accidental changes part 2 Signed-off-by: Igor Bagnucki <[email protected]> * Restore correct file name Signed-off-by: Igor Bagnucki <[email protected]> * Document structure of MVPD partition Signed-off-by: Igor Bagnucki <[email protected]> * Fix a typo Signed-off-by: Igor Bagnucki <[email protected]> * Improve formating Signed-off-by: Igor Bagnucki <[email protected]> * Typos Signed-off-by: Igor Bagnucki <[email protected]> * Add description of RT keyword Signed-off-by: Igor Bagnucki <[email protected]> * Analyze functions extracting ring from MVPD Signed-off-by: Igor Bagnucki <[email protected]> * Fix typo Signed-off-by: Igor Bagnucki <[email protected]> * Analyze apply_overlays_ring() function Signed-off-by: Igor Bagnucki <[email protected]> * Simplification of code associated with TOR Signed-off-by: Igor Bagnucki <[email protected]> * Analysis of variables in get_ring_from_ring_section() Signed-off-by: Igor Bagnucki <[email protected]> * Code simpleifaction Signed-off-by: Igor Bagnucki <[email protected]> Co-authored-by: Maciej Pijanowski <[email protected]> * power9_core_starting.md: describe SGPE debugging, script for dumping OCC SRAM Signed-off-by: Krystian Hebel <[email protected]> * power9_core_starting.md: add description of CME debugging Signed-off-by: Krystian Hebel <[email protected]> * devnotes/power9_core_starting.md: add OCC log dumping instructions Signed-off-by: Krystian Hebel <[email protected]> * devnotes/scripts/awk_program*: skip empty lines Signed-off-by: Krystian Hebel <[email protected]> * Add information about starting OCC Signed-off-by: Sergii Dmytruk <[email protected]> * devnotes/scripts/awk_program_occ: work on data split into 4B chunks This minimises amount of manual work required when trace buffer overflows. Signed-off-by: Krystian Hebel <[email protected]> Co-authored-by: Igor Bagnucki <[email protected]> Co-authored-by: Maciej Pijanowski <[email protected]> Co-authored-by: Sergii Dmytruk <[email protected]>
1 parent 751fa2d commit e240ea5

File tree

10 files changed

+3374
-4
lines changed

10 files changed

+3374
-4
lines changed

devnotes/homer.md

Lines changed: 318 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,323 @@
1+
# HOMER (Hardware Offload Microcode Engine Region)
2+
3+
High level description of HOMER can be found at [OpenPOWER docs repo](https://github.com/open-power/docs/blob/master/occ/p9_pmcd_homer.pdf).
4+
5+
This document tries to describe all structures and point to the source of data
6+
created in istep 15.1. Offsets are relative to the base of relevant region
7+
(Quad, Core or Pstate), unless noted otherwise.
8+
9+
### OCC PM region (OPMR)
10+
11+
This region is not touched by 15.1.
12+
13+
### Quad PM region (QPMR)
14+
15+
#### SGPE
16+
17+
* offset: 0
18+
* size: <80K, with padding to 128K after
19+
20+
##### QPMR header
21+
22+
* offset: 0
23+
* size: 512 bytes
24+
25+
Comes from HCODE->SGPE->QPMR. Holds flags, offsets and sizes of further
26+
structures. It is modified later by multiple functions (layoutRingsForSgpe(),
27+
updateQpmrHeader() and functions called by those two), based on contents of
28+
other structures and attributes.
29+
30+
##### L1 bootloader, aka bootcopier
31+
32+
* offset: 512B
33+
* size: <=1K
34+
35+
Comes from HCODE->SGPE->L1_BOOTLOADER. Actual code is less than the full size.
36+
37+
##### L2 bootloader, aka bootloader
38+
39+
* offset: 1.5K
40+
* size: <=1K
41+
42+
Comes from HCODE->SGPE->L2_BOOTLOADER. Actual code is less than the full size.
43+
44+
##### SRAM image
45+
46+
* offset: 2.5K
47+
* size: <=74K, later written to QPMRHdr->sram_img_size
48+
49+
Comes from HCODE->SGPE->HCODE which holds interrupt vectors, header and code.
50+
Actual code size is less than the full size. The rest is filled by the code with
51+
ring data; that data is included in SRAM image size.
52+
53+
###### Interrupt vectors
54+
55+
* offset: 0 (relative to SRAM image), QPMRHdr->img_offset (relative to QPMR)
56+
* size: 0x180 = 384 bytes
57+
58+
###### SGPE header
59+
60+
* offset: 0x180 (relative to SRAM image)
61+
* size: depends on version
62+
63+
This also holds offsets and sizes of various structures, in a format that is
64+
easy to use by GPE that reads it. Written to in various places.
65+
66+
###### Code
67+
68+
* offset: immediately after header and alignment
69+
* size: <50K (ends at QPMRHdr->img_len, relative to SRAM image)
70+
71+
###### Common ring
72+
73+
* offset: immediately after code and alignment, written later to
74+
QPMRHdr->cmn_ring_offset
75+
* size: depends on the size of rings, written later to QPMRHdr->cmn_ring_len
76+
77+
Filled by layoutRingsForSGPE() based on data from getPpeScanRings(), which reads
78+
rings from MVPD partition.
79+
80+
###### Specialized ring
81+
82+
* offset: immediately after common ring and alignment, written later to
83+
QPMRHdr->spec_ring_offset
84+
* size: depends on the size of rings, written later to QPMRHdr->spec_ring_len
85+
86+
Filled by layoutRingsForSGPE() based on data from getPpeScanRings(), which reads
87+
rings from MVPD partition.
88+
89+
#### Cache SCOM region
90+
91+
* offset: 128K
92+
* size: 6*4K
93+
94+
Filled by populateEpsilonL2ScomReg(), populateEpsilonL3ScomReg(),
95+
populateL3RefreshScomReg() and populateNcuRngBarScomReg() by calling STOP API
96+
(p9_stop_save_scom()).
97+
98+
#### Auxiliary (24x7)
99+
100+
* offset: 512K
101+
* size: 64K
102+
103+
Not filled by 15.1.
104+
105+
### Core PM region (CPMR)
106+
107+
#### Self restore region
108+
109+
* offset: 0
110+
* size: 9K
111+
112+
##### SR header, aka CPMR header
113+
114+
* offset: 0
115+
* size: 256B
116+
117+
Comes from HCODE->RESTORE->CPMR. Contains various version numbers, flags,
118+
offsets and sizes. Modified in multiple places, mostly in updateCpmrCmeRegion().
119+
WARNING: this XIP image must be written after the next one.
120+
121+
##### SR code
122+
123+
* offset: 256B
124+
* size: 8.75K
125+
126+
Comes from HCODE->RESTORE->SELF. Image in XIP actually has a padding for the
127+
header above, filled with zeros. Reading it after the header would overwrite it.
128+
129+
#### Core self restore
130+
131+
* offset: 9K
132+
* size: 96K (24 cores * 4K)
133+
134+
This region holds 24 (max number of cores) sets of the areas listed below. This
135+
whole range is filled with `attn` instructions, except for first instructions in
136+
restore areas by initSelfRestoreRegion(). Save areas for functional cores are
137+
then updated by p9_stop_init_cpureg() and p9_stop_init_self_save().
138+
139+
##### Thread restore area
140+
141+
* offset: 0 (relative to core self restore)
142+
* size: 2K (4 threads * 512B)
143+
144+
##### Thread save area
145+
146+
* offset: 2K (relative to core self restore)
147+
* size: 1K (4 threads * 256B)
148+
149+
##### Core restore area
150+
151+
* offset: 3K (relative to core self restore)
152+
* size: 512B
153+
154+
##### Core save area
155+
156+
* offset: 3.5K (relative to core self restore)
157+
* size: 512B
158+
159+
#### Core SCOM restore
160+
161+
* offset: 256K
162+
* size: 6K (12*512B, actually there are 24*256B entries, but Hostboot groups the
163+
cores in pairs)
164+
165+
Not filled by 15.1.
166+
167+
#### CME SRAM region
168+
169+
* offset: 262K
170+
* size: <=64K
171+
172+
Comes from HCODE->CME->HCODE which holds interrupt vectors, header and code.
173+
Actual code size is less than the full size. The rest is filled by the code with
174+
ring data; that data is included in SRAM image size.
175+
176+
##### Interrupt vectors
177+
178+
* offset: 0 (relative to SRAM image), CPMRHdr->img_offset (relative to CPMR)
179+
* size: 0x180 = 384 bytes
180+
181+
##### CME header
182+
183+
* offset: 0x180 (relative to SRAM image)
184+
* size: depends on version
185+
186+
This also holds offsets and sizes of various structures, in a format that is
187+
easy to use by GPE that reads it (e.g. offsets and sizes are in 32B blocks,
188+
because that is the size CME block copy engine uses). Written to in various
189+
places: updateCpmrCmeRegion(), layoutRingsForCme(), buildParameterblock().
190+
191+
##### Code
192+
193+
* offset: immediately after header and alignment
194+
* size: ~30K (ends at CPMRHdr->img_len, relative to SRAM image)
195+
196+
##### Common ring
197+
198+
* offset: immediately after code and alignment, written later to
199+
CPMRHdr->cme_common_ring_offset **in bytes**
200+
* size: depends on the size of rings, written later to
201+
CPMRHdr->cme_common_ring_len **in bytes**
202+
203+
Filled by layoutRingsForCME() based on data from getPpeScanRings(), which reads
204+
rings from MVPD partition.
205+
206+
##### Specialized ring
207+
208+
* offset: immediately after common ring and alignment, written later to
209+
CPMRHdr->core_spec_ring_offset **in 32B blocks**
210+
* size: depends on the size of rings, written later to CMEHdr->max_spec_ring_len
211+
and CPMRHdr->core_spec_ring_len **in 32B blocks**
212+
213+
Filled by layoutRingsForCME() based on data from getPpeScanRings(), which reads
214+
rings from MVPD partition.
215+
216+
##### CME Pstates Parameter Block
217+
218+
* offset: immediately after specialized ring and alignment, written later to
219+
CMEHdr->pstate_offset **as 32B blocks** relative to SRAM image
220+
* size: sizeof(LocalPstateParmBlock)
221+
222+
Created by buildParameterBlock().
223+
224+
Pairs of specialized ring and CME PPB are repeated for every functional core.
225+
Those structures don't have fixed offsets, they are written one after the other,
226+
without gaps in between (other than alignment to CME copy engine block size).
227+
Sum of specialized ring and PPB sizes is written to CMEHdr->custom_len as a
228+
** number of 32B blocks**.
229+
230+
### Pstate PM region (PPMR)
231+
232+
#### PPMR header
233+
234+
* offset: 0
235+
* size: 1K
236+
237+
Comes from HCODE->PGPE_>PPMR. Contains various offsets and sizes. Modified by
238+
buildParameterBlock().
239+
240+
#### L1 bootloader, aka bootcopier
241+
242+
* offset: 1K
243+
* size: <=1K
244+
245+
Comes from HCODE->PGPE->L1_BOOTLOADER. Actual code is less than the full size.
246+
247+
#### L2 bootloader, aka bootloader
248+
249+
* offset: 2K
250+
* size: <=1K
251+
252+
Comes from HCODE->PGPE->L2_BOOTLOADER. Actual code is less than the full size.
253+
254+
#### SRAM image
255+
256+
* offset: 3K
257+
* size: <=50K, later written to PPMRHdr->sram_img_size
258+
259+
Comes from HCODE->PGPE->HCODE which holds interrupt vectors, header and code.
260+
Actual code size is less than the full size. The rest is filled by the code with
261+
ring data; that data is included in SRAM image size.
262+
263+
##### Interrupt vectors
264+
265+
* offset: 0 (relative to SRAM image), PPMRHdr->hcode_offset (relative to PPMR)
266+
* size: 0x180 = 384 bytes
267+
268+
##### PGPE header
269+
270+
* offset: 0x180 (relative to SRAM image)
271+
* size: depends on version
272+
273+
This also holds offsets and sizes of various structures, in a format that is
274+
easy to use by GPE that reads it. Written to in updatePpmrHeader().
275+
276+
##### Code
277+
278+
* offset: immediately after header and alignment
279+
* size: <50K (ends at PPMRHdr->hcode_len, relative to SRAM image)
280+
281+
##### Global PPB
282+
283+
* offset: immediately after code and alignment, written to PPMRHdr->gppb_offset
284+
relative to PPMR
285+
* size: sizeof(GlobalPstateParmBlock), written to PPMRHdr->gppb_len (aligned to
286+
8B)
287+
288+
Created by buildParameterBlock() (gppb_init()) from attributes and data from
289+
MVPD.
290+
291+
#### OCC PPB
292+
293+
* offset: 128K
294+
* size: sizeof(OCCPstateParmBlock)
295+
296+
Created by buildParameterBlock() (oppb_init()) from attributes and data from
297+
MVPD.
298+
299+
#### OCC P-State Table
300+
301+
* offset: 144K
302+
* size: 16K
303+
304+
Not filled by 15.1.
305+
306+
#### WOF tables
307+
308+
* offset: 768K
309+
* size: 256K
310+
311+
Copied by buildParameterBlock() (oppb_init()) from WOFDATA PNOR partition, based
312+
on data from MVPD (different tables are used based on core count, frequency,
313+
power etc).
314+
315+
# Dumps
316+
1317
## Homer filled by Hostboot
2-
Homer documentation is
3-
[available here](https://github.com/open-power/docs/blob/master/occ/p9_pmcd_homer.pdf).
4318

5-
Homer dump after Hostboot fills the the structure with the data is
6-
[available here](https://cloud.3mdeb.com/index.php/s/cNZJYE9ysgSaebJ).
319+
Homer dump after Hostboot fills the the structure with the data (after Petitboot
320+
starts) is [available here](https://cloud.3mdeb.com/index.php/s/cNZJYE9ysgSaebJ).
7321

8322
## Dumping Homer image
9323

0 commit comments

Comments
 (0)