Skip to content

Commit

Permalink
Updates persistant PMIC error bits prints
Browse files Browse the repository at this point in the history
Simplifies char/quals handling of known errors

Change-Id: Id6426f31d48a1a0a78224a165782a494b59410f1
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/96309
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/96393
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
sglancy6 authored and dcrowell77 committed May 11, 2020
1 parent e5e01d7 commit 89c2449
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Expand Up @@ -334,14 +334,15 @@ fapi2::ReturnCode check_pmic(
bool l_status_error = false;

// if we exit from this try, there were i2c errors
FAPI_TRY(mss::pmic::status::check_fields(i_pmic_target, mss::pmic::status::IDT_SPECIFIC_STATUS_FIELDS, l_status_error));
FAPI_TRY(mss::pmic::status::check_fields(i_pmic_target, "PMIC_WARNING_BIT",
mss::pmic::status::IDT_SPECIFIC_STATUS_FIELDS, l_status_error));
}

{
bool l_status_error = false;

// if we exit from this try, there were i2c errors
FAPI_TRY(mss::pmic::status::check_fields(i_pmic_target, mss::pmic::status::STATUS_FIELDS, l_status_error));
FAPI_TRY(mss::pmic::status::check_fields(i_pmic_target, "ERROR", mss::pmic::status::STATUS_FIELDS, l_status_error));
o_error = l_status_error;
}

Expand Down Expand Up @@ -380,12 +381,14 @@ fapi_try_exit:
/// @brief Check an individual set of PMIC status codes
///
/// @param[in] i_pmic_target PMIC target
/// @param[in] i_error_type error type for the PMIC in question
/// @param[in] i_statuses STATUS object to check
/// @param[out] o_error At least one error bit was found to be set
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error in case of an I2C read error
///
fapi2::ReturnCode check_fields(
const fapi2::Target<fapi2::TARGET_TYPE_PMIC>& i_pmic_target,
const char* i_error_type,
const std::vector<std::pair<uint8_t, std::vector<status_field>>>& i_statuses,
bool& o_error)
{
Expand All @@ -401,8 +404,9 @@ fapi2::ReturnCode check_fields(
if (l_reg_contents.getBit(l_status.l_reg_field))
{
// Print it out
FAPI_ERR("%s :: REG 0x%02x bit %u was set on %s",
FAPI_ERR("%s %s :: REG 0x%02x bit %u was set on %s",
l_status.l_error_description,
i_error_type,
l_reg_bit_pair.first,
l_status.l_reg_field,
mss::c_str(i_pmic_target));
Expand Down
Expand Up @@ -339,15 +339,17 @@ fapi2::ReturnCode check_pmic(const fapi2::Target<fapi2::TARGET_TYPE_PMIC>& i_pmi
fapi2::ReturnCode clear(const fapi2::Target<fapi2::TARGET_TYPE_PMIC>& i_pmic_target);

///
/// @brief Check the IDT specific status codes
/// @brief Check an individual set of PMIC status codes
///
/// @param[in] i_pmic_target PMIC target
/// @param[in] i_error_type error type for the PMIC in question
/// @param[in] i_statuses STATUS object to check
/// @param[out] o_error At least one error bit was found to be set
/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS iff success, else error in case of an I2C read error
///
fapi2::ReturnCode check_fields(
const fapi2::Target<fapi2::TARGET_TYPE_PMIC>& i_pmic_target,
const char* i_error_type,
const std::vector<std::pair<uint8_t, std::vector<status_field>>>& i_statuses,
bool& o_error);

Expand Down

0 comments on commit 89c2449

Please sign in to comment.