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
|
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/hwpf/hwp/dmi_training/proc_dmi_scominit/proc_dmi_scominit.C $ */
/* */
/* IBM CONFIDENTIAL */
/* */
/* COPYRIGHT International Business Machines Corp. 2013,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: proc_dmi_scominit.C,v 1.10 2014/05/08 20:46:32 jmcgill Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/proc_dmi_scominit.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2012
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//------------------------------------------------------------------------------
// *! TITLE : proc_dmi_scominit.C
// *! DESCRIPTION : Invoke DMI initfiles (FAPI)
// *!
// *! OWNER NAME : Mike Jones Email: mjjones@us.ibm.com
// *! BACKUP NAME : Joe McGill Email: jmcgill@us.ibm.com
// *!
// *! ADDITIONAL COMMENTS :
// *!
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Version Date Owner Description
//------------------------------------------------------------------------------
// 1.9 03/10/14 jmcgill Add endpoint power up
// 1.8 10/08/13 jmcgill Updates for RAS review
// 1.7 05/14/13 jmcgill Address review comments
// 1.6 05/01/13 jgrell Added proc chip target
// 1.5 02/06/13 jmcgill Change passed targets in order to match
// scominit file updates.
// 1.4 02/04/13 thomsen Fixed informational print to not say
// Error
// 1.3 01/23/13 thomsen Added separate calls to base &
// customized scominit files. Removed
// separate calls to SIM vs. HW scominit
// files
// 1.2 01/10/13 thomsen Added separate calls to SIM vs. HW
// scominit files
// Added commented-out call to OVERRIDE
// initfile for system/bus/lane specific
// inits
// Changed passed targets in order to match
// scominit file updates.
// CO-REQs required:
// p8.dmi.vbu.scom.initfile v1.1 and
// p8.dmi.hw.scom.initfile v1.1
// 1.1 8/11/12 jmcgill Initial release
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#include <fapiHwpExecInitFile.H>
#include <proc_dmi_scominit.H>
#include <p8_scom_addresses.H>
//------------------------------------------------------------------------------
// Constant definitions
//------------------------------------------------------------------------------
// map MCS chiplet ID -> associated bus IORESET bit in IOMC SCOM_MODE_PB
// register
const uint8_t IOMC_SCOM_MODE_PB_IORESET_BIT[8] = { 5,4,2,3,5,4,2,3 };
extern "C" {
//------------------------------------------------------------------------------
// Function definitions
//------------------------------------------------------------------------------
// HWP entry point, comments in header
fapi::ReturnCode proc_dmi_scominit(const fapi::Target & i_target)
{
fapi::ReturnCode rc;
uint32_t rc_ecmd = 0x0;
fapi::Target this_pu_target;
std::vector<fapi::Target> targets;
fapi::Target cen_target;
uint8_t mcs_pos;
ecmdDataBufferBase data(64);
// mark HWP entry
FAPI_INF("proc_dmi_scominit: Start");
do
{
// test target type to confirm correct before calling initfile(s)
// to execute
if (i_target.getType() == fapi::TARGET_TYPE_MCS_CHIPLET)
{
rc = fapiGetOtherSideOfMemChannel(i_target,
cen_target,
fapi::TARGET_STATE_FUNCTIONAL);
// use return code only to indicate presence of connected Centaur,
// do not propogate/emit error if not connected
if (rc.ok())
{
// set the init state attribute to DMI_ACTIVE
uint8_t attr_mss_init_state = fapi::ENUM_ATTR_MSS_INIT_STATE_DMI_ACTIVE;
rc = FAPI_ATTR_SET(ATTR_MSS_INIT_STATE,
&cen_target,
attr_mss_init_state);
if (!rc.ok())
{
FAPI_ERR("proc_dmi_scominit: Error from FAPI_ATTR_SET (ATTR_MSS_INIT_STATE) on %s",
cen_target.toEcmdString());
break;
}
}
else
{
rc = fapi::FAPI_RC_SUCCESS;
}
// assert IO reset to power-up bus endpoint logic
rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &i_target, mcs_pos);
if (!rc.ok())
{
FAPI_ERR("proc_dmi_scominit: Error from FAPI_ATTR_GET (ATTR_CHIP_UNIT_POS) on %s",
i_target.toEcmdString());
break;
}
// read-modify-write, set single reset bit (HW auto-clears)
// on writeback
rc = fapiGetScom(i_target, IOMC_SCOM_MODE_PB_0x02011A20, data);
if (!rc.ok())
{
FAPI_ERR("proc_dmi_scominit: Error from fapiGetScom (IOMC_SCOM_MODE_PB_0x02011A20) on %s",
i_target.toEcmdString());
break;
}
rc_ecmd |= data.setBit(IOMC_SCOM_MODE_PB_IORESET_BIT[mcs_pos]);
if (rc_ecmd)
{
FAPI_ERR("proc_dmi_scominit: Error 0x%x forming IOMC SCOM Mode PB register data buffer on %s",
rc_ecmd, i_target.toEcmdString());
rc.setEcmdError(rc_ecmd);
break;
}
rc = fapiPutScom(i_target, IOMC_SCOM_MODE_PB_0x02011A20, data);
if (!rc.ok())
{
FAPI_ERR("proc_dmi_scominit: Error from fapiPutScom (IOMC_SCOM_MODE_PB_0x02011A20) on %s",
i_target.toEcmdString());
break;
}
// get parent chip target
rc = fapiGetParentChip(i_target, this_pu_target);
if (!rc.ok())
{
FAPI_ERR("proc_dmi_scominit: Error from fapiGetParentChip (%s)",
i_target.toEcmdString());
break;
}
// populate targets vector
targets.push_back(i_target); // chiplet target
targets.push_back(this_pu_target); // chip target
// Call BASE DMI SCOMINIT
FAPI_INF("proc_dmi_scominit: fapiHwpExecInitfile executing %s on %s, %s",
MCS_DMI_BASE_IF,
i_target.toEcmdString(),
this_pu_target.toEcmdString());
FAPI_EXEC_HWP(rc, fapiHwpExecInitFile, targets, MCS_DMI_BASE_IF);
if (!rc.ok())
{
FAPI_ERR("proc_dmi_scominit: Error from fapiHwpExecInitfile executing %s on %s, %s",
MCS_DMI_BASE_IF,
i_target.toEcmdString(),
this_pu_target.toEcmdString());
break;
}
// Call CUSTOMIZED DMI SCOMINIT
FAPI_INF("proc_dmi_scominit: fapiHwpExecInitfile executing %s on %s, %s",
MCS_DMI_CUSTOM_IF,
i_target.toEcmdString(),
this_pu_target.toEcmdString());
FAPI_EXEC_HWP(rc, fapiHwpExecInitFile, targets, MCS_DMI_CUSTOM_IF);
if (!rc.ok())
{
FAPI_ERR("proc_dmi_scominit: Error from fapiHwpExecInitfile executing %s on %s, %s",
MCS_DMI_CUSTOM_IF,
i_target.toEcmdString(),
this_pu_target.toEcmdString());
break;
}
}
// unsupported target type
else
{
FAPI_ERR("proc_dmi_scominit: Unsupported target type");
const fapi::Target & MCS_TARGET = i_target;
FAPI_SET_HWP_ERROR(rc, RC_PROC_DMI_SCOMINIT_INVALID_TARGET);
break;
}
} while (0);
// mark HWP exit
FAPI_INF("proc_dmi_scominit: End");
return rc;
}
} // extern "C"
|