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
|
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/hwpf/hwp/build_winkle_images/p8_set_pore_bar/p8_pm.H $ */
/* */
/* IBM CONFIDENTIAL */
/* */
/* COPYRIGHT International Business Machines Corp. 2012,2013 */
/* */
/* 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: p8_pm.H,v 1.7 2013/08/02 19:02:43 stillgs Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/fapi/p8_pm.H,v $
//------------------------------------------------------------------------------
// *|
// *! (C) Copyright International Business Machines Corp. 2011
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
// *|
// *! TITLE : p8_pm.H
// *! DESCRIPTION : Common header for Power Manangement procedures
// *!
// *! OWNER NAME : Greg Still Email: stillgs@us.ibm.com
// *! BACKUP NAME : Jim Yacynych Email: jimyac@us.ibm.com
// *!
//------------------------------------------------------------------------------
#ifndef _P8_PM_H_
#define _P8_PM_H_
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#include <fapi.H>
#include "p8_scom_addresses.H"
extern "C" {
//------------------------------------------------------------------------------
// Constant definitions
//------------------------------------------------------------------------------
#ifndef _P8_PM_FLOW_MODE
#define _P8_PM_FLOW_MODE
enum p8_PM_FLOW_MODE {
PM_CONFIG = 0x1,
PM_RESET = 0x2,
PM_INIT = 0x3,
PM_SETUP = 0x4,
PM_SETUP_PIB = 0x5,
PM_SETUP_ALL = 0x6,
PM_RESET_SOFT = 0x7,
PM_CONFIG_SOFT = PM_CONFIG,
PM_INIT_SOFT = 0x8,
PM_INIT_SPECIAL = 0x9
};
#endif // _P8_PM_FLOW_MODE
// Macros to enhance readability yet provide for error handling
// Assume the error path is to break out of the current loop. If nested loops
// are employed, the error_flag can be used to break out of the necessary
// levels.
#define PUTSCOM(_mi_rc, _mi_target, _mi_address, _mi_buffer){ \
_mi_rc = fapiPutScom(_mi_target, _mi_address, _mi_buffer); \
if(!_mi_rc.ok()) \
{ \
FAPI_ERR("PutScom error to address 0x%08llx", _mi_address); \
break; \
} \
}
#define GETSCOM(_mi_rc, _mi_target, _mi_address, _mi_buffer){ \
_mi_rc = fapiGetScom(_mi_target, _mi_address, _mi_buffer); \
if(!_mi_rc.ok()) \
{ \
FAPI_ERR("GetScom error to address 0x%08llx", _mi_address); \
break; \
} \
}
#define E_RC_CHECK(_mi_e_rc, _mi_l_rc){ \
if (_mi_e_rc) \
{ \
FAPI_ERR("Error (0x%x) accessing ecmdDataBufferBase", _mi_e_rc);\
_mi_l_rc.setEcmdError(_mi_e_rc); \
break; \
} \
}
#define GETATTR_DEFAULT(_mi_rc, _mi_attr, _mi_attr_name, _mi_target, _mi_value, _mi_default){\
_mi_rc = FAPI_ATTR_GET(_mi_attr, _mi_target, _mi_value); \
if (_mi_rc) \
{ \
FAPI_ERR("fapiGetAttribute of %s with rc = 0x%x", _mi_attr_name, (uint32_t)_mi_rc); \
break; \
} \
FAPI_INF (" value read from attribute %s = 0x%x", _mi_attr_name, _mi_value ); \
if (!_mi_value) \
{ \
FAPI_DBG(" setting value of read attribute %s to default = 0x%x", _mi_attr_name, _mi_default ); \
_mi_value = _mi_default;\
} \
}
#define GETATTR(_mi_rc, _mi_attr, _mi_attr_name, _mi_target, _mi_value){\
_mi_rc = FAPI_ATTR_GET(_mi_attr, _mi_target, _mi_value); \
if (_mi_rc) \
{ \
FAPI_ERR("fapiGetAttribute of %s with rc = 0x%x", _mi_attr_name, (uint32_t)rc); \
break; \
} \
FAPI_INF (" value read from attribute %s = 0x%x", _mi_attr_name, _mi_value ); \
}
#define SETATTR(_mi_rc, _mi_attr, _mi_attr_name, _mi_target, _mi_value){\
_mi_rc = FAPI_ATTR_SET(_mi_attr, _mi_target, _mi_value); \
if (_mi_rc) \
{ \
FAPI_ERR("fapiSetAttribute of %s with rc = 0x%x", _mi_attr_name, (uint32_t)_mi_rc); \
break; \
} \
FAPI_INF (" value written to attribute %s = 0x%x", _mi_attr_name, _mi_value ); \
}
} // extern "C"
#endif // _P8_PM_H_
|