summaryrefslogtreecommitdiffstats
path: root/src/usr/isteps/istep08/sbe_extract_rc_handler.H
blob: a83febf2210dc1351d049ec94eb494cadb59aa35 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/isteps/istep08/sbe_extract_rc_handler.H $             */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 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 __SBE_EXTRACT_RC_HANDLER_H
#define __SBE_EXTRACT_RC_HANDLER_H

/*************************** State declarations ***************************/
/**
 * @brief This is the initial retry. If we get to a failure, we attempt to
 *  reboot the SBE on the other side.
 *
 * @param[in] i_target     - current proc target
 * @param[in] i_prev_error - Previous SBE error
 *
 * @return - pass(0) or specific returned SBE error
 */
P9_EXTRACT_SBE_RC::RETURN_ACTION same_side_retry_state(
                TARGETING::Target * i_target,uint8_t i_prev_error);

/**
 * @brief This is the other side retry.  If we fail twice on the same side
 *        We attempt to reboot the SBE on the other proc.
 *
 * @param[in] i_target     - current proc target
 * @param[in] i_prev_error - Previous SBE error
 *
 * @return - pass(0) or specific returned SBE error
 */
P9_EXTRACT_SBE_RC::RETURN_ACTION other_side_state(
                TARGETING::Target * i_target,uint8_t i_prev_error);

/**
 * @brief This is the working (passing) exit state.  This state occurs when
 *        we start an SBE correctly within the threshold FSM. Depending on
 *        which state we come from, there are some different functions.
 *
 * @param[in] i_target     - current proc target
 * @param[in] i_prev_error - Previous SBE error
 *
 * @return - pass(0) or specific returned SBE error
 */
P9_EXTRACT_SBE_RC::RETURN_ACTION working_exit_state(
                TARGETING::Target * i_target,uint8_t i_prev_error);

/**
 * @brief This is the failing exit state.  This state only occurs when we
 *        fail on every retry.  In this case we look at where we came from
 *        and either escalate to REIPL_BKP_SEEPROM or we gard and callout
 *        this proc and return to complete the istep.
 *
 * @param[in] i_target     - current proc target
 * @param[in] i_prev_error - Previous SBE error
 *
 * @return - pass(0) or specific returned SBE error
 */
P9_EXTRACT_SBE_RC::RETURN_ACTION failing_exit_state(
                TARGETING::Target * i_target,uint8_t i_prev_error);

/**
 * @brief This is the main function of the finite state machine.  It handles
 *        the outputs, current state and next state transitions.
 *
 * @param[in] i_procSide      - Which side we want to try to reboot.
 *                              0/1: current/other
 * @param[in] i_target        - Current Proc target
 * @param[in] i_currentAction - Most recent return value from HWP
 * @param[in] i_previousError - The previous return value from HWP
 */
void sbe_threshold_handler( bool i_procSide,
                            TARGETING::Target * i_target,
                            P9_EXTRACT_SBE_RC::RETURN_ACTION i_currentAction,
                            uint8_t i_previousError );

/**
 * @brief This is the switch case that handles the different actions needed for
 *        each output of the proc_extract_sbe_rc HWP.
 *
 * @param[in] i_target         - current proc target
 * @param[in] i_previous_error - The previous return value from HWP
 * @param[in] i_current_error  - The most recent return value from HWP
 *
 * @return - NULL
 */
void proc_extract_sbe_handler( TARGETING::Target * i_target,
                uint8_t i_previous_error, uint8_t i_current_error);
#endif
OpenPOWER on IntegriCloud