/* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ /* $Source: src/usr/hwpf/hwp/mc_config/mss_eff_mb_interleave/mss_eff_mb_interleave.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2014 */ /* [+] 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 */ // $Id: mss_eff_mb_interleave.C,v 1.7 2014/02/26 21:47:44 thi Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/centaur/working/procedures/ipl/fapi/mss_eff_mb_interleave.C,v $ //------------------------------------------------------------------------------ // *! (C) Copyright International Business Machines Corp. 2014 // *! All Rights Reserved -- Property of IBM // *! *** *** // *! Licensed material - Program property of IBM // *! Refer to copyright instructions form no. G120-2083 // *! Created on Wed Jan 8 2014 at 07:56:26 //------------------------------------------------------------------------------ // *! TITLE : mss_eff_mb_interleave // *! DESCRIPTION : Set up centaur internal interleaving (between mba's) // *| Checks and Sets ATTR_MSS_DERIVED_MBA_CACHELINE_INTERLEAVE_MODE // *| ATTR_MSS_DERIVED_MBA_ADDR_INTERLEAVE_BIT // *| // *! OWNER NAME : Bellows Mark D. (Mark D),319432 Email: bellows@us.ibm.com // *! BACKUP NAME : Email: ______@us.ibm.com // *! ADDITIONAL COMMENTS : // //------------------------------------------------------------------------------ // Don't forget to create CVS comments when you check in your changes! //------------------------------------------------------------------------------ // CHANGE HISTORY: //------------------------------------------------------------------------------ // Version:| Author: | Date: | Comment: //---------|----------|---------|----------------------------------------------- // 1.7 | thi |26-FEB-14| Add explanation for 1.6 in this header // 1.6 | thi |26-FEB-14| Add rc checking for attribute get // 1.5 | bellows |21-FEB-14| Move interleave rule checkking to system level // 1.4 | bellows |19-FEB-14| More RAS updates // 1.3 | bellows |17-FEB-14| Additional RAS review updates // 1.2 | bellows |14-FEB-14| Revamped Plug checking, RAS Review pass #1 comments added // 1.1 | bellows |08-JAN-14| Created. #include #include extern "C" { enum DECONFIG_TYPES { DECONFIG_PORT_1_SLOT_0_IS_EMPTY_PORT_0_SLOT_0_IS_NOT=0, DECONFIG_PORT_1_SLOT_0_IS_NOT_EQUAL_TO_PORT_0_SLOT_0_A=1, DECONFIG_PORT_1_SLOT_0_IS_NOT_EQUAL_TO_PORT_0_SLOT_0_B=2, DECONFIG_PORT_0_SLOT_1_DECONFIGURED_BECAUSE_PORT_0_SLOT_0_WAS_DECONFIGURED=3, DECONFIG_PORT_1_SLOT_1_DECONFIGURED_BECAUSE_PORT_0_SLOT_0_WAS_DECONFIGURED=4, DECONFIG_PORT_0_SLOT_1_DECONFIGURED_BECAUSE_PORT_1_SLOT_1_IS_NOT_EQUAL=5, DECONFIG_PORT_1_SLOT_1_DECONFIGURED_BECAUSE_PORT_0_SLOT_1_IS_NOT_EQAUL=6, DECONFIG_PORT_0_SLOT_1_DECONFIGURED_BECAUSE_PORT_0_SLOT_0_IS_NOT_EQUAL=7, DECONFIG_PORT_1_SLOT_1_DECONFIGURED_BECAUSE_PORT_0_SLOT_0_IS_NOT_EQUAL=8, DECONFIG_PORT_0_SLOT_1_DECONFIGURED_BECAUSE_PORT_1_SLOT_1_IS_NOT_VALID=9, DECONFIG_PORT_1_SLOT_1_DECONFIGURED_BECAUSE_PORT_0_SLOT_1_IS_NOT_VALID=10, DECONFIG_PORT_1_HAS_SOMETHING_BUT_PORT_0_SLOT_0_IS_EMPTY=11, DECONFIG_PORT_0_SLOT_1_HAS_SOMETHING_BUT_PORT_0_SLOT_0_IS_EMPTY=12, DECONFIG_SLOT_1_HAS_SOMETHING_BUT_PORT_0_SLOT_0_IS_EMPTY=13, DECONFIG_INTERLEAVE_MODE_CONTROL_IS_REQUIRED=99 }; const uint8_t MSS_MBA_ADDR_INTERLEAVE_BIT = 24; // From Eric Retter: // the prefetch and cleaner assume that bit 24 is the interleave bit. // We put other interleave options in for other settings that could be // tried in performance testing using namespace fapi; class mss_eff_mb_dimm { public: uint8_t module_type; uint8_t dram_gen; uint8_t device_density; uint8_t num_of_ranks; uint8_t device_width; uint8_t module_width; uint8_t thermal_sensor; uint8_t size; Target mydimm_target; bool valid; uint8_t side; uint8_t port; uint8_t slot; mss_eff_mb_dimm(); ReturnCode load(fapi::Target & i_dimms, uint32_t size); bool is_valid(); ReturnCode deconfig(uint8_t i_case); bool operator!=(const mss_eff_mb_dimm &) const; }; //---------------------------------------------- // MSS EFF GROUPING FUNCTIONs............ //---------------------------------------------------- ReturnCode mss_eff_mb_interleave(const fapi::Target & i_cen_target) { ReturnCode rc; mss_eff_mb_dimm l_dimm_array[2][2][2]; // side, port, dimm std::vector l_target_dimm_array[2]; std::vector l_mba_chiplets; uint8_t mba_i; uint8_t mba; uint8_t l_cur_mba_port; uint8_t l_cur_mba_dimm; uint8_t side,port,slot; uint8_t hadadeconfig[2]; uint8_t l_mss_derived_mba_cacheline_interleave_mode; uint8_t l_mss_mba_addr_interleave_bit; uint8_t mrw_mba_cacheline_interleave_mode_control; uint32_t size[2]; uint8_t eff_dimm_size[2][2]; uint8_t l_attr_mrw_strict_mba_plug_rule_checking; uint8_t l_deconfig_0_0; do { // first step, load up the dimms connected to this centaur for(side=0;side<2;side++) { for(port=0;port<2;port++) { for(slot=0;slot<2;slot++) { l_dimm_array[side][port][slot].side = side; l_dimm_array[side][port][slot].port = port; l_dimm_array[side][port][slot].slot = slot; } } } rc = fapiGetChildChiplets(i_cen_target, fapi::TARGET_TYPE_MBA_CHIPLET, l_mba_chiplets); if(rc) { FAPI_ERR("Error retrieving fapiGetChildChiplets"); break; } rc = FAPI_ATTR_GET(ATTR_MRW_STRICT_MBA_PLUG_RULE_CHECKING, NULL, l_attr_mrw_strict_mba_plug_rule_checking); if(rc) { FAPI_ERR("Error retrieving ATTR_MRW_STRICT_MBA_PLUG_RULE_CHECKING"); break; } if(l_attr_mrw_strict_mba_plug_rule_checking == ENUM_ATTR_MRW_STRICT_MBA_PLUG_RULE_CHECKING_TRUE) { for(mba_i=0; mba_i