summaryrefslogtreecommitdiffstats
path: root/src/usr/htmgt/htmgt_cfgdata.H
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_cfgdata.H
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_cfgdata.H')
-rw-r--r--src/usr/htmgt/htmgt_cfgdata.H174
1 files changed, 174 insertions, 0 deletions
diff --git a/src/usr/htmgt/htmgt_cfgdata.H b/src/usr/htmgt/htmgt_cfgdata.H
new file mode 100644
index 000000000..5b6d30f5a
--- /dev/null
+++ b/src/usr/htmgt/htmgt_cfgdata.H
@@ -0,0 +1,174 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/htmgt/htmgt_cfgdata.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_CFGDATA_H
+#define HTMGT_CFGDATA_H
+
+#include <targeting/common/target.H>
+#include "htmgt_occ.H"
+
+
+namespace HTMGT
+{
+
+ /** OCC configuration data message formats */
+ enum occCfgDataFormat
+ {
+ OCC_CFGDATA_NO_REQUEST = 0x00, // no request for config data
+ OCC_CFGDATA_PSTATE_SSTRUCT = 0x01, // Psate Super Structure
+ OCC_CFGDATA_FREQ_POINT = 0x02, // Frequency Operating Points
+ OCC_CFGDATA_OCC_ROLE = 0x03, // OCC Role
+ OCC_CFGDATA_APSS_CONFIG = 0x04, // APSS Config
+ OCC_CFGDATA_MEM_CONFIG = 0x05, // Memory Configuration
+ OCC_CFGDATA_FIR_SCOMS = 0x06, // FIR Scoms Table
+ OCC_CFGDATA_PCAP_CONFIG = 0x07, // PCAP Config
+ OCC_CFGDATA_SYS_CONFIG = 0x0F, // System Configuration
+ OCC_CFGDATA_MEM_THROTTLE = 0x12, // Memory Throttle Settings
+ OCC_CFGDATA_TCT_CONFIG = 0x13, // Thermal Control Treshold
+
+ OCC_CFGDATA_FORMAT_END, // Marker to indicate last entry
+ OCC_CFGDATA_CLEAR_ALL = 0xFF, // Clear All Active Config Data
+ };
+
+
+ enum // constants
+ {
+ //KVM mode + single node
+ OCC_CFGDATA_OPENPOWER_SYSTEMTYPE = 0x81,
+
+ CFGDATA_CORES = 12,
+
+ CFGDATA_FRU_TYPE_PROC = 0x00,
+ CFGDATA_FRU_TYPE_MEMBUF = 0x01,
+ CFGDATA_FRU_TYPE_DIMM = 0x02,
+
+ CFDATA_DVFS_NOT_DEFINED = 0xFF,
+ };
+
+
+ /**
+ * Fills in the Memory Config Configuration Data message buffer,
+ * including the format and version numbers.
+ *
+ * @param[in] i_occ - the OCC to gather data for
+ * @param[in] i_monitoringEnabled - set it to true if mem monitoring on
+ * @param[out] o_data - preallocated buffer to fill in
+ * @param[out] o_size - set to the message size
+ * @pre o_data is large enough.
+ */
+ void getMemConfigMessageData(const TARGETING::TargetHandle_t i_occ,
+ bool i_monitoringEnabled,
+ uint8_t* o_data, uint64_t & o_size);
+
+
+ /**
+ * Fills in the Memory Throttle Configuration Data message buffer,
+ * including the format and version numbers.
+ *
+ * @param[in] i_occ - the OCC to gather data for
+ * @param[in] o_data - preallocated buffer to fill in
+ * @param[out] o_size - set to the message size
+ * @pre o_data is large enough.
+ */
+ void getMemThrottleMessageData(const TARGETING::TargetHandle_t i_occ,
+ uint8_t* o_data, uint64_t & o_size);
+
+
+ /**
+ * Fills in the OCC Role Configuration Data message buffer.
+ *
+ * @param[in] i_master - if this is for the OCC master
+ * @param[in] i_firMaster - if this is for the OCC FIR master
+ * @param[out] o_data - preallocated buffer to fill in
+ * @param[out] o_size - set to the message size
+ * @pre o_data is large enough.
+ */
+ void getOCCRoleMessageData(bool i_master, bool i_firMaster,
+ uint8_t* o_data, uint64_t & o_size);
+
+
+ /**
+ * Fills in the Power Cap Configuration Data message buffer.
+ *
+ * @param[out] o_data - preallocated buffer to fill in
+ * @param[out] o_size - set to the message size
+ * @pre o_data is large enough.
+ */
+ void getPowerCapMessageData(uint8_t* o_data, uint64_t & o_size);
+
+
+ /**
+ * Fills in the System Config Configuration Data message buffer.
+ *
+ * @param[out] o_data - preallocated buffer to fill in
+ * @param[out] o_size - set to the message size
+ * @pre o_data is large enough.
+ */
+ void getSystemConfigMessageData(uint8_t* o_data, uint64_t & o_size);
+
+
+ /**
+ * Fills in the Thermal Control Thresholds Configuration
+ * Data message buffer.
+ *
+ * @param[out] o_data - preallocated buffer to fill in
+ * @param[out] o_size - set to the message size
+ * @pre o_data is large enough.
+ */
+ void getThermalControlMessageData(uint8_t* o_data, uint64_t & o_size);
+
+
+ /**
+ * Fill in the Frequency Point Configuration Data
+ * message buffer.
+ *
+ * @param[out] o_data - preallocated buffer to fill in
+ * @param[out] o_size - set to the message size
+ * @pre o_data is large enough.
+ */
+ void getFrequencyPointMessageData(uint8_t* o_data,
+ uint64_t & o_size);
+
+ /**
+ * Read pstate data from attribute and build occcmd message
+ * @param[in] The OCC TARGETING::Target
+ * @param[out] The occ cmd message
+ * @param[in/out] In: Byte size of the o_data area. Out: Byte size of
+ * the occ cmd message.
+ */
+ void getPstateTableMessageData(const TARGETING::TargetHandle_t i_occTarget,
+ uint8_t* o_data,
+ uint64_t & io_size);
+
+ /**
+ * Generate the APSS configuration message
+ * @param[out] The APSS cfg message
+ * @param[in/out] In: Byte size of the o_data area. Out: Byte size of
+ * the occ cmd message
+ */
+ void getApssMessageData(uint8_t* o_data,
+ uint64_t & o_size);
+
+};
+#endif
OpenPOWER on IntegriCloud