summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9
diff options
context:
space:
mode:
authorJacob Harvey <jlharvey@us.ibm.com>2016-08-30 13:09:30 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2016-10-28 11:06:02 -0400
commit98fe6cc0bfa0e60a8475a8512820d13074f3c871 (patch)
tree494ade9a05dbe26a73e52c9cee5b0eeac11853db /src/import/chips/p9
parenta10ef71c06f7aa0623ef326d6f4e66d1b164925d (diff)
downloadtalos-hostboot-98fe6cc0bfa0e60a8475a8512820d13074f3c871.tar.gz
talos-hostboot-98fe6cc0bfa0e60a8475a8512820d13074f3c871.zip
Implement p9_mss_throttle_mem
Scomming the runtime throttle values into the register Change-Id: Ifc1b21e64dc7fb2a0080d723c78a10d715d79ede Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30736 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Michael D. Pardeik <pardeik@us.ibm.com> Reviewed-by: Louis Stermole <stermole@us.ibm.com> Reviewed-by: Brian R. Silver <bsilver@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31932 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.C39
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.H21
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.mk29
3 files changed, 72 insertions, 17 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.C b/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.C
index 608b7767a..e1c27e4b3 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.C
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.C
@@ -27,15 +27,15 @@
/// @file p9_mss_throttle_mem.C
/// @brief Write the runtime memory throttle settings from attributes to scom registers
///
-// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP HWP Owner: Jacob Harvey <jlharvey@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP Team: Memory
-// *HWP Level: 1
-// *HWP Consumed by: FSP:HB
+// *HWP Level: 2
+// *HWP Consumed by: Cronus
#include <fapi2.H>
-#include <p9_mss_thermal_throttle_mem.H>
-
+#include <p9_mss_throttle_mem.H>
+#include <mss.H>
using fapi2::TARGET_TYPE_MCS;
extern "C"
@@ -45,12 +45,37 @@ extern "C"
/// @brief Write the runtime memory throttle settings from attributes to scom registers
/// @param[in] i_target the controller target
/// @return FAPI2_RC_SUCCESS iff ok
+/// @note overwriting the safemem_throttle values
///
fapi2::ReturnCode p9_mss_throttle_mem( const fapi2::Target<TARGET_TYPE_MCS>& i_target )
{
FAPI_INF("Start throttle mem");
- FAPI_INF("End throttle mem");
+ for (const auto& l_mca : mss::find_targets<fapi2::TARGET_TYPE_MCA> (i_target))
+ {
+ uint32_t l_runtime_port = 0;
+ uint32_t l_runtime_slot = 0;
+ uint32_t l_throttle_denominator = 0;
+
+ FAPI_TRY( mss::mem_m_dram_clocks( l_mca, l_throttle_denominator) );
+ FAPI_TRY( mss::runtime_mem_throttled_n_commands_per_port(l_mca, l_runtime_port));
+ FAPI_TRY( mss::runtime_mem_throttled_n_commands_per_slot(l_mca, l_runtime_slot));
+
+ fapi2::buffer<uint64_t> l_data;
+ FAPI_TRY(mss::getScom(l_mca, MCA_MBA_FARB3Q, l_data));
+
+ l_data.insertFromRight<MCA_MBA_FARB3Q_CFG_NM_N_PER_SLOT, MCA_MBA_FARB3Q_CFG_NM_N_PER_SLOT_LEN>(l_runtime_slot);
+ l_data.insertFromRight<MCA_MBA_FARB3Q_CFG_NM_N_PER_PORT, MCA_MBA_FARB3Q_CFG_NM_N_PER_PORT_LEN>(l_runtime_port);
+
+ FAPI_TRY( mss::putScom(l_mca, MCA_MBA_FARB3Q, l_data) );
+
+ }
+
+ FAPI_INF("End throttle mem");
return fapi2::FAPI2_RC_SUCCESS;
+
+ fapi_try_exit:
+ FAPI_ERR("Couldn't finish mss_throttle_mem");
+ return fapi2::current_err;
}
-}
+} // extern "C"
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.H b/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.H
index 858925b2d..c9061ea8c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.H
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.H
@@ -22,17 +22,16 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
-
///
/// @file p9_mss_throttle_mem.H
/// @brief Write the runtime memory throttle settings from attributes to scom registers
///
-// *HWP HWP Owner: Andre Marin <aamarin@us.ibm.com>
+// *HWP HWP Owner: Jacob Harvey <jlharvey@us.ibm.com>
// *HWP HWP Backup: Brian Silver <bsilver@us.ibm.com>
// *HWP Team: Memory
-// *HWP Level: 1
-// *HWP Consumed by: FSP:HB
-
+// *HWP Level: 2
+// *HWP Consumed by: Cronus
+//
#ifndef __P9_MSS_THROTTLE_MEM__
#define __P9_MSS_THROTTLE_MEM__
@@ -42,12 +41,14 @@ typedef fapi2::ReturnCode (*p9_mss_throttle_mem_FP_t) (const fapi2::Target<fapi2
extern "C"
{
-///
-/// @brief Write the runtime memory throttle settings from attributes to scom registers
-/// @param[in] i_target the controller target
-/// @return FAPI2_RC_SUCCESS iff ok
-///
+ ///
+ /// @brief Write the runtime memory throttle settings from attributes to scom registers
+ /// @param[in] i_target the controller target
+ /// @return FAPI2_RC_SUCCESS iff ok
+ /// @note overwriting the safemem_throttle values
+ ///
fapi2::ReturnCode p9_mss_throttle_mem( const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target );
+
}
#endif
diff --git a/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.mk b/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.mk
new file mode 100644
index 000000000..79db1aa15
--- /dev/null
+++ b/src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.mk
@@ -0,0 +1,29 @@
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/import/chips/p9/procedures/hwp/memory/p9_mss_throttle_mem.mk $
+#
+# OpenPOWER HostBoot Project
+#
+# Contributors Listed Below - COPYRIGHT 2015,2016
+# [+] 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 00common.mk
+
+PROCEDURE=p9_mss_throttle_mem
+$(eval $(call ADD_MEMORY_INCDIRS,$(PROCEDURE)))
+$(call BUILD_PROCEDURE)
OpenPOWER on IntegriCloud