blob: f6eafe5dccbe1023ac1b3705da6e6d704c4520f0 [file] [log] [blame]
From 430bf7d7b8194bf7789db053999464390e143fdc Mon Sep 17 00:00:00 2001
From: Brian Horton <brianh@linux.ibm.com>
Date: Wed, 11 Mar 2015 16:13:11 -0500
Subject: [PATCH] mss thermal patch from Mike Pradik
AND undeo 1.18 attribute change
Change-Id: I0c3e9d126077fb18bb771909631e0491da4b5f99
---
.../mss_thermal_init/mss_thermal_init.C | 26 ++++++++++++++++----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --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
index e09f47f..dc21852 100644
--- 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
@@ -22,7 +22,7 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_thermal_init.C,v 1.19 2015/02/12 23:23:56 pardeik Exp $
+// $Id: mss_thermal_init.C,v 1.18c CHANGED IN OPENPOWER PATCH brianh Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/centaur/working/procedures/ipl/fapi/mss_thermal_init.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
@@ -49,6 +49,8 @@
//------------------------------------------------------------------------------
// Version:| Author: | Date: | Comment:
//---------|----------|---------|-----------------------------------------------
+// 1.18v | brianhk |11-MAR-15| undo 1.18 change
+// 1.18u | pardeik |03-MAR-15| user version to be like v1.20
// 1.18 | pardeik |12-FEB-15| change ATTR_MRW_MEM_SENSOR_CACHE_ADDR_MAP to
// | a centaur target (was system)
// 1.17 | pardeik |19-NOV-14| Use MRW attribute for SC address map for ISDIMMs
@@ -160,6 +162,7 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
const uint8_t I2C_BUS_ENCODE_PRIMARY = 0;
const uint8_t I2C_BUS_ENCODE_SECONDARY = 8;
const uint8_t MAX_NUM_DIMM_SENSORS = 8;
+ const uint8_t MAX_I2C_BUSSES = 2;
// Variable declaration
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
@@ -249,6 +252,19 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
l_custom_dimm[i] = fapi::ENUM_ATTR_EFF_CUSTOM_DIMM_NO;
}
+ // zero out the l_dimm_ranks_array so it is initialized for later use if there is a deconfigured MBA
+ for (uint8_t i = 0; i < l_NUM_MBAS; i++)
+ {
+ for (uint8_t j = 0; j < l_NUM_PORTS; j++)
+ {
+ for (uint8_t k = 0; k < l_NUM_DIMMS; k++)
+ {
+ l_dimm_ranks_array[i][j][k]=0;
+ }
+ }
+
+ }
+
for (uint8_t mba_index = 0; mba_index < l_target_mba_array.size(); mba_index++){
l_rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &l_target_mba_array[mba_index], l_mba_pos);
if (l_rc) return l_rc;
@@ -279,7 +295,7 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
else
{
// sensor cache address map for non custom dimm temperature sensors (which i2c bus and i2c address they are)
- l_rc = FAPI_ATTR_GET(ATTR_MRW_MEM_SENSOR_CACHE_ADDR_MAP, &i_target, l_dimm_sensor_cache_addr_map);
+ l_rc = FAPI_ATTR_GET(ATTR_MRW_MEM_SENSOR_CACHE_ADDR_MAP, NULL, l_dimm_sensor_cache_addr_map);
if (l_rc) return l_rc;
}
@@ -399,9 +415,9 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
l_cdimm_number_dimm_temp_sensors = 0;
// cycle through both primary and secondary i2c busses, determine i2c address and enable bits
- for (uint8_t k = 0; k < 2; k++)
+ for (uint8_t k = 0; k < MAX_I2C_BUSSES; k++)
{
- for (uint8_t i = 0; i < 8; i++)
+ for (uint8_t i = 0; i < MAX_NUM_DIMM_SENSORS; i++)
{
if (k == 0)
{
@@ -492,7 +508,7 @@ fapi::ReturnCode mss_thermal_init(const fapi::Target & i_target)
// Iterate through the num_ranks array to determine what DIMMs are plugged
// Enable sensor monitoring for each plugged DIMM
uint32_t l_iterator = 0;
- for (uint32_t i = 0; i < 2; i++){
+ for (uint32_t i = 0; i < l_NUM_MBAS; i++){
if (l_dimm_ranks_array[i][0][0] != 0){
l_ecmd_rc |= l_data_scac_enable.setBit(l_iterator);
}
--
1.7.4.1