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
186
187
188
189
190
191
192
193
194
195
|
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/hwpf/hwp/bus_training/io_funcs.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2014 */
/* [+] 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 */
// $Id: io_funcs.H,v 1.17 2014/02/20 13:27:29 varkeykv Exp $
// *!***************************************************************************
// *! (C) Copyright International Business Machines Corp. 1997, 1998
// *! All Rights Reserved -- Property of IBM
// *! *** ***
// *!***************************************************************************
// *! FILENAME : IO_funcs.H
// *! TITLE :
// *! DESCRIPTION : IO training comomon functions
// *! CONTEXT :
// *!
// *! OWNER NAME : Varghese, Varkey Email: varkey.kv@in.ibm.com
// *! BACKUP NAME : Vijay S Kantanavar Email: vijaysk@in.ibm.com
// *!
// *!***************************************************************************
// CHANGE HISTORY:
//------------------------------------------------------------------------------
// Version:|Author: | Date: | Comment:
// --------|--------|--------|--------------------------------------------------
// 1.0 |varkeykv|11/17/11| Combined other header files into one common file
//------------------------------------------------------------------------------
/****************************************************************************************/
/* IO_funcs.H */
/****************************************************************************************/
#ifndef IO_funcs
#define IO_funcs
#include <fapi.H>
#include "gcr_funcs.H"
#include "io_clear_firs.H"
using namespace fapi;
// Bus Status State
typedef enum { NOT_RUNNING, SELECTED, RUNNING, SUCCESSFULL ,
FAILED} bus_status;
class edi_training {
public:
// Training enums for Wire test , Deskew , Eye Opt ,Repair , Functional ---
typedef enum { WIRE_TEST , DESKEW , EYE_OPT , REPAIR , FUNCTIONAL
, TRAINING_TYPES} training_function;
// Selection
bus_status wire_test_selected;
bus_status desckew_selected;
bus_status eye_opt_selected;
bus_status repair_selected;
bus_status functional_selected;
// Current Training States
bus_status wire_test_status;
bus_status desckew_status;
bus_status eye_opt_status;
bus_status repair_status;
bus_status functional_status;
//Updating max cycles to suit 280ms theoretical max timeout as per Mike Spear
static const uint32_t max_poll_cycles=1000;
static const uint32_t increment_poll_cycles=1;
uint32_t endpoints_set; // How many end points have we accessed so far
bool rx_wderf_timeout[6]; // Summary 5 bit timout status
bool rx_wderf_start[6]; // Summary 5 bit status
bool rx_wderf_done[6]; // Summary 5 bit done
bool rx_wderf_failed[6]; // Summary 5 bit failed
// Constructor Initializes default states for status variables
edi_training( bus_status wire_test=SELECTED,bus_status deskew=SELECTED,bus_status eye_opt=SELECTED,bus_status repair=SELECTED,bus_status functional=SELECTED)
{
wire_test_selected = wire_test;
desckew_selected = deskew;
eye_opt_selected = eye_opt;
repair_selected = repair;
functional_selected = functional;
wire_test_status = wire_test;
desckew_status = deskew;
eye_opt_status = eye_opt;
repair_status = repair;
functional_status = functional;
for(int i=0;i<6;++i)
{
rx_wderf_timeout[i]=false;
rx_wderf_start[i]=false;
rx_wderf_done[i]=false;
rx_wderf_failed[i]=false;
}
endpoints_set=0; // reset this for multi endpoint pair runs
}
//! Destructor
~edi_training() {
}
// Training Functions
// Run Wirtest,Deskew,Repair and Functional mode on selected target(endpoint) pair
ReturnCode run_training(const Target& master_target, io_interface_t
master_interface,uint32_t master_group,const Target& slave_target,
io_interface_t slave_interface,uint32_t slave_group);
// Runs the selected training function(s)
ReturnCode run_training_functions(const Target& target,
io_interface_t interface,uint32_t current_group);
// Checks the status of the training selected function(s)
ReturnCode training_function_status(const Target& master_target,
io_interface_t master_interface,uint32_t master_group,
const Target& slave_target,
io_interface_t slave_interface,uint32_t slave_group
);
// First Fail Data Capture Routines
// Wire Test First Fail Data Capture
ReturnCode dump_ffdc_wiretest(const Target& master_chip_target,
io_interface_t master_chip_interface ,
uint32_t master_group,
const Target& slave_chip_target ,
io_interface_t slave_chip_interface,
uint32_t slave_group
);
// First Fail Data Capture Routines
// Deskew First Fail Data Capture
ReturnCode dump_ffdc_deskew(const Target& master_chip_target,
io_interface_t master_chip_interface ,
uint32_t master_group,
const Target& slave_chip_target ,
io_interface_t slave_chip_interface,
uint32_t slave_group
);
// Eye opt First Fail Data Capture
ReturnCode dump_ffdc_eyeopt(const Target& master_chip_target,
io_interface_t master_chip_interface ,
uint32_t master_group,
const Target& slave_chip_target ,
io_interface_t slave_chip_interface,
uint32_t slave_group
);
// Repair First Fail Data Capture
ReturnCode dump_ffdc_repair(const Target& master_chip_target,
io_interface_t master_chip_interface ,
uint32_t master_group,
const Target& slave_chip_target ,
io_interface_t slave_chip_interface,
uint32_t slave_group
);
// FUnc mode First Fail Data Capture
ReturnCode dump_ffdc_func(const Target& master_chip_target,
io_interface_t master_chip_interface ,
uint32_t master_group,
const Target& slave_chip_target ,
io_interface_t slave_chip_interface,
uint32_t slave_group
);
// Utility functions
// Determines if target chip is a Master (reads rx_master_mode bit)
ReturnCode isChipMaster(const Target& target, io_interface_t interface,uint32_t current_group,
bool& master_chip_found
);
};
/* functions */
#endif
|