summaryrefslogtreecommitdiffstats
path: root/src/usr/hdat/hdatbldda.H
blob: 7ac6a499494c0782526813e260ed934b4cb8d6bc (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/hdat/hdatbldda.H $                                    */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2016,2017                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

#ifndef HDATBLDDA_H
#define HDATBLDDA_H


/**
 *  @file hdatbldda.H
 *
 *  @brief This file contains the interfaces for building hypervisor data
 *         areas.
 */

/*----------------------------------------------------------------------------*/
/* Includes                                                                   */
/*----------------------------------------------------------------------------*/
#include <stdint.h>          // standard types
#include <hdat/hdat.H>            // HDAT header type definitions
#include "hdatvpd.H"
#include <errl/errlentry.H>       // ErrlEntry class definition
#include <hdat/hdat_reasoncodes.H>
#include <../vpd/mvpd.H>
#include <../vpd/ipvpd.H>
#include <../vpd/pvpd.H>
using namespace MVPD;
using namespace PVPD;
using namespace IPVPD;

namespace HDAT
{

/** @brief Constant for the eye catcher for VPD structures
 */
const char HDAT_FRU_VPD_STRUCT_NAME[] = "FRUVPD";
const char HDAT_SYS_VPD_STRUCT_NAME[] = "SYSVPD";


/** @enum hdatSpiraDataAreas
 *        This enumeration defines the various data areas that must be built
 T_MISC_VPD_FILE_NAME
 *        processor.
 *        This list must be kept in the same order as the 5-tuple entries in
 *        the SPIRA.
 *
 *        If the order is changed, entries are added, or entries are deleted,
 *        update the HDAT_STR_NAME array in hdatPrtSpira().
 */
enum hdatSpiraDataAreas
{
  HDAT_SPIRA_DA_FIRST   = 0,
  HDAT_SP_SUBSYS        = 0,    // service processor subsystem
  HDAT_IPL_PARAMS        = 1,    // IPL parameters
  HDAT_ENCLOSURE_VPD    = 2,    // enclosure vital product data
  HDAT_SLCA             = 3,    // slot location code array
  HDAT_BACKPLANE_VPD    = 4,    // backplane vital product data
  HDAT_SYS_VPD          = 5,    // system vital product data
  HDAT_CHIP_TOD         = 6,    // chip time-of-day
  HDAT_PROC_INIT        = 7,    // phyp-supplied processor init data
  HDAT_CLOCK_VPD        = 8,    // clock vital product data
  HDAT_ANCHOR_VPD       = 9,    // anchor card vital product data
  HDAT_OP_PNL_VPD       = 10,   // operator panel vital product data
  HDAT_L3_VPD           = 11,   // level 3 cache vital product data
  HDAT_MISC_CEC_VPD     = 12,   // miscellaneous FRU vital product data
  HDAT_PACA             = 13,   // processor address communication area
  HDAT_MDT              = 14,   // memory description tree
  HDAT_IO_HUB           = 15,   // I/O hub FRU array
  HDAT_CPU_CTRL         = 16,   // CPU controls
  HDAT_MS_DUMP_SRC_TBL  = 17,   // mainstore dump source table (can change at run time)
  HDAT_MS_DUMP_DST_TBL  = 18,   // mainstore dump destination table (can change at run time)
  HDAT_MS_DUMP_RSLT_TBL = 19,   // mainstore dump results table
  HDAT_SPIRA_DA_GA1LAST = 20,   // End of list for 1st eclipz release
  HDAT_HEAP             = 20,   // Phyp allocated storage location for most of the data
  HDAT_SPIRA_OLDPACA_LAST = 21, // This was last entry for old PACA format.                                  //bs01a

  HDAT_PCIA             = 21,   // PCIA (Core information area) starting out on  P7+                         //bs01a
  HDAT_PCRD             = 22,   // PCRD (Chip related data area) starting out on P7+                         //bs01a
  HDAT_HOSTSR           = 23,   // HOSTSR (Host service data) starting out on P8                             //rij01A
  HDAT_SPIRA_DA_LAST    = 24                                                                                 //bs01c
};

/**
 * @brief The routines in this file drive the building of the various hypervisor
 *        data areas
 *
 * @pre
 *
 * @post
 *
 * @param[in] i_dataArea - An identifier for the specific data area
 * @param[in] i_msAddr   - The main store address where this data area
 *                     will be written to.
 * @param[out] o_count - number of instance of each area
 * @param[out] o_size  - actual size wrote to memory
 *
 * @return A null error log handle if successful, else the return code pointed 
 *         to by errlHndl_t contains one of:
 *
 */

/* Build the specific VPD data areas */
errlHndl_t hdatBldSpecificVpd(hdatSpiraDataAreas i_dataArea,
                              const hdatMsAddr_t &i_msAddr,
                              uint32_t &o_count,
                              uint32_t &o_size);

/**
 * @brief This function build vpd structure and write the data to MS memory.
 *
 * @pre
 *
 * @post
 *
 * @param[in] i_msAddr   - The main store address where this data area
 * @param[in] i_dataArea - An identifier for the specific data area
 *                     will be written to.
 * @param[in] i_fetchVpd - VPD record and keyword details                    
 * @param[in] i_size     - number of entries in VPD table
 * @param[in] i_vpdtype  - type of fru
 * @param[out] o_count - number of instance of each area
 * @param[out] o_size  - actual size wrote to memory
 *
 * @return A null error log handle if successful, else the return code pointed 
 *         to by errlHndl_t contains one of:
 *
 */
errlHndl_t hdatProcessFru(const hdatMsAddr_t &i_msAddr,
                                const hdatSpiraDataAreas i_dataArea,
                                const IpVpdFacade::recordInfo i_fetchVpd[],
                                const uint8_t i_size,
                                vpdType i_vpdtype,
                                uint32_t &o_count,
                                uint32_t &o_size);
};
#endif //HDATBLDDA_H
OpenPOWER on IntegriCloud