summaryrefslogtreecommitdiffstats
path: root/import/hwpf
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2016-01-20 17:36:57 -0600
committerSantosh S. Puranik <santosh.puranik@in.ibm.com>2016-03-04 07:21:39 -0500
commit30b78febf6c4a4611d3bd5b0d0ef1260d5b8333c (patch)
tree565a73c11b2673b672ba0cff6d8270758eb9ae07 /import/hwpf
parent14afc569dec865dd3d80edd3c746bb70eb52c162 (diff)
downloadtalos-sbe-30b78febf6c4a4611d3bd5b0d0ef1260d5b8333c.tar.gz
talos-sbe-30b78febf6c4a4611d3bd5b0d0ef1260d5b8333c.zip
VPD Accessor Changes for P9
Change-Id: I5342d99c753f6eb6a388dab0771341fe11d17c07 RTC:144543 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/10623 Tested-by: Jenkins Server Tested-by: Auto Mirror Reviewed-by: Brian R. Silver <bsilver@us.ibm.com> Reviewed-by: Matt K. Light <mklight@us.ibm.com> Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21705 Reviewed-by: Santosh S. Puranik <santosh.puranik@in.ibm.com>
Diffstat (limited to 'import/hwpf')
-rw-r--r--import/hwpf/fapi2/include/fapi2_vpd_access.H60
-rw-r--r--import/hwpf/fapi2/include/plat/plat_vpd_access.H57
-rw-r--r--import/hwpf/fapi2/include/plat/vpd_access.H75
-rw-r--r--import/hwpf/fapi2/include/vpd_access_defs.H52
4 files changed, 244 insertions, 0 deletions
diff --git a/import/hwpf/fapi2/include/fapi2_vpd_access.H b/import/hwpf/fapi2/include/fapi2_vpd_access.H
new file mode 100644
index 00000000..a44afc4f
--- /dev/null
+++ b/import/hwpf/fapi2/include/fapi2_vpd_access.H
@@ -0,0 +1,60 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: hwpf/fapi2/include/fapi2_vpd_access.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* EKB Project */
+/* */
+/* COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/// @file fapi2_vpd_access.H
+/// @brief Common file that defines the vpd access functions that
+/// platform code must implement.
+///
+//
+
+#ifndef _FAPI2_VPDACCESS_H_
+#define _FAPI2_VPDACCESS_H_
+
+#include <return_code.H>
+#include <target_types.H>
+#include <vpd_access_defs.H>
+#include <plat_vpd_access.H>
+
+namespace fapi2
+{
+
+/// @brief Return a blob of memory VPD data associated with the input target
+/// @param[in] i_target, a valid fapi2 target
+/// @param[in] io_vpd_info, fapi2::VPDInfo class that specifies which piece of data to return
+/// @param[out] o_blob, the blob of raw data from the vpd
+/// @return FAPI2_RC_SUCCESS if there's no problem
+/// @note passing nullptr for o_blob will return the size of the keyword
+///
+/// Example:
+/// fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> vpdInfo(MR_keyword);
+/// vpdInfo.iv_speed_bin = 2400_SPEED_BIN;
+///
+/// uint8_t * blob = NULL;
+///
+/// FAPI_TRY(getVPD( mcs, vpdInfo, blob ));
+/// blob = static_cast<uint8_t *>(malloc(vpdInfo.iv_size));
+/// FAPI_TRY(getVPD( mcs, vpdInfo, blob ));
+/// blob now contains the VPD data for the MCS.
+///
+template<TargetType T>
+ReturnCode getVPD(const Target<T>& i_target,
+ VPDInfo<T>& io_vpd_info,
+ uint8_t* o_blob);
+
+};
+#endif
diff --git a/import/hwpf/fapi2/include/plat/plat_vpd_access.H b/import/hwpf/fapi2/include/plat/plat_vpd_access.H
new file mode 100644
index 00000000..f7ca470d
--- /dev/null
+++ b/import/hwpf/fapi2/include/plat/plat_vpd_access.H
@@ -0,0 +1,57 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: hwpf/fapi2/include/plat/plat_vpd_access.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* EKB Project */
+/* */
+/* COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/// @file plat_vpd_access.H
+///
+/// @brief Platform vpd-access definitions
+///
+
+#ifndef _FAPI2_PLAT_VPDACCESS_H_
+#define _FAPI2_PLAT_VPDACCESS_H_
+
+#include <fapi2_vpd_access.H>
+
+namespace fapi2
+{
+
+/// @brief Class representing required VPDInfo to be used in vpd collection.
+/// @tparam T, the type of target this class is used with.
+template<>
+class VPDInfo<TARGET_TYPE_MCS>
+{
+ public:
+ // @brief VPDInfo constructor
+ VPDInfo( const fapi2::MemVpdData& i_vpd_type)
+ : iv_vpd_type(i_vpd_type),
+ iv_size(0), iv_freq(0), iv_rank_count_dimm_0(0),
+ iv_rank_count_dimm_1(0), iv_dimm_drop_per_port(0)
+ {};
+
+ // size of the vpd data
+ size_t iv_size;
+ uint64_t iv_freq;
+ uint64_t iv_rank_count_dimm_0;
+ uint64_t iv_rank_count_dimm_1;
+ uint64_t iv_dimm_drop_per_port;
+
+ // type of vpd field to return
+ fapi2::MemVpdData_t iv_vpd_type;
+};
+
+};
+#endif // _FAPI2_PLAT_VPDACCESS_H_
diff --git a/import/hwpf/fapi2/include/plat/vpd_access.H b/import/hwpf/fapi2/include/plat/vpd_access.H
new file mode 100644
index 00000000..f13c5ca5
--- /dev/null
+++ b/import/hwpf/fapi2/include/plat/vpd_access.H
@@ -0,0 +1,75 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: hwpf/fapi2/include/plat/vpd_access.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* EKB Project */
+/* */
+/* COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* IBM_PROLOG_END_TAG */
+/// @file vpd_access.H
+///
+/// @brief VPD access functions that needs to be specialized for
+/// platform implementation.
+///
+
+#ifndef __VPDACCESS_H_
+#define __VPDACCESS_H_
+
+#include <target.H>
+#include <return_code.H>
+#include <plat_vpd_access.H>
+#include <fapi2_vpd_access.H>
+namespace fapi2
+{
+
+/// @brief Return a blob of memory VPD data associated with the input target
+/// @param[in] i_target, a valid fapi2 target
+/// @param[in] io_vpd_info, fapi2::VPDInfo class that specifies which piece of data to return
+/// @param[out] o_blob, the blob of raw data from the vpd
+/// @return FAPI2_RC_SUCCESS if there's no problem
+/// @note passing nullptr for o_blob will return the size of the keyword
+///
+/// Example:
+/// fapi2::VPDInfo<fapi2::TARGET_TYPE_MCS> vpdInfo(i_target, MR_keyword);
+/// vpdInfo.iv_speed_bin = 2400_SPEED_BIN;
+///
+/// FAPI_TRY(getVPD( mcs, vpdInfo, nullptr ));
+/// char blob[vpdInfo.iv_size];
+/// FAPI_TRY(getVPD( mcs, vpdInfo, blob ));
+/// blob now contains the VPD data for the MCS.
+///
+template<> ReturnCode getVPD(const Target<TARGET_TYPE_MCS>& i_target,
+ VPDInfo<TARGET_TYPE_MCS>& io_vpd_info,
+ uint8_t* o_blob)
+{
+ ReturnCode l_rc = FAPI2_RC_SUCCESS;
+
+ if( o_blob == nullptr )
+ {
+ io_vpd_info.iv_size = 2048;
+ }
+ else
+ {
+ o_blob[0] = 111;
+ printf("io_vpd_info.iv_vpd_type = %d\n", io_vpd_info.iv_vpd_type);
+ printf("io_vpd_info.iv_freq = %d\n", io_vpd_info.iv_freq);
+ printf("io_vpd_info.iv_rank_count_dimm_0 = %d\n", io_vpd_info.iv_rank_count_dimm_0);
+ printf("io_vpd_info.iv_rank_count_dimm_1 = %d\n", io_vpd_info.iv_rank_count_dimm_1);
+
+ }
+
+ return l_rc;
+}
+};
+
+#endif // _FAPI2_VPDACCESS_H_
diff --git a/import/hwpf/fapi2/include/vpd_access_defs.H b/import/hwpf/fapi2/include/vpd_access_defs.H
new file mode 100644
index 00000000..52fe0984
--- /dev/null
+++ b/import/hwpf/fapi2/include/vpd_access_defs.H
@@ -0,0 +1,52 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: hwpf/fapi2/include/vpd_access_defs.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* EKB Project */
+/* */
+/* COPYRIGHT 2016 */
+/* [+] International Business Machines Corp. */
+/* */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* IBM_PROLOG_END_TAG */
+///
+/// @file vpd_access_defs.H
+///
+/// @brief VPD access definitions
+///
+
+#ifndef __VPDACCESSDEFS_H_
+#define __VPDACCESSDEFS_H_
+
+#include <stdint.h>
+
+namespace fapi2
+{
+
+// @brief VPD accesss enums
+enum MemVpdData
+{
+ MR, //! Memory phase rotator
+ MT, //! Memory Termination
+ MP, //! Memory Power related info
+};
+
+typedef MemVpdData MemVpdData_t;
+
+/// @brief Class representing required VPDInfo to be used in vpd collection.
+/// @tparam T, the type of target this class is used with.
+///
+/// NOTE: to be defined by implementor
+//
+template<fapi2::TargetType T>
+class VPDInfo;
+
+}
+#endif
OpenPOWER on IntegriCloud