diff options
author | Elizabeth Liner <eliner@us.ibm.com> | 2014-09-11 15:59:59 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-10-31 17:19:49 -0500 |
commit | c864e50f89bfeb102a2edca45825e6e02cf6ba56 (patch) | |
tree | 171cebc68e36d757780e8d94ba5f74e5ddf7e40d | |
parent | 23bb36591f824acacfb4e924ab0efda26e8d1f6e (diff) | |
download | talos-hostboot-c864e50f89bfeb102a2edca45825e6e02cf6ba56.tar.gz talos-hostboot-c864e50f89bfeb102a2edca45825e6e02cf6ba56.zip |
Support VPD keyword changes for ISDIMMS
RTC:94871
Change-Id: I8c00494263284ed7a047dbc7c6d02a54aeff5f6c
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13580
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r-- | src/include/usr/hwpf/fapi/fapiMBvpdAccess.H | 56 | ||||
-rw-r--r-- | src/include/usr/vpd/cvpdenums.H | 2 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C | 105 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C | 147 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C | 170 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml | 67 | ||||
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatMBvpdAccess.C | 54 | ||||
-rw-r--r-- | src/usr/vpd/cvpd.H | 2 |
8 files changed, 526 insertions, 77 deletions
diff --git a/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H b/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H index b06a54609..56d3dc55d 100644 --- a/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H +++ b/src/include/usr/hwpf/fapi/fapiMBvpdAccess.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,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. */ @@ -20,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: fapiMBvpdAccess.H,v 1.9 2014/01/20 20:03:18 mjjones Exp $ +// $Id: fapiMBvpdAccess.H,v 1.11 2014/10/23 20:57:58 eliner Exp $ /** * @file fapiMBvpdAccess.H * @@ -54,6 +56,9 @@ namespace fapi MBVPD_RECORD_MER0 = 0x02, MBVPD_RECORD_VSPD = 0x03, MBVPD_RECORD_VINI = 0x04, + MBVPD_RECORD_OPFR = 0x05, + MBVPD_RECORD_VNDR = 0x06, + MBVPD_RECORD_SPDX = 0x07, }; enum MBvpdKeyword @@ -71,6 +76,53 @@ namespace fapi MBVPD_KEYWORD_VZ = 0x0a, MBVPD_KEYWORD_PDD = 0x0b, MBVPD_KEYWORD_MX = 0x0c, + MBVPD_KEYWORD_DW = 0x0d, + MBVPD_KEYWORD_PN = 0x0e, + MBVPD_KEYWORD_SN = 0x0f, + MBVPD_KEYWORD_DR = 0x10, + MBVPD_KEYWORD_CE = 0x11, + MBVPD_KEYWORD_FN = 0x12, + MBVPD_KEYWORD_CC = 0x13, + MBVPD_KEYWORD_HE = 0x14, + MBVPD_KEYWORD_CT = 0x15, + MBVPD_KEYWORD_HW = 0x16, + MBVPD_KEYWORD_VD = 0x17, + MBVPD_KEYWORD_VN = 0x18, + MBVPD_KEYWORD_VP = 0x19, + MBVPD_KEYWORD_SV = 0x1a, + MBVPD_KEYWORD_M0 = 0x1b, + MBVPD_KEYWORD_M1 = 0x1c, + MBVPD_KEYWORD_M2 = 0x1d, + MBVPD_KEYWORD_M3 = 0x1e, + MBVPD_KEYWORD_M4 = 0x1f, + MBVPD_KEYWORD_M5 = 0x20, + MBVPD_KEYWORD_M6 = 0x21, + MBVPD_KEYWORD_M7 = 0x22, + MBVPD_KEYWORD_M8 = 0x23, + MBVPD_KEYWORD_T1 = 0x24, + MBVPD_KEYWORD_T2 = 0x25, + MBVPD_KEYWORD_T4 = 0x26, + MBVPD_KEYWORD_T5 = 0x27, + MBVPD_KEYWORD_T6 = 0x28, + MBVPD_KEYWORD_T8 = 0x29, + MBVPD_KEYWORD_Q0 = 0x2a, + MBVPD_KEYWORD_Q1 = 0x2b, + MBVPD_KEYWORD_Q2 = 0x2c, + MBVPD_KEYWORD_Q3 = 0x2d, + MBVPD_KEYWORD_Q4 = 0x2e, + MBVPD_KEYWORD_Q5 = 0x2f, + MBVPD_KEYWORD_Q6 = 0x30, + MBVPD_KEYWORD_Q7 = 0x31, + MBVPD_KEYWORD_Q8 = 0x32, + MBVPD_KEYWORD_K0 = 0x33, + MBVPD_KEYWORD_K1 = 0x34, + MBVPD_KEYWORD_K2 = 0x35, + MBVPD_KEYWORD_K3 = 0x36, + MBVPD_KEYWORD_K4 = 0x37, + MBVPD_KEYWORD_K5 = 0x38, + MBVPD_KEYWORD_K6 = 0x39, + MBVPD_KEYWORD_K7 = 0x3a, + MBVPD_KEYWORD_K8 = 0x3b, }; } diff --git a/src/include/usr/vpd/cvpdenums.H b/src/include/usr/vpd/cvpdenums.H index 005073125..f3b534012 100644 --- a/src/include/usr/vpd/cvpdenums.H +++ b/src/include/usr/vpd/cvpdenums.H @@ -42,7 +42,7 @@ namespace CVPD VINI = 0x04, OPFR = 0x05, VNDR = 0x06, - VSPX = 0x07, + SPDX = 0x07, // Last Record CVPD_LAST_RECORD, CVPD_TEST_RECORD, // Test purposes ONLY! diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C index f2054ee71..60a725c28 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C +++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdPhaseRotatorData.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,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. */ @@ -20,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: getMBvpdPhaseRotatorData.C,v 1.8 2014/02/12 22:11:46 mjjones Exp $ +// $Id: getMBvpdPhaseRotatorData.C,v 1.10 2014/10/23 20:59:36 eliner Exp $ /** * @file getMBvpdPhaseRotatorData.C * @@ -144,11 +146,100 @@ fapi::ReturnCode getMBvpdPhaseRotatorData( // Read the MR keyword field l_pMrBuffer = new mr_keyword; - l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, - fapi::MBVPD_KEYWORD_MR, - l_mbTarget, - reinterpret_cast<uint8_t *>(l_pMrBuffer), - l_MrBufsize); + uint8_t l_customDimm = 0; + + l_fapirc = FAPI_ATTR_GET(ATTR_EFF_CUSTOM_DIMM,&i_mbaTarget, + l_customDimm); + if(l_fapirc) + { + FAPI_ERR("getMBvpdPhaseRotatorData: Read of Custom Dimm failed"); + break; + } + + //if custom_dimm = 0, use isdimm + if(fapi::ENUM_ATTR_EFF_CUSTOM_DIMM_NO == l_customDimm) + { + const uint8_t l_M0_KEYWORD_SIZE = 32; + + uint8_t l_m0_keyword[l_M0_KEYWORD_SIZE]; + uint32_t l_M0Bufsize = l_M0_KEYWORD_SIZE; + + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_SPDX, + fapi::MBVPD_KEYWORD_M0, + l_mbTarget, + (uint8_t *)(&l_m0_keyword), + l_M0Bufsize); + if (l_fapirc) + { + FAPI_ERR("getMBvpdPhaseRotatorData: Read of M0 keyword failed"); + break; // break out with fapirc + } + + uint32_t l_dimmPos = 0; + //@todo-RTC:116304 + l_fapirc = FAPI_ATTR_GET(ATTR_POS,&l_mbTarget,l_dimmPos); + if(l_fapirc) + { + FAPI_ERR("getMBvpdPhaseRotatorData: read of ATTR_POS failed"); + break; + } + + fapi::MBvpdKeyword l_MR_Keyword = fapi::MBVPD_KEYWORD_M1; + + uint8_t l_actualM0Data = l_m0_keyword[l_dimmPos]; + + switch (l_actualM0Data) + { + case 1: + l_MR_Keyword = fapi::MBVPD_KEYWORD_M1; + break; + case 2: + l_MR_Keyword = fapi::MBVPD_KEYWORD_M2; + break; + case 3: + l_MR_Keyword = fapi::MBVPD_KEYWORD_M3; + break; + case 4: + l_MR_Keyword = fapi::MBVPD_KEYWORD_M4; + break; + case 5: + l_MR_Keyword = fapi::MBVPD_KEYWORD_M5; + break; + case 6: + l_MR_Keyword = fapi::MBVPD_KEYWORD_M6; + break; + case 7: + l_MR_Keyword = fapi::MBVPD_KEYWORD_M7; + break; + case 8: + l_MR_Keyword = fapi::MBVPD_KEYWORD_M8; + break; + default: + FAPI_ERR("Incorrect M0 data : 0x%02x",l_actualM0Data); + const uint8_t & M0_DATA = l_actualM0Data; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INVALID_M0_DATA); + break; + } + if(l_fapirc) + { + FAPI_ERR("getMBvpdPhaseRotatorData: Invalid M0 data"); + break; + } + + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_SPDX, + l_MR_Keyword, + l_mbTarget, + reinterpret_cast<uint8_t *>(l_pMrBuffer), + l_MrBufsize); + //else custom_dimm is 1 and we need to use the CDIMM + }else{ + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_MR, + l_mbTarget, + reinterpret_cast<uint8_t *>(l_pMrBuffer), + l_MrBufsize); + } + if (l_fapirc) { FAPI_ERR("getMBvpdPhaseRotatorData: Read of MR keyword failed"); diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C index 33b63b9f6..3e05baffc 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C +++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdSpareDramData.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,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. */ @@ -20,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: getMBvpdSpareDramData.C,v 1.5 2014/02/12 22:14:28 mjjones Exp $ +// $Id: getMBvpdSpareDramData.C,v 1.7 2014/10/23 21:00:12 eliner Exp $ #include <stdint.h> // fapi support @@ -78,80 +80,107 @@ fapi::ReturnCode getMBvpdSpareDramData(const fapi::Target &i_mba, do { - // find the Centaur memory buffer from the passed MBA - l_rc = fapiGetParentChip (i_mba, l_mbTarget); - if (l_rc) - { - FAPI_ERR("getMBvpdSpareDramData: Finding the parent mb failed "); - break; - } + uint8_t l_customDimm = 0; - // Read AM keyword field - l_pAmBuffer = new AmKeyword(); - l_rc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, - fapi::MBVPD_KEYWORD_AM, - l_mbTarget, - reinterpret_cast<uint8_t *>(l_pAmBuffer), - l_AmBufSize); - if (l_rc) + l_rc = FAPI_ATTR_GET(ATTR_EFF_CUSTOM_DIMM,&i_mba,l_customDimm); + if(l_rc) { - FAPI_ERR("getMBvpdSpareDramData: " - "Read of AM Keyword failed"); + FAPI_ERR("getMBvpdSpareDramData: Read of Custom Dimm failed"); break; } - // Check for error or incorrect amount of data returned - if (l_AmBufSize < AM_KEYWORD_SIZE) + //if custom_dimm = 0, use isdimm + if(fapi::ENUM_ATTR_EFF_CUSTOM_DIMM_NO == l_customDimm) { - FAPI_ERR("getMBvpdSpareDramData:" - " less AM keyword returned than expected %d < %d", - l_AmBufSize, AM_KEYWORD_SIZE); - const uint32_t & KEYWORD = fapi::MBVPD_KEYWORD_AM; - const uint32_t & RETURNED_SIZE = l_AmBufSize; - const fapi::Target & CHIP_TARGET = l_mbTarget; - FAPI_SET_HWP_ERROR(l_rc, RC_MBVPD_INSUFFICIENT_VPD_RETURNED ); - break; - } + //ISDIMMs do not have any spare drams, + //return 0 for all ports and ranks. + for (uint8_t i = 0; i < DIMM_DQ_MAX_MBA_PORTS; i++) + { + for (uint8_t j = 0; j < DIMM_DQ_MAX_MBAPORT_DIMMS; j++) + { + for (uint8_t k = 0; k < DIMM_DQ_MAX_DIMM_RANKS; k++) + { + o_data[i][j][k] = 0; + } + } + } + //if custom_dimm = 1, use cdimm + }else + { + // find the Centaur memory buffer from the passed MBA + l_rc = fapiGetParentChip (i_mba, l_mbTarget); + if (l_rc) + { + FAPI_ERR("getMBvpdSpareDramData: Finding the parent mb failed "); + break; + } - // Find the position of the passed mba on the centuar - uint8_t l_mba = 0; - l_rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &i_mba, l_mba); + // Read AM keyword field + l_pAmBuffer = new AmKeyword(); + l_rc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + fapi::MBVPD_KEYWORD_AM, + l_mbTarget, + reinterpret_cast<uint8_t *>(l_pAmBuffer), + l_AmBufSize); + if (l_rc) + { + FAPI_ERR("getMBvpdSpareDramData: " + "Read of AM Keyword failed"); + break; + } - if (l_rc) - { - FAPI_ERR("getMBvpdSpareDramData: Get MBA position failed "); - break; - } - // Data in the AM Keyword contains information for both MBAs and - // is stored in [mba][port][dimm] ([2][2][2]) format, where the - // third (dimm) dimension contains a byte where each two bits of that - // byte are the spare status for a particular rank. - // The caller expects data returned for a particular MBA, - // and where the ranks for each dimm are separately indexed, - // so conversion to a [port][dimm][rank] ([2][2][4]) format - // is necessary. - for (uint8_t i = 0; i < DIMM_DQ_MAX_MBA_PORTS; i++) - { - for (uint8_t j = 0; j < DIMM_DQ_MAX_MBAPORT_DIMMS; j++) + // Check for error or incorrect amount of data returned + if (l_AmBufSize < AM_KEYWORD_SIZE) { - // Mask to pull of two bits at a time from iv_dimmSpareData - uint8_t l_dimmMask = 0xC0; - // Shift amount decrements each time as l_dimmMask is shifted - // to the right - uint8_t l_rankBitShift = 6; - for (uint8_t k = 0; k < DIMM_DQ_MAX_DIMM_RANKS; k++) + FAPI_ERR("getMBvpdSpareDramData:" + " less AM keyword returned than expected %d < %d", + l_AmBufSize, AM_KEYWORD_SIZE); + const uint32_t & KEYWORD = fapi::MBVPD_KEYWORD_AM; + const uint32_t & RETURNED_SIZE = l_AmBufSize; + const fapi::Target & CHIP_TARGET = l_mbTarget; + FAPI_SET_HWP_ERROR(l_rc, RC_MBVPD_INSUFFICIENT_VPD_RETURNED ); + break; + } + + // Find the position of the passed mba on the centuar + uint8_t l_mba = 0; + l_rc = FAPI_ATTR_GET(ATTR_CHIP_UNIT_POS, &i_mba, l_mba); + + if (l_rc) + { + FAPI_ERR("getMBvpdSpareDramData: Get MBA position failed "); + break; + } + // Data in the AM Keyword contains information for both MBAs and + // is stored in [mba][port][dimm] ([2][2][2]) format, where the + // third (dimm) dimension contains a byte where each two bits of + // that byte are the spare status for a particular rank. + // The caller expects data returned for a particular MBA, + // and where the ranks for each dimm are separately indexed, + // so conversion to a [port][dimm][rank] ([2][2][4]) format + // is necessary. + for (uint8_t i = 0; i < DIMM_DQ_MAX_MBA_PORTS; i++) + { + for (uint8_t j = 0; j < DIMM_DQ_MAX_MBAPORT_DIMMS; j++) { - o_data[i][j][k] = ((l_pAmBuffer->iv_mbaSpareData[l_mba]. + // Mask to pull of two bits at a time from iv_dimmSpareData + uint8_t l_dimmMask = 0xC0; + // Shift amount decrements each time as l_dimmMask + // is shifted to the right + uint8_t l_rankBitShift = 6; + for (uint8_t k = 0; k < DIMM_DQ_MAX_DIMM_RANKS; k++) + { + o_data[i][j][k] =((l_pAmBuffer->iv_mbaSpareData[l_mba]. iv_portSpareData[i].iv_dimmSpareData[j]. iv_dimmSpareData & l_dimmMask) >> l_rankBitShift); - l_dimmMask >>= 2; - l_rankBitShift -= 2; + l_dimmMask >>= 2; + l_rankBitShift -= 2; + } } } } }while(0); - delete l_pAmBuffer; l_pAmBuffer = NULL; return l_rc; diff --git a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C index 20ef8435c..6fa6a4d54 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C +++ b/src/usr/hwpf/hwp/mvpd_accessors/getMBvpdTermData.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,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. */ @@ -20,14 +22,13 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: getMBvpdTermData.C,v 1.11 2014/04/08 20:52:26 whs Exp $ +// $Id: getMBvpdTermData.C,v 1.16 2014/10/27 16:12:56 eliner Exp $ /** * @file getMBvpdTermData.C * * @brief get Termination Data from MBvpd MT keyword * */ - #include <stdint.h> // fapi support @@ -313,11 +314,172 @@ fapi::ReturnCode getMBvpdTermData( // Read the MT keyword field l_pMtBuffer = new mt_keyword; - l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, + uint8_t l_customDimm = 0; + + l_fapirc = FAPI_ATTR_GET(ATTR_EFF_CUSTOM_DIMM,&i_mbaTarget, + l_customDimm); + if(l_fapirc) + { + FAPI_ERR("getMBvpdTermData: Read of Custom Dimm failed"); + break; + } + + //if custom_dimm = 0, use isdimm + if(fapi::ENUM_ATTR_EFF_CUSTOM_DIMM_NO == l_customDimm) + { + //MT keyword is located in the SPDX record, + //and found by using ATTR_SPD_NUM_RANKS + //T1: one dimm, rank 1 T2: one dimm, rank 2 T3: one dimm, rank 4 + //T5: two dimm, rank 1 T6: two dimm, rank 2 T8: two dimm, rank 4 + uint8_t l_spd_dimm_ranks[2][2] = {{0,0},{0,0}}; + uint8_t l_mba_port; + uint8_t l_mba_dimm; + + std::vector<fapi::Target> l_target_dimm_array; + l_fapirc = fapiGetAssociatedDimms(i_mbaTarget, l_target_dimm_array, + fapi::TARGET_STATE_PRESENT); + if(l_fapirc) + { + FAPI_ERR("getMBvpdTermData: read of Associated Dimms failed"); + break; + } + + for(uint8_t l_dimm_index=0; l_dimm_index<l_target_dimm_array.size(); + l_dimm_index+=1) + { + l_fapirc = FAPI_ATTR_GET(ATTR_MBA_PORT, + &l_target_dimm_array[l_dimm_index], + l_mba_port); + if(l_fapirc) + { + FAPI_ERR("getMBvpdTermData: read of ATTR_MBA_PORT failed"); + break; + } + l_fapirc = FAPI_ATTR_GET(ATTR_MBA_DIMM, + &l_target_dimm_array[l_dimm_index], + l_mba_dimm); + if(l_fapirc) + { + FAPI_ERR("getMBvpdTermData: read of ATTR_MBA_DIMM failed"); + break; + } + + l_fapirc = FAPI_ATTR_GET(ATTR_SPD_NUM_RANKS, + &l_target_dimm_array[l_dimm_index], + l_spd_dimm_ranks[l_mba_port][l_mba_dimm]); + } + if(l_fapirc) + { + FAPI_ERR("getMBvpdTermData: read of ATTR_SPD_NUM_RANKS failed"); + break; + } + + uint8_t l_rankCopy = 0; + uint8_t l_dimmInvalid = 0; + /* Mismatched rank numbers between the paired ports is an error that + * should deconfigure the parent MBA so the data for that MBA should + * never be fetched. The same is for mismatched slot 1 and slot 0 + * on the same port + */ + + //single or double drop + if(l_spd_dimm_ranks[0][1] == 0 && l_spd_dimm_ranks[1][1] == 0) + { + //if the two match, it's a valid case. + if(l_spd_dimm_ranks[0][0] == l_spd_dimm_ranks[1][0]) + { + //0000, set to 1 + if(l_spd_dimm_ranks[0][0] == 0) + { + l_rankCopy = 1; + //throwing error for all empty + FAPI_ERR("No dimm's found"); + const uint8_t DIMM_P0S0 = l_spd_dimm_ranks[0][0]; + const uint8_t DIMM_P0S1 = l_spd_dimm_ranks[0][1]; + const uint8_t DIMM_P1S0 = l_spd_dimm_ranks[1][0]; + const uint8_t DIMM_P1S1 = l_spd_dimm_ranks[1][1]; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_DIMMS_NOT_FOUND); + + //either 0101,0202,0404. + }else + l_rankCopy = l_spd_dimm_ranks[0][0]; + }else + { + //throwing error for invalid dimm combination + l_dimmInvalid = 1; + } + //if all 4 are the same, its double ranked + }else if(l_spd_dimm_ranks[0][1] == l_spd_dimm_ranks[0][0] && + l_spd_dimm_ranks[1][1] == l_spd_dimm_ranks[1][0] && + l_spd_dimm_ranks[0][1] == l_spd_dimm_ranks[1][1]) + { + //either 1111,2222,4444 + l_rankCopy = l_spd_dimm_ranks[0][0] + 4; + }else + { + //throwing error for invalid dimm combination + l_dimmInvalid = 1; + } + + if(l_dimmInvalid) + { + FAPI_ERR("There is an invalid combination of dimm's found"); + const uint8_t INVALID_DIMM_P0S0 = l_spd_dimm_ranks[0][0]; + const uint8_t INVALID_DIMM_P0S1 = l_spd_dimm_ranks[0][1]; + const uint8_t INVALID_DIMM_P1S0 = l_spd_dimm_ranks[1][0]; + const uint8_t INVALID_DIMM_P1S1 = l_spd_dimm_ranks[1][1]; + const fapi::Target & MBA = i_mbaTarget; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INVALID_DIMM_FOUND); + break; + } + + fapi::MBvpdKeyword l_MT_Keyword = fapi::MBVPD_KEYWORD_T1; + switch (l_rankCopy) + { + case 1: + l_MT_Keyword = fapi::MBVPD_KEYWORD_T1; + break; + case 2: + l_MT_Keyword = fapi::MBVPD_KEYWORD_T2; + break; + case 4: + l_MT_Keyword = fapi::MBVPD_KEYWORD_T4; + break; + case 5: + l_MT_Keyword = fapi::MBVPD_KEYWORD_T5; + break; + case 6: + l_MT_Keyword = fapi::MBVPD_KEYWORD_T6; + break; + case 8: + l_MT_Keyword = fapi::MBVPD_KEYWORD_T8; + break; + default: + FAPI_ERR("Incorrect data from dimm ranks : 0x%02x",l_rankCopy); + const uint8_t & RANK_NUM = l_rankCopy; + FAPI_SET_HWP_ERROR(l_fapirc, RC_MBVPD_INVALID_MT_DATA); + break; + } + if(l_fapirc) + { + FAPI_ERR("getMBvpdTermData: Invalid rank 0x%02x",l_rankCopy); + break; + } + + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_SPDX, + l_MT_Keyword, + l_mbTarget, + reinterpret_cast<uint8_t *>(l_pMtBuffer), + l_MtBufsize); + //else custom_dimm is 1 and we need to use the CDIMM + }else{ + l_fapirc = fapiGetMBvpdField(fapi::MBVPD_RECORD_VSPD, fapi::MBVPD_KEYWORD_MT, l_mbTarget, reinterpret_cast<uint8_t *>(l_pMtBuffer), l_MtBufsize); + } + if (l_fapirc) { FAPI_ERR("getMBvpdTermData: Read of MT keyword failed"); diff --git a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml index 41db40b28..e912380b3 100644 --- a/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml +++ b/src/usr/hwpf/hwp/mvpd_accessors/mvpd_errors.xml @@ -5,7 +5,9 @@ <!-- --> <!-- OpenPOWER HostBoot Project --> <!-- --> -<!-- COPYRIGHT International Business Machines Corp. 2012,2014 --> +<!-- Contributors Listed Below - COPYRIGHT 2012,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. --> @@ -20,7 +22,7 @@ <!-- permissions and limitations under the License. --> <!-- --> <!-- IBM_PROLOG_END_TAG --> -<!-- $Id: mvpd_errors.xml,v 1.15 2014/02/12 22:26:52 mjjones Exp $ --> +<!-- $Id: mvpd_errors.xml,v 1.19 2014/10/27 16:13:41 eliner Exp $ --> <hwpErrors> <!-- ********************************************************************* --> <hwpError> @@ -243,4 +245,65 @@ <target>MEMBUF_TARGET</target> </gard> </hwpError> + <hwpError> + <rc>RC_MBVPD_INVALID_MT_DATA</rc> + <description> + To get the proper MT data, we need a valid + dimm rank combination. + </description> + <ffdc>RANK_NUM</ffdc> + <callout> + <procedure>CODE</procedure> + <priority>HIGH</priority> + </callout> + </hwpError> + <hwpError> + <rc>RC_MBVPD_DIMMS_NOT_FOUND</rc> + <description> + To get the proper MT data, we need to find the + dimm's to get a valid dimm rank combination + </description> + <ffdc>DIMM_P0S0</ffdc> + <ffdc>DIMM_P0S1</ffdc> + <ffdc>DIMM_P1S0</ffdc> + <ffdc>DIMM_P1S1</ffdc> + <callout> + <procedure>CODE</procedure> + <priority>HIGH</priority> + </callout> + </hwpError> + <hwpError> + <rc>RC_MBVPD_INVALID_DIMM_FOUND</rc> + <description> + Something went very wrong in the dimm's and + the combination received is not valid + </description> + <ffdc>INVALID_DIMM_P0S0</ffdc> + <ffdc>INVALID_DIMM_P0S1</ffdc> + <ffdc>INVALID_DIMM_P1S0</ffdc> + <ffdc>INVALID_DIMM_P1S1</ffdc> + <callout> + <procedure>MEMORY_PLUGGING_ERROR</procedure> + <priority>HIGH</priority> + </callout> + <callout> + <target>MBA</target> + <priority>MEDIUM</priority> + </callout> + <deconfigure> + <target>MBA</target> + </deconfigure> + </hwpError> + <hwpError> + <rc>RC_MBVPD_INVALID_M0_DATA</rc> + <description> + To get the proper MR data, we need to have the + correct M0 data. + </description> + <ffdc>M0_DATA</ffdc> + <callout> + <procedure>CODE</procedure> + <priority>HIGH</priority> + </callout> + </hwpError> </hwpErrors> diff --git a/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C b/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C index 9f7a7695d..73e9a4a19 100644 --- a/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C +++ b/src/usr/hwpf/plat/fapiPlatMBvpdAccess.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,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. */ @@ -60,6 +62,9 @@ fapi::ReturnCode MBvpdRecordXlate(const fapi::MBvpdRecord i_fapiRecord, CVPD::MER0, CVPD::VSPD, CVPD::VINI, + CVPD::OPFR, + CVPD::VNDR, + CVPD::SPDX, }; const uint8_t NUM_MBVPD_RECORDS = sizeof(mbvpdFapiRecordToHbRecord)/sizeof(mbvpdFapiRecordToHbRecord[0]); @@ -123,6 +128,53 @@ fapi::ReturnCode MBvpdKeywordXlate(const fapi::MBvpdKeyword i_fapiKeyword, CVPD::VZ, CVPD::pdD, CVPD::MX, + CVPD::DW, + CVPD::PN, + CVPD::SN, + CVPD::DR, + CVPD::CE, + CVPD::FN, + CVPD::CC, + CVPD::HE, + CVPD::CT, + CVPD::HW, + CVPD::VD, + CVPD::VN, + CVPD::VP, + CVPD::SV, + CVPD::M0, + CVPD::M1, + CVPD::M2, + CVPD::M3, + CVPD::M4, + CVPD::M5, + CVPD::M6, + CVPD::M7, + CVPD::M8, + CVPD::T1, + CVPD::T2, + CVPD::T4, + CVPD::T5, + CVPD::T6, + CVPD::T8, + CVPD::Q0, + CVPD::Q1, + CVPD::Q2, + CVPD::Q3, + CVPD::Q4, + CVPD::Q5, + CVPD::Q6, + CVPD::Q7, + CVPD::Q8, + CVPD::K0, + CVPD::K1, + CVPD::K2, + CVPD::K3, + CVPD::K4, + CVPD::K5, + CVPD::K6, + CVPD::K7, + CVPD::K8, }; const uint8_t NUM_MBVPD_KEYWORDS = sizeof(mbvpdFapiKeywordToHbKeyword)/sizeof(mbvpdFapiKeywordToHbKeyword[0]); diff --git a/src/usr/vpd/cvpd.H b/src/usr/vpd/cvpd.H index 30424603e..f7b2b120a 100644 --- a/src/usr/vpd/cvpd.H +++ b/src/usr/vpd/cvpd.H @@ -70,7 +70,7 @@ namespace CVPD { VINI, "VINI" }, { OPFR, "OPFR" }, { VNDR, "VNDR" }, - { VSPX, "VSPX" }, + { SPDX, "SPDX" }, // ------------------------------------------------------------------- // DO NOT USE!! This is for test purposes ONLY! { CVPD_TEST_RECORD, "TEST" }, |