diff options
author | Elizabeth Liner <eliner@us.ibm.com> | 2014-09-05 10:05:01 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-11-06 14:31:50 -0600 |
commit | d2c667e95002a89e72cfabe8221a32a0319552a9 (patch) | |
tree | 9e0e091eb1c8936e25f9ae145c66833b2e356750 /src/include/usr/hwpf | |
parent | 566d31deb492436c37124a9f369c298d7f3610b0 (diff) | |
download | blackbird-hostboot-d2c667e95002a89e72cfabe8221a32a0319552a9.tar.gz blackbird-hostboot-d2c667e95002a89e72cfabe8221a32a0319552a9.zip |
Rosetta Stone decompression files and attributes
RTC:113491
Change-Id: Ie6720e582f89342b123fc4b5c4c28aba5fe0c7a5
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13128
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/hwpf')
4 files changed, 239 insertions, 1 deletions
diff --git a/src/include/usr/hwpf/hwp/dimmConsts.H b/src/include/usr/hwpf/hwp/dimmConsts.H index efb12d4f8..8a049f312 100644 --- a/src/include/usr/hwpf/hwp/dimmConsts.H +++ b/src/include/usr/hwpf/hwp/dimmConsts.H @@ -27,7 +27,7 @@ * * @brief DIMM Constants */ -// $Id: dimmConsts.H,v 1.2 2014/06/27 18:58:39 thi Exp $ +// $Id: dimmConsts.H,v 1.5 2014/11/03 17:16:17 eliner Exp $ /* * Change Log ****************************************************************** * Flag Defect/Feature User Date Description @@ -59,4 +59,12 @@ const uint8_t DIMM_DQ_NUM_DQS = DIMM_DQ_RANK_BITMAP_SIZE * 8; // (DIMM_DQ_MAX_DIMM_RANKS * DIMM_DQ_RANK_BITMAP_SIZE), plus the header const uint8_t DIMM_DQ_SPD_DATA_SIZE = 80; +//ISDIMM to C4 DQ and DQS constant +//Number of Ports needed in the array +const uint8_t DIMM_TO_C4_PORTS = 4; +//Number of entries in the DQ attribute +const uint8_t DIMM_TO_C4_DQ_ENTRIES = 80; +//Number of entries in the DQS attribute +const uint8_t DIMM_TO_C4_DQS_ENTRIES = 20; + #endif diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getDecompressedISDIMMAttrs.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getDecompressedISDIMMAttrs.H new file mode 100644 index 000000000..8a46ac8a1 --- /dev/null +++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getDecompressedISDIMMAttrs.H @@ -0,0 +1,109 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/hwpf/hwp/mvpd_accessors/getDecompressedISDIMMAttrs.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $ID: getDecompressedISDIMMAttrs.H, v 1.1 2014/9/26 09:22:00 eliner Exp $ +/** + * @file getDecompressedISDIMMAttrs.H + * + * @brief Decompresses the ISDIMMToC4DQ and DQS Attributes for proper use + */ +extern "C" +{ + +/** + * @brief Un-permeates the decimal input into an array of variable size + * + * @param[in] i_permNum - Decimal number to un-permeate + * @param[in] i_finalSize - Final Size of the variable array + * @param[out] o_array - Created Array of un-permeated numbers + */ +void antiPermutation(int i_permNum, int* o_array,int i_finalSize); + +/** + * @brief Translates the array from the condensed version to the + * actual information + * example: [1,0,0,5,1,1,1,1,0] -> [1,0,2,8,4,5,6,7,3] + * + * @param[in] i_array - condensed array of information + * @param[in] i_size - size of array + * @param[out] o_result - translated array of information + */ +void unPermeateToVector(int* i_array, int i_size, std::vector<int>& o_result); + +/** + * @brief Separates the input into the 4 needed parts; nibble swap, nibble + * to nibble relationship, DQS nibble swap, and the byte to + * byte relationship + * + * @param[in] i_toSeparateDQ - contains all the information for DQ + * @param[in] i_toSeparateDQS - contains all the information for DQS + * @param[out] o_nibSwap - DQ nibble swap information + * @param[out] o_nibToNib - nibble to nibble relationship + * @param[out[ o_nibSwapDQS - DQS nibble swap information + * + * @return int - byte to byte relationship information + */ +int getSeparatedInformation(ecmdDataBufferBase& i_toSeparateDQ, + ecmdDataBufferBase& i_separateDQS, + int* o_nibSwap,int* o_nibToNib,int* o_nibSwapDQS); + +/** + * @brief Converts all information into the final DQ 80-byte array + * + * @param[out] o_final80Array - completed decompressed array + * @param[in] i_byteNums - translated relationship between the bytes + * @param[in] i_nibbleSwap - translated DQ nibble swap information + * @param[in] i_nibbleToNibNums - translated relationship between the nibbles + */ +void convertToFinal80Array(int* o_final80Array, + std::vector<int>& i_byteNums,int* i_nibbleSwap, + std::vector<std::vector<int> >& i_nibbleToNibNums); + +/** + * @brief Converts all the information into the final dQS 20-byte array + * + * @param[out] o_final20Array - completed decompressed array + * @param[in] i_byteNums - translated relationship between the bytes + * @param[in] i_nibbleSwap - translated DQS nibble swap information + */ +void convertToFinal20Array(int* o_final20Array,std::vector<int>& i_byteNums, + int* i_nibbleSwap); + +/** + * @brief Controls the flow of data from the different functions + * + * @param[in] i_dataDQ - original DQ information before any processing + * @param[in] i_dataDQS - original DQS information before any processing + * @param[out] o_finalArray - completed DQ decompressed array + * @param[out] o_finalDQSArray - completed DQS decompressed array + */ +void decodeISDIMMAttrs(ecmdDataBufferBase& i_dataDQ, + ecmdDataBufferBase& i_dataDQS, + uint8_t* o_finalArray, uint8_t* o_finalDQSArray); + +} + + + + diff --git a/src/include/usr/hwpf/hwp/mvpd_accessors/getISDIMMTOC4DAttrs.H b/src/include/usr/hwpf/hwp/mvpd_accessors/getISDIMMTOC4DAttrs.H new file mode 100644 index 000000000..422eedb79 --- /dev/null +++ b/src/include/usr/hwpf/hwp/mvpd_accessors/getISDIMMTOC4DAttrs.H @@ -0,0 +1,85 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/hwpf/hwp/mvpd_accessors/getISDIMMTOC4DAttrs.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2014 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +// $ID: getISDIMMTOC4DAttrs.H, v 1.1 2014/9/25 04:38:00 eliner Exp $ +/* + * @file getISDIMMTOC4DAttrs.H + * + * @brief MBvpd accessor for the ATTR_VPD_ISDIMMTOC4DQ and DQS attributes + */ + +#ifndef _HWP_MVPDGETISDIMMTOC4DATTRS_ +#define _HWP_MVPDGETISDIMMTOC4DATTRS_ + +extern "C" +{ +const uint32_t DQ_KEYWORD_SIZE = 96; + +/* + * @brief Utility function for the ATTR_VPD_ISDIMMTOC4DQ attribute + * + * Given the D0 information, return the correct DQ copy. + * + * @param[in] i_mbTarget - Reference to mb Target + * @param[in] i_whichCopy - D0 information of which Q copy to get + * @param[out] o_DQKeyword - Correct DQ information + * + * @return fapi::ReturnCode FAPI_RC_SUCCESS if success, else error code + */ + +fapi::ReturnCode getDQAttribute(const fapi::Target &i_mbTarget, + uint32_t i_whichCopy, uint8_t (&o_DQKeyword)[DQ_KEYWORD_SIZE]); + +/* + * @brief MBvpd accessor for the ATTR_VPD_ISDIMMTOC4DQ attribute + * + * Access the compressed DQ data in the MBvpd record SPDX, keyword Q1-Q9 + * + * @param[in] i_mbTarget - Reference to mb Target + * @param[out] o_val[4][80] - Decoded Q data + * + * @return fapi::ReturnCode FAPI_RC_SUCCESS if success, else error code + */ + +fapi::ReturnCode getDQAttrISDIMM( + const fapi::Target &i_mbTarget, + uint8_t (&o_val)[4][80]); + +/* + * @brief MBvpd accessor for the ATTR_VPD_ISDIMMTOC4DQS attribute + * + * Access the compressed DQS data in the MBvpd record, SPDX, keyword K1-K9 + * + * @param[in] i_mbTarget - Reference to mb Target + * @param[out] o_val[4][20] - Decoded K data + * + * @return fapi::ReturnCode FAPI_RC_SUCCESS if success, else error code + */ + +fapi::ReturnCode getDQSAttrISDIMM( + const fapi::Target &i_mbTarget, + uint8_t (&o_val)[4][20]); +} +#endif + diff --git a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H index 15ead58f5..0ed731f6d 100644 --- a/src/include/usr/hwpf/plat/fapiPlatAttributeService.H +++ b/src/include/usr/hwpf/plat/fapiPlatAttributeService.H @@ -57,6 +57,7 @@ #include <hwpf/hwp/mvpd_accessors/getMBvpdSensorMap.H> #include <hwpf/hwp/mvpd_accessors/getControlCapableData.H> #include <hwpf/hwp/mvpd_accessors/accessMBvpdL4BankDelete.H> +#include <hwpf/hwp/mvpd_accessors/getISDIMMTOC4DAttrs.H> #include <hwpf/hwp/spd_accessors/getSpdAttrAccessor.H> #include <hwpf/hwp/pll_accessors/getPllRingInfoAttr.H> #include <hwpf/hwp/chip_accessors/getOscswitchCtlAttr.H> @@ -735,6 +736,30 @@ fapi::ReturnCode fapiPlatGetOscswitchCtl fapi::ReturnCode fapiPlatGetControlCapable(const fapi::Target * i_pTarget, uint8_t & o_val); +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting the + * ATTR_VPD_ISDIMMTOC4DQ attribute. + * It should not be called directly + * + * @param[in] i_pTarget MBA Target pointer + * @param[out] o_val Pointer to output array + */ +fapi::ReturnCode getIsDimmToC4DQ + (const fapi::Target * i_pTarget, + uint8_t (&o_val) [DIMM_TO_C4_PORTS][DIMM_TO_C4_DQ_ENTRIES]); + +/** + * @brief This function is called by the FAPI_ATTR_GET macro when getting the + * ATTR_VPD_ISDIMMTOC4DQS attribute. + * It should not be called directly. + * + * @param[in] i_pTarget MBA Target pointer + * @param[out] o_val Pointer to the output array + */ +fapi::ReturnCode getIsDimmToC4DQS + (const fapi::Target * i_pTarget, + uint8_t (&o_val) [DIMM_TO_C4_PORTS][DIMM_TO_C4_DQS_ENTRIES]); + } // namespace platAttrSvc } // namespace fapi @@ -781,6 +806,17 @@ fapi::ReturnCode fapiPlatGetControlCapable(const fapi::Target * i_pTarget, fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::fapiPlatGetControlCapable(PTARGET,VAL) //------------------------------------------------------------------------------ +// MACRO to support the DQ and DQS attributes. +//------------------------------------------------------------------------------ +#define ATTR_VPD_ISDIMMTOC4DQ_GETMACRO(ID,PTARGET,VAL)\ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID,PTARGET,&VAL)?\ + fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::getIsDimmToC4DQ(PTARGET,VAL) + +#define ATTR_VPD_ISDIMMTOC4DQS_GETMACRO(ID,PTARGET,VAL)\ + fapi::AttrOverrideSync::getAttrOverrideFunc(fapi::ID,PTARGET,&VAL)?\ + fapi::FAPI_RC_SUCCESS : fapi::platAttrSvc::getIsDimmToC4DQS(PTARGET,VAL) + +//------------------------------------------------------------------------------ // MACROs to route each ATTR_SPD access to the Hostboot SPD function //------------------------------------------------------------------------------ #define ATTR_SPD_DRAM_DEVICE_TYPE_GETMACRO(ID, PTARGET, VAL) \ |