blob: 5ed49f89eda6c8cb491cd952249513b3b9d31edc [file] [log] [blame]
Matt Ploetz91829cb2015-03-05 14:08:07 -06001From 1b7b2c8af560b71aa1dcddb4e8075047a1321d1e Mon Sep 17 00:00:00 2001
2From: Matt Ploetz <maploetz@us.ibm.com>
3Date: Wed, 4 Mar 2015 13:25:30 -0600
4Subject: [PATCH] mss thermal patch from Mike Pradik
5
6Change-Id: I0980f7b996a854f92c0ffad39eb32758539df91e
7---
8 .../mss_thermal_init/mss_thermal_init.C | 23 ++++++++++++++++++----
9 1 file changed, 19 insertions(+), 4 deletions(-)
10
11diff --git a/src/usr/hwpf/hwp/dram_initialization/mss_thermal_init/mss_thermal_init.C b/src/usr/hwpf/hwp/dram_initialization/mss_thermal_init/mss_thermal_init.C
12index aa217c6..2e6600f 100644
13--- a/src/usr/hwpf/hwp/dram_initialization/mss_thermal_init/mss_thermal_init.C
14+++ b/src/usr/hwpf/hwp/dram_initialization/mss_thermal_init/mss_thermal_init.C
15@@ -22,7 +22,7 @@
16 /* permissions and limitations under the License. */
17 /* */
18 /* IBM_PROLOG_END_TAG */
19-// $Id: mss_thermal_init.C,v 1.18 2015/01/23 17:54:09 dcrowell Exp $
20+// $Id: mss_thermal_init.C,v 1.18b CHANGED IN OPENPOWER PATCH maploetz Exp $
21 // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/centaur/working/procedures/ipl/fapi/mss_thermal_init.C,v $
22 //------------------------------------------------------------------------------
23 // *! (C) Copyright International Business Machines Corp. 2011
24@@ -49,6 +49,7 @@
25 //------------------------------------------------------------------------------
26 // Version:| Author: | Date: | Comment:
27 //---------|----------|---------|-----------------------------------------------
28+// 1.18u | pardeik |03-MAR-15| user version to be like v1.20
29 // 1.17 | pardeik |19-NOV-14| Use MRW attribute for SC address map for ISDIMMs
30 // 1.16 | pardeik |06-FEB-14| removed string in trace statement
31 // 1.15 | pardeik |24-FEB-14| added support for ATTR_MRW_CDIMM_SPARE_I2C_TEMP_SENSOR_ENABLE
32@@ -158,6 +159,7 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
33 const uint8_t I2C_BUS_ENCODE_PRIMARY = 0;
34 const uint8_t I2C_BUS_ENCODE_SECONDARY = 8;
35 const uint8_t MAX_NUM_DIMM_SENSORS = 8;
36+ const uint8_t MAX_I2C_BUSSES = 2;
37
38 // Variable declaration
39 uint8_t l_dimm_ranks_array[l_NUM_MBAS][l_NUM_PORTS][l_NUM_DIMMS]; // Number of ranks for each configured DIMM in each MBA
40@@ -247,6 +249,19 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
41 l_custom_dimm[i] = fapi::ENUM_ATTR_EFF_CUSTOM_DIMM_NO;
42 }
43
44+ // zero out the l_dimm_ranks_array so it is initialized for later use if there is a deconfigured MBA
45+ for (uint8_t i = 0; i < l_NUM_MBAS; i++)
46+ {
47+ for (uint8_t j = 0; j < l_NUM_PORTS; j++)
48+ {
49+ for (uint8_t k = 0; k < l_NUM_DIMMS; k++)
50+ {
51+ l_dimm_ranks_array[i][j][k]=0;
52+ }
53+ }
54+
55+ }
56+
57 for (uint8_t mba_index = 0; mba_index < l_target_mba_array.size(); mba_index++){
58 l_rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_target_mba_array[mba_index], l_mba_pos);
59 if (l_rc) return l_rc;
60@@ -397,9 +412,9 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
61
62 l_cdimm_number_dimm_temp_sensors = 0;
63 // cycle through both primary and secondary i2c busses, determine i2c address and enable bits
64- for (uint8_t k = 0; k < 2; k++)
65+ for (uint8_t k = 0; k < MAX_I2C_BUSSES; k++)
66 {
67- for (uint8_t i = 0; i < 8; i++)
68+ for (uint8_t i = 0; i < MAX_NUM_DIMM_SENSORS; i++)
69 {
70 if (k == 0)
71 {
72@@ -490,7 +505,7 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
73 // Iterate through the num_ranks array to determine what DIMMs are plugged
74 // Enable sensor monitoring for each plugged DIMM
75 uint32_t l_iterator = 0;
76- for (uint32_t i = 0; i < 2; i++){
77+ for (uint32_t i = 0; i < l_NUM_MBAS; i++){
78 if (l_dimm_ranks_array[i][0][0] != 0){
79 l_ecmd_rc |= l_data_scac_enable.setBit(l_iterator);
80 }
81--
821.8.2.2
83