summaryrefslogtreecommitdiffstats
path: root/import/hwpf
diff options
context:
space:
mode:
authorRichard J. Knight <rjknight@us.ibm.com>2016-03-07 13:53:28 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2016-04-14 11:23:26 -0400
commita5f98c5c8ddbd08f17549c6ddca0ce8cd5943c16 (patch)
treed29378b3a6530749d0fbaef056d0c0a64e1812dd /import/hwpf
parent609adc1ccf032597c3c5c867161f718bb1bd5b58 (diff)
downloadtalos-sbe-a5f98c5c8ddbd08f17549c6ddca0ce8cd5943c16.tar.gz
talos-sbe-a5f98c5c8ddbd08f17549c6ddca0ce8cd5943c16.zip
Update getVPD interface
-Move definitnion of specialized VPDInfo struct into fapi2. Change-Id: Ie91bfffd9c91e4a84f8b5451d2833522a540fca0 RTC:149122 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21782 Tested-by: Jenkins Server Tested-by: PPE CI Reviewed-by: Brian R. Silver <bsilver@us.ibm.com> Reviewed-by: Matt K. Light <mklight@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/21783 Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'import/hwpf')
-rw-r--r--import/hwpf/fapi2/include/fapi2_vpd_access.H26
-rw-r--r--import/hwpf/fapi2/include/plat/plat_vpd_access.H46
-rw-r--r--import/hwpf/fapi2/include/plat/vpd_access.H43
3 files changed, 57 insertions, 58 deletions
diff --git a/import/hwpf/fapi2/include/fapi2_vpd_access.H b/import/hwpf/fapi2/include/fapi2_vpd_access.H
index a44afc4f..80bdcd97 100644
--- a/import/hwpf/fapi2/include/fapi2_vpd_access.H
+++ b/import/hwpf/fapi2/include/fapi2_vpd_access.H
@@ -33,6 +33,32 @@
namespace fapi2
{
+/// @brief Specialized class representing required VPDInfo to be used
+/// in collecting VPD for the MCS target type.
+/// @tparam T fapi2::TARGET_TYPE_MCS
+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)
+ {};
+ // type of vpd field to return
+ fapi2::MemVpdData_t iv_vpd_type;
+
+ // 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;
+
+};
+
+
/// @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
diff --git a/import/hwpf/fapi2/include/plat/plat_vpd_access.H b/import/hwpf/fapi2/include/plat/plat_vpd_access.H
index 69e7b2e4..d9f32ee9 100644
--- a/import/hwpf/fapi2/include/plat/plat_vpd_access.H
+++ b/import/hwpf/fapi2/include/plat/plat_vpd_access.H
@@ -28,30 +28,32 @@
namespace fapi2
{
+// -- platform specific getVPD implementation goes here --
-/// @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>
+// platform specific for MCS target -- test code only
+inline fapi2::ReturnCode platGetVPD(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target,
+ VPDInfo<fapi2::TARGET_TYPE_MCS>& io_vpd_info,
+ uint8_t* o_blob)
{
- 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)
- {};
-
- // type of vpd field to return
- fapi2::MemVpdData_t iv_vpd_type;
-
- // 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;
-};
+ fapi2::ReturnCode l_rc = fapi2::FAPI2_RC_SUCCESS;
+
+ if( o_blob == nullptr )
+ {
+ io_vpd_info.iv_size = 2048;
+ }
+ else
+ {
+ o_blob[0] = 111;
+
+ io_vpd_info.iv_freq = 10000;
+ io_vpd_info.iv_rank_count_dimm_0 = 1;
+ io_vpd_info.iv_rank_count_dimm_1 = 8;
+ io_vpd_info.iv_dimm_drop_per_port = 6;
+
+ }
+
+ return l_rc;
+}
};
#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
index f13c5ca5..b227fab1 100644
--- a/import/hwpf/fapi2/include/plat/vpd_access.H
+++ b/import/hwpf/fapi2/include/plat/vpd_access.H
@@ -31,45 +31,16 @@
#include <fapi2_vpd_access.H>
namespace fapi2
{
+// -- platform specializations for getVPD go here --
-/// @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)
+// specialization for MCS target
+template<> fapi2::ReturnCode getVPD(const fapi2::Target<fapi2::TARGET_TYPE_MCS>& i_target,
+ VPDInfo<fapi2::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;
+ return platGetVPD( i_target, io_vpd_info, o_blob );
}
+
};
#endif // _FAPI2_VPDACCESS_H_
OpenPOWER on IntegriCloud