From 84bd222f9d541e53ec9f5876366c6f09dd260a58 Mon Sep 17 00:00:00 2001 From: Brent Wieman Date: Wed, 18 May 2016 14:37:56 -0500 Subject: added for hb/fw/cronus/dump support Change-Id: Ie0463fec62b33bf576c951e1badcaad2554a37b6 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24742 Reviewed-by: Brent Wieman Dev-Ready: Brent Wieman Tested-by: Jenkins Server Reviewed-by: Jen-Yeu T. Chen Reviewed-by: Christian R. Geddes Reviewed-by: Brian R. Silver Reviewed-by: Jennifer A. Stofer Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44447 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- .../centaur/common/scominfo/centaur_scominfo.C | 219 +++++++++++++++++++++ .../centaur/common/scominfo/centaur_scominfo.H | 81 ++++++++ 2 files changed, 300 insertions(+) create mode 100644 src/import/chips/centaur/common/scominfo/centaur_scominfo.C create mode 100644 src/import/chips/centaur/common/scominfo/centaur_scominfo.H (limited to 'src/import/chips/centaur/common') 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& 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 +#include +#include + +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& o_chipUnitPairing, uint32_t i_mode = 0); + +} + +#endif /* centaur_scominfo_h */ -- cgit v1.2.1