From b455fb2ff154b9ff42598d96240123804659fc25 Mon Sep 17 00:00:00 2001 From: Mike Jones Date: Tue, 21 Feb 2012 07:29:40 -0600 Subject: HWPF Attribute Support: Memory/MirrorMemory base addresses Change-Id: I7ddf2ffb36b453ccf37dc6d3138752c1c8c4079d Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/682 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton Reviewed-by: CAMVAN T. NGUYEN Reviewed-by: A. Patrick Williams III --- .../usr/hwpf/plat/fapiPlatAttributeService.H | 33 ++++++++++++++++++++++ src/include/usr/hwpf/plat/fapiPlatReasonCodes.H | 2 ++ 2 files changed, 35 insertions(+) (limited to 'src/include') diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H index f328dbf4d..6bd206383 100755 --- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H +++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H @@ -137,10 +137,35 @@ ReturnCode fapiPlatGetSpdAttr(const Target * i_target, const uint16_t i_keyword, void * o_data, size_t i_len ); +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting + * ATTR_MSS_MEMORY_BASE. It should not be called directly + * + * @param[in] i_pMcsTarget MCS target pointer + * @param[out] o_addr Address of MCS BAR register + * @return ReturnCode. Zero on success, else platform specified error + */ +fapi::ReturnCode fapiPlatGetMemoryBaseAddr(const fapi::Target * i_pMcsTarget, + uint64_t & o_addr); + +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting + * ATTR_MSS_MIRROR_BASE. It should not be called directly + * + * @param[in] i_pMcsTarget MCS target pointer + * @param[out] o_addr Address of MCS BAR register + * @return ReturnCode. Zero on success, else platform specified error + */ +fapi::ReturnCode fapiPlatGetMirrorBaseAddr(const fapi::Target * i_pMcsTarget, + uint64_t & o_addr); + } } +//------------------------------------------------------------------------------ +// MACROs to route each ATTR_SPD access to the Hostboot SPD function +//------------------------------------------------------------------------------ #define ATTR_SPD_DRAM_DEVICE_TYPE_GETMACRO(ID, PTARGET, VAL) \ fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::BASIC_MEMORY_TYPE, &(VAL), sizeof(VAL) ) #define ATTR_SPD_MODULE_TYPE_GETMACRO(ID, PTARGET, VAL) \ @@ -230,4 +255,12 @@ ReturnCode fapiPlatGetSpdAttr(const Target * i_target, #define ATTR_SPD_DRAM_MANUFACTURER_JEDEC_ID_CODE_GETMACRO(ID, PTARGET, VAL) \ fapi::platAttrSvc::fapiPlatGetSpdAttr( PTARGET, SPD::DRAM_MANUFACTURER_ID, &(VAL), sizeof(VAL) ) +//------------------------------------------------------------------------------ +// MACROs to route ATTR Base Address accesses to the correct Hostboot function +//------------------------------------------------------------------------------ +#define ATTR_MSS_MEMORY_BASE_GETMACRO(ID, PTARGET, VAL) \ + fapi::platAttrSvc::fapiPlatGetMemoryBaseAddr(PTARGET, VAL) +#define ATTR_MSS_MIRROR_BASE_GETMACRO(ID, PTARGET, VAL) \ + fapi::platAttrSvc::fapiPlatGetMirrorBaseAddr(PTARGET, VAL) + #endif // FAPIPLATATTRIBUTESERVICE_H_ diff --git a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H index 7f7025cb9..0eaa87920 100644 --- a/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H +++ b/src/include/usr/hwpf/plat/fapiPlatReasonCodes.H @@ -41,6 +41,7 @@ namespace fapi MOD_PLAT_ATTR_SVC_CREATE_ATTR_ACCESS_ERROR = 0x05, MOD_HANDLE_ECMD_BUF_RC = 0x06, MOD_VERIFY_CFAM_ACCESS_TARGET = 0x07, + MOD_ATTR_BASE_ADDR_GET = 0x08, }; // Note that for HWP generated errors (MOD_HWP_RC_TO_ERRL), the @@ -58,6 +59,7 @@ namespace fapi RC_FAILED_TO_ACCESS_ATTRIBUTE = HWPF_COMP_ID | 0x13, RC_ECMD_OPERATION_FAILURE = HWPF_COMP_ID | 0x14, RC_CFAM_ACCESS_ON_PROC_ERR = HWPF_COMP_ID | 0x15, + RC_ATTR_BASE_BAD_PARAM = HWPF_COMP_ID | 0x16, }; }; -- cgit v1.2.1