summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_access_delay_reg.H
blob: 2bb4657fffd3f3ce6e617254b3428df602d79678 (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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/hwpf/hwp/dram_training/mss_draminit_trainadv/mss_access_delay_reg.H $ */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2012,2014              */
/*                                                                        */
/* p1                                                                     */
/*                                                                        */
/* Object Code Only (OCO) source materials                                */
/* Licensed Internal Code Source Materials                                */
/* IBM HostBoot Licensed Internal Code                                    */
/*                                                                        */
/* The source code for this program is not published or otherwise         */
/* divested of its trade secrets, irrespective of what has been           */
/* deposited with the U.S. Copyright Office.                              */
/*                                                                        */
/* Origin: 30                                                             */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
//$Id: mss_access_delay_reg.H,v 1.12 2014/01/24 17:22:16 sasethur Exp $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//------------------------------------------------------------------------------
// *! TITLE       : mss_demo_access_delay_reg.H
// *! DESCRIPTION : Header file for mss_access_delay_reg.
// *! OWNER NAME  : Saurabh Chadha    Email: sauchadh@in.ibm.com
// *! ADDITIONAL COMMENTS :
//
//
//
//------------------------------------------------------------------------------
// Don't forget to create CVS comments when you check in your changes!
//------------------------------------------------------------------------------
// CHANGE HISTORY:
//------------------------------------------------------------------------------
// Version:|  Author: |  Date:  | Comment:
//---------|----------|---------|-----------------------------------------------
//   1.12  | mjjones  |20-Jan-14| RAS Review Updates
//   1.1   | sauchadh |15-Oct-12| First Draft.
//------------------------------------------------------------------------------


#ifndef MSS_ACCESS_DELAY_REG_H_
#define MSS_ACCESS_DELAY_REG_H_

//------------------------------------------------------------------------------
// My Includes
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#include <fapi.H>


//----------------------------------------------------------------------
// ENUMs   
//----------------------------------------------------------------------
enum access_type_t {
   READ = 0,
   WRITE = 1
};

enum input_type_t {
   WR_DQ,
   RAW_WR_DQ_0,
   RAW_WR_DQ_1,
   RAW_WR_DQ_2,
   RAW_WR_DQ_3,
   RAW_WR_DQ_4,
   RD_DQ,
   RAW_RD_DQ_0,
   RAW_RD_DQ_1,
   RAW_RD_DQ_2,
   RAW_RD_DQ_3,
   RAW_RD_DQ_4,
   WR_DQS,
   RAW_WR_DQS_0,
   RAW_WR_DQS_1,
   RAW_WR_DQS_2,
   RAW_WR_DQS_3,
   RAW_WR_DQS_4,
   RD_DQS,
   RAW_RD_DQS_0,
   RAW_RD_DQS_1,
   RAW_RD_DQS_2,
   RAW_RD_DQS_3,
   RAW_RD_DQS_4,
   RAW_SYS_ADDR_CLK,
   RAW_SYS_CLK_0,
   RAW_SYS_CLK_1,
   RAW_SYS_CLK_2,
   RAW_SYS_CLK_3,
   RAW_SYS_CLK_4,
   RAW_WR_CLK_0,
   RAW_WR_CLK_1,
   RAW_WR_CLK_2,
   RAW_WR_CLK_3,
   RAW_WR_CLK_4,
   RAW_ADDR_0,
   RAW_ADDR_1,
   RAW_ADDR_2,
   RAW_ADDR_3,
   DQS_GATE,
   RAW_DQS_GATE_0,
   RAW_DQS_GATE_1,
   RAW_DQS_GATE_2,
   RAW_DQS_GATE_3,
   RAW_DQS_GATE_4,
   DQS_ALIGN,
   RAW_DQS_ALIGN_0,
   RAW_DQS_ALIGN_1,
   RAW_DQS_ALIGN_2,
   RAW_DQS_ALIGN_3,
   RAW_DQS_ALIGN_4,
   RAW_RDCLK_0,
   RAW_RDCLK_1,
   RAW_RDCLK_2,
   RAW_RDCLK_3,
   RAW_RDCLK_4,
   RDCLK,
   RAW_DQSCLK_0,
   RAW_DQSCLK_1,
   RAW_DQSCLK_2,
   RAW_DQSCLK_3,
   RAW_DQSCLK_4,
   DQSCLK,
   COMMAND,
   CONTROL,
   CLOCK,
   ADDRESS,
   DATA_DISABLE
   };

enum ip_type_t {
   WR_DQ_t,
   RAW_WR_DQ,
   RD_DQ_t,
   RAW_RD_DQ,
   WR_DQS_t,
   RAW_WR_DQS,
   RD_DQS_t,
   RAW_RD_DQS,
   RD_CLK_t,
   RAW_SYS_ADDR_CLKS0S1,
   RAW_SYS_CLK,
   RAW_WR_CLK,
   RAW_ADDR,
   DQS_GATE_t,
   RAW_DQS_GATE,
   DQS_ALIGN_t,
   RAW_DQS_ALIGN,
   RDCLK_t,
   RAW_RDCLK,
   DQSCLK_t,
   RAW_DQSCLK,
   COMMAND_t,
   CONTROL_t,
   CLOCK_t,
   ADDRESS_t,
   DATA_DISABLE_t
};


enum input_type {
  ISDIMM_DQ,
  ISDIMM_DQS,
  CDIMM_DQS,
  CDIMM_DQ,
  GL_NET_DQ,
  GL_NET_DQS
};

struct scom_location {
   uint64_t scom_addr;
   uint8_t start_bit;
   uint8_t bit_length;
};


typedef fapi::ReturnCode (*mss_access_delay_reg_FP_t)(const fapi::Target &,
                                                      access_type_t,
                                                      uint8_t,
                                                      uint8_t,
                                                      input_type_t,
                                                      uint8_t,
                                                      uint8_t,
                                                      uint32_t &);

extern "C" {

/**
 * @brief Reads or Writes delay values
 *
 * @param[in] i_target_mba     Reference to centaur.mba target
 * @param[in] i_access_type_e  Access type (READ or WRITE)
 * @param[in] i_port_u8        Port number
 * @param[in] i_rank_u8        Rank number
 * @param[in] i_input_type_e   Input type (from input_type_t)
 * @param[in] i_input_index_u8 Input index
 * @param[in] i_verbose        1 = Verbose tracing
 * @param[io] io_value_u32     READ=input, WRITE=output
 *
 * @return ReturnCode
 */
fapi::ReturnCode mss_access_delay_reg_schmoo(const fapi::Target & i_target_mba,
                                             access_type_t i_access_type_e,
                                             uint8_t i_port_u8,
                                             uint8_t i_rank_u8,
                                             input_type_t i_input_type_e,
                                             uint8_t i_input_index_u8,
                                             uint8_t i_verbose,
                                             uint16_t &io_value_u32);

/**
 * @brief Reads or Writes delay values
 *
 * @param[in] i_target_mba     Reference to centaur.mba target
 * @param[in] i_access_type_e  Access type (READ or WRITE)
 * @param[in] i_port_u8        Port number
 * @param[in] i_rank_u8        Rank number
 * @param[in] i_input_type_e   Input type (from input_type_t)
 * @param[in] i_input_index_u8 Input index
 * @param[in] i_verbose        1 = Verbose tracing
 * @param[io] io_value_u32     READ=input, WRITE=output
 *
 * @return ReturnCode
 */
fapi::ReturnCode mss_access_delay_reg(const fapi::Target & i_target_mba,
                                      access_type_t i_access_type_e,
                                      uint8_t i_port_u8,
                                      uint8_t i_rank_u8,
                                      input_type_t i_input_type_e,
                                      uint8_t i_input_index_u8,
                                      uint8_t i_verbose,
                                      uint32_t &io_value_u32);

/**
 * @brief cross_coupled
 *
 * @param[in]  i_target_mba   Reference to centaur.mba target
 * @param[in]  i_port         Port number
 * @param[in]  i_rank_pair    Rank pair
 * @param[in]  i_input_type_e Input type (from input_type_t)
 * @param[in]  i_input_index  Input index
 * @param[in]  i_verbose      1 = Verbose tracing
 * @param[out] out            Output
 *
 * @return ReturnCode
 */
fapi::ReturnCode cross_coupled(const fapi::Target & i_target_mba,
                               uint8_t i_port,
                               uint8_t i_rank_pair,
                               input_type_t i_input_type_e,
                               uint8_t i_input_index,
                               uint8_t i_verbose,
                               scom_location& out);

/**
 * @brief mss_c4_phy
 *
 * @param[in] i_target_mba   Reference to centaur.mba target
 * @param[in] i_port         Port number
 * @param[in] i_rank_pair    Rank pair
 * @param[in] i_input_type_e Input type (from input_type_t)
 * @param[in] i_input_index  Input index
 * @param[in] i_verbose      1 = Verbose tracing
 * @param[io] phy_lane       PHY Lane
 * @param[io] phy_block      PHY Block
 * @param[in] flag           Flag
 *
 * @return ReturnCode
 */
fapi::ReturnCode mss_c4_phy(const fapi::Target & i_target_mba,
                            uint8_t i_port,
                            uint8_t i_rank_pair,
                            input_type_t i_input_type_e,
                            uint8_t &i_input_index,
                            uint8_t i_verbose,
                            uint8_t &phy_lane,
                            uint8_t &phy_block,
                            uint8_t flag);

/**
 * @brief get_address
 *
 * @param[in]  i_target_mba      Reference to centaur.mba target
 * @param[in]  i_port            Port number
 * @param[in]  i_rank_pair       Rank pair
 * @param[in]  i_input_type_e    Input type (from input_type_t)
 * @param[in]  i_block           Block
 * @param[in]  i_lane            Lane
 * @param[out] o_scom_address_64 Output scom address
 * @param[out] o_start_bit       Output Start bit
 * @param[out] o_len             Output length
 *
 * @return ReturnCode
 */
fapi::ReturnCode get_address(const fapi::Target & i_target_mba,
                             uint8_t i_port,
                             uint8_t i_rank_pair,
                             ip_type_t i_input_type_e,
                             uint8_t i_block,
                             uint8_t i_lane,
                             uint64_t &o_scom_address_64,
                             uint8_t &o_start_bit,
                             uint8_t &o_len);

/**
 * @brief Returns C4 bit for the corresponding ISDIMM bit
 *
 * @param[in]  i_target_mba   Reference to centaur.mba target
 * @param[in]  i_port         Port number
 * @param[in]  i_input_type_e Input type (from input_type_t)
 * @param[in]  i_input_index  Input index
 * @param[in]  i_verbose      1 = Verbose tracing
 * @param[out] o_value        Output C4 bit
 *
 * @return ReturnCode
 */
fapi::ReturnCode rosetta_map(const fapi::Target & i_target_mba,
                             uint8_t i_port,
                             input_type i_input_type_e,
                             uint8_t i_input_index,
                             uint8_t i_verbose,
                             uint8_t &o_value);

/**
 * @brief Gets the rank pair
 *
 * @param[in]  i_target_mba     Reference to centaur.mba target
 * @param[in]  i_port           Port
 * @param[in]  i_rank           Rank
 * @param[out] o_rank_pair      Output rank pair
 * @param[out] o_rankpair_table Output rank pair table
 *
 * @return ReturnCode
 */
fapi::ReturnCode mss_getrankpair(const fapi::Target & i_target_mba,
                                 uint8_t i_port,
                                 uint8_t i_rank,
                                 uint8_t *o_rank_pair,
                                 uint8_t o_rankpair_table[]);

} // extern "C"

#endif // MSS_ACCESS_DELAY_REG_H

OpenPOWER on IntegriCloud