summaryrefslogtreecommitdiffstats
path: root/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
diff options
context:
space:
mode:
authorLouis Stermole <stermole@us.ibm.com>2019-06-05 16:59:44 -0400
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-06-14 12:36:07 -0500
commitf11931ee5e44f37421455d97930536b57249a9c0 (patch)
treedca8e68afab4f962c89637ee7aab1c2cb5e850b6 /src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
parentcb318fbc38a9924e1e1fc9a7e76e4801f32c0872 (diff)
downloadtalos-hostboot-f11931ee5e44f37421455d97930536b57249a9c0.tar.gz
talos-hostboot-f11931ee5e44f37421455d97930536b57249a9c0.zip
Add attr to control endian swap of OMI CFG reg data on Explorer
Change-Id: I3834e170cbf1594ede6854cf23c1e6184e6357dd Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78411 Reviewed-by: STEPHEN GLANCY <sglancy@us.ibm.com> Reviewed-by: Mark Pizzutillo <mark.pizzutillo@ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@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: Jennifer A Stofer <stofer@us.ibm.com> Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/78468 Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C')
-rw-r--r--src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
index a18fa4ba1..4d2f89ffe 100644
--- a/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
+++ b/src/import/chips/ocmb/explorer/procedures/hwp/memory/exp_inband.C
@@ -127,10 +127,28 @@ fapi2::ReturnCode putOCCfg(
const uint64_t i_cfgAddr,
const fapi2::buffer<uint32_t>& i_data)
{
+ fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM;
uint32_t l_v = static_cast<uint32_t>(i_data);
std::vector<uint8_t> l_wd;
- forceLE(l_v, l_wd);
- return fapi2::putMMIO(i_target, i_cfgAddr, 4, l_wd);
+ fapi2::ATTR_MSS_OCMB_EXP_OMI_CFG_ENDIAN_CTRL_Type l_endian;
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_OCMB_EXP_OMI_CFG_ENDIAN_CTRL,
+ FAPI_SYSTEM, l_endian));
+
+ if (l_endian == fapi2::ENUM_ATTR_MSS_OCMB_EXP_OMI_CFG_ENDIAN_CTRL_LITTLE_ENDIAN)
+ {
+ forceLE(l_v, l_wd);
+ }
+ else
+ {
+ forceBE(l_v, l_wd);
+ }
+
+ FAPI_TRY( fapi2::putMMIO(i_target, i_cfgAddr, 4, l_wd) );
+
+fapi_try_exit:
+ FAPI_DBG("Exiting with return code : 0x%08X...", (uint64_t) fapi2::current_err);
+ return fapi2::current_err;
}
@@ -397,11 +415,26 @@ fapi2::ReturnCode getOCCfg(
const uint64_t i_cfgAddr,
fapi2::buffer<uint32_t>& o_data)
{
+ fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM;
uint32_t l_rd = 0;
std::vector<uint8_t> l_data(4);
uint32_t l_idx = 0;
+ fapi2::ATTR_MSS_OCMB_EXP_OMI_CFG_ENDIAN_CTRL_Type l_endian;
+
+ FAPI_TRY( FAPI_ATTR_GET(fapi2::ATTR_MSS_OCMB_EXP_OMI_CFG_ENDIAN_CTRL,
+ FAPI_SYSTEM, l_endian));
+
FAPI_TRY(fapi2::getMMIO(i_target, i_cfgAddr, 4, l_data));
- readLE(l_data, l_idx, l_rd);
+
+ if (l_endian == fapi2::ENUM_ATTR_MSS_OCMB_EXP_OMI_CFG_ENDIAN_CTRL_LITTLE_ENDIAN)
+ {
+ readLE(l_data, l_idx, l_rd);
+ }
+ else
+ {
+ readBE(l_data, l_idx, l_rd);
+ }
+
o_data = l_rd;
fapi_try_exit:
FAPI_DBG("Exiting with return code : 0x%08X...", (uint64_t) fapi2::current_err);
OpenPOWER on IntegriCloud