summaryrefslogtreecommitdiffstats
path: root/src/occ_405/cmdh/cmdh_dbug_cmd.h
blob: 2baea2779b4404be33246159edc4a74c8b2200c1 (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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/occ_405/cmdh/cmdh_dbug_cmd.h $                            */
/*                                                                        */
/* OpenPOWER OnChipController Project                                     */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2011,2018                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#ifndef _CMDHDBUGCMD_H
#define _CMDHDBUGCMD_H

//*************************************************************************/
// Includes
//*************************************************************************/
#include <occ_common.h>
#include <cmdh_fsp.h>
#include <cmdh_fsp_cmds.h>

//*************************************************************************/
// Externs
//*************************************************************************/

//*************************************************************************/
// Macros
//*************************************************************************/

//*************************************************************************/
// Defines/Enums
//*************************************************************************/
///Max string length of trace component name
#define OCC_TRACE_NAME_SIZE     4

// Size of data returned for debug DMA read
#define CMDH_DEBUG_DMA_READ_SIZE  1024

// Enum of the various Debug commands that may be sent to OCC
// over the TMGT<->OCC interface.  This is the first byte of data in the debug command
typedef enum
{
    DBUG_DUMP_WOF_DATA      = 0x01,
    DBUG_FORCE_WOF_RESET    = 0x02,
    DBUG_GET_TRACE          = 0x03,
    DBUG_CLEAR_TRACE        = 0x04,
    DBUG_ALLOW_TRACE        = 0x05,
    DBUG_DUMP_OPPB          = 0x06,
    DBUG_GET_AME_SENSOR     = 0x07,
    DBUG_DUMP_GPU_TIMINGS   = 0x08,
    DBUG_PEEK               = 0x09,
//  free = 0x0A,
//  free = 0x0B,
//  free = 0x0C,
    DBUG_DUMP_RAW_AD        = 0x0D,
//  free = 0x0E,
//  free = 0x0F,
//  free = 0x10,
//  free = 0x11,
    DBUG_TRIGGER_EPOW       = 0x12,
//  free = 0x13
    DBUG_INJECT_ERRL        = 0x14,
    DBUG_DIMM_INJECT        = 0x15,
//  free  = 0x16
//  free  = 0x17,
//  free  = 0x18,
//  free  = 0x19,
//  free  = 0x1A,
//  free  = 0x1B,
//  free  = 0x1C,
//  free  = 0x1D,
//  free  = 0x1E,
    DBUG_INTERNAL_FLAGS     = 0x1F,
    DBUG_FLUSH_DCACHE       = 0x20,
//  free  = 0x21,
    DBUG_CENTAUR_SENSOR_CACHE = 0x22,
    DBUG_DUMP_PROC_DATA     = 0x23,
    DBUG_GEN_CHOM_LOG       = 0x24,
    DBUG_DUMP_APSS_DATA     = 0x25,
    DBUG_DUMP_AME_SENSOR    = 0x26,
    DBUG_CLEAR_AME_SENSOR   = 0x27,
    DBUG_WOF_CONTROL        = 0x28,
    DBUG_WOF_OCS            = 0x29
} DBUG_CMD;

//*************************************************************************/
// Structures
//*************************************************************************/

// Used by OCC tool to get trace, version 0.
typedef struct __attribute__ ((packed))
{
    struct    cmdh_fsp_cmd_header;
    int8_t    sub_cmd;
    int16_t   size_request;
    int8_t    comp[OCC_TRACE_NAME_SIZE];
}cmdh_dbug_get_trace_query_t;

// Used by OCC to response "get trace" cmd, version 0.
typedef struct __attribute__ ((packed))
{
    struct    cmdh_fsp_rsp_header;
    uint8_t   data[0];
}cmdh_dbug_get_trace_resp_t;

#define CMDH_DBUG_GET_TRACE_RESP_LEN 6  // size_request(2) and occ_comp_sram_offset(4)

// Used by occtool to get AME sensor data
typedef struct __attribute__ ((packed))
{
    struct     cmdh_fsp_cmd_header;
    uint8_t    sub_cmd;
    uint16_t   type;
    uint16_t   location;
}cmdh_dbug_get_sensor_query_t;

// Max number of sensors that can be returned with cmdh_dbug_get_ame_sensor command

#define CMDH_DBUG_MAX_NUM_SENSORS  50
// Size of standard response header (5 bytes) plus checksum (2 bytes)
#define CMDH_DBUG_FSP_RESP_LEN     7

// Used by OCC firmware to respond "cmdh_dbug_get_ame_sensor" debug command
typedef struct __attribute__ ((packed))
{
    struct                  cmdh_fsp_rsp_header;
    uint16_t                num_sensors;
    cmdh_dbug_sensor_list_t sensor[CMDH_DBUG_MAX_NUM_SENSORS];
    uint8_t                 filler;
    uint16_t                checksum;
}cmdh_dbug_get_sensor_resp_t;

/**
 * struct cmdh_dbug_inject_errl_query_t;
 * Used by debug command to create elog, version 0.
 */
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_cmd_header;
    uint8_t     sub_cmd;
    char        comp[OCC_TRACE_NAME_SIZE];
}cmdh_dbug_inject_errl_query_t;

