summaryrefslogtreecommitdiffstats
path: root/src/include/usr/hwpf/hwp/erepairConsts.H
blob: 12a01682b3b2a0999008e5328ddb7d7a07a29afb (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/include/usr/hwpf/hwp/erepairConsts.H $                    */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2012,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                                                     */


/**
 *  @file eRepairConsts.H
 *
 *  @brief eRepair Constants
 */

/*
 * Change Log ******************************************************************
 * Flag     Defect/Feature  User        Date        Description
 * ------   --------------  ----------  ----------- ----------------------------
 *                          bilicon     09/14/2012  Created.
 */

#ifndef EREPAIRCONSTS_H_
#define EREPAIRCONSTS_H_


/******************************************************************************
 * Erepair constants
 *****************************************************************************/

namespace EREPAIR
{

const uint8_t INVALID_FAIL_LANE_NUMBER = 0xFF;

// X-Bus is 78+2 lanes wide in 8 byte mode
// X-Bus is 44+2 lanes wide in 4 byte mode
// Data lanes numbering:  0 - 77 in 8 byte mode
// Spare lanes numbering: 78, 79 in 8 byte mode
// Data lanes numbering:  0 - 43 in 4 byte mode
// Spare lanes numbering: 44, 45 in 8 byte mode
const uint8_t XBUS_8_ACTIVE_LANE_START   = 0;
const uint8_t XBUS_8_ACTIVE_LANE_END     = 77;

const uint8_t XBUS_4_ACTIVE_LANE_START   = 0;
const uint8_t XBUS_4_ACTIVE_LANE_END     = 43;

const uint8_t XBUS_SPARE_DEPLOY_LANE_1   = 0;
const uint8_t XBUS_SPARE_DEPLOY_LANE_2   = 1;
const uint8_t XBUS_MAXSPARES_IN_HW       = 2;

// A-Bus is 21+1 lanes wide.
// Data lanes numbering: 0 - 20
// Spare lane numbering: 21
const uint8_t ABUS_ACTIVE_LANE_START     = 0;
const uint8_t ABUS_ACTIVE_LANE_END       = 20;

const uint8_t ABUS_SPARE_DEPLOY_LANE_1   = 0;
const uint8_t ABUS_MAXSPARES_IN_HW       = 1;

// UpStream DMI-Bus is 21+2 lanes wide.
// Data lanes numbering:  0 - 20
// Spare lanes numbering: 21, 22
const uint8_t DMIBUS_UPSTREAM_ACTIVE_LANE_START   = 0;
const uint8_t DMIBUS_UPSTREAM_ACTIVE_LANE_END     = 20;

// DownStream DMI-Bus is 14+2 lanes wide.
// Data lanes numbering:  0 - 13
// Spare lanes numbering: 14, 15
const uint8_t DMIBUS_DOWNSTREAM_ACTIVE_LANE_START = 0;
const uint8_t DMIBUS_DOWNSTREAM_ACTIVE_LANE_END   = 13;

const uint8_t DMIBUS_SPARE_DEPLOY_LANE_1          = 0;
const uint8_t DMIBUS_SPARE_DEPLOY_LANE_2          = 1;
const uint8_t DMIBUS_MAXSPARES_IN_HW              = 2;

const uint32_t EREPAIR_P8_MODULE_VPD_FIELD_SIZE       = 0x154; // 340 bytes
const uint32_t EREPAIR_P8_MODULE_VPD_MNFG_SIZE        = 0xC4;  // 196 bytes
const uint32_t EREPAIR_MEM_FIELD_VPD_SIZE_PER_CENTAUR = 0x1C;  // 28 bytes
const uint32_t EREPAIR_MEM_MNFG_VPD_SIZE_PER_CENTAUR  = 0x14;  // 20 bytes

enum busType
{
    UNKNOWN_BUS_TYPE = 0,
    PROCESSOR_EI4            = 1,
    PROCESSOR_EDI            = 2,
    MEMORY_EDI               = 3
};

enum interfaceType
{
    UNKNOWN_INT_TYPE         = 0,
    PBUS_DRIVER              = 1,  // X-Bus, A-Bus transmit
    PBUS_RECEIVER            = 2,  // X-Bus, A-Bus receive
    DMI_MCS_RECEIVE          = 3,  // MCS receive
    DMI_MCS_DRIVE            = 4,  // MCS transmit
    DMI_MEMBUF_RECEIVE       = 5,  // Centaur receive
    DMI_MEMBUF_DRIVE         = 6,  // Centaur transmit
    DRIVE                    = 7,  // Tx
    RECEIVE                  = 8   // Rx
};

// VPD Type to read-write
enum erepairVpdType
{
    EREPAIR_VPD_UNKNOWN = 0,
    EREPAIR_VPD_MNFG    = 1,
    EREPAIR_VPD_FIELD   = 2,
};

}// end of EREPAIR namespace

/******************************************************************************
 * VPD Structures.
 *****************************************************************************/

// eRepair Header
struct eRepairHeader
{
   struct
   {
       uint8_t eye1;
       uint8_t eye2;
       uint8_t eye3;
   }eyeCatcher;

   uint8_t  numRecords;
};

// Device info structure of the P8 Processor
struct eRepairProcDevInfo
{
   uint8_t processor_id;// Range:0x00-0xFF. Value:Processor MRU IDs
   uint8_t fabricBus;   // Range:0x00-0xFF. Value: FabricBus(ATTR_CHIP_UNIT_POS) 
};

// eRepair structure for failing lanes on Power Bus
struct eRepairPowerBus
{
   eRepairProcDevInfo device;     // Device info of P8
   uint8_t type      :4;          // Range:0x0-0xF. Value:PROCESSOR_EI4,
                                  //                      PROCESSOR_EDI
   uint8_t interface :4;          // Range:0x0-0xF. Value:PBUS_DRIVER,
                                  //                      PBUS_RECEIVER
   uint8_t failBit;               // Range:0x00-0xFF. Value:Failing lane number
};


// Device info structure of the endpoints of the Memory Channel
struct eRepairMemDevInfo
{
   uint8_t proc_centaur_id;// Range:0x00-0xFF.Value:Processor or Centaur MRU ID
   uint8_t memChannel;   // Range:0x00-0xFF.Value: MemoryBus(ATTR_CHIP_UNIT_POS)
};

// eRepair structure of failing lanes on Memory Channel
struct eRepairMemBus
{
   eRepairMemDevInfo device;        // Device info of P8 and Centaur
   uint8_t             type      :4;// Range:0x0-0xF. Value:MEMORY_EDI
   uint8_t             interface :4;// Range:0x0-0xF. Value:MCS_Receive,
                                    //                      MCS_Drive,
                                    //                      memBuf_Receive,
                                    //                      memBuf_Drive
   uint8_t             failBit;     // Range:0x00-0xFF.
                                    // Value:Failing lane number:0-13 OR 0-20
                                    //       depends on DownStream or UpStream
};

#endif
OpenPOWER on IntegriCloud