diff options
| author | Dan Crowell <dcrowell@us.ibm.com> | 2016-08-26 10:03:53 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-08-30 17:22:01 -0400 |
| commit | ab651844afcc9b0ac6a1c74779da555b62342bf1 (patch) | |
| tree | a2237315dc22c11545d00f4f97aea7645028f5ef /src/usr/hwpf/hwp/dmi_training/mss_getecid | |
| parent | 85cb1f757c9de446ab4e1f460e206091242b2c49 (diff) | |
| download | blackbird-hostboot-ab651844afcc9b0ac6a1c74779da555b62342bf1.tar.gz blackbird-hostboot-ab651844afcc9b0ac6a1c74779da555b62342bf1.zip | |
Remove last of old hwpf directory
Remove all of the old fapi1 HWPs from P8
Update makefiles/code to not include old hwpf headers
Change-Id: Idc840554721f68b0af3b6ee6c7ad84f5df258e60
RTC: 146345
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28844
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/dmi_training/mss_getecid')
4 files changed, 0 insertions, 971 deletions
diff --git a/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid.C b/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid.C deleted file mode 100644 index 3b32a46a5..000000000 --- a/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid.C +++ /dev/null @@ -1,456 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ -/* [+] 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: mss_get_cen_ecid.C,v 1.41 2015/02/11 15:26:08 janssens Exp $ -//------------------------------------------------------------------------------ -// *| -// *! (C) Copyright International Business Machines Corp. 2012 -// *! All Rights Reserved -- Property of IBM -// *! *** *** -// *| -// *! TITLE : mss_get_cen_ecid.C -// *! DESCRIPTION : Get ECID string from target using SCOM's -// *! -// *! OWNER NAME : Mark Bellows Email: bellows@us.ibm.com -// *! Copied From : Joe McGill's proc_cleanup code -// *! -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// CHANGE HISTORY: -//------------------------------------------------------------------------------ -// Version:| Author: | Date: | Comment: -//---------|----------|---------|----------------------------------------------- -// 1.41 | janssens |11-FEB-15| Fixed compile bug -// 1.40 | sglancy |11-FEB-15| Fixed Firmware compile bug -// 1.39 | sglancy |10-FEB-15| Removed hardcoding of centaur version and removed erroneous FAPI_ERR statement -// 1.38 | sglancy |03-FEB-15| Fixed bugs surrounding the ATTR_CENTAUR_BLUEWATERFALL_NWELL_BROKEN_CHECK_FLAG update -// 1.37 | jprispol |03-NOV-14| Moved bluewaterfall/nwell variable declarations -// 1.36 | jprispol |28-OCT-14| Updated bluewaterfall/nwell broken attribute name -// 1.34 | jprispol |24-OCT-14| Replaced privileged fapi attribute call -// 1.32 | sglancy |08-MAY-14| Changed location of the setting ATTR_MSS_INIT_STATE to track IPL states -// 1.31 | sglancy |25-MAR-14| RAS review updates -// 1.30 | bellows |11-NOV-13| Gerrit review updates -// 1.29 | bellows |08-NOV-13| Added ATTR_MSS_INIT_STATE to track IPL states -// 1.28 | bellows |02-OCT-13| Minor Review Comments addressed -// 1.27 | bellows |26-SEP-13| Fixed Minor firware comment -// 1.26 | bellows |19-SEP-13| Fixed the bug in 1.24 -// 1.25 | bellows |18-SEP-13| Back to 1.23 because of some issue -// 1.24 | bellows |17-SEP-13| Support for external wrappers and decode -// 1.23 | bellows |10-SEP-13| For DD2, no partial logic hardware bits -// 1.22 | jones |18-JUN-13| <attr ec use> -// 1.21 | bellows |14-JUN-13| ECBIT added for case when we can trust the cache enable -// 1.20 | bellows |22-MAY-13| Bluewaterfall matching actual ECID definition -// 1.19 | bellows |15-MAY-13| Added Bluewaterfall handling -// 1.18 | bellows |27-MAR-13| Fixes to rc handling from reviewer comments -// 1.17 | bellows |26-MAR-13| Additional reviewer comments -// 1.16 | bellows |26-MAR-13| Cleanup because of Firmware Gerrit Review Comments -// 1.15 | bellows |22-MAR-13| Changed name of ECID Attribute per Firmware request -// 1.14 | bellows |29-JAN-13| Getting sub version, setting NWELL Attribute -// 1.13 | bellows |24-JAN-13| Cache Disable Valid bit is ecid_128, made bit -// | | | number consistent -// 1.12 | bellows |23-JAN-13| PSRO attriubute is available in cronus dev -// 1.11 | bellows |21-JAN-13| fixed log comment -// 1.10 | bellows |21-JAN-13| chip sub id read, psro shell added -// 1.9 | bellows |15-JAN-13| moved Cache Enable Information to the caller -// 1.8 | sglancy |10-DEC-12| Corrected typo -// 1.7 | sglancy | 6-DEC-12| Updated to coincide with firmware updates to ECID attribute -// 1.6 | sglancy | 5-DEC-12| Updated to coincide with firmware change requests -// 1.5-1 | sglancy | 5-DEC-12| Lost due to no update log - - -//------------------------------------------------------------------------------ -// Includes -//------------------------------------------------------------------------------ -#include <fapi.H> -#include <mss_get_cen_ecid.H> - -extern "C" { - -using namespace fapi; -//------------------------------------------------------------------------------ -// Function definitions -//------------------------------------------------------------------------------ - fapi::ReturnCode user_ecid( uint8_t & o_ddr_port_status, - uint8_t & o_cache_enable, - uint8_t & o_centaur_sub_revision, - ecid_user_struct & ecid_struct - ); - -// HWP entry point - fapi::ReturnCode mss_get_cen_ecid( - const fapi::Target& i_target, - uint8_t & o_ddr_port_status, - uint8_t & o_cache_enable, - uint8_t & o_centaur_sub_revision, - ecid_user_struct & ecid_struct - ) - { - // return code - fapi::ReturnCode rc; - - - // set the init state attribute to CLOCKS_ON - uint8_t l_attr_mss_init_state; - l_attr_mss_init_state=ENUM_ATTR_MSS_INIT_STATE_CLOCKS_ON; - rc = FAPI_ATTR_SET(ATTR_MSS_INIT_STATE, &i_target, l_attr_mss_init_state); - if(rc) return rc; - - uint8_t l_bluewaterfall_nwell_broken; - rc = FAPI_ATTR_GET(ATTR_CENTAUR_BLUEWATERFALL_NWELL_BROKEN_CHECK_FLAG, - &i_target, l_bluewaterfall_nwell_broken); - // For certain Centaur DD1.0* subversions, adjustments need to be made to - // the bluewaterfall and the transistor misplaced in the nwell. - // l_bluewaterfall_nwell_broken will be 1 if needing changes and 0 if not - if (!rc.ok()) { - FAPI_ERR("mss_get_cen_ecid: could not GET ATTR_CENTAUR_BLUEWATERFALL_NWELL_BROKEN_CHECK_FLAG" ); - return rc; - } - - if(l_bluewaterfall_nwell_broken) ecid_struct.io_ec = 0x10; - else ecid_struct.io_ec = 0x20; - FAPI_INF("Centaur EC version 0x%02x",ecid_struct.io_ec); - - if(ecid_struct.valid) { - - rc = mss_parse_ecid(ecid_struct.io_ecid, - ecid_struct.i_checkL4CacheEnableUnknown, - ecid_struct.i_ecidContainsPortLogicBadIndication, - l_bluewaterfall_nwell_broken, - o_ddr_port_status, - o_cache_enable, - o_centaur_sub_revision, - ecid_struct.o_psro, - ecid_struct.o_bluewaterfall_broken, - ecid_struct.o_nwell_misplacement ); - - // procedure is done. - return rc; - } - - uint8_t l_psro; - - // mark HWP entry - uint32_t rc_ecmd = 0; - ecmdDataBufferBase scom(64); - FAPI_IMP("Entering mss_get_cen_ecid...."); - rc = fapiGetScom( i_target, ECID_PART_0_0x00010000, scom ); - if (rc) - { - FAPI_ERR("mss_get_cen_ecid: could not read scom address 0x00010000" ); - return rc; - } - rc_ecmd = scom.reverse(); - if(rc_ecmd) - { - FAPI_ERR("mss_get_cen_ecid: error manipulating ecmdDataBufferBase"); - rc.setEcmdError(rc_ecmd); - return rc; - } - ecid_struct.io_ecid[0] = scom.getDoubleWord(0); - - //gets the second part of the ecid and sets the attribute - rc = fapiGetScom( i_target, ECID_PART_1_0x00010001, scom ); - if (rc) - { - FAPI_ERR("mss_get_cen_ecid: could not read scom address 0x00010001" ); - return rc; - } - rc_ecmd |= scom.reverse(); - if(rc_ecmd) - { - FAPI_ERR("mss_get_cen_ecid: error manipulating ecmdDataBufferBase"); - rc.setEcmdError(rc_ecmd); - return rc; - } - ecid_struct.io_ecid[1] = scom.getDoubleWord(0); - - uint64_t ecid[2]; - ecid[0]=ecid_struct.io_ecid[0]; - ecid[1]=ecid_struct.io_ecid[1]; - - rc = FAPI_ATTR_SET(ATTR_ECID, &i_target, ecid); - if (rc) - { - FAPI_ERR("mss_get_cen_ecid: Could not set ATTR_ECID" ); - return rc; - } - - uint8_t l_checkL4CacheEnableUnknown = 0; - rc = FAPI_ATTR_GET(ATTR_CENTAUR_EC_CHECK_L4_CACHE_ENABLE_UNKNOWN, - &i_target, l_checkL4CacheEnableUnknown); - if (!rc.ok()) { - FAPI_ERR("mss_get_cen_ecid: could not get ATTR_CENTAUR_EC_CHECK_L4_CACHE_ENABLE_UNKNOWN" ); - return rc; - } - - uint8_t l_ecidContainsPortLogicBadIndication = 0; - rc = FAPI_ATTR_GET(ATTR_CENTAUR_EC_ECID_CONTAINS_PORT_LOGIC_BAD_INDICATION, - &i_target, l_ecidContainsPortLogicBadIndication); - if (!rc.ok()) { - FAPI_ERR("mss_get_cen_ecid: could not get ATTR_CENTAUR_EC_ECID_CONTAINS_PORT_LOGIC_BAD_INDICATION" ); - return rc; - } - - uint8_t l_bluewaterfall_broken; - uint8_t l_nwell_misplacement; - rc = mss_parse_ecid(ecid, - l_checkL4CacheEnableUnknown, - l_ecidContainsPortLogicBadIndication, - l_bluewaterfall_nwell_broken, - o_ddr_port_status, - o_cache_enable, - o_centaur_sub_revision, - l_psro, - l_bluewaterfall_broken, - l_nwell_misplacement ); - - ecid_struct.o_psro=l_psro; - ecid_struct.o_bluewaterfall_broken=l_bluewaterfall_broken; - ecid_struct.o_nwell_misplacement=l_nwell_misplacement; - - if (rc) - { - FAPI_ERR("mss_get_cen_ecid: mss_parse_ecid" ); - return rc; - } - - rc = FAPI_ATTR_SET(ATTR_MSS_PSRO, &i_target, l_psro); - if (!rc.ok()) { - FAPI_ERR("mss_get_cen_ecid: could not set ATTR_MSS_PSRO" ); - return rc; - } - - rc = FAPI_ATTR_SET(ATTR_MSS_BLUEWATERFALL_BROKEN, &i_target, l_bluewaterfall_broken); - if (!rc.ok()) { - FAPI_ERR("mss_get_cen_ecid: could not set ATTR_MSS_BLUEWATERFALL_BROKEN" ); - return rc; - } - - rc = FAPI_ATTR_SET(ATTR_MSS_NWELL_MISPLACEMENT, &i_target, l_nwell_misplacement); - if (!rc.ok()) { - FAPI_ERR("mss_get_cen_ecid: could not set ATTR_MSS_NWELL_MISPLACEMENT" ); - return rc; - } - - // mark HWP exit - FAPI_IMP("Exiting mss_get_cen_ecid...."); - return rc; - } - -// Decoder function which allows us to pass in just the raw ECID data and get it decoded for in the lab -// or we can just use it to set up all the needed attributes - - fapi::ReturnCode mss_parse_ecid(uint64_t ecid[2], - const uint8_t i_checkL4CacheEnableUnknown, - const uint8_t i_ecidContainsPortLogicBadIndication, - const uint8_t i_bluewaterfall_nwell_broken, - uint8_t & o_ddr_port_status, - uint8_t & o_cache_enable, - uint8_t & o_centaur_sub_revision, - uint8_t & o_psro, - uint8_t & o_bluewaterfall_broken, - uint8_t & o_nwell_misplacement ){ -//get bit128 - uint8_t bit128 = 0; - uint32_t rc_ecmd = 0; - fapi::ReturnCode rc; - ecmdDataBufferBase scom(64); - - o_nwell_misplacement = 0; - o_bluewaterfall_broken = 0; - - - rc_ecmd = scom.setDoubleWord(0, ecid[1]); - if(rc_ecmd) { - FAPI_ERR("mss_get_cen_ecid: error manipulating ecmdDataBufferBase" ); - rc.setEcmdError(rc_ecmd); - return rc; - } - rc_ecmd |= scom.extract(&bit128,63,1); - bit128 = bit128 >> 7; - if(rc_ecmd) { - FAPI_ERR("mss_get_cen_ecid: could not extract cache data_valid bit" ); - rc.setEcmdError(rc_ecmd); - return rc; - } - - if(bit128 == 1) { // Cache enable bit is valid - - //gets bits 113 and 114 to determine the state of the cache - uint8_t bit113_114=0; - rc_ecmd |= scom.extract(&bit113_114,48,2); - bit113_114 = bit113_114 >> 6; - uint8_t t; - if(rc_ecmd) { - FAPI_ERR("mss_get_cen_ecid: could not extract cache data" ); - rc.setEcmdError(rc_ecmd); - return rc; - } - //determines the state of the cache - if(bit113_114 == 0) t = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_ON; - else if(bit113_114 == 1) t = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_HALF_A; - else if(bit113_114 == 2) t = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_HALF_B; - else t = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_OFF; - - // Centaur DD1.X chips have an ECBIT in bit127, if this is zero then the - // cache enable bits are in an unknown state. DD2.X chips and higher do not - // have an ECBIT. The decision to look at the ECBIT is done with a Chip EC - // Feature Attribute - the attribute XML can be easily tweaked if it is - // found that other DD levels also have an ECBIT. - // Centaur | DataValid | ECBIT | Return Value | Firmware Action | Cronus Action**| - // 1.* | 0 | 0 or 1 | DIS | DIS | DIS | - // 1.* | 1 | 0 | Unk ENA/DIS/A/B| DIS | ENA/DIS/A/B | - // 1.* | 1 | 1 | ENA/DIS/A/B | ENA/DIS* | ENA/DIS/A/B | - // != 1.* | 0 | N/A | DIS | DIS | DIS | - // != 1.* | 1 | N/A | ENA/DIS/A/B | ENA/DIS | ENA/DIS/A/B | - // - // * firmware can suport paritial cache if it wants to for DD1.* (e.g. DD1.0 DD1.01, DD1.1 etc) - // However, if it chooses to, it should still make all Unk ones disabled - // ** Cronus Action - cronus and all fapi procedures only support the original defintion of ENA/DIS/A/B - // Cronus actually uses its config file for the 4 values and checks the hardware via the get_cen_ecid - // procedure during step 11 to make sure the end user does not enable a disable cache - // Under cronus, the Unk information is only printed to the screen - - if (i_checkL4CacheEnableUnknown) - { - uint8_t bit127 = 0; - rc_ecmd |= scom.extract(&bit127,62,1); - bit127 = bit127 >> 7; - if(rc_ecmd) { - FAPI_ERR("mss_get_cen_ecid: could not extract ECBIT bit" ); - rc.setEcmdError(rc_ecmd); - return rc; - } - if(bit127 == 0) { - FAPI_INF("mss_get_cen_ecid: Cache Enable Bits are in Unknown State"); - if(bit113_114 == 0) t = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_UNK_ON; - else if(bit113_114 == 1) t = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_UNK_HALF_A; - else if(bit113_114 == 2) t = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_UNK_HALF_B; - else t = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_UNK_OFF; - } - else - { - FAPI_INF("mss_get_cen_ecid: Cache Enable Bits are in Known State"); - } - } - - o_cache_enable = t; - } - else { - FAPI_INF("Cache Disbled because eDRAM data bits are assumed to be bad"); - o_cache_enable = fapi::ENUM_ATTR_MSS_CACHE_ENABLE_OFF; - } - - //reads in the ECID info for whether a DDR port side is good or bad - //This is only defined for DD1.x parts - if(i_ecidContainsPortLogicBadIndication ) { - rc_ecmd |= scom.extract(&o_ddr_port_status,50,2); - if(rc_ecmd) { - FAPI_ERR("mss_get_cen_ecid: could not extract DDR status data" ); - rc.setEcmdError(rc_ecmd); - return rc; - } - o_ddr_port_status = o_ddr_port_status >> 6; - } - else { - o_ddr_port_status = 0x0; // logic in both ports are good - } - - - //116..123 average PSRO from 85C wafer test - uint8_t bit117_124=0; - rc_ecmd |= scom.extract(&bit117_124,52,8); - if(rc_ecmd) { - FAPI_ERR("mss_get_cen_ecid: could not extract PSRO" ); - rc.setEcmdError(rc_ecmd); - return rc; - } - o_psro=bit117_124; - - // read the bit in the ecid to see if we are a DD1.01 - // Bit 124 DD1.01 Indicator Bit. Set to '1' for DD1.01 devices - uint8_t bit125 =0; - rc_ecmd = scom.extract(&bit125,60,1); - bit125 = bit125 >> 7; - if(rc_ecmd) { - FAPI_ERR("mss_get_cen_ecid: could not extract dd1.01 indicator bit" ); - rc.setEcmdError(rc_ecmd); - return rc; - } - o_centaur_sub_revision=bit125; - // The ecid contains the chip's subrevision, changes in the subrevision should not - // change firmware behavior but for the exceptions, update attributes to indicate - // those behaviors - if (i_bluewaterfall_nwell_broken && (o_centaur_sub_revision < 1)) - { - // For DD1.00, the transistor misplaced in the nwell needs some setting adjustments to get it to function - // after DD1.00, we no longer need to make that adjustment - o_nwell_misplacement = 1; - } - - uint8_t bit126 =0; - rc_ecmd = scom.extract(&bit126,61,1); - bit126 = bit126 >> 7; - if(rc_ecmd) { - FAPI_ERR("mss_get_cen_ecid: could not extract dd1.03 indicator bit" ); - rc.setEcmdError(rc_ecmd); - return rc; - } - - // we have to look at both the bluewaterfall and the n-well misplacement to determine the proper values of the n-well - if (i_bluewaterfall_nwell_broken) { - if(bit126 == 0) - { - // on and after DD1.03, we no longer need to make adjustments due to the bluewaterfall - this is before - o_bluewaterfall_broken = 1; - } - else { - o_nwell_misplacement = 0; // Assume if the bluewaterfall is fixed, then the nwell is also fixed - } - } - - return rc; - } - - fapi::ReturnCode user_ecid( uint8_t & o_ddr_port_status, - uint8_t & o_cache_enable, - uint8_t & o_centaur_sub_revision, - ecid_user_struct & ecid_struct - ){ - - return mss_parse_ecid(ecid_struct.io_ecid, - ecid_struct.i_checkL4CacheEnableUnknown, - ecid_struct.i_ecidContainsPortLogicBadIndication, - ecid_struct.i_bluewaterfall_nwell_broken, - o_ddr_port_status, - o_cache_enable, - o_centaur_sub_revision, - ecid_struct.o_psro, - ecid_struct.o_bluewaterfall_broken, - ecid_struct.o_nwell_misplacement ); - - } - - -} // extern "C" diff --git a/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid.H b/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid.H deleted file mode 100644 index b6e9ef23d..000000000 --- a/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid.H +++ /dev/null @@ -1,148 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* 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. */ -/* 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: mss_get_cen_ecid.H,v 1.14 2014/10/24 16:44:40 jprispol Exp $ -//------------------------------------------------------------------------------ -// *| -// *! (C) Copyright International Business Machines Corp. 2012 -// *! All Rights Reserved -- Property of IBM -// *! *** *** -// *| -// *! TITLE : mss_get_cen_ecid.H -// *! DESCRIPTION : Get ECID string from target using SCOM's -// *! -// *! OWNER NAME : Mark Bellows Email: bellows@us.ibm.com -// *! Copied From : Joe McGill's proc_cleanup code -// *! -// *! ADDITIONAL COMMENTS: -// *! -// *! -//------------------------------------------------------------------------------ -// CHANGE HISTORY: -//------------------------------------------------------------------------------ -// Version:| Author: | Date: | Comment: -//---------|----------|---------|----------------------------------------------- -// 1.14 | jprispol |24-OCT-14| Replaced privileged fapi attr call in mss_get_cen_ecid.c -// 1.11 | sglancy |25-MAR-14| Minor Review Comments addressed -// 1.10 | bellows |02-OCT-13| Minor Review Comments addressed -// 1.9 | bellows |17-SEP-13| Allow for external wrapper parsing -// 1.8 | bellows |26-MAR-13| Reviewer found updates -// 1.7 | bellows |22-MAR-13| Changed commented name of ECID Attribute per Firmware request -// 1.6 | bellows |21-JAN-13| added in sub revision reader -// 1.5 | bellows |15-JAN-13| moved Cache Enable Information to the caller -// 1.1-1.4 | various |07-DEC-12| Original Program - -#ifndef _MSS_GET_CEN_ECID_H_ -#define _MSS_GET_CEN_ECID_H_ - - -//------------------------------------------------------------------------------ -// Includes -//------------------------------------------------------------------------------ - -#include <fapi.H> -#include <cen_scom_addresses.H> - -//defines enumerators -enum mss_get_cen_ecid_ddr_status -{ - MSS_GET_CEN_ECID_DDR_STATUS_ALL_GOOD = 0, - MSS_GET_CEN_ECID_DDR_STATUS_MBA1_BAD = 1, - MSS_GET_CEN_ECID_DDR_STATUS_MBA0_BAD = 2, - MSS_GET_CEN_ECID_DDR_STATUS_ALL_BAD = 3, -}; - -//------------------------------------------------------------------------------ -// Structure definitions -//------------------------------------------------------------------------------ -class ecid_user_struct { -public: - uint8_t valid; - uint8_t i_checkL4CacheEnableUnknown; - uint8_t i_ecidContainsPortLogicBadIndication; - uint8_t i_bluewaterfall_nwell_broken; - uint8_t i_user_defined; - uint8_t io_ec; - uint64_t io_ecid[2]; - uint8_t o_psro; - uint8_t o_bluewaterfall_broken; - uint8_t o_nwell_misplacement; - - ecid_user_struct(); -}; - -inline ecid_user_struct::ecid_user_struct() { valid=0; i_checkL4CacheEnableUnknown=0; i_ecidContainsPortLogicBadIndication=0; i_user_defined=0; io_ec=0; io_ecid[0]=0; io_ecid[1]=0; } - - -// function pointer typedef definition for HWP call support -typedef fapi::ReturnCode -(*mss_get_cen_ecid_FP_t)(const fapi::Target& i_target, uint8_t & o_ddr_port_status, uint8_t & o_cache_enable, uint8_t & o_centaur_sub_revision, ecid_user_struct & user_data - - ); - - -//------------------------------------------------------------------------------ -// Function prototypes -//------------------------------------------------------------------------------ - -extern "C" -{ - -// function: FAPI mss_get_cen_ecid HWP entry point -// parameters: i_target => cen chip target -// &o_ddr_port_status => indicates if the MBA's are bad, with MBA 1 being the rightmost bit and MBA 0 being the next to right most bit -// &o_cache_enable => what it would have set the cache enable attribute to if it sets attributes -// &o_centaur_sub_revision => the sub revision indicator between DD1.0 and DD1.01 -// returns: FAPI_RC_SUCCESS if FBC stop is deasserted at end of execution -// else FAPI return code for failing operation -// Updates attributes: ATTR_ECID[2] -> bits 1-64 and 65-128 of the ECID -// ATTR_MSS_PSRO -> average PSRO from 85C wafer test -// ATTR_MSS_NWELL_MISPLACEMENT -> indicates if nwell defect in hardware - fapi::ReturnCode mss_get_cen_ecid( - const fapi::Target& i_target, - uint8_t & o_ddr_port_status, - uint8_t & o_cache_enable, - uint8_t & o_centaur_sub_revision, - ecid_user_struct & user_data - - ); - - fapi::ReturnCode mss_parse_ecid( - uint64_t ecid[2], // input ECID in bit order - const uint8_t l_checkL4CacheEnableUnknown, // input L4CacheEnableUnknown is possible - const uint8_t l_ecidContainsPortLogicBadIndication, // input logic can be bad - const uint8_t l_bluewaterfall_nwell_broken, // adjustments possibly needed for bluewaterfall and transistor misplaced in the nwell - uint8_t & ddr_port, //output ddr ports are non functional - uint8_t & cache_enable_o, // output cache is functional or not - uint8_t & centaur_sub_revision_o, // output sub revsion number - uint8_t & o_psro, // output psro - uint8_t & o_bluewaterfall_broken, // output blue waterfall broken - uint8_t & o_nwell_misplacement // output nwell misplacement - ); - - - -} // extern "C" - -#endif // _MSS_GET_CEN_ECID_H_ diff --git a/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid_decode.C b/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid_decode.C deleted file mode 100644 index 8b34a8e1e..000000000 --- a/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid_decode.C +++ /dev/null @@ -1,258 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid_decode.C $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2013,2015 */ -/* [+] 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: mss_get_cen_ecid_decode.C,v 1.10 2015/02/03 15:08:48 sglancy Exp $ -//------------------------------------------------------------------------------ -// *| -// *! (C) Copyright International Business Machines Corp. 2013 -// *! All Rights Reserved -- Property of IBM -// *! *** *** -// *| -// *! TITLE : mss_get_cen_ecid_decode.C -// *! DESCRIPTION : Get ECID string from target using SCOM's -// *! -// *! OWNER NAME : Mark Bellows Email: bellows@us.ibm.com -// *! Copied From : Joe McGill's proc_cleanup code -// *! -//------------------------------------------------------------------------------ -//------------------------------------------------------------------------------ -// CHANGE HISTORY: -//------------------------------------------------------------------------------ -// Version:| Author: | Date: | Comment: -//---------|----------|---------|----------------------------------------------- -// 1.10 | sglancy |03-FEB-15| Fixed bugs surrounding the ATTR_CENTAUR_BLUEWATERFALL_NWELL_BROKEN_CHECK_FLAG update -// 1.9 | bellows |17-FEB-14| RAS Review Comments -// 1.8 | bellows |14-OCT-13| One more sprintf update to make this hostboot/cronus agnostic -// 1.7 | bellows |08-OCT-13| Made update so it compiles with cronus + hostboot -// 1.6 | thi |05-OCT-13| Fix compiler error -// 1.5 | bellows |02-OCT-13| Minor Review Comments addressed -// 1.4 | bellows |27-SEP-13| Removed std::string -// 1.3 | bellows |26-SEP-13| Firware comments and error checking added -// 1.2 | bellows |25-SEP-13| Changed the format so that the ECID bits are -// | | | broken into two lines. -// 1.1 | bellows |17-SEP-13| Initial version - -//------------------------------------------------------------------------------ -// Includes -//------------------------------------------------------------------------------ -#include <fapi.H> -#include <mss_get_cen_ecid_decode.H> - -using namespace fapi; - -extern "C" { - -//------------------------------------------------------------------------------ -// Function definitions -//------------------------------------------------------------------------------ -// HWP entry point - fapi::ReturnCode mss_get_cen_ecid_decode( - uint8_t & i_ddr_port_status, - uint8_t & i_cache_enable, - uint8_t & i_centaur_sub_revision, - ecid_user_struct & i_user_info, - char * o_display_string - ) - { - // return code - fapi::ReturnCode rc; - - -//void decode_base_code(uint64_t ecid[2], uint8_t ddr_port, uint8_t cache_enable_o, uint8_t centaur_sub_revision_o, uint8_t nwell, uint8_t waterfall_broken, uint8_t user_input, uint8_t psro, uint8_t i_ec) { - //checks the DDR ports and outputs the results - //prints out all of the information - uint32_t t = i_user_info.io_ecid[0]; - ecmdDataBufferBase temp(64); - uint64_t data[2]; - data[0]=i_user_info.io_ecid[0]; - data[1]=i_user_info.io_ecid[1]; - char ecid_char; - uint8_t c; - float chip_version; - char ECID[13]; - for(int i=0;i<13;i++) ECID[i]='\0'; - uint8_t x; - uint8_t y; - char temp_string[200]; - uint32_t rc_num = 0; - - o_display_string[0]='\0'; - - - rc_num |= temp.insert(&t,32,32,0); - t = data[0] >> 32; - rc_num |= temp.insert(&t,0,32,0); - for(uint8_t i=0;i<10;i++) - { - rc_num |= temp.extract(&c,4+i*6,6); - c = c >> 2; - rc = get_ecid_char( c, &ecid_char); - if(rc) - { - FAPI_ERR("get_ecid_char returned with an error"); - return rc; - } - ECID[i]=ecid_char; - } - get_ecid_checksum(ECID); - - //generates the x and y location from the ecid - t = data[1]; - rc_num |= temp.insert(&t,32,32,0); - t = data[1] >> 32; - rc_num |= temp.insert(&t,0,32,0); - rc_num |= temp.extract(&x,0,8); - rc_num |= temp.extract(&y,8,8); - - chip_version=i_user_info.io_ec/0x10; - - if(i_user_info.io_ec < 0x20) - { - if(!i_user_info.o_nwell_misplacement) chip_version = 1.01; - if(!i_user_info.o_bluewaterfall_broken) chip_version=1.10; - } - else { - chip_version=2.00; - } - - if(!(i_user_info.i_user_defined & CSV)) - { - sprintf(temp_string, "ECID(1:64) 0x%016llx\n", static_cast<unsigned long long int>(i_user_info.io_ecid[0])); - strcat(o_display_string, temp_string); - sprintf(temp_string, "ECID(65:128) 0x%016llx\n", static_cast<unsigned long long int>(i_user_info.io_ecid[1])); - strcat(o_display_string, temp_string); - sprintf(temp_string, " Wafer ID: %s\n", ECID); - strcat(o_display_string, temp_string); - sprintf(temp_string, " Chip X/Y loc: x:%d y:%d\n",x,y); - strcat(o_display_string, temp_string); - sprintf(temp_string, " Chip version: DD%.02f\n",chip_version); - strcat(o_display_string, temp_string); - - switch(i_cache_enable) - { - case fapi::ENUM_ATTR_MSS_CACHE_ENABLE_ON: - sprintf(temp_string, " All eDRAMs Halves are good\n"); // Note A is Even, B is Odd - break; - case fapi::ENUM_ATTR_MSS_CACHE_ENABLE_HALF_A: - sprintf(temp_string, " eDRAM Half A is good. eDRAM Half B is bad\n"); - break; - case ENUM_ATTR_MSS_CACHE_ENABLE_HALF_B: - sprintf(temp_string, " eDRAM Half A is bad. eDRAM Half B is good\n"); - break; - case ENUM_ATTR_MSS_CACHE_ENABLE_OFF: - sprintf(temp_string, " All eDRAMs Halves are bad\n"); - break; - case ENUM_ATTR_MSS_CACHE_ENABLE_UNK_ON: - sprintf(temp_string, " All eDRAMs Halves are full unk good\n"); - break; - case ENUM_ATTR_MSS_CACHE_ENABLE_UNK_HALF_A: - sprintf(temp_string, " All eDRAMs A or Even unk good\n"); - break; - case ENUM_ATTR_MSS_CACHE_ENABLE_UNK_HALF_B: - sprintf(temp_string, " All eDRAMs B or odd unk good\n"); - break; - default: - sprintf(temp_string, " All eDRAMs Halves are full unk bad\n"); - break; - } - strcat(o_display_string, temp_string); - - if(i_ddr_port_status == 0) sprintf(temp_string, " All DDR Ports are good\n"); - else if(i_ddr_port_status == 1) sprintf(temp_string, " DDR Port 0/1 is good. DDR Port 2/3 is bad\n"); - else if(i_ddr_port_status == 2) sprintf(temp_string, " DDR Port 0/1 is bad. DDR Port 2/3 is good\n"); - else sprintf(temp_string, " All DDR Ports are bad\n"); // this is informational, so no callouts are made - strcat(o_display_string, temp_string); - - sprintf(temp_string, " PSRO: 0x%02x %f ps\n",i_user_info.o_psro, i_user_info.o_psro*0.025+7.5); - strcat(o_display_string, temp_string); - } - //prints out a CSV - else - { - uint8_t repair,bad_edram_a,bad_edram_b; - uint8_t bad_ddr_port01,bad_ddr_port23; - if(i_cache_enable == fapi::ENUM_ATTR_MSS_CACHE_ENABLE_ON) {repair=1;bad_edram_a=0;bad_edram_b=0; } - else if(i_cache_enable == fapi::ENUM_ATTR_MSS_CACHE_ENABLE_HALF_A) {repair=1;bad_edram_a=0;bad_edram_b=1; } - else if(i_cache_enable == fapi::ENUM_ATTR_MSS_CACHE_ENABLE_HALF_B) {repair=1;bad_edram_a=1;bad_edram_b=0; } - else if(i_cache_enable == fapi::ENUM_ATTR_MSS_CACHE_ENABLE_OFF) {repair=1;bad_edram_a=1;bad_edram_b=1; } -// else if(cache_enable_o == fapi::ENUM_ATTR_MSS_CACHE_ENABLE_UNK_ON) {repair=0;bad_edram_a=0;bad_edram_b=0; } -// else if(cache_enable_o == fapi::ENUM_ATTR_MSS_CACHE_ENABLE_UNK_HALF_A) {repair=0;bad_edram_a=0;bad_edram_b=1; } -// else if(cache_enable_o == fapi::ENUM_ATTR_MSS_CACHE_ENABLE_UNK_HALF_B) {repair=0;bad_edram_a=1;bad_edram_b=0; } - else {repair=0;bad_edram_a=1;bad_edram_b=1; } - - if(i_ddr_port_status == 0) { bad_ddr_port01 = 0 ; bad_ddr_port23 = 0; } - else if(i_ddr_port_status == 1) { bad_ddr_port01 = 0 ; bad_ddr_port23 = 1; } - else if(i_ddr_port_status == 2) { bad_ddr_port01 = 1 ; bad_ddr_port23 = 0; } - else { bad_ddr_port01 = 1 ; bad_ddr_port23 = 1; } - sprintf(o_display_string, "%s,%d,%d,%0.2f,%d,%d,%d,%d,%d,%f ps\n",ECID,x,y,chip_version,repair,bad_edram_a,bad_edram_b,bad_ddr_port01,bad_ddr_port23,((float)i_user_info.o_psro*0.025+7.5)); - } - - if(rc_num) - { - FAPI_ERR("Error occured during databuffer manipulations"); - rc.setEcmdError(rc); - } - - return rc; - } - -//gets the character for the ECID - fapi::ReturnCode get_ecid_char(uint8_t c, char *creturn) - { - //c is a number, so use the offset for a number - if(c < 10) {*creturn = (char)(c+48);} - else {*creturn = (char)(c+55);} - return fapi::FAPI_RC_SUCCESS; - } - -//gets the checksum, the last two characters, in the ecid string - void get_ecid_checksum(char ECID[13]) - { - char rtn[13]; - for(uint32_t i = 0; i < 10; i++) rtn[i] = ECID[i]; - rtn[10]='A'; - rtn[11]='0'; - rtn[12]='\0'; - int sum=0; - for (uint32_t i = 0; i < 12; i++) - { - sum = ((sum * 8) + (rtn[i] - 32)) % 59; - } - if (sum != 0) - { - int adjust = 59 - sum; - rtn[11] += adjust & 7; - adjust >>= 3; - rtn[10] += adjust & 7; - } - for (uint32_t i = 0; i < 13; i++) - { - ECID[i] = rtn[i]; - } - } - - - - -} // extern "C" diff --git a/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid_decode.H b/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid_decode.H deleted file mode 100644 index 86edee48f..000000000 --- a/src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid_decode.H +++ /dev/null @@ -1,109 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/hwpf/hwp/dmi_training/mss_getecid/mss_get_cen_ecid_decode.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* 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. */ -/* 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: mss_get_cen_ecid_decode.H,v 1.4 2014/02/19 13:41:32 bellows Exp $ -//------------------------------------------------------------------------------ -// *| -// *! (C) Copyright International Business Machines Corp. 2013 -// *! All Rights Reserved -- Property of IBM -// *! *** *** -// *| -// *! TITLE : mss_get_cen_ecid_decode.H -// *! DESCRIPTION : Decode the ECID into a string -// *! -// *! OWNER NAME : Mark Bellows Email: bellows@us.ibm.com -// *! Copied From : Joe McGill's proc_cleanup code -// *! -// *! ADDITIONAL COMMENTS: -// *! -// *! -//------------------------------------------------------------------------------ -// CHANGE HISTORY: -//------------------------------------------------------------------------------ -// Version:| Author: | Date: | Comment: -//---------|----------|---------|----------------------------------------------- -// 1.4 | bellows |19-FEB-14| RAS Review Updates -// 1.3 | bellows |02-OCT-13| Minor Review Comments addressed -// 1.2 | bellows |24-SEP-13| Fixed typo -// 1.1 | bellows |17-SEP-13| Original Program - -#ifndef _MSS_GET_CEN_ECID_DECODE_H_ -#define _MSS_GET_CEN_ECID_DECODE_H_ - -//------------------------------------------------------------------------------ -// Includes -//------------------------------------------------------------------------------ - -#include <fapi.H> -#include <mss_get_cen_ecid.H> - - - -// function pointer typedef definition for HWP call support -typedef fapi::ReturnCode -(*mss_get_cen_ecid_decode_FP_t)(uint8_t & i_ddr_port_status, uint8_t & i_cache_enable, uint8_t & i_centaur_sub_revision, ecid_user_struct & i_user_data, char *o_display_string - ); - -const int MSS_GET_CEN_ECID_DECODE_STRING_LENGTH=1000; - -//void decode_base_code(uint64_t ecid[2], uint8_t ddr_port, uint8_t cache_enable_o, uint8_t centaur_sub_revision_o, uint8_t o_nwell_misplacement, uint8_t o_bluewaterfall_broken, uint8_t user_defined, uint8_t psro, uint8_t i_ec ); -//ReturnCode get_ecid_char(uint8_t c, char *creturn); -//void get_ecid_checksum(char ECID[12]); - -enum user_flags { - USER_INPUT_ECID = 1, - CSV = 2, - COMMENT = 4, -}; - -//------------------------------------------------------------------------------ -// Function prototypes -//------------------------------------------------------------------------------ - -extern "C" -{ - -// function: FAPI mss_get_cen_ecid_decode HWP entry point -// parameters: -// &o_ddr_port_status => indicates if the MBA's are bad, with MBA 1 being the rightmost bit and MBA 0 being the next to right most bit -// &o_cache_enable => what it would have set the cache enable attribute to if it sets attributes -// &o_centaur_sub_revision => the sub revision indicator between DD1.0 and DD1.01 -// &o_user_data => holder for additional information for printing -// &o_display_string -> output string- max of MSS_GET_CEN_ECID_DECODE_STRING_LENGTH length -// returns: FAPI_RC_SUCCESS if FBC stop is deasserted at end of execution -// else FAPI return code for failing operation - fapi::ReturnCode mss_get_cen_ecid_decode( - uint8_t & i_ddr_port_status, - uint8_t & i_cache_enable, - uint8_t & i_centaur_sub_revision, - ecid_user_struct & i_user_data, - char * o_display_string - - ); - fapi::ReturnCode get_ecid_char(uint8_t c, char *creturn); // print helping function - void get_ecid_checksum(char ECID[13]); - -} // extern "C" - -#endif // _MSS_GET_CEN_ECID_DECODE_H_ |

