summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/procedures/hwp
diff options
context:
space:
mode:
Diffstat (limited to 'src/import/chips/p9/procedures/hwp')
-rw-r--r--src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H31
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_getecid.C37
-rw-r--r--src/import/chips/p9/procedures/hwp/perv/p9_getecid.H4
3 files changed, 59 insertions, 13 deletions
diff --git a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H
index e83926f9f..d3521a28c 100644
--- a/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H
+++ b/src/import/chips/p9/procedures/hwp/memory/lib/mss_attribute_accessors_manual.H
@@ -136,13 +136,15 @@ inline bool chip_ec_feature_mss_wr_vref(const fapi2::Target<T>& i_target)
{
const auto l_chip = mss::find_target<fapi2::TARGET_TYPE_PROC_CHIP>(i_target);
uint8_t l_value = 0;
+ uint8_t l_do_value = 0;
FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_MSS_WR_VREF, l_chip, l_value) );
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_DO_MSS_WR_VREF, l_chip, l_do_value) );
- return l_value != 0;
+ return (l_value != 0) && (l_do_value == fapi2::ENUM_ATTR_DO_MSS_WR_VREF_YES);
fapi_try_exit:
- FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_WR_VREF: 0x%lx (target: %s)",
+ FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_WR_VREF or ATTR_DO_MSS_WR_VREF: 0x%lx (target: %s)",
uint64_t(fapi2::current_err), mss::c_str(i_target));
fapi2::Assert(false);
return false;
@@ -182,13 +184,15 @@ inline bool chip_ec_feature_mss_vccd_override(const fapi2::Target<T>& i_target)
{
const auto l_chip = mss::find_target<fapi2::TARGET_TYPE_PROC_CHIP>(i_target);
uint8_t l_value = 0;
+ uint8_t l_do_value = 0;
FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_MSS_VCCD_OVERRIDE, l_chip, l_value) );
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_DO_MSS_VCCD_OVERRIDE, l_chip, l_do_value) );
- return l_value != 0;
+ return (l_value != 0) && (l_do_value == fapi2::ENUM_ATTR_DO_MSS_VCCD_OVERRIDE_YES);
fapi_try_exit:
- FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_VCCD_OVERRIDE: 0x%lx (target: %s)",
+ FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_VCCD_OVERRIDE or ATTR_DO_MSS_VCCD_OVERRIDE: 0x%lx (target: %s)",
uint64_t(fapi2::current_err), mss::c_str(i_target));
fapi2::Assert(false);
return false;
@@ -205,13 +209,15 @@ inline bool chip_ec_feature_mss_vref_dac(const fapi2::Target<T>& i_target)
{
const auto l_chip = mss::find_target<fapi2::TARGET_TYPE_PROC_CHIP>(i_target);
uint8_t l_value = 0;
+ uint8_t l_do_value = 0;
FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_MSS_VREF_DAC, l_chip, l_value) );
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_DO_MSS_VREF_DAC, l_chip, l_do_value) );
- return l_value != 0;
+ return (l_value != 0) && (l_do_value == fapi2::ENUM_ATTR_DO_MSS_VREF_DAC_YES);
fapi_try_exit:
- FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_VREF_DAC: 0x%lx (target: %s)",
+ FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_VREF_DAC or ATTR_DO_MSS_VREF_DAC: 0x%lx (target: %s)",
uint64_t(fapi2::current_err), mss::c_str(i_target));
fapi2::Assert(false);
return false;
@@ -228,13 +234,15 @@ inline bool chip_ec_feature_mss_vreg_coarse(const fapi2::Target<T>& i_target)
{
const auto l_chip = mss::find_target<fapi2::TARGET_TYPE_PROC_CHIP>(i_target);
uint8_t l_value = 0;
+ uint8_t l_do_value = 0;
FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_MSS_VREG_COARSE, l_chip, l_value) );
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_DO_MSS_VREG_COARSE, l_chip, l_do_value) );
- return l_value != 0;
+ return (l_value != 0) && (l_do_value == fapi2::ENUM_ATTR_DO_MSS_VREG_COARSE_YES);
fapi_try_exit:
- FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_VREG_COARSE: 0x%lx (target: %s)",
+ FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_VREG_COARSE or ATTR_DO_MSS_VREG_COARSE: 0x%lx (target: %s)",
uint64_t(fapi2::current_err), mss::c_str(i_target));
fapi2::Assert(false);
return false;
@@ -275,13 +283,16 @@ inline bool chip_ec_feature_mss_training_bad_bits(const fapi2::Target<T>& i_targ
// TODO RTC:165862 - need to get the minor EC number and check that in here.
const auto l_chip = mss::find_target<fapi2::TARGET_TYPE_PROC_CHIP>(i_target);
uint8_t l_value = 0;
+ uint8_t l_do_value = 0;
FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_CHIP_EC_FEATURE_MSS_TRAINING_BAD_BITS, l_chip, l_value) );
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_DO_MSS_TRAINING_BAD_BITS, l_chip, l_do_value) );
- return l_value != 0;
+ return (l_value != 0) && (l_do_value == fapi2::ENUM_ATTR_DO_MSS_TRAINING_BAD_BITS_YES);
fapi_try_exit:
- FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_TRAINING_BAD_BITS: 0x%lx (target: %s)",
+ FAPI_ERR("failed accessing ATTR_CHIP_EC_FEATURE_MSS_TRAINING_BAD_BITS"
+ " or ATTR_DO_MSS_TRAINING_BAD_BITS: 0x%lx (target: %s)",
uint64_t(fapi2::current_err), mss::c_str(i_target));
fapi2::Assert(false);
return false;
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_getecid.C b/src/import/chips/p9/procedures/hwp/perv/p9_getecid.C
index f293525c8..cc5d86eb4 100644
--- a/src/import/chips/p9/procedures/hwp/perv/p9_getecid.C
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_getecid.C
@@ -42,9 +42,39 @@
#include <p9_misc_scom_addresses_fld.H>
#include <p9_const_common.H>
+// The bit locations in ecid_part02 where the DD Level is found. These correspond to ECID bits 173:175
+constexpr uint64_t DD_LEVEL(45);
+constexpr uint64_t DD_LEVEL_LEN(3);
-fapi2::ReturnCode p9_getecid(const
- fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip, fapi2::variable_buffer& o_fuseString)
+static fapi2::ReturnCode setup_memory_work_around_attributes(
+ const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target,
+ const fapi2::buffer<uint64_t>& i_ecid_part)
+{
+ uint8_t l_version = 0;
+ i_ecid_part.extractToRight<DD_LEVEL, DD_LEVEL_LEN>(l_version);
+
+ // Workarounds for modules which are before 1.02 (memory part 1)
+ if (l_version < ddLevelMemoryPart1)
+ {
+ FAPI_DBG("seeing version < 1.02 (0x%x) setting attributes", l_version);
+
+ // All these attributes have 1 as their 'YES' enum value
+ uint8_t l_value = 1;
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_DO_MSS_WR_VREF, i_target, l_value) );
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_DO_MSS_VCCD_OVERRIDE, i_target, l_value) );
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_DO_MSS_VREF_DAC, i_target, l_value) );
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_DO_MSS_VREG_COARSE, i_target, l_value) );
+ FAPI_TRY( FAPI_ATTR_SET(fapi2::ATTR_DO_MSS_TRAINING_BAD_BITS, i_target, l_value) );
+ }
+
+ return fapi2::FAPI2_RC_SUCCESS;
+
+fapi_try_exit:
+ return fapi2::current_err;
+}
+
+fapi2::ReturnCode p9_getecid(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target_chip,
+ fapi2::variable_buffer& o_fuseString)
{
uint64_t attr_data[2];
fapi2::buffer<uint64_t> l_ecid_part0_data64 = 0;
@@ -78,6 +108,9 @@ fapi2::ReturnCode p9_getecid(const
FAPI_TRY(FAPI_ATTR_SET(fapi2::ATTR_ECID, i_target_chip, attr_data));
+ // Set some attributes memory can used to make work-around decisions.
+ FAPI_TRY( setup_memory_work_around_attributes(i_target_chip, l_ecid_part2_data64) );
+
FAPI_INF("Exiting ...");
fapi_try_exit:
diff --git a/src/import/chips/p9/procedures/hwp/perv/p9_getecid.H b/src/import/chips/p9/procedures/hwp/perv/p9_getecid.H
index a1471ca91..0dd964723 100644
--- a/src/import/chips/p9/procedures/hwp/perv/p9_getecid.H
+++ b/src/import/chips/p9/procedures/hwp/perv/p9_getecid.H
@@ -44,7 +44,9 @@
enum P9_GETECID_Private_Constants
{
- fuseString_len = 176 // fuse string length
+ fuseString_len = 176, // fuse string length
+ ddLevelMemoryPart1 = 0b110, // bit field in ecid buffer representing DD1.02
+ ddLevelMemoryPart2 = 0b111, // bit field in ecid buffer representing DD1.02
};
typedef fapi2::ReturnCode (*p9_getecid_FP_t)(const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>&,
OpenPOWER on IntegriCloud