// Used by OCC to debug on real hardware
typedef struct __attribute__ ((packed))
{
    struct    cmdh_fsp_cmd_header;
    uint8_t   sub_cmd;
    uint8_t   type;
    uint16_t  size;
    uint32_t  address;
}cmdh_dbug_peek_t;

typedef struct __attribute__ ((packed))
{
    uint8_t     func;
    uint16_t    raw;
    uint16_t    calculated;
    uint32_t    ipmi_sid;
    uint32_t    offset;
    uint32_t    gain;
}cmdh_dbug_apss_data_t;

// Used to get the APSS raw values
typedef struct __attribute__ ((packed))
{
    struct                  cmdh_fsp_rsp_header;
    cmdh_dbug_apss_data_t   ApssCh[MAX_APSS_ADC_CHANNELS];
    uint8_t                 checksum[2];
} cmdh_dbug_apss_data_resp_t;

// DBUG_DUMP_AME_SENSOR command struct
typedef struct __attribute__ ((packed))
{
    struct   cmdh_fsp_cmd_header;  // Standard command header
    uint8_t  sub_cmd;              // Debug sub-command
    uint16_t gsid;                 // Global Sensor ID
} cmdh_dbug_dump_ame_sensor_cmd_t;

// DBUG_DUMP_AME_SENSOR response struct
typedef struct __attribute__ ((packed))
{
    struct        cmdh_fsp_rsp_header;               // Standard response header
    sensor_info_t sensor_info;                       // Static sensor fields
    sensor_t      sensor;                            // Dynamic sensor fields
    uint8_t       checksum[CMDH_FSP_CHECKSUM_SIZE];  // Checksum
} cmdh_dbug_dump_ame_sensor_rsp_t;

// DBUG_CLEAR_AME_SENSOR command struct
typedef struct __attribute__ ((packed))
{
    struct   cmdh_fsp_cmd_header;  // Standard command header
    uint8_t  sub_cmd;              // Debug sub-command
    uint16_t gsid;                 // Global Sensor ID
    uint16_t clear_type;           // Fields to clear (AMEC_SENSOR_CLEAR_TYPE)
} cmdh_dbug_clear_ame_sensor_cmd_t;

// DBUG_CLEAR_AME_SENSOR response struct
typedef struct __attribute__ ((packed))
{
    struct   cmdh_fsp_rsp_header;               // Standard response header
    sensor_t sensor;                            // Dynamic sensor fields
    uint8_t  checksum[CMDH_FSP_CHECKSUM_SIZE];  // Checksum
} cmdh_dbug_clear_ame_sensor_rsp_t;

// DBUG_WOF_CONTROL command struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_cmd_header;    // Standard command header
    uint8_t     sub_cmd;                // Debug sub-command
    uint8_t     action;                 // CLEAR(0) or SET(1)
    uint32_t    wof_rc;                 // Bit to set
} cmdh_dbug_wof_control_cmd_t;

// DBUG_WOF_CONTROL response struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_rsp_header;
    uint32_t    wof_disabled;
    uint8_t     checksum[CMDH_FSP_CHECKSUM_SIZE];
} cmdh_dbug_wof_control_rsp_t;

// DBUG_WOF_OCS command struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_cmd_header;    // Standard command header
    uint8_t     sub_cmd;                // Debug sub-command
    uint16_t    ceff_up_amount;           // OCS Ceff Addr going up
    uint16_t    ceff_down_amount;         // OCS Ceff Addr going down
} cmdh_dbug_wof_ocs_cmd_t;

// DBUG_WOF_OCS response struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_rsp_header;
    uint16_t    ceff_up_amount;
    uint16_t    ceff_down_amount;
    uint8_t     checksum[CMDH_FSP_CHECKSUM_SIZE];
} cmdh_dbug_wof_ocs_rsp_t;

// DBUG_ALLOW_TRACE command struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_cmd_header;
    uint8_t     sub_cmd;
    uint8_t     action;
    uint16_t    trace_flags;
}cmdh_dbug_allow_trace_cmd_t;

// DBUG_ALLOW_TRACE response struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_rsp_header;
    uint16_t    trace_flags;
    uint8_t     checksum[CMDH_FSP_CHECKSUM_SIZE];
}cmdh_dbug_allow_trace_rsp_t;

// DBUG_DIMM_INJECT command struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_cmd_header;
    uint8_t     sub_cmd;
    uint64_t    inject_mask;
}cmdh_dbug_dimm_inject_cmd_t;

// DBUG_DIMM_INJECT response struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_rsp_header;
    uint64_t    inject_mask;
    uint8_t     checksum[CMDH_FSP_CHECKSUM_SIZE];
}cmdh_dbug_dimm_inject_rsp_t;

// DBUG_INTERNAL_FLAGS command struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_cmd_header;
    uint8_t     sub_cmd;
    uint32_t    flags;
}cmdh_dbug_internal_flags_cmd_t;

// DBUG_INTERNAL_FLAGS response struct
typedef struct __attribute__ ((packed))
{
    struct      cmdh_fsp_rsp_header;
    uint32_t    flags;
    uint8_t     checksum[CMDH_FSP_CHECKSUM_SIZE];
}cmdh_dbug_internal_flags_rsp_t;

//*************************************************************************
// Globals
//*************************************************************************

//*************************************************************************
// Function Prototypes
//*************************************************************************

//*************************************************************************
// Functions
//*************************************************************************

#endif

OpenPOWER on IntegriCloud