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
|
// IBM_PROLOG_BEGIN_TAG
// This is an automatically generated prolog.
//
// $Source: src/usr/hwpf/hwp/dram_training/mss_funcs.H $
//
// IBM CONFIDENTIAL
//
// COPYRIGHT International Business Machines Corp. 2012
//
// 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 other-
// wise divested of its trade secrets, irrespective of what has
// been deposited with the U.S. Copyright Office.
//
// Origin: 30
//
// IBM_PROLOG_END
/* File mss_funcs.H created by SLOAT JACOB D. (JAKE),2D3970 on Fri Apr 22 2011. */
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2007
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//------------------------------------------------------------------------------
// *! TITLE : mss_funcs.H
// *! DESCRIPTION : Tools for centaur procedures
// *! OWNER NAME :
// *! BACKUP NAME :
// #! ADDITIONAL COMMENTS :
//
// CCS related and general utility functions.
//------------------------------------------------------------------------------
// Don't forget to create CVS comments when you check in your changes!
//------------------------------------------------------------------------------
// CHANGE HISTORY:
//------------------------------------------------------------------------------
// Version:| Author: | Date: | Comment:
//---------|----------|---------|-----------------------------------------------
// 1.11 | 3/21/12 | divyakum| Added mss_execute_zq_cal function
// 1.10 | 2/14/12 | jdsloat | Comment section filled in, elimated unnecessary constant, added enums
// 1.9 | 2/08/12 | jdsloat | Target to Target&
// 1.8 | 2/02/12 | jdsloat | Added fapi:: to arguments in function prototypes
// 1.7 | 1/13/12 | jdsloat | Capatilization, cleaned up includes, address names, "mss_" prefix, argument prefix
// 1.6 | 1/6/12 | jdsloat | Added a function call
// 1.5 | 1/5/12 | jdsloat | Got rid of Globals
// 1.4 | 10/31/11 | jdsloat | CCS Update - goto_inst now assumed to be +1, CCS_fail fix, CCS_status fix
// 1.3 | 10/06/11 | jdsloat | argument data type fix
// 1.2 | 10/05/11 | jdsloat | Convert integers to ecmdDataBufferBase in CCS_INST_1, CCS_INST_2, CCS_MODE
// 1.1 | 10/04/11 | jdsloat | First drop of Centaur in FAPI dir
//---------|----------|---------|-----------------------------------------------
// 1.6 | 09/29/11 | jdsloat | global CCS counts, port added to calls, temp dimms defined as #
// 1.5 | 09/27/11 | jdsloat | Added port information.
// 1.4 | 09/22/11 | jdsloat | Full update to FAPI. Functional changes to match procedure.
// 1.3 | 09/13/11 | jdsloat | First attempt at FAPI upgrade - attributes still in ecmd
// 1.00 | 04/22/11 | jdsloat | First drop of Centaur
#ifndef _MSS_FUNCS_H
#define _MSS_FUNCS_H
//----------------------------------------------------------------------
// Constants for CCS Operations
//----------------------------------------------------------------------
const uint64_t CCS_INST_ARRY0_AB_REG0_0x03010615 = 0x03010615;
const uint64_t CCS_INST_ARRY1_AB_REG0_0x03010635 = 0x03010635;
const uint64_t CCS_CNTLQ_AB_REG_0x030106A5 = 0x030106A5;
const uint64_t CCS_MODEQ_AB_REG_0x030106A7 = 0x030106A7;
const uint64_t CCS_STATQ_AB_REG_0x030106A6 = 0x030106A6;
const uint64_t MBA01_CALFIR_REG_0x03010402 = 0x03010402;
//----------------------------------------------------------------------
// Enums for CCS Operations
//----------------------------------------------------------------------
enum mss_ccs_status_query_result
{
MSS_STAT_QUERY_PASS = 1,
MSS_STAT_QUERY_IN_PROGRESS = 2,
MSS_STAT_QUERY_FAIL = 3
};
const bool MSS_CCS_START = 0;
const bool MSS_CCS_STOP = 1;
//----------------------------------------------------------------------
// CCS FUNCS
//----------------------------------------------------------------------
//--------------------------------------------------------------
// mss_ccs_inst_arry_0
// Adding information to the CCS - 0 instruction array by index
// Target = centaur.mba
//--------------------------------------------------------------
fapi::ReturnCode mss_ccs_inst_arry_0( fapi::Target& i_target,
uint32_t& io_instruction_number,
ecmdDataBufferBase i_address,
ecmdDataBufferBase i_bank,
ecmdDataBufferBase i_activate,
ecmdDataBufferBase i_rasn,
ecmdDataBufferBase i_casn,
ecmdDataBufferBase i_wen,
ecmdDataBufferBase i_cke,
ecmdDataBufferBase i_csn,
ecmdDataBufferBase i_odt,
ecmdDataBufferBase i_ddr_cal_type,
uint32_t i_port);
//--------------------------------------------------------------
// mss_ccs_inst_arry_1
// Adding information to the CCS - 1 instruction array by index
// Target = centaur.mba
//--------------------------------------------------------------
fapi::ReturnCode mss_ccs_inst_arry_1( fapi::Target& i_target,
uint32_t& io_instruction_number,
ecmdDataBufferBase i_num_idles,
ecmdDataBufferBase i_num_repeat,
ecmdDataBufferBase i_data,
ecmdDataBufferBase i_read_compare,
ecmdDataBufferBase i_rank_cal,
ecmdDataBufferBase i_ddr_cal_enable,
ecmdDataBufferBase i_ccs_end);
//-----------------------------------------
// mss_ccs_status_query
// Querying the status of the CCS
// Target = centaur.mba
//-----------------------------------------
fapi::ReturnCode mss_ccs_status_query( fapi::Target& i_target,
mss_ccs_status_query_result& io_status);
//-----------------------------------------
// mss_ccs_start_stop
// Issuing a start or stop of the CCS
// Target = centaur.mba
//-----------------------------------------
fapi::ReturnCode mss_ccs_start_stop( fapi::Target& i_target,
uint32_t i_start_stop);
//----------------------------------------------
// mss_ccs_mode
// Adding info the the Mode Register of the CCS
// Target = centaur.mba
//----------------------------------------------
fapi::ReturnCode mss_ccs_mode( fapi::Target& i_target,
ecmdDataBufferBase i_stop_on_err,
ecmdDataBufferBase i_ue_disable,
ecmdDataBufferBase i_data_sel,
ecmdDataBufferBase i_pclk,
ecmdDataBufferBase i_nclk,
ecmdDataBufferBase i_cal_time_cnt,
ecmdDataBufferBase i_resetn,
ecmdDataBufferBase i_reset_recover,
ecmdDataBufferBase i_copy_spare_cke);
//-----------------------------------------
// mss_ccs_fail_type
// Extracting the type of ccs fail
// Target = centaur.mba
//-----------------------------------------
fapi::ReturnCode mss_ccs_fail_type( fapi::Target& i_target);
//-----------------------------------
// mss_execute_ccs_inst_array
// Execute the CCS intruction array
// Target = centaur.mba
//-----------------------------------
fapi::ReturnCode mss_execute_ccs_inst_array( fapi::Target& i_target,
uint32_t i_num_poll,
uint32_t i_wait_timer);
//-------------------------------------------
// mss_ccs_set_end_bit
// Setting the End location of the CCS array
// Target = centaur.mba
//-------------------------------------------
fapi::ReturnCode mss_ccs_set_end_bit( fapi::Target& i_target,
uint32_t i_instruction_number);
//--------------------------------------------------------
// mss_rcd_parity_check
// Checking the Parity Error Bits associated with the RCD
// Target = centaur.mba
//--------------------------------------------------------
fapi::ReturnCode mss_rcd_parity_check(fapi::Target& i_target,
uint32_t i_port);
//-----------------------------------------
// mss_reverse_32bits, mss_reverse_8bits
// Reversing bit order of 8 or 32 bit uint
//-----------------------------------------
uint32_t mss_reverse_32bits( uint32_t i_x);
uint8_t mss_reverse_8bits(uint8_t i_number);
//-----------------------------------------
// mss_execute_zq_cal
// execute init ZQ Cal on given target and port
// Target = centaur.mba
//-----------------------------------------
fapi::ReturnCode mss_execute_zq_cal(fapi::Target& i_target,
uint8_t i_port);
#endif /* _MSS_FUNCS_H */
|