summaryrefslogtreecommitdiffstats
path: root/src/usr/hdat/hdathostslcadata.H
blob: 4a03555465f93239d7bca8fbffd0ba868811f0f2 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/hdat/hdathostslcadata.H $                             */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2016                             */
/* [+] 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 HDATHOSTDATA_H_
#define HDATHOSTDATA_H_

namespace HDAT
{

const uint16_t HDAT_SLCA_STRUCT_VERSION    = 0x21;
const char HDAT_SLCA_STRUCT_NAME[7] = "SLCA  ";

struct HDAT_slcaEntry_t
{
    uint16_t fru_index;                 //slca_index_of_this_fru
    uint16_t fru_rid;                   //vpd_resourece_id_of_this_fru
    char fru_id[2];                     //ASCII resource description
    uint16_t parent_index;              //slca_index_of_this_frus_parent
    uint8_t slca_reserved:6,
    non_functional_redundant_copy:1,    //1 = not functional, 0 = functional
    flag_embedded_pluggable:1;          //1 = embedded.  0=pluggable
    uint8_t number_of_children;         //number_of_children
    uint16_t first_child_index;         //slca_index_of_this_frus_first_child
    uint16_t first_child_rid;           //resource_ID of this frus first child
    uint8_t max_location_code_len;
    uint8_t actual_location_code_len;   //length_of_location_code
    char location_code[80];             //location_code (NULL terminated)
    uint16_t first_redundant_index;     //slca index of the redundant copy
    uint8_t number_redundant_copies;    //total number of redundant copy
    uint8_t reserved;
    uint16_t number_of_children_2B;     //number of children - 2 byte version
    uint8_t installed;                  //Is FRU installed
    uint8_t collected;                  //Is FRU VPD collected
};

enum HDAT_FRUType_t
{
 HDAT_SLCA_FRU_TYPE_BP      = 0x00,
 HDAT_SLCA_FRU_TYPE_EV      = 0x01,
 HDAT_SLCA_FRU_TYPE_SV      = 0x02,
 HDAT_SLCA_FRU_TYPE_PROC    = 0x03,
 HDAT_SLCA_FRU_TYPE_MEM     = 0x04,
 HDAT_SLCA_FRU_TYPE_IOP     = 0x05,
 HDAT_SLCA_FRU_TYPE_SP      = 0x06,
 HDAT_SLCA_FRU_TYPE_PS      = 0x07,
 HDAT_SLCA_FRU_TYPE_AM      = 0x08,
 HDAT_SLCA_FRU_TYPE_CU      = 0x09,
 HDAT_SLCA_FRU_TYPE_CE      = 0x0A,
 HDAT_SLCA_FRU_TYPE_OP      = 0x0B,
 HDAT_SLCA_FRU_TYPE_RG      = 0x0C,
 HDAT_SLCA_FRU_TYPE_SA      = 0x0D,
 HDAT_SLCA_FRU_TYPE_EI      = 0x0E,
 HDAT_SLCA_FRU_TYPE_EF      = 0x0F,
 HDAT_SLCA_FRU_TYPE_CS      = 0x10,
 HDAT_SLCA_FRU_TYPE_DIMM    = 0x11,
 HDAT_SLCA_FRU_TYPE_VV      = 0x12,
 HDAT_SLCA_FRU_TYPE_RI      = 0x13,
 HDAT_SLCA_FRU_TYPE_UNKNOWN = 0xFF,
};

struct fru_id_rid_t
{
 uint16_t fru_rid;
 uint8_t fru_id[3];
};

struct hdatSLCAArrayHdr_t
{
 uint32_t hdatOffsetToSLCAArray;
 uint32_t hdatActualNrEntries;
 uint32_t hdatSizeOfEntryAllotted;
 uint32_t hdatActualSizeOfEntry;
};

struct hdatSLCAStruct_t
{
   hdatHDIF_t             hdatHdr;
   hdatHDIFDataHdr_t      hdatSLCAIntData[1];
   uint8_t                hdatPadding[8];
   hdatSLCAArrayHdr_t     hdatSLCAArrayHdr;
};

/**
 * @brief This routine builds the SLCA structure as per HDAT specifications
 *
 * @pre None
 *
 * @post None
 *
 * @param i_msAddr - Mainstore address where SLCA structure is loaded
 *        o_hdatslcaCount - output parameter - Number of SLCA structures
 *        o_hdatslcaSize - output paramster - Size of SLCA created
 *
 * @return errlHndl_t - Error Handle
 *
 * @retval HDAT_OTHER_COMP_ERROR
 */
errlHndl_t hdatBuildSLCA(const HDAT::hdatMsAddr_t &i_msAddr,
                               uint32_t &o_hdatslcaCount,
                               uint32_t &o_hdatslcaSize);

/**
 * @brief This routine copies the SLCA from a source address to a destination
 *        address
 *
 * @pre None
 *
 * @post None
 *
 * @param i_msAddrSource - input parameter - Source address of SLCA
 *        i_msAddrDest   - input parameter - Destination address of SLCA
 *        i_slcaSize     - input parameter - Size of SLCA to be copied
 *
 * @return None
 *
 * @retval HDAT_OTHER_COMP_ERROR
 */
void hdatMoveSLCA(const HDAT::hdatMsAddr_t &i_msAddrSource,
                   const HDAT::hdatMsAddr_t &i_msAddrDest,
                   uint32_t i_slcaSize);

}
#endif
OpenPOWER on IntegriCloud