Skip to content

Commit

Permalink
Implement the VPD backend for these attributes
Browse files Browse the repository at this point in the history
   - ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY
   - ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY

Change-Id: Idb20b53f1fe9d5a8fbdbef608fb3ab3faa64330b
CQ:SW422858
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/60473
Tested-by: Jenkins Server <pfd-jenkins+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>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
bhmadhur authored and dcrowell77 committed Jun 16, 2018
1 parent 7cc8294 commit e3163f3
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/include/usr/fapi2/attribute_service.H
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,29 @@ ReturnCode platGetDQSAttrISDIMM(
ATTR_CEN_VPD_ISDIMMTOC4DQS_Type &o_vpdIsDimmTOC4DQSVal
);

/// @brief This function is called by the FAPI_ATTR_GET macro when getting
// the CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY attribute. It should not be called directly.
//
// @param[in] i_fapiTarget The target for the attribute operation.
// @param[out] o_SensorMapType The retrieved attribute value.
// @return ReturnCode Zero on success, else platform specified error.
ReturnCode platGetMBvpdSensorMapPrimary(
const Target<TARGET_TYPE_ALL>& i_fapiTarget,
ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY_Type& o_SensorMapType
);

/// @brief This function is called by the FAPI_ATTR_GET macro when getting
// the CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY attribute. It should not be called directly.
//
// @param[in] i_fapiTarget The target for the attribute operation.
// @param[out] o_SensorMapType The retrieved attribute value.
// @return ReturnCode Zero on success, else platform specified error.
ReturnCode platGetMBvpdSensorMapSecondary(
const Target<TARGET_TYPE_ALL>& i_fapiTarget,
ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY_Type& o_SensorMapType
);


/// @brief This function is called by the FAPI_ATTR_GET macro when getting
// the CEN_VPD_DRAM_ADDRESS_MIRRORING attribute. It should not be called directly.
//
Expand Down Expand Up @@ -674,6 +697,24 @@ fapiToTargeting::ID, sizeof(VAL), &(VAL))
? fapi2::ReturnCode() : \
fapi2::platAttrSvc::platGetDQSAttrISDIMM(TARGET, VAL)

//-----------------------------------------------------------------------------
// MACRO to route ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY_GETMACRO access to the
// correct HB function
//-----------------------------------------------------------------------------
#define ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY_GETMACRO(ID, TARGET, VAL) \
AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
? fapi2::ReturnCode() : \
fapi2::platAttrSvc::platGetMBvpdSensorMapPrimary(TARGET, VAL)

//-----------------------------------------------------------------------------
// MACRO to route ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY_GETMACRO access to the
// correct HB function
//-----------------------------------------------------------------------------
#define ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY_GETMACRO(ID, TARGET, VAL) \
AttrOverrideSync::getAttrOverrideFunc(ID, TARGET, &VAL)\
? fapi2::ReturnCode() : \
fapi2::platAttrSvc::platGetMBvpdSensorMapSecondary(TARGET, VAL)

//-----------------------------------------------------------------------------
// MACRO to route ATTR_CEN_VPD_DRAM_ADDRESS_MIRRORING access to the correct
// HB function
Expand Down
62 changes: 62 additions & 0 deletions src/usr/fapi2/attribute_service.C
Original file line number Diff line number Diff line change
Expand Up @@ -1933,6 +1933,68 @@ ReturnCode platGetDQSAttrISDIMM(
return rc;
}

//-----------------------------------------------------------------------------
ReturnCode platGetMBvpdSensorMapPrimary(
const Target<TARGET_TYPE_ALL>& i_fapiTarget,
ATTR_CEN_VPD_CDIMM_SENSOR_MAP_PRIMARY_Type& o_SensorMapType
)
{
ReturnCode rc;

// Don't need to check the type here, the FAPI_ATTR_GET macro clause
// "fapi2::Target<ID##_TargetType>(TARGET)" does it for us. However,
// to enable a streamlined dump of the attributes, all plat code must use
// the generic TARGET_TYPE_ALL -- so convert back to the correct type
// manually
TARGETING::Target * l_pTarget = NULL;
errlHndl_t l_errl = getTargetingTarget(i_fapiTarget, l_pTarget);

if (l_errl)
{
FAPI_ERR("platGetMBvpdSensorMapPrimary: "
"Error from getTargetingTarget");
rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
}
else
{
fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> l_fapiTarget(l_pTarget);
rc = getMBvpdSensorMap(l_fapiTarget, fapi2::SENSOR_MAP_PRIMARY, o_SensorMapType);
}

return rc;
}

//-----------------------------------------------------------------------------
ReturnCode platGetMBvpdSensorMapSecondary(
const Target<TARGET_TYPE_ALL>& i_fapiTarget,
ATTR_CEN_VPD_CDIMM_SENSOR_MAP_SECONDARY_Type& o_SensorMapType
)
{
ReturnCode rc;

// Don't need to check the type here, the FAPI_ATTR_GET macro clause
// "fapi2::Target<ID##_TargetType>(TARGET)" does it for us. However,
// to enable a streamlined dump of the attributes, all plat code must use
// the generic TARGET_TYPE_ALL -- so convert back to the correct type
// manually
TARGETING::Target * l_pTarget = NULL;
errlHndl_t l_errl = getTargetingTarget(i_fapiTarget, l_pTarget);

if (l_errl)
{
FAPI_ERR("platGetMBvpdSensorMapSecondary: "
"Error from getTargetingTarget");
rc.setPlatDataPtr(reinterpret_cast<void *> (l_errl));
}
else
{
fapi2::Target<fapi2::TARGET_TYPE_MEMBUF_CHIP> l_fapiTarget(l_pTarget);
rc = getMBvpdSensorMap(l_fapiTarget, fapi2::SENSOR_MAP_SECONDARY, o_SensorMapType);
}

return rc;
}

//-----------------------------------------------------------------------------
ReturnCode platGetMBvpdDramAddressMirroring(
const Target<TARGET_TYPE_ALL>& i_fapiTarget,
Expand Down
1 change: 1 addition & 0 deletions src/usr/fapi2/fapi2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ include ${CENTAUR_VPD_PATH}/getDecompressedISDIMMAttrs.mk
include ${CENTAUR_VPD_PATH}/getISDIMMTOC4DAttrs.mk
include ${CENTAUR_VPD_PATH}/getDQAttrISDIMM.mk
include ${CENTAUR_VPD_PATH}/getDQSAttrISDIMM.mk
include ${CENTAUR_VPD_PATH}/getMBvpdSensorMap.mk
include ${CENTAUR_VPD_PATH}/getMBvpdAddrMirrorData.mk
include ${CENTAUR_VPD_PATH}/getMBvpdAttr.mk
include ${CENTAUR_VPD_PATH}/getMBvpdDram2NModeEnabled.mk
Expand Down

0 comments on commit e3163f3

Please sign in to comment.