summaryrefslogtreecommitdiffstats
path: root/src/import/chips/centaur/procedures/hwp/memory/p9c_mss_memdiags.H
blob: 92baa9d6d9e0f700ebef5d888be8c291b72ba2af (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/import/chips/centaur/procedures/hwp/memory/p9c_mss_memdiags.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 _MSS_MEMDIAGS_H
#define _MSS_MEMDIAGS_H

//------------------------------------------------------------------------------
//  Includes
//------------------------------------------------------------------------------


#include <fapi2.H>

typedef fapi2::ReturnCode (*p9c_mss_memdiags_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target);

extern "C"
{

    ///
    /// @brief Uses maint cmds to write pattern to memory and read back.
    /// @param[in]  i_target  Reference to target
    /// @return FAPI2_RC_SUCCESS iff successful
    ///
    fapi2::ReturnCode p9c_mss_memdiags( const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target );



    ///
    /// @brief Check for ECC errors after sf read
    /// @param[in]      i_target  Reference to target
    /// @param[out]     o_error_summary   Maint error summary per rank, per pattern
    /// @param[in]      i_pattern_index   Index to keep track of which pattern in the sequence of patterns we are on.
    /// @return FAPI2_RC_SUCCESS iff successful
    ///
    fapi2::ReturnCode mss_check_for_ECC_errors(const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target,
            uint8_t (&o_error_summary)[8][9],
            const uint8_t i_pattern_index);

    ///
    /// @brief Update error summary per rank, per pattern
    /// @param[in]      i_rank            Rank being analyzed
    /// @param[in]      i_pattern_index   Index to keep track of which pattern in the sequence of patterns we are on.
    /// @param[in]      i_mbeccfir        MBECCFIR
    /// @param[out]     o_error_summary   Maint error summary per rank, per pattern
    /// @return none
    ///
    void mss_update_error_summary(const uint8_t i_rank,
                                  const uint8_t i_pattern_index,
                                  fapi2::buffer<uint64_t> i_mbeccfir,
                                  uint8_t (&o_error_summary)[8][9]);



    ///
    /// @brief Runs IPL verify chip mark procedure on a given rank
    /// @param[in]  i_target          Reference to target
    /// @param[in]  i_rank            Rank to run on
    /// @param[in]  i_pattern_index   Index to keep track of which pattern in the sequence of patterns we are on.
    /// @param[out] o_error_summary   Maint error summary per rank, per pattern
    /// @param[out] o_mark verified   True if chip mark verified, and no UEs or RCEs hit.
    /// @return FAPI2_RC_SUCCESS iff successful
    ///
    fapi2::ReturnCode mss_ipl_verify_chip_mark(const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target,
            const uint8_t i_rank,
            const uint8_t i_pattern_index,
            uint8_t (&o_error_summary)[8][9],
            bool& o_mark_verified);


    ///
    /// @brief Runs IPL steer procedure on a given rank
    /// @param[in]  i_target          Reference to target
    /// @param[in]  i_rank            Rank to run on
    /// @param[in]  i_pattern_index   Index to keep track of which pattern in
    /// @param[out] o_error_summary   Maint error summary per rank, per pattern
    /// @return FAPI2_RC_SUCCESS iff successful
    ///
    fapi2::ReturnCode mss_ipl_steer( const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target,
                                     const uint8_t i_rank,
                                     const uint8_t i_pattern_index,
                                     uint8_t (&o_error_summary)[8][9]);



    ///
    /// @brief Clears ECC error status
    /// @param[in]  i_target    Reference to target
    /// @param[in]  i_rank      Rank to run on
    /// @return FAPI2_RC_SUCCESS iff successful
    ///
    fapi2::ReturnCode mss_error_status_cleanup(const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target,
            const uint8_t i_rank);



    ///
    /// @brief speed options for time base commands.
    ///
    enum AddressRange
    {
        SINGLE_ADDRESS =                     0,
        WHOLE_RANK =                         1,
    };

    ///
    /// @brief speed options for time base commands.
    ///
    enum CeType
    {
        NONE =                              0x00,
        SOFT =                              0x01,
        INTERMITTENT =                      0x02,
        HARD =                              0x04,
    };


    ///
    /// @brief Does a targeted fast scrub of either single address or whole rank
    /// @param[in]  i_target          Reference to target (MBA)
    /// @param[in]  i_address         Address to scrub
    /// @param[in]  i_address_range   SINGLE_ADDRESS, or WHOLE_RANK
    /// @param[in]  i_ce_type         SOFT or INTERMITTENT or HARD or any combo
    /// @return FAPI2_RC_SUCCESS iff successful
    ///
    fapi2::ReturnCode mss_targeted_fast_scrub(const fapi2::Target<fapi2::TARGET_TYPE_MBA>& i_target,
            const fapi2::buffer<uint64_t> i_address,
            const AddressRange i_address_range,
            const uint8_t i_ce_type);

} // extern "C"

#endif /* _MSS_MEMDIAGS_H */
OpenPOWER on IntegriCloud