diff options
author | Brent Wieman <bwieman@us.ibm.com> | 2016-05-18 14:37:56 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-08-10 09:26:18 -0400 |
commit | 84bd222f9d541e53ec9f5876366c6f09dd260a58 (patch) | |
tree | c421e1f4602a632698d8ca0bcf3cdafe2b19366d /src/import/chips/centaur/common | |
parent | 90d2d0fe52ca6f3b61056e7b239da696713eaec1 (diff) | |
download | talos-hostboot-84bd222f9d541e53ec9f5876366c6f09dd260a58.tar.gz talos-hostboot-84bd222f9d541e53ec9f5876366c6f09dd260a58.zip |
added for hb/fw/cronus/dump support
Change-Id: Ie0463fec62b33bf576c951e1badcaad2554a37b6
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24742
Reviewed-by: Brent Wieman <bwieman@us.ibm.com>
Dev-Ready: Brent Wieman <bwieman@us.ibm.com>
Tested-by: Jenkins Server
Reviewed-by: Jen-Yeu T. Chen <jenyeu@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Reviewed-by: Brian R. Silver <bsilver@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44447
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: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/centaur/common')
-rw-r--r-- | src/import/chips/centaur/common/scominfo/centaur_scominfo.C | 219 | ||||
-rw-r--r-- | src/import/chips/centaur/common/scominfo/centaur_scominfo.H | 81 |
2 files changed, 300 insertions, 0 deletions
diff --git a/src/import/chips/centaur/common/scominfo/centaur_scominfo.C b/src/import/chips/centaur/common/scominfo/centaur_scominfo.C new file mode 100644 index 000000000..3f7c23dc6 --- /dev/null +++ b/src/import/chips/centaur/common/scominfo/centaur_scominfo.C @@ -0,0 +1,219 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/centaur/common/scominfo/centaur_scominfo.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* [+] 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 */ +/// +/// @file centaur_scominfo.C +/// @brief Centaur chip unit SCOM address platform translation code +/// +/// HWP HWP Owner: unknown +/// HWP FW Owner: dcrowell@us.ibm.com +/// HWP Team: Infrastructure +/// HWP Level: 1 +/// HWP Consumed by: FSP/HB +/// + +#include "centaur_scominfo.H" + +#define centaur_scominfo_C + +/* @brief Defines all the bus types we support */ + +extern "C" +{ + + uint64_t centaur_scominfo_createChipUnitScomAddr(centaurChipUnits_t i_CentaurCU, uint8_t i_ChipUnitNum, + uint64_t i_scomAddr, uint32_t i_mode) + { + uint64_t o_scomAddr = i_scomAddr;//default it to pass back the addr that was entered + + if ((o_scomAddr & 0xFFFFFFFFFFFFFC00ull) == 0x03010400) + { + if ((o_scomAddr & 0x000003FF) <= 0x0000007f) + { + o_scomAddr &= 0x000003FF; + + if (i_ChipUnitNum == 0) + { + o_scomAddr |= 0x03010400; + } + else if (i_ChipUnitNum == 1) + { + o_scomAddr |= 0x03010C00; + } + } + else if ( ((o_scomAddr & 0x000003FF) >= 0x00000200) && ((o_scomAddr & 0x000003FF) <= 0x000002FF)) + { + o_scomAddr &= 0x000003FF; + + if (i_ChipUnitNum == 0) + { + o_scomAddr |= 0x03010400; + } + else if (i_ChipUnitNum == 1) + { + o_scomAddr |= 0x03010C00; + } + } + } + else if ((o_scomAddr & 0xFFFFFFFFFFFFFC00ull) == 0x03011400) + { + o_scomAddr &= 0x000003FF; + + if (i_ChipUnitNum == 0) + { + o_scomAddr |= 0x03011400; + } + else if (i_ChipUnitNum == 1) + { + o_scomAddr |= 0x03011800; + } + } + else if ((o_scomAddr & 0xFFF00000FFFFFFFFull) == 0x800000000301143Full) + { + o_scomAddr &= 0x000FFFFFF00000000ull; + + if (i_ChipUnitNum == 0) + { + o_scomAddr |= 0x800000000301143Full; + } + else if (i_ChipUnitNum == 1) + { + o_scomAddr |= 0x800000000301183Full; + } + } + else if ((o_scomAddr & 0xFFF00000FFFFFFFFull) == 0x800000000701143Full) + { + o_scomAddr &= 0x000FFFFFF00000000ull; + + if (i_ChipUnitNum == 0) + { + o_scomAddr |= 0x800000000701143Full; + } + else if (i_ChipUnitNum == 1) + { + o_scomAddr |= 0x800000000701183Full; + } + } + + return o_scomAddr; + } + + + + uint32_t centaur_scominfo_isChipUnitScom(uint64_t i_scomAddr, bool& o_chipUnitRelated, + std::vector<centaur_chipUnitPairing_t>& o_chipUnitPairing, uint32_t i_mode) + { + uint32_t rc = 0; + o_chipUnitRelated = false; + + centaur_chipUnitPairing_t l_singleChipUnitPairing; + + /* got this info from ekb centaur/working/ec_ind/centuar.chipunit.scominfo */ + if ((i_scomAddr & 0xFFFFFFFFFFFFFC00ull) == 0x03010400) + { + if ( ((i_scomAddr & 0x000003FF) <= 0x0000007F) || + (((i_scomAddr & 0x000003FF) >= 0x00000200) && ((i_scomAddr & 0x000003FF) <= 0x000002FF)) ) + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 0; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + } + else if ((i_scomAddr & 0xFFFFFFFFFFFFFC00ull) == 0x03010C00) + { + if ( ((i_scomAddr & 0x000003FF) <= 0x0000007F) || + (((i_scomAddr & 0x000003FF) >= 0x00000200) && ((i_scomAddr & 0x000003FF) <= 0x000002FF)) ) + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 1; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + } + else if ((i_scomAddr & 0xFFFFFFFFFFFFFC00ull) == 0x03011400) + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 0; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + else if ((i_scomAddr & 0xFFFFFFFFFFFFFC00ull) == 0x03011800) + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 1; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + else if ((i_scomAddr & 0xFFFFFFFFFFFFFFC0ull) == 0x03010880) // trace for MBA01 + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 0; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + else if ((i_scomAddr & 0xFFFFFFFFFFFFFFC0ull) == 0x030110C0) // trace for MBA23 + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 1; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + else if ((i_scomAddr & 0xFFF00000FFFFFFFFull) == 0x800000000301143Full) + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 0; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + else if ((i_scomAddr & 0xFFF00000FFFFFFFFull) == 0x800000000301183Full) + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 1; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + else if ((i_scomAddr & 0xFFF00000FFFFFFFFull) == 0x800000000701143Full) + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 0; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + else if ((i_scomAddr & 0xFFF00000FFFFFFFFull) == 0x800000000701183Full) + { + o_chipUnitRelated = true; + l_singleChipUnitPairing.chipUnitType = MBA_CHIPUNIT; + l_singleChipUnitPairing.chipUnitNum = 1; + o_chipUnitPairing.push_back(l_singleChipUnitPairing); + } + + return rc; + } + + +} // extern "C" + +#undef centaur_scominfo_C + diff --git a/src/import/chips/centaur/common/scominfo/centaur_scominfo.H b/src/import/chips/centaur/common/scominfo/centaur_scominfo.H new file mode 100644 index 000000000..c9d1981d1 --- /dev/null +++ b/src/import/chips/centaur/common/scominfo/centaur_scominfo.H @@ -0,0 +1,81 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/centaur/common/scominfo/centaur_scominfo.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2015,2017 */ +/* [+] 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 */ +/// +/// @file centaur_scominfo.H +/// @brief Centaur chip unit SCOM address platform translation code +/// +/// HWP HWP Owner: unknown +/// HWP FW Owner: dcrowell@us.ibm.com +/// HWP Team: Infrastructure +/// HWP Level: 1 +/// HWP Consumed by: FSP/HB +/// + +#ifndef centaur_scominfo_h +#define centaur_scominfo_h + +#include <iostream> +#include <vector> +#include <stdint.h> + +extern "C" { + typedef enum + { + CENTAUR_CHIP = 0, //Included as we might need this for future expansion + MBA_CHIPUNIT = 1 + } centaurChipUnits_t; + + struct centaur_chipUnitPairing_t + { + centaurChipUnits_t chipUnitType; + uint32_t chipUnitNum; + }; + + + /** + @brief creates the actual scom addr based on the chipunit, chipUnitNum, and chipUnit Zero's scom addr + @param i_CentaurCU enumeration of the ChipUnit + @param i_ChipUnitNum number of the chipUnit + @param i_scomAddr the scom addr of chipUnit zero + @param i_mode, used for special purposes, default to 0 + @retval uint64_t actual scom addr for the chipUnit/chipUnitNum passed in + */ + uint64_t centaur_scominfo_createChipUnitScomAddr(centaurChipUnits_t i_CentaurCU, uint8_t i_ChipUnitNum, + uint64_t i_scomAddr, uint32_t i_mode = 0); + + /** + @brief determines if the scom address correlates to a chipUnit, if so create a list of chipUnits and their number + @param i_scomAddr scom address that we want to test + @param o_chipUnitRelated, bool returns true if scom addr is a chipUnit Addr + @param o_chipUnitPairing, list of the enum of chipUnitPairings + @param i_mode, used for special purposes, default to 0 + @retval uint32_t return non-zero for error + */ + uint32_t centaur_scominfo_isChipUnitScom(uint64_t i_scomAddr, bool& o_chipUnitRelated, + std::vector<centaur_chipUnitPairing_t>& o_chipUnitPairing, uint32_t i_mode = 0); + +} + +#endif /* centaur_scominfo_h */ |