Skip to content

Commit

Permalink
Refactor PMIC attributes to be at OCMB level
Browse files Browse the repository at this point in the history
eff_config can now put SPD attributes at OCMB level if the
attribute is defined as such. It will ignore any values for
DIMM 1 and only use those for DIMM 0 (attributes that will
be the same, like PMIC fields, for example)

Minor fix to pmic_status_tool_ut failing UTs due to mismatch
in help screen

git-coreq:hostboot:I5a66f0540ecc65434123c976d83103c99d9ae018
Change-Id: I5a66f0540ecc65434123c976d83103c99d9ae018
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90584
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Tested-by: HWSV CI <hwsv-ci+hostboot@us.ibm.com>
Reviewed-by: Louis Stermole <stermole@us.ibm.com>
Reviewed-by: ANDRE A MARIN <aamarin@us.ibm.com>
Reviewed-by: Jennifer A Stofer <stofer@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/90777
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
markypizz authored and dcrowell77 committed Feb 24, 2020
1 parent f83a8c5 commit 6579e15
Show file tree
Hide file tree
Showing 16 changed files with 332 additions and 366 deletions.
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019 */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -59,7 +59,6 @@ namespace mss
template< proc_type P>
struct attrEngineTraits<P, pmic::attr_eff_engine_fields, pmic::attr_eff_engine_fields::ATTR_EFF_BASE_CASE> {};


//----------------------------------------
// PMIC 0
//----------------------------------------
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019 */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -76,7 +76,7 @@ using CONSTS = mss::pmic::consts<mss::pmic::product::JEDEC_COMPLIANT>;
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic0_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic0_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
uint8_t l_offset = 0;
Expand All @@ -98,7 +98,7 @@ fapi_try_exit:
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic0_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic0_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
uint8_t l_offset = 0;
Expand All @@ -120,7 +120,7 @@ fapi_try_exit:
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic0_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic0_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
uint8_t l_offset = 0;
Expand All @@ -142,7 +142,7 @@ fapi_try_exit:
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic0_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic0_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
uint8_t l_offset = 0;
Expand All @@ -164,7 +164,7 @@ fapi_try_exit:
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic1_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic1_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
uint8_t l_offset = 0;
Expand All @@ -186,7 +186,7 @@ fapi_try_exit:
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic1_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic1_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
uint8_t l_offset = 0;
Expand All @@ -208,7 +208,7 @@ fapi_try_exit:
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic1_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic1_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
uint8_t l_offset = 0;
Expand All @@ -230,7 +230,7 @@ fapi_try_exit:
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic1_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic1_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
uint8_t l_offset = 0;
Expand All @@ -252,7 +252,7 @@ fapi_try_exit:
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode process(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode process(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data)
{
FAPI_TRY(pmic0_swa_voltage_offset(i_target, i_efd_data));
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019 */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -63,7 +63,7 @@ namespace efd
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic0_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic0_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

///
Expand All @@ -72,7 +72,7 @@ fapi2::ReturnCode pmic0_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYP
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic0_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic0_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

///
Expand All @@ -81,7 +81,7 @@ fapi2::ReturnCode pmic0_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYP
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic0_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic0_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

///
Expand All @@ -90,7 +90,7 @@ fapi2::ReturnCode pmic0_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYP
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic0_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic0_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

///
Expand All @@ -99,7 +99,7 @@ fapi2::ReturnCode pmic0_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYP
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic1_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic1_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

///
Expand All @@ -108,7 +108,7 @@ fapi2::ReturnCode pmic1_swa_voltage_offset(const fapi2::Target<fapi2::TARGET_TYP
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic1_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic1_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

///
Expand All @@ -117,7 +117,7 @@ fapi2::ReturnCode pmic1_swb_voltage_offset(const fapi2::Target<fapi2::TARGET_TYP
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic1_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic1_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

///
Expand All @@ -126,16 +126,16 @@ fapi2::ReturnCode pmic1_swc_voltage_offset(const fapi2::Target<fapi2::TARGET_TYP
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode pmic1_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode pmic1_swd_voltage_offset(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

///
/// @brief Process the EFD data and set attributes
/// @param[in] i_target DIMM target on which to operate
/// @param[in] i_target OCMB target on which to operate
/// @param[in] i_efd_data the EFD data to process
/// @return fapi2::FAPI2_RC_SUCCESS iff function completes successfully
///
fapi2::ReturnCode process(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
fapi2::ReturnCode process(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
const std::shared_ptr<mss::efd::base_decoder>& i_efd_data);

} // ns efd
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019 */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -50,7 +50,8 @@ namespace pmic
{

// Attribute getter pointer for manufacturer/vendor ID
typedef fapi2::ReturnCode (*mfg_id_attr_ptr)(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target, uint16_t& o_value);
typedef fapi2::ReturnCode (*mfg_id_attr_ptr)(const fapi2::Target<fapi2::TARGET_TYPE_OCMB_CHIP>& i_target,
uint16_t& o_value);

// Manufacturer / Vendor ID
static constexpr mfg_id_attr_ptr get_mfg_id[] =
Expand Down
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2019 */
/* Contributors Listed Below - COPYRIGHT 2019,2020 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -98,6 +98,9 @@ enum rail
SWD = 3,
};

///
/// @brief pmic attr_eff_engine_fields
///
enum class attr_eff_engine_fields
{
// Template recursive base case
Expand Down Expand Up @@ -156,6 +159,7 @@ enum class attr_eff_engine_fields

PMIC0_MFG_ID = 43,
PMIC1_MFG_ID = 44,

PMIC0_SEQUENCE = 45,
PMIC1_SEQUENCE = 46,

Expand Down

0 comments on commit 6579e15

Please sign in to comment.