summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2016-10-26 09:59:28 -0500
committerZane C. Shelley <zshelle@us.ibm.com>2016-11-07 15:03:35 -0500
commit5ada2e09331fb9221bf02aa41b0a5482a0b7fa07 (patch)
treeb660be005c16b749d0797546abc0c3f894e251e6
parentee5c4cb46daccc67092aec3c867f45f8e3be69a8 (diff)
downloadblackbird-hostboot-5ada2e09331fb9221bf02aa41b0a5482a0b7fa07.tar.gz
blackbird-hostboot-5ada2e09331fb9221bf02aa41b0a5482a0b7fa07.zip
PRD: Defined interfaces for markstore read/write
Change-Id: I90421b43da36654e02a9b7dc28700bc0ecebc1ab RTC: 163594 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31847 Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com> Reviewed-by: Benjamin J. Weisenbeck <bweisenb@us.ibm.com> Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32245
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemMark.C342
-rw-r--r--src/usr/diag/prdf/plat/mem/prdfMemMark.H152
-rw-r--r--src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk5
3 files changed, 498 insertions, 1 deletions
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemMark.C b/src/usr/diag/prdf/plat/mem/prdfMemMark.C
new file mode 100644
index 000000000..3b685dbf2
--- /dev/null
+++ b/src/usr/diag/prdf/plat/mem/prdfMemMark.C
@@ -0,0 +1,342 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfMemMark.C $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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 */
+
+#include <prdfMemMark.H>
+
+#include <prdfTrace.H>
+
+using namespace TARGETING;
+
+namespace PRDF
+{
+
+using namespace PlatServices;
+
+namespace MarkStore
+{
+
+//##############################################################################
+// Utilities to read/write markstore (MCA)
+//##############################################################################
+
+// TODO: RTC 163595
+// - We have the ability to set chip marks via the FWMSx registers, but there
+// are only eight repairs total that we can use in the FWMSx registers.
+// Therefore we will always use the HWMSx registers for the chip marks on
+// master ranks and use the FWMSx registers for other repairs.
+// - Also, we have the ability in the FWMSx registers to scale the range of
+// where the chip/symbol marks are placed (i.e. slave ranks, banks, etc.).
+// However, we are still limited to 8 repairs and the complication of
+// managing the repairs dynamically to ensure we can place as many repairs as
+// possible is more work than what we want to deal with at this time.
+// Therefore, we will only use the FWMSx registers to place a single symbol
+// mark per master rank. This matches the P8 behavior. This could be improved
+// upon later if we have the time, but doubtful.
+// - Summary:
+// - Chip marks will use HWMS0-7 registers (0x07010AD0-0x07010AD7).
+// - Symbol marks will use FWMS0-7 registers (0x07010AD8-0x07010ADF).
+// - Each register maps to master ranks 0-7.
+
+template<>
+uint32_t readChipMark<TYPE_MCA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank, MemMark & o_mark )
+{
+ #define PRDF_FUNC "[readChipMark<TYPE_MCA>] "
+
+ uint32_t o_rc = SUCCESS;
+
+ o_mark = MemMark(); // ensure invalid
+
+ // TODO: RTC 163595
+ // - HWMSx[0:7] contains the Galois field.
+ // - If the Galois field is zero, do nothing and use the default contructor
+ // for o_mark.
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t writeChipMark<TYPE_MCA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank,
+ const MemMark & i_mark )
+{
+ #define PRDF_FUNC "[writeChipMark<TYPE_MCA>] "
+
+ PRDF_ASSERT( i_mark.isValid() );
+
+ uint32_t o_rc = SUCCESS;
+
+ // TODO: RTC 163595
+ // - HWMSx[0:7] set this to the Galois field.
+ // - HWMSx[8] confirmed with the hardware team that this will not trigger
+ // another MPE attention and that they want this set to 1.
+ // - HWMSx[9] set to 1 to enable exit 1 for markstore reads. This is a
+ // performance improvement because we know the DRAM is bad.
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t clearChipMark<TYPE_MCA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank )
+{
+ #define PRDF_FUNC "[clearChipMark<TYPE_MCA>] "
+
+ uint32_t o_rc = SUCCESS;
+
+ // TODO: RTC 163595
+ // - Clear the entire HWMSx register.
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t readSymbolMark<TYPE_MCA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank, MemMark & o_mark )
+{
+ #define PRDF_FUNC "[readSymbolMark<TYPE_MCA>] "
+
+ uint32_t o_rc = SUCCESS;
+
+ o_mark = MemMark(); // ensure invalid
+
+ // TODO: RTC 163595
+ // - FWMSx[0:7] contains the Galois field.
+ // - If the Galois field is zero:
+ // - Do nothing and use the default contructor for o_mark.
+ // - Otherwise, check the other fields for accurancy (assert on failure):
+ // - FWMSx[8] should be 1 to indicate a symbol mark.
+ // - FWMSx[9:11] should be 0b101 to indicate master rank.
+ // - FWMSx[12:14] is the master rank and should match the register
+ // number.
+ // - FWMSx[15:22] should be all zeros
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t writeSymbolMark<TYPE_MCA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank,
+ const MemMark & i_mark )
+{
+ #define PRDF_FUNC "[writeSymbolMark<TYPE_MCA>] "
+
+ PRDF_ASSERT( i_mark.isValid() );
+
+ uint32_t o_rc = SUCCESS;
+
+ // TODO: RTC 163595
+ // - FWMSx[0:7] set this to the Galois field.
+ // - FWMSx[8] set to 1 to indicate a symbol mark.
+ // - FWMSx[9:11] set to 0b101 to indicate master rank.
+ // - FWMSx[12:14] set this to the master rank which should match the
+ // register number.
+ // - FWMSx[15:22] set to all zeros
+ // - FWMSx[23] set to 1 to enable exit 1 for markstore reads. This is a
+ // performance improvement because we know the symbol is bad.
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t clearSymbolMark<TYPE_MCA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank )
+{
+ #define PRDF_FUNC "[clearSymbolMark<TYPE_MCA>] "
+
+ uint32_t o_rc = SUCCESS;
+
+ // TODO: RTC 163595
+ // - Clear the entire FWMSx register.
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//##############################################################################
+// Utilities to read/write markstore (MBA)
+//##############################################################################
+
+template<>
+uint32_t readChipMark<TYPE_MBA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank, MemMark & o_mark )
+{
+ #define PRDF_FUNC "[readChipMark<TYPE_MBA>] "
+
+ uint32_t o_rc = SUCCESS;
+
+ o_mark = MemMark(); // ensure invalid
+
+ // TODO: RTC 157888
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t writeChipMark<TYPE_MBA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank,
+ const MemMark & i_mark )
+{
+ #define PRDF_FUNC "[writeChipMark<TYPE_MBA>] "
+
+ PRDF_ASSERT( i_mark.isValid() );
+
+ uint32_t o_rc = SUCCESS;
+
+ // TODO: RTC 157888
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t clearChipMark<TYPE_MBA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank )
+{
+ #define PRDF_FUNC "[clearChipMark<TYPE_MBA>] "
+
+ uint32_t o_rc = SUCCESS;
+
+ // TODO: RTC 157888
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t readSymbolMark<TYPE_MBA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank, MemMark & o_mark )
+{
+ #define PRDF_FUNC "[readSymbolMark<TYPE_MBA>] "
+
+ uint32_t o_rc = SUCCESS;
+
+ o_mark = MemMark(); // ensure invalid
+
+ // TODO: RTC 157888
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t writeSymbolMark<TYPE_MBA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank,
+ const MemMark & i_mark )
+{
+ #define PRDF_FUNC "[writeSymbolMark<TYPE_MBA>] "
+
+ PRDF_ASSERT( i_mark.isValid() );
+
+ uint32_t o_rc = SUCCESS;
+
+ // TODO: RTC 157888
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+template<>
+uint32_t clearSymbolMark<TYPE_MBA>( ExtensibleChip * i_chip,
+ const MemRank & i_rank )
+{
+ #define PRDF_FUNC "[clearSymbolMark<TYPE_MBA>] "
+
+ uint32_t o_rc = SUCCESS;
+
+ // TODO: RTC 157888
+
+ PRDF_ERR( PRDF_FUNC "function not implemented yet" );
+
+ return o_rc;
+
+ #undef PRDF_FUNC
+}
+
+//------------------------------------------------------------------------------
+
+} // end namespace MarkStore
+
+} // end namespace PRDF
+
diff --git a/src/usr/diag/prdf/plat/mem/prdfMemMark.H b/src/usr/diag/prdf/plat/mem/prdfMemMark.H
new file mode 100644
index 000000000..de8e5c33b
--- /dev/null
+++ b/src/usr/diag/prdf/plat/mem/prdfMemMark.H
@@ -0,0 +1,152 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/prdf/plat/mem/prdfMemMark.H $ */
+/* */
+/* OpenPOWER HostBoot Project */
+/* */
+/* Contributors Listed Below - COPYRIGHT 2016 */
+/* [+] 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 */
+
+#ifndef __prdfMemMark_H
+#define __prdfMemMark_H
+
+#include <prdfExtensibleChip.H>
+#include <prdfMemAddress.H>
+#include <prdfMemSymbol.H>
+#include <prdfPlatServices.H>
+
+//##############################################################################
+// class MemMark
+//##############################################################################
+
+namespace PRDF
+{
+
+/** @brief Container for a memory mark (chip or symbol). */
+class MemMark
+{
+ public: // constructor
+
+ /** Default constructor. */
+ MemMark() = default;
+
+ /**
+ * @brief Constructor from components.
+ * @param i_trgt MBA or MCA target.
+ * @param i_rank The rank this mark is on.
+ * @param i_galois The Galois field.
+ */
+ MemMark( TARGETING::TargetHandle_t i_trgt, const MemRank & i_rank,
+ uint8_t i_galois ) :
+ iv_galois( i_galois ),
+ iv_symbol( MemSymbol::fromGalois(i_trgt, i_rank, i_galois) )
+ {}
+
+ public: // functions
+
+ /** @return The Galois field representing this mark. */
+ uint8_t getGalois() const { return iv_galois; }
+
+ /** @return The symbol representing this mark. */
+ MemSymbol getSymbol() const { return iv_symbol; }
+
+ /** @return The symbol representing this mark. */
+ bool isValid() const { return iv_symbol.isValid(); }
+
+ private: // instance variables
+
+ uint8_t iv_galois; ///< Galois field representing any symbol on this mark.
+ MemSymbol iv_symbol; ///< Any symbol on this mark.
+};
+
+//##############################################################################
+// Utilities to read/write markstore
+//##############################################################################
+
+namespace MarkStore
+{
+
+/**
+ * @brief Reads markstore and returns the chip mark for the given rank.
+ * @param i_chip MBA or MCA chip.
+ * @param i_rank Target rank.
+ * @param o_mark The returned chip mark.
+ * @return Non-SUCCESS if an internal function fails. SUCCESS otherwise.
+ */
+template<TARGETING::TYPE T>
+uint32_t readChipMark( ExtensibleChip * i_chip, const MemRank & i_rank,
+ MemMark & o_mark );
+
+/**
+ * @brief Writes a chip mark into markstore for the given rank.
+ * @param i_chip MBA or MCA chip.
+ * @param i_rank Target rank.
+ * @param i_mark Target chip mark.
+ * @return Non-SUCCESS if an internal function fails. SUCCESS otherwise.
+ */
+template<TARGETING::TYPE T>
+uint32_t writeChipMark( ExtensibleChip * i_chip, const MemRank & i_rank,
+ const MemMark & i_mark );
+
+/**
+ * @brief Clear chip mark in markstore for the given rank.
+ * @param i_chip MBA or MCA chip.
+ * @param i_rank Target rank.
+ * @return Non-SUCCESS if an internal function fails. SUCCESS otherwise.
+ */
+template<TARGETING::TYPE T>
+uint32_t clearChipMark( ExtensibleChip * i_chip, const MemRank & i_rank );
+
+/**
+ * @brief Reads markstore and returns the symbol mark for the given rank.
+ * @param i_chip MBA or MCA chip.
+ * @param i_rank Target rank.
+ * @param o_mark The returned symbol mark.
+ * @return Non-SUCCESS if an internal function fails. SUCCESS otherwise.
+ */
+template<TARGETING::TYPE T>
+uint32_t readSymbolMark( ExtensibleChip * i_chip, const MemRank & i_rank,
+ MemMark & o_mark );
+
+/**
+ * @brief Writes a symbol mark into markstore for the given rank.
+ * @param i_chip MBA or MCA chip.
+ * @param i_rank Target rank.
+ * @param i_mark Target symbol mark.
+ * @return Non-SUCCESS if an internal function fails. SUCCESS otherwise.
+ */
+template<TARGETING::TYPE T>
+uint32_t writeSymbolMark( ExtensibleChip * i_chip, const MemRank & i_rank,
+ const MemMark & i_mark );
+
+/**
+ * @brief Clear symbol mark in markstore for the given rank.
+ * @param i_chip MBA or MCA chip.
+ * @param i_rank Target rank.
+ * @return Non-SUCCESS if an internal function fails. SUCCESS otherwise.
+ */
+template<TARGETING::TYPE T>
+uint32_t clearSymbolMark( ExtensibleChip * i_chip, const MemRank & i_rank );
+
+} // end namespace MarkStore
+
+} // end namespace PRDF
+
+#endif // __prdfMemMark_H
+
diff --git a/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk b/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
index 88bd84fdc..89198b76f 100644
--- a/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
+++ b/src/usr/diag/prdf/plat/mem/prdf_plat_mem_hb_only.mk
@@ -37,6 +37,10 @@ prd_incpath += ${PRD_SRC_PATH}/plat/mem
# Hostboot only object files common to both IPL and runtime
################################################################################
+# plat/mem/ (non-rule plugin related)
+prd_obj += prdfMemMark.o
+prd_obj += prdfMemScrubUtils.o
+
# plat/mem/ (rule plugin related)
prd_rule_plugin += prdfP9Mca.o
prd_rule_plugin += prdfP9Mcbist.o
@@ -48,7 +52,6 @@ prd_rule_plugin += prdfP9Mcbist.o
ifneq (${HOSTBOOT_RUNTIME},1)
# plat/mem/ (non-rule plugin related)
-prd_obj += prdfMemScrubUtils.o
prd_obj += prdfMemTdCtlr_ipl.o
prd_obj += prdfMemTps_ipl.o
prd_obj += prdfMemVcm_ipl.o
OpenPOWER on IntegriCloud