summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/dram_training/mss_lrdimm_funcs/mss_lrdimm_funcs.H
blob: 94f9b6677f6eb0071057dab649366ce4320e5b5a (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/hwpf/hwp/dram_training/mss_lrdimm_funcs/mss_lrdimm_funcs.H $ */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2013,2014              */
/*                                                                        */
/* 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: mss_lrdimm_funcs.H,v 1.2 2013/09/16 13:28:55 bellows Exp $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2013
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//------------------------------------------------------------------------------
// *! TITLE : mss_lrdimm_funcs.H
// *! DESCRIPTION : Tools for lrdimm centaur procedures
// *! OWNER NAME : KCOOK
// *! BACKUP NAME : MWUU
// #! ADDITIONAL COMMENTS :
//
// CCS related and general utility functions.

//------------------------------------------------------------------------------
// Don't forget to create CVS comments when you check in your changes!
//------------------------------------------------------------------------------
// CHANGE HISTORY:
//------------------------------------------------------------------------------
// Version:|  Author: |  Date:  | Comment:
//---------|----------|---------|-----------------------------------------------
//  1.2    | 09/16/13 | bellows | Added ID tag
//  1.1    | 08/27/13 | kcook   | First drop of Centaur

#ifndef _MSS_LRDIMM_FUNCS_H
#define _MSS_LRDIMM_FUNCS_H

//#define LRDIMM 1

//----------------------------------------------------------------------
//  Constants 
//----------------------------------------------------------------------
const uint8_t PORT = 2;
const uint8_t DIMM = 2;
const uint8_t RANK = 4;
//----------------------------------------------------------------------
//  Enums 
//----------------------------------------------------------------------

struct mss_lrdimm_spd_data 
{
    uint8_t lr_addr_mirroring[PORT][DIMM];
    uint8_t lr_f0rc3_f0rc2[PORT][DIMM];
    uint8_t lr_f0rc5_f0rc4[PORT][DIMM];
    uint8_t lr_f1rc11_f1rc8[PORT][DIMM];
    uint8_t lr_f1rc13_f1rc12[PORT][DIMM];
    uint8_t lr_f1rc15_f1rc14[PORT][DIMM];
    uint8_t lr_f3rc9_f3rc8_for_800_1066[PORT][DIMM];
    uint8_t lr_f34rc11_f34rc10_for_800_1066[PORT][DIMM];
    uint8_t lr_f56rc11_f56rc10_for_800_1066[PORT][DIMM];
    uint8_t lr_f78rc11_f78rc10_for_800_1066[PORT][DIMM];
    uint8_t lr_f910rc11_f910rc10_for_800_1066[PORT][DIMM];
    uint8_t lr_mr12_for_800_1066[PORT][DIMM];
    uint8_t lr_f3rc9_f3rc8_for_1333_1600[PORT][DIMM];
    uint8_t lr_f34rc11_f34rc10_for_1333_1600[PORT][DIMM];
    uint8_t lr_f56rc11_f56rc10_for_1333_1600[PORT][DIMM];
    uint8_t lr_f78rc11_f78rc10_for_1333_1600[PORT][DIMM];
    uint8_t lr_f910rc11_f910rc10_for_1333_1600[PORT][DIMM];
    uint8_t lr_mr12_for_1333_1600[PORT][DIMM];
    uint8_t lr_f3rc9_f3rc8_for_1866_2133[PORT][DIMM];
    uint8_t lr_f34rc11_f34rc10_for_1866_2133[PORT][DIMM];
    uint8_t lr_f56rc11_f56rc10_for_1866_2133[PORT][DIMM];
    uint8_t lr_f78rc11_f78rc10_for_1866_2133[PORT][DIMM];
    uint8_t lr_f910rc11_f910rc10_for_1866_2133[PORT][DIMM];
    uint8_t lr_mr12_for_1866_2133[PORT][DIMM];
};


//----------------------------------------------------------------------
// LRDIMM FUNCS
//----------------------------------------------------------------------

//--------------------------------------------------------------
// mss_lrimm_rcd_load
// Set Function 1-13 RCD words
// Target = centaur.mba
//--------------------------------------------------------------
fapi::ReturnCode mss_lrdimm_rcd_load( fapi::Target& i_target, 
                                      uint32_t port_number,
                                      uint32_t& ccs_inst_cnt );

//--------------------------------------------------------------
// mss_lrdimm_mrs_load
// Set MRS1 settings for Rank 0 and Rank 1
// Target = centaur.mba
//--------------------------------------------------------------
fapi::ReturnCode mss_lrdimm_mrs_load( fapi::Target& i_target,
                                      uint32_t i_port_number,
                                      uint32_t dimm_number,
                                      uint32_t& io_ccs_inst_cnt);
//--------------------------------------------------------------
// mss_execute_lrdimm_mb_dram_training
// run lrdimm memory buffer training
// Target = centaur.mba
//--------------------------------------------------------------
fapi::ReturnCode mss_execute_lrdimm_mb_dram_training( fapi::Target& i_target); 

//--------------------------------------------------------------
// mss_lrdimm_eff_config
// run lrdimm attribute set up
// Target = centaur.mba
//--------------------------------------------------------------
fapi::ReturnCode mss_lrdimm_eff_config( const fapi::Target& i_target_mba,
                                  uint8_t cur_dimm_spd_valid_u8array[PORT][DIMM],
                                  uint32_t mss_freq,
                                  uint8_t eff_num_ranks_per_dimm[PORT][DIMM]);

//--------------------------------------------------------------
// mss_lrdimm_rewrite_odt
// eff config termination rewrite odts for dual drop
// Target = centaur.mba
//--------------------------------------------------------------
fapi::ReturnCode mss_lrdimm_rewrite_odt( const fapi::Target& i_target_mba,
                                         uint32_t *p_b_var_array,
                                         uint32_t *var_array_p_array[5]);


//--------------------------------------------------------------
// mss_lrdimm_term_atts  
// eff config termination rewrite odts for dual drop
// Target = centaur.mba
//--------------------------------------------------------------
fapi::ReturnCode mss_lrdimm_term_atts( const fapi::Target& i_target_mba);



//-----------------------------------------
// mss_spec_rcd_load
// execute RCD loads of specific control words. For LRDIMM.
// Target = centaur.mba
//-----------------------------------------
fapi::ReturnCode mss_spec_rcd_load(fapi::Target& i_target,
                                   uint32_t i_port_number,
                                   uint8_t * p_i_rcd_num_arr,
                                   uint8_t i_rcd_num_arr_length,
                                   uint64_t  i_rcd_word[],
                                   uint32_t& io_ccs_inst_cnt,
                                   uint8_t i_keep_cke_high=0);



#endif /* _MSS_LRDIMM_FUNCS_H */

OpenPOWER on IntegriCloud