summaryrefslogtreecommitdiffstats
path: root/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_attribute_accessors_manual.H
diff options
context:
space:
mode:
authorLouis Stermole <stermole@us.ibm.com>2018-10-12 08:58:56 -0500
committerChristian R. Geddes <crgeddes@us.ibm.com>2019-02-10 22:32:39 -0600
commit3d3ef8466200c5eaf439612bd1148d551347f947 (patch)
treebfd7def6ed6bb5602e4c9a7b97de4c4133d5b5be /src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_attribute_accessors_manual.H
parentbd23628e6e9da8c5cd2d0ab014512e8343fdffdb (diff)
downloadtalos-hostboot-3d3ef8466200c5eaf439612bd1148d551347f947.tar.gz
talos-hostboot-3d3ef8466200c5eaf439612bd1148d551347f947.zip
Add p9a_mss_volt procedure
Change-Id: Ib825eaeab9bdef2c4d746224780502afac008aa1 Original-Change-Id: I893685b365f6c815653717d4cc8149f2ea7acb94 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68412 Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: ANDRE A. MARIN <aamarin@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71352 Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_attribute_accessors_manual.H')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_attribute_accessors_manual.H45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_attribute_accessors_manual.H b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_attribute_accessors_manual.H
index 003e59615..ea713830b 100644
--- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_attribute_accessors_manual.H
+++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/lib/exp_attribute_accessors_manual.H
@@ -40,6 +40,7 @@
#include <fapi2.H>
#include <generic/memory/lib/utils/c_str.H>
+#include <generic/memory/lib/utils/find.H>
namespace mss
{
@@ -131,6 +132,50 @@ fapi_try_exit:
return fapi2::current_err;
}
+///
+/// @brief ATTR_MEM_EFF_VOLT_VDDR setter
+/// @tparam T the fapi2 target type of the target
+/// @param[in] i_target const ref to the TARGET_TYPE_OCMB_CHIP
+/// @param[in] i_value value to set
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff set is OK
+//TODO: Remove this once we have auto-generated attr setters
+///
+template< fapi2::TargetType T >
+inline fapi2::ReturnCode set_volt_vddr(const fapi2::Target<T>& i_target, uint32_t i_value)
+{
+ const auto l_ocmb = mss::find_target<fapi2::TARGET_TYPE_OCMB_CHIP>(i_target);
+
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_MEM_EFF_VOLT_VDDR, l_ocmb, i_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed setting ATTR_MEM_EFF_VOLT_VDDR: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
+///
+/// @brief ATTR_MEM_EFF_VOLT_VPP setter
+/// @tparam T the fapi2 target type of the target
+/// @param[in] i_target const ref to the TARGET_TYPE_OCMB_CHIP
+/// @param[in] i_value value to set
+/// @return fapi2::ReturnCode - FAPI2_RC_SUCCESS iff set is OK
+//TODO: Remove this once we have auto-generated attr setters
+///
+template< fapi2::TargetType T >
+inline fapi2::ReturnCode set_volt_vpp(const fapi2::Target<T>& i_target, uint32_t i_value)
+{
+ const auto l_ocmb = mss::find_target<fapi2::TARGET_TYPE_OCMB_CHIP>(i_target);
+
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_MEM_EFF_VOLT_VPP, l_ocmb, i_value) );
+ return fapi2::current_err;
+
+fapi_try_exit:
+ FAPI_ERR("failed setting ATTR_MEM_EFF_VOLT_VPP: 0x%lx (target: %s)",
+ uint64_t(fapi2::current_err), mss::c_str(i_target));
+ return fapi2::current_err;
+}
+
} // ns mss
#endif
OpenPOWER on IntegriCloud