summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorDzuy Nguyen <dzuy@us.ibm.com>2017-11-01 08:54:12 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-12-01 15:22:31 -0500
commitc71ed1c414501ce568f914e38b2ddbbc9c258cb6 (patch)
treecb222fe6f89fc1905454576f0a75745cdc70282b /src/include/usr
parent6bc72e2973d1868fcccf74f696bcb9bf08a62951 (diff)
downloadblackbird-hostboot-c71ed1c414501ce568f914e38b2ddbbc9c258cb6.tar.gz
blackbird-hostboot-c71ed1c414501ce568f914e38b2ddbbc9c258cb6.zip
Add support for OBUS PLL buckets
Add MRW support for ATTR_FREQ_O_MHZ attribute Add MACRO functions for ATTR_OB[0-3]_PLL_BUCKET attribute Change-Id: I75d02192bc09c9814fccadadb6aed69606508a58 RTC: 176188 CMVC-Prereq: 1039767 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48890 Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/fapi2/attribute_service.H32
-rw-r--r--src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H6
-rw-r--r--src/include/usr/util/util_reasoncodes.H3
-rw-r--r--src/include/usr/util/utilcommonattr.H60
4 files changed, 100 insertions, 1 deletions
diff --git a/src/include/usr/fapi2/attribute_service.H b/src/include/usr/fapi2/attribute_service.H
index 47538d00c..dfdd23803 100644
--- a/src/include/usr/fapi2/attribute_service.H
+++ b/src/include/usr/fapi2/attribute_service.H
@@ -429,6 +429,14 @@ ReturnCode platGetMBvpdAttr(
sizeof(T));
}
+/// @brief Function to be called by GETMACRO_OB[0,1,2,3]_PLL_BUCKET
+/// functions
+/// @param[in] i_fapiTarget FAPI2 Target pointer
+/// @param[out] o_bucket_val corresponding number in PLL frequency list
+/// @param[in] i_index The index number of the OBUS (0,1,2,3)
+ReturnCode getPllBucket(const Target<TARGET_TYPE_ALL>& i_fapiTarget,
+ uint8_t &o_bucket_val,
+ const uint8_t i_index);
// -----------------------------------------------------------------------------
// End TODO: End to be supported functions
@@ -462,6 +470,29 @@ platAttrSvc::setTargetingAttr(PTARGET, (const TARGETING::ATTRIBUTE_ID)\
fapiToTargeting::ID, sizeof(VAL), &(VAL))
//------------------------------------------------------------------------------
+// MACRO to route ATTR_OB[0..3]_PLL_BUCKET access to the correct HB function
+//------------------------------------------------------------------------------
+#define ATTR_OB0_PLL_BUCKET_GETMACRO(ID,PTARGET,VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, PTARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::getPllBucket(PTARGET, VAL, 0)
+
+#define ATTR_OB1_PLL_BUCKET_GETMACRO(ID,PTARGET,VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, PTARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::getPllBucket(PTARGET, VAL, 1)
+
+#define ATTR_OB2_PLL_BUCKET_GETMACRO(ID,PTARGET,VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, PTARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::getPllBucket(PTARGET, VAL, 2)
+
+#define ATTR_OB3_PLL_BUCKET_GETMACRO(ID,PTARGET,VAL) \
+ AttrOverrideSync::getAttrOverrideFunc(ID, PTARGET, &VAL)\
+ ? fapi2::ReturnCode() : \
+ fapi2::platAttrSvc::getPllBucket(PTARGET, VAL, 3)
+
+//------------------------------------------------------------------------------
// MACRO to route ATTR_NAME access to the correct Hostboot function
//------------------------------------------------------------------------------
#define ATTR_NAME_GETMACRO(ID, PTARGET, VAL) \
@@ -1424,4 +1455,5 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL))
fapi2::platAttrSvc::\
platGetMBvpdAttr<fapi2::ATTR_CEN_VPD_MT_DATA_CONTROL_BYTE_Type>(ID, TARGET, VAL)
+
#endif // ATTRIBUTESERVICE_H_
diff --git a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
index 0018d3c57..b9b963d28 100644
--- a/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
+++ b/src/include/usr/fapi2/hwpf_fapi2_reasoncodes.H
@@ -61,7 +61,8 @@ namespace fapi2
MOD_FAPI2_BAD_DQ_BITMAP = 0x12,
MOD_FAPI2_GET_CHIP_CFAM_TARGET = 0x13,
MOD_FAPI2_GET_ATTR_CEN_VPD_VERSION = 0x14,
- MOD_FAPI2_GET_MB_VPD_ATTR = 0x15
+ MOD_FAPI2_GET_MB_VPD_ATTR = 0x15,
+ MOD_FAPI2_GET_PLL_BUCKET = 0x16,
};
/**
@@ -140,6 +141,9 @@ namespace fapi2
// DIMM SPD generated errors
RC_BAD_DQ_MFG_MODE_BITS = HWPF_COMP_ID | 0x30,
+ // PLL_BUCKET generated errors
+ RC_NO_MATCHING_FREQ = HWPF_COMP_ID | 0x31,
+ RC_FREQ_LIST_NOT_FOUND = HWPF_COMP_ID | 0x32,
};
diff --git a/src/include/usr/util/util_reasoncodes.H b/src/include/usr/util/util_reasoncodes.H
index 77fd1e628..8b1e90e8a 100644
--- a/src/include/usr/util/util_reasoncodes.H
+++ b/src/include/usr/util/util_reasoncodes.H
@@ -51,6 +51,7 @@ namespace Util
UTIL_MCL_REL_MEM = 0x11, // MasterContainerLidMgr::releaseMem
UTIL_MCL_PROCESS_COMP = 0x12, // MasterContainerLidMgr::processComponent
UTIL_MCL_VERIFY_EXT = 0x13, // MasterContainerLidMgr::verifyExtend
+ UTIL_MOD_GET_OBUS_PLL_BUCKET = 0x14, // UtilCommonAttr::getObusPllBucket
};
enum ReasonCode
@@ -80,6 +81,8 @@ namespace Util
UTIL_MM_BLOCK_UNMAP_FAILED = UTIL_COMP_ID | 0x17,
UTIL_MCL_SIZE_MISMATCH = UTIL_COMP_ID | 0x18,
UTIL_MCL_COMPID_MISMATCH = UTIL_COMP_ID | 0x19,
+ UTIL_ERC_NO_FREQ_LIST = UTIL_COMP_ID | 0x1A,
+ UTIL_ERC_NO_MATCHING_FREQ = UTIL_COMP_ID | 0x1B,
};
};
diff --git a/src/include/usr/util/utilcommonattr.H b/src/include/usr/util/utilcommonattr.H
new file mode 100644
index 000000000..24aa12df7
--- /dev/null
+++ b/src/include/usr/util/utilcommonattr.H
@@ -0,0 +1,60 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/include/usr/util/utilcommonattr.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2017 */
+/* [+] 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 UTILCOMMONATTR_H
+#define UTILCOMMONATTR_H
+
+/**
+ * @file utilcommonattr.H
+ *
+ * @brief Common attribute interfaces shared between components
+ *
+ */
+
+/*****************************************************************************/
+// I n c l u d e s
+/*****************************************************************************/
+#include <stdint.h>
+#include <errl/errlentry.H>
+
+#include <targeting/common/target.H>
+
+namespace Util
+{
+
+ /**
+ * @brief Get the OBUS PLL bucket that corresponds to index and target
+ * @param[in] i_chipTarget Target pointer to chip
+ * @param[out] i_o_bucket_val corresponding number in PLL frequency list
+ * @param[in] i_index The index number of the OBUS (0,1,2,3)
+ *
+ * @return errlHndl_t Error log if unable to get bucket value
+ */
+ errlHndl_t getObusPllBucket(TARGETING::Target * i_chipTarget,
+ uint8_t &o_bucket_val,
+ const uint8_t i_index);
+
+}; // namespace Util
+
+#endif // UTILCOMMONATTR_H
OpenPOWER on IntegriCloud