summaryrefslogtreecommitdiffstats
path: root/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H
blob: 6db2eaf5badd018c5121c7952bdf2e612909d643 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/include/usr/hwpf/fapi/fapiMBvpdAccess.H $                 */
/*                                                                        */
/* 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: fapiMBvpdAccess.H,v 1.9 2014/01/20 20:03:18 mjjones Exp $
/**
 *  @file fapiMBvpdAccess.H
 *
 *  @brief Defines the Memory Bus (Centaur) VPD functions that platform
 *   must implement
 *
 */

/*
 * Change Log ******************************************************************
 * Flag     Defect/Feature  User        Date        Description
 * ------   --------------  ----------  ----------- ----------------------------
 *                          whs         01/24/2013  Added fapiGetMBvpdField
 *                          whs         04/29/2013  Added VSPD record, keywords
 */

#ifndef _FAPI_FAPIMBVPDACCESS_H_
#define _FAPI_FAPIMBVPDACCESS_H_

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

namespace fapi
{
    enum MBvpdRecord
    {
        MBVPD_RECORD_VEIR = 0x00,
        MBVPD_RECORD_VER0 = 0x01,
        MBVPD_RECORD_MER0 = 0x02,
        MBVPD_RECORD_VSPD = 0x03,
        MBVPD_RECORD_VINI = 0x04,
    };

    enum MBvpdKeyword
    {
        MBVPD_KEYWORD_PDI = 0x00,
        MBVPD_KEYWORD_PF  = 0x01,
        MBVPD_KEYWORD_MT  = 0x02,
        MBVPD_KEYWORD_MR  = 0x03,
        MBVPD_KEYWORD_PDA = 0x04,
        MBVPD_KEYWORD_EL  = 0x05,
        MBVPD_KEYWORD_LM  = 0x06,
        MBVPD_KEYWORD_MW  = 0x07,
        MBVPD_KEYWORD_MV  = 0x08,
        MBVPD_KEYWORD_AM  = 0x09,
        MBVPD_KEYWORD_VZ  = 0x0a,
        MBVPD_KEYWORD_PDD = 0x0b,
        MBVPD_KEYWORD_MX  = 0x0c,
    };

}

extern "C"
{

/**
 *  @brief Get Memory Buffer (Centaur)  VPD field.
 *  
 *  A Memory Buffer VPD field is specified using a record and keyword enumerator
 *  
 *  Suggested way to call this routine is to call it once with a NULL buffer
 *  pointer to to retrieve the size of the record, then allocate the proper
 *  size of the buffer and call again.
 *
 *  @param[in] i_record       Record enumerator
 *  @param[in] i_keyword      Keyword enumerator
 *  @param[in] i_memBufTarget Reference to memory buffer chip target for
 *                            the record
 *  @param[in] i_pBuffer      Pointer to buffer where record will be stored. If
 *                            NULL then the size of record will be stored in
 *                            io_fieldSize
 *  @param[io] io_fieldSize   Size of i_pBuffer in bytes
 *
 *  @return fapi::ReturnCode. FAPI_RC_SUCCESS, or failure value.
 */
fapi::ReturnCode fapiGetMBvpdField(const fapi::MBvpdRecord i_record,
                                  const fapi::MBvpdKeyword i_keyword,
                                  const fapi::Target &i_memBufTarget,
                                  uint8_t * const i_pBuffer,
                                  uint32_t &io_fieldSize);

/**
 *  @brief Set Memory Buffer (Centaur) VPD field.
 *
 *  A Memory Buffer VPD field is specified using a record and keyword enumerator
 *
 *  @param[in] i_record       Record enumerator
 *  @param[in] i_keyword      Keyword enumerator
 *  @param[in] i_memBufTarget Reference to memory buffer chip target for
 *                            the record
 *  @param[in] i_pBuffer      Pointer to buffer where data to set is stored
 *  @param[io] i_fieldSize    Size of i_pBuffer in bytes
 *
 *  @return fapi::ReturnCode. FAPI_RC_SUCCESS, or failure value.
 */
fapi::ReturnCode fapiSetMBvpdField(const fapi::MBvpdRecord i_record,
                                  const fapi::MBvpdKeyword i_keyword,
                                  const fapi::Target &i_memBufTarget,
                                  const uint8_t * const i_pBuffer,
                                  const uint32_t i_fieldSize);
}

#endif
OpenPOWER on IntegriCloud