blob: f6eafe5dccbe1023ac1b3705da6e6d704c4520f0 [file] [log] [blame]
Brian Horton1bbf4b92015-03-11 15:39:22 -05001From 430bf7d7b8194bf7789db053999464390e143fdc Mon Sep 17 00:00:00 2001
2From: Brian Horton <brianh@linux.ibm.com>
3Date: Wed, 11 Mar 2015 16:13:11 -0500
Matt Ploetz91829cb2015-03-05 14:08:07 -06004Subject: [PATCH] mss thermal patch from Mike Pradik
5
Brian Horton1bbf4b92015-03-11 15:39:22 -05006AND undeo 1.18 attribute change
7
8Change-Id: I0c3e9d126077fb18bb771909631e0491da4b5f99
Matt Ploetz91829cb2015-03-05 14:08:07 -06009---
Brian Horton1bbf4b92015-03-11 15:39:22 -050010 .../mss_thermal_init/mss_thermal_init.C | 26 ++++++++++++++++----
11 1 files changed, 21 insertions(+), 5 deletions(-)
Matt Ploetz91829cb2015-03-05 14:08:07 -060012
13diff --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
Brian Horton1bbf4b92015-03-11 15:39:22 -050014index e09f47f..dc21852 100644
Matt Ploetz91829cb2015-03-05 14:08:07 -060015--- a/src/usr/hwpf/hwp/dram_initialization/mss_thermal_init/mss_thermal_init.C
16+++ b/src/usr/hwpf/hwp/dram_initialization/mss_thermal_init/mss_thermal_init.C
17@@ -22,7 +22,7 @@
18 /* permissions and limitations under the License. */
19 /* */
20 /* IBM_PROLOG_END_TAG */
Brian Horton1bbf4b92015-03-11 15:39:22 -050021-// $Id: mss_thermal_init.C,v 1.19 2015/02/12 23:23:56 pardeik Exp $
22+// $Id: mss_thermal_init.C,v 1.18c CHANGED IN OPENPOWER PATCH brianh Exp $
Matt Ploetz91829cb2015-03-05 14:08:07 -060023 // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/centaur/working/procedures/ipl/fapi/mss_thermal_init.C,v $
24 //------------------------------------------------------------------------------
25 // *! (C) Copyright International Business Machines Corp. 2011
Brian Horton1bbf4b92015-03-11 15:39:22 -050026@@ -49,6 +49,8 @@
Matt Ploetz91829cb2015-03-05 14:08:07 -060027 //------------------------------------------------------------------------------
28 // Version:| Author: | Date: | Comment:
29 //---------|----------|---------|-----------------------------------------------
Brian Horton1bbf4b92015-03-11 15:39:22 -050030+// 1.18v | brianhk |11-MAR-15| undo 1.18 change
Matt Ploetz91829cb2015-03-05 14:08:07 -060031+// 1.18u | pardeik |03-MAR-15| user version to be like v1.20
Brian Horton1bbf4b92015-03-11 15:39:22 -050032 // 1.18 | pardeik |12-FEB-15| change ATTR_MRW_MEM_SENSOR_CACHE_ADDR_MAP to
33 // | a centaur target (was system)
Matt Ploetz91829cb2015-03-05 14:08:07 -060034 // 1.17 | pardeik |19-NOV-14| Use MRW attribute for SC address map for ISDIMMs
Brian Horton1bbf4b92015-03-11 15:39:22 -050035@@ -160,6 +162,7 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
Matt Ploetz91829cb2015-03-05 14:08:07 -060036 const uint8_t I2C_BUS_ENCODE_PRIMARY = 0;
37 const uint8_t I2C_BUS_ENCODE_SECONDARY = 8;
38 const uint8_t MAX_NUM_DIMM_SENSORS = 8;
39+ const uint8_t MAX_I2C_BUSSES = 2;
40
41 // Variable declaration
42 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
Brian Horton1bbf4b92015-03-11 15:39:22 -050043@@ -249,6 +252,19 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
Matt Ploetz91829cb2015-03-05 14:08:07 -060044 l_custom_dimm[i] = fapi::ENUM_ATTR_EFF_CUSTOM_DIMM_NO;
45 }
46
47+ // zero out the l_dimm_ranks_array so it is initialized for later use if there is a deconfigured MBA
48+ for (uint8_t i = 0; i < l_NUM_MBAS; i++)
49+ {
50+ for (uint8_t j = 0; j < l_NUM_PORTS; j++)
51+ {
52+ for (uint8_t k = 0; k < l_NUM_DIMMS; k++)
53+ {
54+ l_dimm_ranks_array[i][j][k]=0;
55+ }
56+ }
57+
58+ }
59+
60 for (uint8_t mba_index = 0; mba_index < l_target_mba_array.size(); mba_index++){
61 l_rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_target_mba_array[mba_index], l_mba_pos);
62 if (l_rc) return l_rc;
Brian Horton1bbf4b92015-03-11 15:39:22 -050063@@ -279,7 +295,7 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
64 else
65 {
66 // sensor cache address map for non custom dimm temperature sensors (which i2c bus and i2c address they are)
67- l_rc = FAPI_ATTR_GET(ATTR_MRW_MEM_SENSOR_CACHE_ADDR_MAP, &i_target, l_dimm_sensor_cache_addr_map);
68+ l_rc = FAPI_ATTR_GET(ATTR_MRW_MEM_SENSOR_CACHE_ADDR_MAP, NULL, l_dimm_sensor_cache_addr_map);
69 if (l_rc) return l_rc;
70 }
71
72@@ -399,9 +415,9 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
Matt Ploetz91829cb2015-03-05 14:08:07 -060073
74 l_cdimm_number_dimm_temp_sensors = 0;
75 // cycle through both primary and secondary i2c busses, determine i2c address and enable bits
76- for (uint8_t k = 0; k < 2; k++)
77+ for (uint8_t k = 0; k < MAX_I2C_BUSSES; k++)
78 {
79- for (uint8_t i = 0; i < 8; i++)
80+ for (uint8_t i = 0; i < MAX_NUM_DIMM_SENSORS; i++)
81 {
82 if (k == 0)
83 {
Brian Horton1bbf4b92015-03-11 15:39:22 -050084@@ -492,7 +508,7 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
Matt Ploetz91829cb2015-03-05 14:08:07 -060085 // Iterate through the num_ranks array to determine what DIMMs are plugged
86 // Enable sensor monitoring for each plugged DIMM
87 uint32_t l_iterator = 0;
88- for (uint32_t i = 0; i < 2; i++){
89+ for (uint32_t i = 0; i < l_NUM_MBAS; i++){
90 if (l_dimm_ranks_array[i][0][0] != 0){
91 l_ecmd_rc |= l_data_scac_enable.setBit(l_iterator);
92 }
93--
Brian Horton1bbf4b92015-03-11 15:39:22 -0500941.7.4.1
Matt Ploetz91829cb2015-03-05 14:08:07 -060095