Skip to content

Commit

Permalink
L3 Update - p9_pm_get_poundv/w_bucket HWPs
Browse files Browse the repository at this point in the history
Change-Id: If57eb4edecbaba0c3436da845da7a1c2d3572a1f
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45416
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/45426
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
ibmthi authored and dcrowell77 committed Sep 7, 2017
1 parent 23997f4 commit 0eb03d7
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 40 deletions.
11 changes: 9 additions & 2 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundv_bucket.C
Expand Up @@ -26,18 +26,25 @@
/// @file p9_pm_get_poundv_bucket.C
/// @brief Grab PM data from attribute
///
/// *HWP HW Owner : N/A (This is a FW delivered function)
/// *HWP FW Owner : Thi Tran <thi@us.ibm.com>
/// *HWP Team : PM - Calling this function.
/// *HWP Consumed by : FSP
/// *HWP Level : 3
///

// ----------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------
#include <p9_pm_get_poundv_bucket.H>
#include <attribute_ids.H>

// See doxygen in header file
fapi2::ReturnCode p9_pm_get_poundv_bucket(
const fapi2::Target<fapi2::TARGET_TYPE_EQ>& i_target,
fapi2::voltageBucketData_t& o_data)
{
FAPI_IMP("Entering p9_pm_get_poundv_bucket ....");
FAPI_DBG("Entering p9_pm_get_poundv_bucket ....");

//Set up a char array to hold the bucket data from an attr read
fapi2::ATTR_POUNDV_BUCKET_DATA_Type l_bucketAttr;
Expand All @@ -50,7 +57,7 @@ fapi2::ReturnCode p9_pm_get_poundv_bucket(
memcpy(&o_data, l_bucketAttr, sizeof(o_data));

fapi_try_exit:
FAPI_IMP("Exiting p9_pm_get_poundv_bucket ....");
FAPI_DBG("Exiting p9_pm_get_poundv_bucket ....");

return fapi2::current_err;
}
12 changes: 9 additions & 3 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundv_bucket.H
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -28,6 +28,12 @@
/// can be stored inside of this struct.
/// Also define prototype for p9_pm_get_poundv_bucket
///
/// *HWP HW Owner : N/A (This is a FW delivered function)
/// *HWP FW Owner : Thi Tran <thi@us.ibm.com>
/// *HWP Team : PM - Calling this function.
/// *HWP Consumed by : FSP
/// *HWP Level : 3
///

#ifndef _P9_PM_GET_POUND_V_BUCKET_H_
#define _P9_PM_GET_POUND_V_BUCKET_H_
Expand Down Expand Up @@ -97,8 +103,8 @@ typedef struct __attribute__((__packed__)) voltageBucketData
/// bucket ID read off of parent proc chip. This function
/// will pass out a structured format of the #V data of correct
/// endianness.
/// @param[in] i_target EQ chiplet target
/// @param[in] o_data structured data describing the #v bucket used
/// @param[in] i_target EQ chiplet target
/// @param[out] o_data structured data describing the #v bucket used
/// @return FAPI2_RC_SUCCESS if success, else error code.
///
fapi2::ReturnCode p9_pm_get_poundv_bucket(
Expand Down
Expand Up @@ -23,9 +23,16 @@
/* */
/* IBM_PROLOG_END_TAG */
///

/// @file p9_pm_get_poundv_bucket_attr.C
/// @brief Grab PM data from certain bucket in #V keyword in LRPX record
///
/// *HWP HW Owner : N/A (This is a FW delivered function)
/// *HWP FW Owner : Thi Tran <thi@us.ibm.com>
/// *HWP Team : PM - Calling this function.
/// *HWP Consumed by : FSP
/// *HWP Level : 3
///

// ----------------------------------------------------------------------
// Includes
Expand Down Expand Up @@ -76,7 +83,6 @@ fapi2::ReturnCode p9_pm_get_poundv_bucket_attr(
lrpRecord = static_cast<fapi2::MvpdRecord>(l_eqChipUnitPos +
fapi2::MVPD_RECORD_LRP0 );


//check if bucket num has been overriden
FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_POUNDV_BUCKET_NUM_OVERRIDE,
i_target,
Expand Down Expand Up @@ -225,10 +231,12 @@ fapi2::ReturnCode p9_pm_get_poundv_bucket_attr(
else
{

FAPI_ERR("p9_pm_get_poundv_bucket_attr::Invalid number of matching nest freqs found for PBFreq=%d. Matches found = %d",
FAPI_ERR("p9_pm_get_poundv_bucket_attr::Invalid number of matching "
"nest freqs found for PBFreq=%d. Matches found = %d",
l_sysNestFreq, l_numMatches );
FAPI_ASSERT(false,
fapi2::INVALID_MATCHING_FREQ_NUMBER().
set_EQ_TARGET(i_target).
set_MATCHES_FOUND(l_numMatches).
set_DESIRED_FREQPB(l_sysNestFreq).
set_LRPREC(lrpRecord).
Expand All @@ -237,15 +245,15 @@ fapi2::ReturnCode p9_pm_get_poundv_bucket_attr(
set_BUCKETC_FREQPB(l_bucketNestFreqs[2]).
set_BUCKETD_FREQPB(l_bucketNestFreqs[3]).
set_BUCKETE_FREQPB(l_bucketNestFreqs[4]).
set_BUCKETF_FREQPB(l_bucketNestFreqs[5]).
set_EQ(i_target),
set_BUCKETF_FREQPB(l_bucketNestFreqs[5]),
"Matches found is NOT 1" );
}
}
else
{
FAPI_ASSERT( false,
fapi2::INVALID_POUNDV_VERSION()
.set_EQ_TARGET(i_target)
.set_POUNDV_VERSION(*l_fullVpdData),
"p9_pm_get_poundv_bucket_attr::Invalid #V record version: 0x%x",
*l_fullVpdData);
Expand All @@ -254,7 +262,9 @@ fapi2::ReturnCode p9_pm_get_poundv_bucket_attr(
// This assert ensures the size of the calculated data is correct
FAPI_ASSERT(l_vpdSize - POUNDV_BUCKET_OFFSET - ((l_bucketId - 1) *
l_bucketSize) >= l_bucketSize,
fapi2::BAD_VPD_READ().set_EXPECTED_SIZE(sizeof(l_bucketSize))
fapi2::BAD_VPD_READ()
.set_EQ_TARGET(i_target)
.set_EXPECTED_SIZE(sizeof(l_bucketSize))
.set_ACTUAL_SIZE(l_vpdSize - POUNDV_BUCKET_OFFSET -
((l_bucketId - 1) * l_bucketSize)),
"#V data read was too small!" );
Expand All @@ -265,7 +275,7 @@ fapi2::ReturnCode p9_pm_get_poundv_bucket_attr(
// NOTE: Bucket IDs range from 1-6
FAPI_ASSERT( (l_bucketId <= NUM_BUCKETS) && (l_bucketId != 0),
fapi2::INVALID_BUCKET_ID()
.set_TARGET(i_target)
.set_EQ_TARGET(i_target)
.set_BUCKET_ID(l_bucketId),
"Invalid Bucket Id = %d",
l_bucketId );
Expand Down Expand Up @@ -294,5 +304,3 @@ fapi_try_exit:

return fapi2::current_err;
}


Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016 */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand All @@ -22,11 +22,18 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */

///
/// @file p9_pm_get_poundv_bucket.H
/// @file p9_pm_get_poundv_bucket_attr.H
/// @brief Provide structure for voltageBucketData so that info from #V keyword
/// can be stored inside of this struct.
/// Also define prototype for p9_pm_get_poundv_bucket
/// Also define prototype for p9_pm_get_poundv_bucket_attr
///
/// *HWP HW Owner : N/A (This is a FW delivered function)
/// *HWP FW Owner : Thi Tran <thi@us.ibm.com>
/// *HWP Team : PM - Calling this function.
/// *HWP Consumed by : FSP
/// *HWP Level : 3
///

#ifndef _P9_PM_GET_POUND_V_BUCKET_ATTR_H_
Expand Down
17 changes: 14 additions & 3 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundw_bucket.C
Expand Up @@ -26,18 +26,30 @@
/// @file p9_pm_get_poundw_bucket.C
/// @brief Grab PM data from attribute
///
/// @file p9_pm_get_poundw_bucket.H
/// @brief Provide structure for vdmData so that info from #W keyword can be
/// stored inside of this struct.
/// Also define prototype for p9_pm_get_poundw_bucket
///
/// *HWP HW Owner : N/A (This is a FW delivered function)
/// *HWP FW Owner : Thi Tran <thi@us.ibm.com>
/// *HWP Team : PM - Calling this function.
/// *HWP Consumed by : FSP
/// *HWP Level : 3
///

// ----------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------
#include <p9_pm_get_poundw_bucket.H>
#include <attribute_ids.H>

// See doxygen in header file
fapi2::ReturnCode p9_pm_get_poundw_bucket(
const fapi2::Target<fapi2::TARGET_TYPE_EQ>& i_target,
fapi2::vdmData_t& o_data)
{
FAPI_IMP("Entering p9_pm_get_poundw_bucket ....");
FAPI_DBG("Entering p9_pm_get_poundw_bucket ....");

//Set up a char array to hold the bucket data from an attr read
fapi2::ATTR_POUNDW_BUCKET_DATA_Type l_bucketAttr;
Expand All @@ -50,7 +62,6 @@ fapi2::ReturnCode p9_pm_get_poundw_bucket(
memcpy(&o_data, l_bucketAttr, sizeof(o_data));

fapi_try_exit:
FAPI_IMP("Exiting p9_pm_get_poundw_bucket ....");

FAPI_DBG("Exiting p9_pm_get_poundw_bucket ....");
return fapi2::current_err;
}
10 changes: 8 additions & 2 deletions src/import/chips/p9/procedures/hwp/pm/p9_pm_get_poundw_bucket.H
Expand Up @@ -28,6 +28,12 @@
/// stored inside of this struct.
/// Also define prototype for p9_pm_get_poundw_bucket
///
/// *HWP HW Owner : N/A (This is a FW delivered function)
/// *HWP FW Owner : Thi Tran <thi@us.ibm.com>
/// *HWP Team : PM - Calling this function.
/// *HWP Consumed by : FSP
/// *HWP Level : 3
///

#ifndef _P9_PM_GET_POUND_W_BUCKET_H_
#define _P9_PM_GET_POUND_W_BUCKET_H_
Expand Down Expand Up @@ -66,8 +72,8 @@ typedef struct __attribute__((__packed__)) vdmData
/// bucket ID read off of parent proc chip. This function
/// will pass out a structured format of the #W data of correct
/// endianness.
/// @param[in] i_target EQ chiplet target
/// @param[in] o_data structured data describing the #w bucket used
/// @param[in] i_target EQ chiplet target
/// @param[out] o_data structured data describing the #w bucket used
/// @return FAPI2_RC_SUCCESS if success, else error code.
///
fapi2::ReturnCode p9_pm_get_poundw_bucket(
Expand Down
Expand Up @@ -26,6 +26,12 @@
/// @file p9_pm_get_poundw_bucket_attr.C
/// @brief Grab PM data from certain bucket in #W keyword in CRP0 record
///
/// *HWP HW Owner : N/A (This is a FW delivered function)
/// *HWP FW Owner : Thi Tran <thi@us.ibm.com>
/// *HWP Team : PM - Calling this function.
/// *HWP Consumed by : FSP
/// *HWP Level : 3
///

// ----------------------------------------------------------------------
// Includes
Expand All @@ -36,6 +42,7 @@
#include <mvpd_access_defs.H>
#include <attribute_ids.H>

// See doxygen in header file
fapi2::ReturnCode p9_pm_get_poundw_bucket_attr(
const fapi2::Target<fapi2::TARGET_TYPE_EQ>& i_target,
uint8_t* o_data)
Expand Down Expand Up @@ -106,6 +113,7 @@ fapi2::ReturnCode p9_pm_get_poundw_bucket_attr(
{
FAPI_ASSERT( false,
fapi2::INVALID_POUNDW_VERSION()
.set_EQ_TARGET(i_target)
.set_POUNDW_VERSION(*l_fullVpdData),
"p9_pm_get_poundw_bucket_attr::Invalid #W record "
"version: 0x%x",
Expand All @@ -119,6 +127,7 @@ fapi2::ReturnCode p9_pm_get_poundw_bucket_attr(
FAPI_ASSERT(l_vpdSize - POUNDW_VERSION_SIZE - ((l_bucketId - 1) *
l_bucketSize) >= l_bucketSize,
fapi2::BAD_POUNDW_VPD_READ()
.set_EQ_TARGET(i_target)
.set_EXPECTED_SIZE(l_bucketSize)
.set_ACTUAL_SIZE(l_vpdSize - POUNDW_VERSION_SIZE -
((l_bucketId - 1) * l_bucketSize)),
Expand All @@ -133,6 +142,7 @@ fapi2::ReturnCode p9_pm_get_poundw_bucket_attr(
// This assert ensures the output data bucket ID matches what we looked for
FAPI_ASSERT( (l_bucketId == ((fapi2::vdmData_t*)o_data)->bucketId),
fapi2::INCORRECT_POUNDW_BUCKET_ID()
.set_EQ_TARGET(i_target)
.set_BUCKET_ID(((fapi2::vdmData_t*)o_data)->bucketId)
.set_EXP_BUCKET_ID(l_bucketId),
"Incorrect Bucket Id = %d, expected %d",
Expand Down
Expand Up @@ -27,6 +27,12 @@
/// @brief Define prototype for p9_pm_get_poundw_bucket_attr. This function
/// retrieves a vdmData structure with info from #W keyword.
///
/// *HWP HW Owner : N/A (This is a FW delivered function)
/// *HWP FW Owner : Thi Tran <thi@us.ibm.com>
/// *HWP Team : PM - Calling this function.
/// *HWP Consumed by : FSP
/// *HWP Level : 3
///

#ifndef _P9_PM_GET_POUND_W_BUCKET_ATTR_H_
#define _P9_PM_GET_POUND_W_BUCKET_ATTR_H_
Expand Down

0 comments on commit 0eb03d7

Please sign in to comment.