diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/htmgt/HBconfig | 4 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_common.mk | 26 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_utility.C | 65 | ||||
-rw-r--r-- | src/usr/htmgt/htmgt_utility.H | 94 | ||||
-rw-r--r-- | src/usr/htmgt/makefile | 37 | ||||
-rw-r--r-- | src/usr/htmgt/runtime/makefile | 40 | ||||
-rw-r--r-- | src/usr/htmgt/test/makefile | 39 | ||||
-rw-r--r-- | src/usr/htmgt/test/pstatetest.H | 186 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mc_config/makefile | 1 | ||||
-rwxr-xr-x | src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.C | 132 | ||||
-rwxr-xr-x | src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.H | 76 | ||||
-rw-r--r-- | src/usr/makefile | 1 |
12 files changed, 701 insertions, 0 deletions
diff --git a/src/usr/htmgt/HBconfig b/src/usr/htmgt/HBconfig new file mode 100644 index 000000000..6a13251c1 --- /dev/null +++ b/src/usr/htmgt/HBconfig @@ -0,0 +1,4 @@ +config HTMGT + default n + help + Enable Host TMGT in hostboot/HBRT diff --git a/src/usr/htmgt/htmgt_common.mk b/src/usr/htmgt/htmgt_common.mk new file mode 100644 index 000000000..d2cc0d3bb --- /dev/null +++ b/src/usr/htmgt/htmgt_common.mk @@ -0,0 +1,26 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/htmgt/htmgt_common.mk $ +# +# 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 +# common objects between hostboot and hbrt +OBJS += htmgt_utility.o diff --git a/src/usr/htmgt/htmgt_utility.C b/src/usr/htmgt/htmgt_utility.C new file mode 100644 index 000000000..078c7eebd --- /dev/null +++ b/src/usr/htmgt/htmgt_utility.C @@ -0,0 +1,65 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/htmgt/tmgtutility.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 */ +#include "htmgt_utility.H" + + +namespace HTMGT +{ + // Trace definition + trace_desc_t* g_trac_htmgt = NULL; + TRAC_INIT(&g_trac_htmgt, HTMGT_COMP_NAME, 2*KILOBYTE); + + // Create/Build an Error log and add HTMGT component trace + void bldErrLog(errlHndl_t & io_err, + const uint8_t i_modid, + const uint16_t i_rc, + const uint32_t i_data1, + const uint32_t i_data2, + const uint32_t i_data3, + const uint32_t i_data4, + const ERRORLOG::errlSeverity_t i_sev) + { + TMGT_INF("bldErrLog(mod: 0x%02X, rc: 0x%02X, data: 0x%08X %08X %08X %08X, sev: 0x%02X", + i_modid, i_rc, i_data1, i_data2, i_data3, i_data4, i_sev); + + if (NULL == io_err) + { + io_err = new ERRORLOG::ErrlEntry + (i_sev, + i_modid, + i_rc, + ((uint64_t)i_data1 << 32) | i_data2, + ((uint64_t)i_data3 << 32) | i_data4, + true /*Add HB Software Callout TODO RTC 115422 RAS review*/); + + io_err->collectTrace("HTMGT"); + } + else + { + io_err->collectTrace("HTMGT"); + } + } + +} // end namespace diff --git a/src/usr/htmgt/htmgt_utility.H b/src/usr/htmgt/htmgt_utility.H new file mode 100644 index 000000000..5ff06d0b0 --- /dev/null +++ b/src/usr/htmgt/htmgt_utility.H @@ -0,0 +1,94 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/htmgt/tmgtutility.H $ */ +/* */ +/* 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 */ +#ifndef HTMGT_UTILITY_H +#define HTMGT_UTILITY_H + +#include <stdint.h> +#include <trace/interface.H> +#include <errl/errlmanager.H> + + +#define TMGT_DBG( _fmt_, _args_...) \ + TRACDCOMP( g_trac_htmgt, "D>" _fmt_, ##_args_ ) + +#define TMGT_INF( _fmt_, _args_...) \ + TRACFCOMP( g_trac_htmgt, _fmt_, ##_args_ ) + +#define TMGT_WRN( _fmt_, _args_...) \ + TRACFCOMP( g_trac_htmgt, "W>" _fmt_, ##_args_ ) + +#define TMGT_ERR( _fmt_, _args_...) \ + TRACFCOMP( g_trac_htmgt, "E>" _fmt_, ##_args_ ) + +#define TMGT_DBG_BIN( _fmt_, _args_...) \ + TRACDBIN( g_trac_htmgt, "D>" _fmt_, ##_args_ ) + +#define TMGT_BIN( _fmt_, _args_...) \ + TRACFBIN( g_trac_htmgt, _fmt_, ##_args_ ) + +inline uint16_t UINT16_GET(const uint8_t * i_ptr) +{ + return (*i_ptr) << 8 | *(i_ptr+1); +} + +inline uint32_t UINT32_GET(const uint8_t * i_ptr) +{ + return (UINT16_GET(i_ptr) << 16) | UINT16_GET(i_ptr + 2); +} + +inline void UINT16_PUT(uint8_t * i_ptr, uint16_t i_value) +{ + *i_ptr = (uint8_t) (i_value >> 8); + *(i_ptr + 1) = (uint8_t) (i_value); +} + +inline void UINT32_PUT(uint8_t * i_ptr, uint32_t i_value) +{ + *i_ptr = (uint8_t)(i_value >> 24); + *(i_ptr + 1) = (uint8_t)(i_value >> 16); + *(i_ptr + 2) = (uint8_t)(i_value >> 8); + *(i_ptr + 3) = (uint8_t)(i_value); +} + + +namespace HTMGT +{ + // Trace definition + extern trace_desc_t* g_trac_htmgt; + + // Create/Build an Error log and add HTMGT component trace + void bldErrLog(errlHndl_t & io_err, + const uint8_t i_modid, + const uint16_t i_rc, + const uint32_t i_data1 = 0, + const uint32_t i_data2 = 0, + const uint32_t i_data3 = 0, + const uint32_t i_data4 = 0, + const ERRORLOG::errlSeverity_t i_sev = ERRORLOG::ERRL_SEV_INFORMATIONAL); + + + +} // end namespace +#endif diff --git a/src/usr/htmgt/makefile b/src/usr/htmgt/makefile new file mode 100644 index 000000000..c04d7e4b0 --- /dev/null +++ b/src/usr/htmgt/makefile @@ -0,0 +1,37 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/htmgt/makefile $ +# +# 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 +ROOTPATH = ../../.. +MODULE = htmgt + +# objects common to hostboot and hbrt +include htmgt_common.mk + +# objects unique to hostboot (none yet) +#OBJS += + +SUBDIRS += test.d +SUBDIRS += runtime.d + +include ${ROOTPATH}/config.mk diff --git a/src/usr/htmgt/runtime/makefile b/src/usr/htmgt/runtime/makefile new file mode 100644 index 000000000..6312bab42 --- /dev/null +++ b/src/usr/htmgt/runtime/makefile @@ -0,0 +1,40 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/htmgt/runtime/makefile $ +# +# 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 +# common objects between hostboot and hbrt + +HOSTBOOT_RUNTIME = 1 +ROOTPATH = ../../../.. +MODULE = htmgt_rt + +#include common ojects between hostboot and runtime hostboot +include ../htmgt_common.mk + +#include unique object modules - currently none +# OBJS += + +#SUBDIRS += test.d + +VPATH += .. +include $(ROOTPATH)/config.mk diff --git a/src/usr/htmgt/test/makefile b/src/usr/htmgt/test/makefile new file mode 100644 index 000000000..a80ff55e2 --- /dev/null +++ b/src/usr/htmgt/test/makefile @@ -0,0 +1,39 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/usr/htmgt/test/makefile $ +# +# 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 +ROOTPATH = ../../../.. + +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/pstates/pstates +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/ecmddatabuffer +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/fapi +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat +EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/hwp +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/include +EXTRAINCDIR += ${ROOTPATH}/src/usr/hwpf/hwp/mc_config/mss_eff_config + +MODULE = testhtmgt +TESTS = *.H + +include ${ROOTPATH}/config.mk + diff --git a/src/usr/htmgt/test/pstatetest.H b/src/usr/htmgt/test/pstatetest.H new file mode 100644 index 000000000..e5d274695 --- /dev/null +++ b/src/usr/htmgt/test/pstatetest.H @@ -0,0 +1,186 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/htmgt/test/pstatetest.H $ */ +/* */ +/* 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 */ +#ifndef __PSTATETEST_H +#define __PSTATETEST_H + +#include <cxxtest/TestSuite.H> +#include <errl/errlentry.H> +#include <errl/errlmanager.H> + +#include <targeting/common/targetservice.H> +#include <targeting/common/attributes.H> +#include <targeting/common/commontargeting.H> +#include <targeting/common/utilFilter.H> +#include <targeting/common/util.H> + +#include <fapi.H> +#include <fapiPlatHwpInvoker.H> + +#include <vfs/vfs.H> +#include <pstates.h> +#include <proc_get_voltage.H> +#include <mss_bulk_pwr_throttles.H> +#include <mss_util_to_throttle.H> +#include <mss_throttle_to_power.H> + +using namespace TARGETING; + +class pstateTest: public CxxTest::TestSuite +{ + public: + + // Test function to build pstate table + // TODO RCT 114284 fix testcase + // Requires Hostboot functions that are not yet merged. Testcase should + // eventually call hb function "runP8BuildPstateDataBlock" declaired in + // freqVoltageSvc.H to build pstate table. + // p8_build_pstate_datablock reads VPD from all existing cores, not + // just functional cores. The current SIMICS standalone model does + // not support MVDP for all existing cores. + void DISABLE_test_verifyPstate( void ) + { + errlHndl_t l_errl = NULL; + bool pstateLibLoadedLocally = false; + + if(!VFS::module_is_loaded( "libpstates.so" ) ) + { + l_errl = VFS::module_load( "libpstates.so" ); + if( l_errl ) + { + TS_FAIL("Could not load pstate module" ); + errlCommit(l_errl,HTMGT_COMP_ID); + } + else + { + pstateLibLoadedLocally = true; + } + } + + PstateSuperStructure pstateData; + TargetHandleList procChips; + getAllChips(procChips, TYPE_PROC, true); + + for (TargetHandleList::iterator itr = procChips.begin(); + itr != procChips.end(); + ++itr) + { + // cast OUR type of target to a FAPI type of target. + const fapi::Target + fapiTarg(fapi::TARGET_TYPE_PROC_CHIP, + (const_cast<Target*>(*itr))); + + + FAPI_INVOKE_HWP( l_errl, + p8_build_pstate_datablock, + fapiTarg, + &pstateData + ); + + if( l_errl ) + { + errlCommit(l_errl,HTMGT_COMP_ID); + TS_FAIL("verifyPstate failed for huid 0x%x", + get_huid(*itr)); + } + } + + if(pstateLibLoadedLocally) + { + VFS::module_unload( "libpstates.so" ); + } + + } + + // test to call procedures HTMGT will need + void test_procedures( void ) + { + errlHndl_t l_errl = NULL; + + bool mccfgLibLoadedLocally = false; + + if(!VFS::module_is_loaded( "libmc_config.so" ) ) + { + l_errl = VFS::module_load( "libmc_config.so" ); + if( l_errl ) + { + TS_FAIL("Could not load mc_config module" ); + errlCommit(l_errl,HTMGT_COMP_ID); + } + else + { + mccfgLibLoadedLocally = true; + } + } + + TARGETING::TargetHandleList l_mbaTargetList; + getAllChiplets(l_mbaTargetList, TYPE_MBA); + + for (TargetHandleList::const_iterator l_mba_iter = l_mbaTargetList.begin(); + l_mba_iter != l_mbaTargetList.end(); ++l_mba_iter) + + { + const TARGETING::Target* l_mba_target = *l_mba_iter; + + const fapi::Target l_fapi_mba_target + (fapi::TARGET_TYPE_MBA_CHIPLET, + (const_cast<TARGETING::Target*>(l_mba_target))); + + FAPI_INVOKE_HWP( l_errl, + mss_bulk_pwr_throttles, + l_fapi_mba_target); + if( l_errl ) + { + errlCommit(l_errl, HTMGT_COMP_ID); + TS_FAIL("Call to mss_bulk_pwr_throttles failed"); + } + + FAPI_INVOKE_HWP( l_errl, + mss_util_to_throttle, + l_fapi_mba_target); + if( l_errl ) + { + errlCommit(l_errl, HTMGT_COMP_ID); + TS_FAIL("Call to mss_util_to_throttle failed"); + } + + + FAPI_INVOKE_HWP( l_errl, + mss_throttle_to_power, + l_fapi_mba_target); + if( l_errl ) + { + errlCommit(l_errl, HTMGT_COMP_ID); + TS_FAIL("Call to mss_throttle_to_power failed"); + } + } + + if(mccfgLibLoadedLocally) + { + VFS::module_unload( "libmc_config.so" ); + } + } +}; + +#endif diff --git a/src/usr/hwpf/hwp/mc_config/makefile b/src/usr/hwpf/hwp/mc_config/makefile index 07a8d838b..8531c68be 100644 --- a/src/usr/hwpf/hwp/mc_config/makefile +++ b/src/usr/hwpf/hwp/mc_config/makefile @@ -62,6 +62,7 @@ OBJS += mss_eff_config_termination.o OBJS += mss_eff_config_rank_group.o OBJS += mss_eff_config_cke_map.o OBJS += mss_bulk_pwr_throttles.o +OBJS += mss_util_to_throttle.o OBJS += mss_throttle_to_power.o OBJS += mss_eff_config_shmoo.o OBJS += mss_error_support.o diff --git a/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.C b/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.C new file mode 100755 index 000000000..93b0d1dea --- /dev/null +++ b/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.C @@ -0,0 +1,132 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.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_util_to_throttle.C,v 1.6 2014/02/11 15:52:42 pardeik Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/ +// centaur/working/procedures/ipl/fapi/mss_util_to_throttle.C,v $ +//------------------------------------------------------------------------------ +// *! TITLE : mss_util_to_throttle +// *! DESCRIPTION : see additional comments below +// *! OWNER NAME : Michael Pardeik Email: pardeik@us.ibm.com +// *! BACKUP NAME : Mark Bellows Email: bellows@us.ibm.com +// *! ADDITIONAL COMMENTS : +// +// applicable CQ component memory_screen +// +// DESCRIPTION: +// The purpose of this procedure is to set the N throttle attributes for a +// given dram data bus utilization. TMGT will call this to determine a +// minimum N_MBA setting for the minimum MBA utilization allowed for that system +// +//------------------------------------------------------------------------------ +// Don't forget to create CVS comments when you check in your changes! +//------------------------------------------------------------------------------ +// CHANGE HISTORY: +//------------------------------------------------------------------------------ +// Version:| Author: | Date: | Comment: +//---------|----------|---------|----------------------------------------------- +// 1.6 | pardeik |11-FEB-14| RAS review fix: change %% to percent +// 1.5 | pardeik |13-JAN-14| Fixed calculation to not include x2 factor for +// | | | other MBA for custom DIMMs +// 1.4 | pardeik |06-JAN-14| Use ATTR_MRW_MEM_THROTTLE_DENOMINATOR instead +// | | | of ATTR_MRW_SAFEMODE_MEM_THROTTLE_DENOMINATOR +// 1.3 | pardeik |07-NOV-13| gerrit review updates +// 1.2 | pardeik |07-NOV-13| gerrit review updates +// 1.1 | pardeik |06-OCT-13| First Draft. + + +//------------------------------------------------------------------------------ +// My Includes +//------------------------------------------------------------------------------ +#include <mss_util_to_throttle.H> + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <fapi.H> + + +extern "C" { + + using namespace fapi; + + +//------------------------------------------------------------------------------ +// @brief mss_util_to_throttle(): This function will determine the minimum +// N throttle settings for N/M throttling given a dram data bus utilization +// +// @param[in] const fapi::Target &i_target_mba: MBA Target +// +// @return fapi::ReturnCode +//------------------------------------------------------------------------------ + + fapi::ReturnCode mss_util_to_throttle(const fapi::Target & i_target_mba) + { + fapi::ReturnCode rc = fapi::FAPI_RC_SUCCESS; + + FAPI_IMP("*** Running mss_util_to_throttle ***"); + + uint32_t throttle_d; + uint8_t data_bus_util; + uint32_t min_throttle_n_per_mba; + +// Get input attributes + rc = FAPI_ATTR_GET(ATTR_MSS_DATABUS_UTIL_PER_MBA, + &i_target_mba, data_bus_util); + if (rc) { + FAPI_ERR("Error getting attribute ATTR_MSS_DATABUS_UTIL_PER_MBA"); + return rc; + } + rc = FAPI_ATTR_GET(ATTR_MRW_MEM_THROTTLE_DENOMINATOR, + NULL, throttle_d); + if (rc) { + FAPI_ERR("Error getting attribute ATTR_MRW_MEM_THROTTLE_DENOMINATOR"); + return rc; + } + +// Calculate out the minimum N_MBA throttle number for the given utilization +// Uses N/M Throttling. Equation: (DRAM data bus utilization Percent / 100 ) = ((N * 4) / M) +// The 4 is a constant since dram data bus utilization is 4X the address bus utilization +// Add one since integer will truncate floating point number, so we we do not end up with a +// lower than intended setting + min_throttle_n_per_mba =((data_bus_util * throttle_d) / 4 / 100) + 1; + FAPI_INF("MIN N_MBA Throttle for %d percent DRAM data bus util = %d", data_bus_util, min_throttle_n_per_mba); + + +// Update output attributes + rc = FAPI_ATTR_SET(ATTR_MSS_UTIL_N_PER_MBA, + &i_target_mba, min_throttle_n_per_mba); + if (rc) { + FAPI_ERR("Error writing attribute ATTR_MSS_UTIL_N_PER_MBA"); + return rc; + } + + FAPI_IMP("*** mss_util_to_throttle COMPLETE ***"); + return rc; + + } + + + +} //end extern C diff --git a/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.H b/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.H new file mode 100755 index 000000000..691e56e5e --- /dev/null +++ b/src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.H @@ -0,0 +1,76 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/mc_config/mss_eff_config/mss_util_to_throttle.H $ */ +/* */ +/* 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_util_to_throttle.H,v 1.2 2013/11/07 20:39:38 pardeik Exp $ +// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/ +// centaur/working/procedures/ipl/fapi/mss_util_to_throttle.H,v $ +//------------------------------------------------------------------------------ +// *! TITLE : mss_util_to_throttle.H +// *! DESCRIPTION : see additional comments below +// *! OWNER NAME : Michael Pardeik Email: pardeik@us.ibm.com +// *! BACKUP NAME : Mark Bellows Email: bellows@us.ibm.com +// *! ADDITIONAL COMMENTS : +// +// Header file for mss_util_to_throttle. +// +//------------------------------------------------------------------------------ +// Don't forget to create CVS comments when you check in your changes! +//------------------------------------------------------------------------------ +// CHANGE HISTORY: +//------------------------------------------------------------------------------ +// Version:| Author: | Date: | Comment: +//---------|----------|---------|----------------------------------------------- +// 1.2 | pardeik |07-NOV-13| gerrit review updates +// 1.1 | pardeik |06-OCT-13| First Draft. + + + +#ifndef MSS_UTIL_TO_THROTTLE_H_ +#define MSS_UTIL_TO_THROTTLE_H_ + +//------------------------------------------------------------------------------ +// Includes +//------------------------------------------------------------------------------ +#include <fapi.H> + +typedef fapi::ReturnCode (*mss_util_to_throttle_FP_t)(const fapi::Target &); + +extern "C" +{ + +//------------------------------------------------------------------------------ +// @brief mss_util_to_throttle(): This function will determine the minimum +// N throttle settings for N/M throttling given a dram data bus utilization +// and update the attribute ATTR_MSS_UTIL_N_PER_MBA with the result +// +// @param[in] const fapi::Target &i_target_mba: MBA Target +// +// @return fapi::ReturnCode +//------------------------------------------------------------------------------ + + fapi::ReturnCode mss_util_to_throttle(const fapi::Target & i_target_mba); + +} // extern "C" + +#endif // MSS_UTIL_TO_THROTTLE_H_ diff --git a/src/usr/makefile b/src/usr/makefile index ec0f713f0..a56abd3f7 100644 --- a/src/usr/makefile +++ b/src/usr/makefile @@ -64,5 +64,6 @@ SUBDIRS += lpc.d SUBDIRS += console.d SUBDIRS += errldisplay.d SUBDIRS += ipmi.d +SUBDIRS += htmgt.d include ${ROOTPATH}/config.mk |