52
52
* - Register address lists - These lists vary in size depending on the number
53
53
* of register addresses needed in each list. The list counts are stored in
54
54
* HOMER_Data_t::regCounts. Order of the lists must match the array indexes
55
- * HOMER_Data_t::regCounts, which are specified in TrgtType_t and
55
+ * of HOMER_Data_t::regCounts, which are specified in TrgtType_t and
56
56
* RegType_t.
57
57
*
58
+ * - Chip specific address list - This is a list of HOMER_ChipSpecAddr_t
59
+ * structs and will vary in size depending on the number of register
60
+ * addresses that are specific to a certain chip or DD level. The number of
61
+ * entries in this list is stored in HOMER_Data_t::ecDepCounts.
62
+ *
63
+ * IMPORTANT NOTE: All of the structs used here are packed. Therefore, we must
64
+ * ensure the variables within the struct are byte aligned. Meaning each
65
+ * uint32_t within the struct must be 4-byte aligned and each uint16_t must
66
+ * be 2-byte aligned. This also means the structs must always start on a
67
+ * 4-bye word boundary to maintain alignment. This is required due to the
68
+ * limitations of the PPE42/SRAM hardware.
69
+ *
58
70
* Note that FIRs and indirect-SCOM FIRs characterize a set of registers to
59
71
* capture. In addition to capturing the FIR (or ID FIR), the OCC will need to
60
72
* capture the following addresses for each type:
@@ -79,6 +91,7 @@ typedef enum
79
91
} HOMER_Version_t ;
80
92
81
93
/** PNOR information contained within the HOMER data. */
94
+ /* NOTE: This structure is 4-byte word aligned. */
82
95
typedef struct __attribute__((packed ))
83
96
{
84
97
uint32_t pnorOffset ; /** Physical offset of FIRDATA in PNOR */
@@ -90,25 +103,26 @@ typedef struct __attribute__((packed))
90
103
91
104
/** HOMER data header information containing hardware configurations and
92
105
* register counts. */
106
+ /* NOTE: This structure may, or may not, be 4-byte word aligned. It all depends
107
+ * on the size of regCounts, which will change based on the number of
108
+ * target types and register types we support. When reading/writing this
109
+ * data ensure that proper padding has been added after this structure so
110
+ * that subsequent structures are 4-byte word aligned. */
93
111
typedef struct __attribute__((packed ))
94
112
{
95
113
uint32_t header ; /** Magic number to indicate valid data and version */
96
114
97
- uint8_t chipCount ; /** Number of configured chips per node */
115
+ uint32_t chipCount : 8 ; /** Number of configured chips per node */
116
+ uint32_t ecDepCounts : 8 ; /** Number of regs that are EC dependent */
117
+ uint32_t iplState : 1 ; /** See IplState_t. */
118
+ uint32_t reserved : 15 ;
98
119
99
- uint8_t iplState : 1 ; /** See IplState_t . */
100
- uint8_t reserved : 7 ;
120
+ /** Information regarding the PNOR location and size . */
121
+ HOMER_PnorInfo_t pnorInfo ;
101
122
102
123
/** Contains number of registers per type for each target type. */
103
124
uint8_t regCounts [TRGT_MAX ][REG_MAX ];
104
125
105
- /** Number of regs that are dependent on EC level **/
106
- /** (these registers follow the normal register list) **/
107
- uint8_t ecDepCounts ;
108
-
109
- /** Information regarding the PNOR location and size. */
110
- HOMER_PnorInfo_t pnorInfo ;
111
-
112
126
} HOMER_Data_t ;
113
127
114
128
/** @return An initialized HOMER_Data_t struct. */
@@ -133,20 +147,20 @@ typedef enum
133
147
} HOMER_ChipType_t ;
134
148
135
149
/** Information for each configured chip. */
150
+ /* NOTE: This structure is 4-byte word aligned. */
136
151
typedef struct __attribute__((packed ))
137
152
{
138
153
uint32_t fsiBaseAddr ; /** FSI base address for the chip. */
139
154
140
- uint16_t chipType : 4 ; /** Chip type (see HOMER_ChipType_t) */
141
- uint16_t chipPos : 6 ; /** Chip position relative to the node. */
142
- uint16_t reserved : 6 ;
143
-
144
- uint8_t chipEcLevel ; /** EC level for this chip */
155
+ uint32_t chipType : 4 ; /** Chip type (see HOMER_ChipType_t) */
156
+ uint32_t chipPos : 6 ; /** Chip position relative to the node. */
157
+ uint32_t chipEcLevel : 8 ; /** EC level for this chip */
158
+ uint32_t reserved : 14 ;
145
159
146
160
} HOMER_Chip_t ;
147
161
148
-
149
162
/** Used for Registers that have EC level dependencies */
163
+ /* NOTE: This structure is 4-byte word aligned. */
150
164
typedef struct __attribute__((packed ))
151
165
{
152
166
uint32_t chipType : 4 ; /** See HOMER_ChipType_t. */
@@ -160,7 +174,6 @@ typedef struct __attribute__((packed))
160
174
161
175
} HOMER_ChipSpecAddr_t ;
162
176
163
-
164
177
/** @return An initialized HOMER_Chip_t struct. */
165
178
static inline HOMER_Chip_t HOMER_getChip ( HOMER_ChipType_t i_type )
166
179
{
@@ -175,6 +188,7 @@ static inline HOMER_Chip_t HOMER_getChip( HOMER_ChipType_t i_type )
175
188
/*----------------------------------------------------------------------------*/
176
189
177
190
/** Information specific to a P9 Nimbus processor chip. */
191
+ /* NOTE: This structure is 4-byte word aligned. */
178
192
typedef struct __attribute__((packed ))
179
193
{
180
194
uint32_t isMaster : 1 ; /** 1 if this is the master PROC, 0 otherwise */
@@ -188,10 +202,10 @@ typedef struct __attribute__((packed))
188
202
uint32_t mcsMask : 4 ; /** Mask of configured MCS units (0-3) */
189
203
uint32_t mcaMask : 8 ; /** Mask of configured MCA units (0-7) */
190
204
191
- uint16_t cappMask : 2 ; /** Mask of configured CAPP units (0-1) */
192
- uint16_t pecMask : 3 ; /** Mask of configured PEC units (0-2) */
193
- uint16_t phbMask : 6 ; /** Mask of configured PHB units (0-5) */
194
- uint16_t reserved : 5 ;
205
+ uint32_t cappMask : 2 ; /** Mask of configured CAPP units (0-1) */
206
+ uint32_t pecMask : 3 ; /** Mask of configured PEC units (0-2) */
207
+ uint32_t phbMask : 6 ; /** Mask of configured PHB units (0-5) */
208
+ uint32_t reserved : 21 ;
195
209
196
210
} HOMER_ChipNimbus_t ;
197
211
@@ -206,6 +220,7 @@ static inline HOMER_ChipNimbus_t HOMER_initChipNimbus()
206
220
/*----------------------------------------------------------------------------*/
207
221
208
222
/** Information specific to a P9 Cumulus processor chip. */
223
+ /* NOTE: This structure is 4-byte word aligned. */
209
224
typedef struct __attribute__((packed ))
210
225
{
211
226
uint32_t isMaster : 1 ; /** 1 if this is the master PROC, 0 otherwise */
@@ -219,10 +234,10 @@ typedef struct __attribute__((packed))
219
234
uint32_t miMask : 4 ; /** Mask of configured MI units (0-3) */
220
235
uint32_t dmiMask : 8 ; /** Mask of configured DMI units (0-7) */
221
236
222
- uint16_t cappMask : 2 ; /** Mask of configured CAPP units (0-1) */
223
- uint16_t pecMask : 3 ; /** Mask of configured PEC units (0-2) */
224
- uint16_t phbMask : 6 ; /** Mask of configured PHB units (0-5) */
225
- uint16_t reserved : 5 ;
237
+ uint32_t cappMask : 2 ; /** Mask of configured CAPP units (0-1) */
238
+ uint32_t pecMask : 3 ; /** Mask of configured PEC units (0-2) */
239
+ uint32_t phbMask : 6 ; /** Mask of configured PHB units (0-5) */
240
+ uint32_t reserved : 21 ;
226
241
227
242
} HOMER_ChipCumulus_t ;
228
243
@@ -237,10 +252,11 @@ static inline HOMER_ChipCumulus_t HOMER_initChipCumulus()
237
252
/*----------------------------------------------------------------------------*/
238
253
239
254
/** Information specific to a Centaur memory buffer chip. */
255
+ /* NOTE: This structure is 4-byte word aligned. */
240
256
typedef struct __attribute__((packed ))
241
257
{
242
- uint8_t mbaMask : 2 ; /** Mask of configured MBA units (0-1) */
243
- uint8_t reserved : 6 ;
258
+ uint32_t mbaMask : 2 ; /** Mask of configured MBA units (0-1) */
259
+ uint32_t reserved : 30 ;
244
260
245
261
} HOMER_ChipCentaur_t ;
246
262
@@ -252,23 +268,4 @@ static inline HOMER_ChipCentaur_t HOMER_initChipCentaur()
252
268
return c ;
253
269
}
254
270
255
- /** @brief Chip information inserted into HOMER data section after header
256
- *
257
- * There is basically an array of these after the initial HOMER
258
- * section (HOMER_Data_t). The register info then follows.
259
- */
260
- typedef struct __attribute__((packed ))
261
- {
262
- HOMER_Chip_t hChipType ; /* Nimbus, Centaur, EC Level, etc...*/
263
-
264
- union
265
- {
266
- HOMER_ChipNimbus_t hChipN ;
267
- HOMER_ChipCumulus_t hChipC ;
268
- HOMER_ChipCentaur_t hChipM ;
269
- };
270
-
271
- } HOMER_ChipInfo_t ;
272
-
273
-
274
271
#endif /* __homerData_common_h */
0 commit comments