summaryrefslogtreecommitdiffstats
path: root/src/include/usr/hwpf/fapi/fapiPlatHwAccess.H
blob: eb6451d66c9f2453914f7962942ef684353cd5f4 (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
//  IBM_PROLOG_BEGIN_TAG
//  This is an automatically generated prolog.
//
//  $Source: src/include/usr/hwpf/fapi/fapiHwAccess.H $
//
//  IBM CONFIDENTIAL
//
//  COPYRIGHT International Business Machines Corp. 2011
//
//  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 fapiPlatHwAccess.H
 *
 *  @brief Defines hardware-access functions for the platform layer.  
 *         Hardware procedure writers will not call these functions. 
 *       
 *         Implementors of platform code will provide worker routines
 *         for these functions in file hwpf/plat/fapiPlatHwAccess.C.
 *         fapi.H will not include this file, so platform implementors
 *         will have to include this file explicitly. 
 * 
 *         These platform entry points are called by fapi functions from 
 *         hwpf/fapi/fapiHwAccess.C which are wrapper functions that 
 *         output scand traces common to all platforms.  
 * 
 *         These functions have the same argument signatures as the
 *         fapi-level functions, but the function names her start with 
 *         "plat."
 *     
 */

/*
 * Change Log ******************************************************************
 * Flag     Defect/Feature  User        Date        Description
 * ------   --------------  ----------  ----------- ----------------------------
 *                          monte       8sep2011    new
 *                          mjjones     11/10/2011  Use ecmdDataBufferBase
 */

#ifndef FAPIPLATHWACCESS_H_
#define FAPIPLATHWACCESS_H_

#include <stdint.h>
#include <ecmdDataBufferBase.H>
#include <fapiReturnCode.H>
#include <fapiTarget.H>


extern "C"
{

//------------------------------------------------------------------------------
// HW Communication Functions to be implemented at the platform layer.
//------------------------------------------------------------------------------


/**
 * @brief Platform-level implementation called by GetScom()
 * Hardware procedures writers will not call this function.
 * 
 * 
 * @param[in] i_target Target to operate on
 * @param[in] i_address Scom address to read from
 * @param[out] o_data ecmdDataBufferBase object that holds data read from
 *                    address
 * @return ReturnCode. Zero on success, else platform specified error
 */
fapi::ReturnCode platGetScom(const fapi::Target& i_target,
                             const uint64_t i_address,
                             ecmdDataBufferBase & o_data);


/**
 * @brief Platform-level implementation called by PutScom().
 * Hardware procedures writers will not call this function.
 * 
 * @param[in] i_target Target to operate on
 * @param[in] i_address Scom address to write to
 * @param[in] i_data ecmdDataBufferBase object that holds data to write into
 *                   address
 * @return ReturnCode. Zero on success, else platform specified error
 */
fapi::ReturnCode platPutScom(const fapi::Target& i_target,
                             const uint64_t i_address,
                             ecmdDataBufferBase & i_data);


/**
 * @brief Platform-level implementation called by PutScomUnderMask()
 * Hardware procedures writers will not call this function.
 * 
 * @param[in] i_target Target to operate on
 * @param[in] i_address Scom address to write to
 * @param[in] i_data ecmdDataBufferBase object that holds the data
 * @param[in] i_mask ecmdDataBufferBase object that holds the mask (i_data to
 *                   write)
 * @return ReturnCode. Zero on success, else platform specified error
 */
fapi::ReturnCode platPutScomUnderMask(const fapi::Target& i_target,
                                      const uint64_t i_address,
                                      ecmdDataBufferBase & i_data,
                                      ecmdDataBufferBase & i_mask);


/**
 * @brief Platorm-level implementation called by GetCfamRegister()
 * Hardware procedures writers will not call this function.
 * 
 * @param[in] i_target Target to operate on
 * @param[in] i_address CFAM address to read from
 * @param[out] o_data ecmdDataBufferBase object that holds data read from
 *                    address
 * @return ReturnCode. Zero on success, else platform specified error
 */
fapi::ReturnCode platGetCfamRegister(const fapi::Target& i_target,
                                     const uint32_t i_address,
                                     ecmdDataBufferBase & o_data);


/**
 * @brief Platform-level implementation called by PutCfamRegister()
 * Hardware procedures writers will not call this function.
 * 
 * @param[in] i_target Target to operate on
 * @param[in] i_address CFAM address to write to
 * @param[in] i_data ecmdDataBufferBase object that holds data to write into
 *                   address
 * @return ReturnCode. Zero on success, else platform specified error
 */
fapi::ReturnCode platPutCfamRegister(const fapi::Target& i_target,
                                     const uint32_t i_address,
                                     ecmdDataBufferBase & i_data);


/**
 * @brief Platform-level implementation of ModifyCfamRegister()
 * Hardware procedures writers will not call this function.
 * 
 * @param[in] i_target Target to operate on
 * @param[in] i_address CFAM address to write to
 * @param[in] i_data ecmdDataBufferBase object that holds the modifying data
 * @param[in] i_modifyMode The modify mode (or/and/xor)
 * @return ReturnCode. Zero on success, else platform specified error
 */
fapi::ReturnCode platModifyCfamRegister(const fapi::Target& i_target,
                                  const uint32_t i_address,
                                  ecmdDataBufferBase & i_data,
                                  const fapi::ChipOpModifyMode i_modifyMode);


} // extern "C"

#endif // FAPIPLATHWACCESS_H_
OpenPOWER on IntegriCloud