summaryrefslogtreecommitdiffstats
path: root/src/include/usr/targeting/common
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2014-03-13 10:21:03 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-04-02 17:06:52 -0500
commitec7743b1c59b7e7deae7ec5a2a2c17325c51185e (patch)
tree0b46043b421eea7e01a6ca9e11c73f73c6677e52 /src/include/usr/targeting/common
parentee4a0749b5298fab4968ca5884690d75501ca45e (diff)
downloadtalos-hostboot-ec7743b1c59b7e7deae7ec5a2a2c17325c51185e.tar.gz
talos-hostboot-ec7743b1c59b7e7deae7ec5a2a2c17325c51185e.zip
Updates to Attribute Override for multi drawer systems
The Node field in an attribute override text file is now picked up. Checking and clearing attribute overrides now takes into account the node. Communication of attribute overrides between Hostboot and HWSV now takes into account the node. There is a follow-on HWSV change, but this change needs to go in first and there are no pre/co-reqs Change-Id: I6537652d2632cc22583a59567795c47304cf4876 RTC: 63163 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9598 Tested-by: Jenkins Server Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com> Reviewed-by: William H. Schwartz <whs@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/targeting/common')
-rw-r--r--src/include/usr/targeting/common/attributeTank.H119
-rw-r--r--src/include/usr/targeting/common/target.H44
2 files changed, 123 insertions, 40 deletions
diff --git a/src/include/usr/targeting/common/attributeTank.H b/src/include/usr/targeting/common/attributeTank.H
index 3fea178c7..7526f6863 100644
--- a/src/include/usr/targeting/common/attributeTank.H
+++ b/src/include/usr/targeting/common/attributeTank.H
@@ -5,7 +5,7 @@
/* */
/* IBM CONFIDENTIAL */
/* */
-/* COPYRIGHT International Business Machines Corp. 2013 */
+/* COPYRIGHT International Business Machines Corp. 2013,2014 */
/* */
/* p1 */
/* */
@@ -26,17 +26,6 @@
* @brief Defines the AttributeTank and its associated classes. These are used
* to store attributes for Attribute Overriding and Synchronization
*/
-
-/*
- * Change Log ******************************************************************
- * Flag Defect/Feature User Date Description
- * ------ -------------- ---------- ----------- ----------------------------
- * mjjones 06/07/2012 Created
- * mjjones 10/15/2012 Moved to general AttributeTank.
- * mjjones 02/13/2013 Moved to Targeting and major
- * design changes
- */
-
#ifndef __TARGETING_COMMON_ATTRTANK_H
#define __TARGETING_COMMON_ATTRTANK_H
@@ -94,9 +83,23 @@ public:
TANK_LAYER_TARG,
};
+ /**
+ * @brief Enumeration of node filter values
+ *
+ * This is passed to serializeAttributes and clearAllAttributes
+ */
+ enum NodeFilter
+ {
+ NODE_FILTER_NONE,
+ NODE_FILTER_NOT_ALL_NODES,
+ NODE_FILTER_SPECIFIC_NODE_AND_ALL,
+ NODE_FILTER_SPECIFIC_NODE,
+ };
+
// Constants for various fields in AttributeHeader
static const uint16_t ATTR_POS_NA = 0xffff; // iv_pos N/A
static const uint8_t ATTR_UNIT_POS_NA = 0xff; // iv_unitPos N/A
+ static const uint8_t ATTR_NODE_NA = 0xf; // iv_node N/A
/**
* @struct AttributeHeader
@@ -120,7 +123,8 @@ public:
uint16_t iv_pos; // For chips/dimms the position
// For chiplets the parent chip position
uint8_t iv_unitPos; // For chiplets the position
- uint8_t iv_flags; // AttributeFlags enum value(s)
+ uint8_t iv_node : 4; // Target Node number
+ uint8_t iv_flags : 4; // AttributeFlags enum value(s)
uint32_t iv_valSize; // Size of the attribute value in bytes
};
@@ -171,8 +175,23 @@ public:
/**
* @brief Clear all attributes
+ *
+ * @param[in] i_nodeFilter NODE_FILTER_NONE:
+ * Clear all attributes
+ * NODE_FILTER_NOT_ALL_NODES:
+ * Clear only those attributes that are not for
+ * all nodes
+ * NODE_FILTER_SPECIFIC_NODE_AND_ALL:
+ * Clear only those attributes that are for a
+ * specific node (i_node) or all nodes
+ * NODE_FILTER_SPECIFIC_NODE
+ * Clear only those attributes that are for a
+ * specific node (i_node)
+ * @param[in] i_node See i_nodeFilter
*/
- virtual void clearAllAttributes();
+ virtual void clearAllAttributes(
+ const NodeFilter i_nodeFilter = NODE_FILTER_NONE,
+ const uint8_t i_node = ATTR_NODE_NA);
/**
* @brief Clear any non-const attribute for a specified ID and Target
@@ -184,11 +203,27 @@ public:
* @param[in] i_targetType Target Type attribute is for
* @param[in] i_pos Target Position
* @param[in] i_unitPos Target Unit Position
+ * @param[in] i_node Target Node
*/
virtual void clearNonConstAttribute(const uint32_t i_attrId,
const uint32_t i_targetType,
const uint16_t i_pos,
- const uint8_t i_unitPos);
+ const uint8_t i_unitPos,
+ const uint8_t i_node);
+
+ /**
+ * @brief DEPRECATED
+ *
+ * Will be removed with RTC99917 when FSP code has been changed to call
+ * the new interface with the i_node parameter
+ */
+ virtual void clearNonConstAttribute(const uint32_t i_attrId,
+ const uint32_t i_targetType,
+ const uint16_t i_pos,
+ const uint8_t i_unitPos)
+ {
+ clearNonConstAttribute(i_attrId, i_targetType, i_pos, i_unitPos, 0);
+ }
/**
* @brief Set an Attribute
@@ -205,6 +240,7 @@ public:
* @param[in] i_targetType Target Type attribute is for
* @param[in] i_pos Target Position
* @param[in] i_unitPos Target Unit Position
+ * @param[in] i_node Target Node
* @param[in] i_flags Flags (ORed set of AttributeFlags)
* @param[in] i_valSize Size of attribute value in bytes
* @param[in] i_pVal Pointer to attribute value
@@ -213,11 +249,30 @@ public:
const uint32_t i_targetType,
const uint16_t i_pos,
const uint8_t i_unitPos,
+ const uint8_t i_node,
const uint8_t i_flags,
const uint32_t i_valSize,
const void * i_pVal);
/**
+ * @brief DEPRECATED
+ *
+ * Will be removed with RTC99917 when FSP code has been changed to call
+ * the new interface with the i_node parameter
+ */
+ virtual void setAttribute(const uint32_t i_attrId,
+ const uint32_t i_targetType,
+ const uint16_t i_pos,
+ const uint8_t i_unitPos,
+ const uint8_t i_flags,
+ const uint32_t i_valSize,
+ const void * i_pVal)
+ {
+ setAttribute(i_attrId, i_targetType, i_pos, i_unitPos, 0, i_flags,
+ i_valSize, i_pVal);
+ }
+
+ /**
* @brief Get a copy of an Attribute
*
* This is called on an OverrideAttributeTank to query/get an Attribute
@@ -227,6 +282,7 @@ public:
* @param[in] i_targetType Target Type attribute is for
* @param[in] i_pos Target Position
* @param[in] i_unitPos Target Unit Position
+ * @param[in] i_node Target Node
* @param[out] o_pVal Pointer to attribute value
*
* return true if attribute exists and a copy was written to o_pVal
@@ -235,9 +291,26 @@ public:
const uint32_t i_targetType,
const uint16_t i_pos,
const uint8_t i_unitPos,
+ const uint8_t i_node,
void * o_pVal) const;
/**
+ * @brief DEPRECATED
+ *
+ * Will be removed with RTC99917 when FSP code has been changed to call
+ * the new interface with the i_node parameter
+ */
+ virtual bool getAttribute(const uint32_t i_attrId,
+ const uint32_t i_targetType,
+ const uint16_t i_pos,
+ const uint8_t i_unitPos,
+ void * o_pVal) const
+ {
+ return getAttribute(i_attrId, i_targetType, i_pos, i_unitPos, 0,
+ o_pVal);
+ }
+
+ /**
* @brief Serialize all Attributes into newly allocated memory chunks
*
* The use case is for getting the attributes to send across an interface
@@ -252,11 +325,25 @@ public:
* structs are added to.
* The caller must free (if MALLOC)
* or delete[] (if NEW) each chunk's memory
+ * @param[in] i_nodeFilter NODE_FILTER_NONE:
+ * Get all attributes
+ * NODE_FILTER_NOT_ALL_NODES:
+ * Get only those attributes that are not for all
+ * nodes
+ * NODE_FILTER_SPECIFIC_NODE_AND_ALL:
+ * Get only those attributes that are for a
+ * specific node (i_node) or all nodes
+ * NODE_FILTER_SPECIFIC_NODE
+ * Get only those attributes that are for a
+ * specific node (i_node)
+ * @param[in] i_node See i_nodeFilter
*/
virtual void serializeAttributes(
const AllocType i_allocType,
const uint32_t i_chunkSize,
- std::vector<AttributeSerializedChunk> & o_attributes) const;
+ std::vector<AttributeSerializedChunk> & o_attributes,
+ const NodeFilter i_nodeFilter = NODE_FILTER_NONE,
+ const uint8_t i_node = ATTR_NODE_NA) const;
/**
* @brief Deserialize a chunk of Attributes into the tank
diff --git a/src/include/usr/targeting/common/target.H b/src/include/usr/targeting/common/target.H
index 168528983..50dbdbc26 100644
--- a/src/include/usr/targeting/common/target.H
+++ b/src/include/usr/targeting/common/target.H
@@ -335,6 +335,22 @@ class Target
*/
static bool uninstallWriteAttributeCallback();
+ /**
+ * @brief Returns the target's position data as used in an attribute
+ * tank.
+ *
+ * This target positions are associated with an attribute in an
+ * attribute tank and help identify which target(s) the attribute
+ * belongs to.
+ *
+ * @param[out] o_pos Chip/Dimm Position (ATTR_POS_NA if not found)
+ * @param[out] o_unitPos Unit Position (ATTR_UNIT_POS_NA if not found)
+ * @param[out] o_node Node Number (ATTR_NODE_NA if not found)
+ */
+ void getAttrTankTargetPosData(uint16_t & o_pos,
+ uint8_t & o_unitPos,
+ uint8_t & o_node) const;
+
private: // Private helper interfaces
/**
@@ -461,7 +477,8 @@ class Target
mutex_t*& o_pMutex) const;
/**
- * @brief Returns the target's type as used in an attribute tank.
+ * @brief Returns the target's type as used in a Targeting attribute
+ * tank.
*
* This target type is associated with an attribute in an attribute
* tank and helps identify which target(s) the attribute belongs to
@@ -471,29 +488,6 @@ class Target
uint32_t getAttrTankTargetType() const;
/**
- * @brief Returns the target's position as used in an attribute tank.
- *
- * This target position is associated with an attribute in an attribute
- * tank and helps identify which target(s) the attribute belongs to.
- * For a unit, this is the parent chip's position
- *
- * @return uint16_t The target position
- */
- uint16_t getAttrTankTargetPos() const;
-
- /**
- * @brief Returns the target's unit position as used in an attribute
- * tank.
- *
- * This target unit position is associated with an attribute in an
- * attribute tank and helps identify which target(s) the attribute
- * belongs to. This is only a valid value for units
- *
- * @return uint8_t The target unit position
- */
- uint8_t getAttrTankTargetUnitPos() const;
-
- /**
* @brief enumeration of assert reasons
*/
enum TargAssertReason
@@ -502,6 +496,8 @@ class Target
GET_ATTR,
GET_ATTR_AS_STRING,
GET_HB_MUTEX_ATTR,
+ GET_ATTR_TANK_TARGET_POS_DATA,
+ GET_ATTR_TANK_TARGET_POS_DATA_ATTR,
};
/**
OpenPOWER on IntegriCloud