summaryrefslogtreecommitdiffstats
path: root/src/usr/htmgt/htmgt_utility.C
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2014-10-22 10:32:01 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-13 10:16:26 -0600
commit61c9acc8fd01eab34b942a284ac851bbd990d9f7 (patch)
tree92c86f3f8e1ad6b3b5f5cf016ae8d8cfb61c88e2 /src/usr/htmgt/htmgt_utility.C
parent5cdd71606bc1577f9cfe87b326190b84b9137dee (diff)
downloadtalos-hostboot-61c9acc8fd01eab34b942a284ac851bbd990d9f7.tar.gz
talos-hostboot-61c9acc8fd01eab34b942a284ac851bbd990d9f7.zip
HTMGT code to build several of the OCC config message payloads.
Includes an interface to run the hardware procedures related to memory throttling, which will write attributes needed for an OCC config message. Change-Id: I302e5c2f0e354dd57d6f6f9c8ad81095277a3d8c RTC: 114286 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14131 Reviewed-by: Christopher Cain <cjcain@us.ibm.com> Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/htmgt/htmgt_utility.C')
-rw-r--r--src/usr/htmgt/htmgt_utility.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/usr/htmgt/htmgt_utility.C b/src/usr/htmgt/htmgt_utility.C
index 733887de3..ef086c592 100644
--- a/src/usr/htmgt/htmgt_utility.C
+++ b/src/usr/htmgt/htmgt_utility.C
@@ -23,7 +23,10 @@
/* */
/* IBM_PROLOG_END_TAG */
#include "htmgt_utility.H"
+#include <targeting/common/commontargeting.H>
+#include <targeting/common/attributes.H>
+using namespace TARGETING;
namespace HTMGT
{
@@ -117,4 +120,28 @@ namespace HTMGT
+ uint8_t getOCCDIMMPos(const TargetHandle_t i_mba,
+ const TargetHandle_t i_dimm)
+ {
+ //To make the OCC DIMM # 0 - 7: 0bABC
+ // A: MBA ATTR_CHIP_UNIT: 0 or 1
+ // B: DIMM ATTR_MBA_PORT: 0 or 1
+ // C: DIMM ATTR_MBA_DIMM: 0 or 1
+
+ //Note: No CDIMM systems in plan. May need to revisit
+ //this if there are any as OCC may not care about logical DIMMs.
+
+ const uint8_t mbaUnit = i_mba->getAttr<ATTR_CHIP_UNIT>();
+ const uint8_t mbaPort = i_dimm->getAttr<ATTR_MBA_PORT>();
+ const uint8_t mbaDIMM = i_dimm->getAttr<ATTR_MBA_DIMM>();
+
+ TMGT_DBG("DIMM 0x%X unit %d port %d pos %d = %d",
+ i_dimm->getAttr<ATTR_HUID>(),
+ mbaUnit, mbaPort, mbaDIMM,
+ ((mbaUnit << 2) | (mbaPort << 1) | mbaDIMM));
+
+ return ((mbaUnit << 2) | (mbaPort << 1) | mbaDIMM);
+ }
+
+
} // end namespace
OpenPOWER on IntegriCloud