summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2014-04-17 14:27:33 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-06-02 12:13:33 -0500
commite3a418419bd7fcf34bed25113111f06ec86ab9bb (patch)
treeaf54d96cbd17415982928ade5efd0ccd9ae57240 /src/usr/hwpf
parenta8e490184f0f436d8fa1e175c7f9d7368923340b (diff)
downloadtalos-hostboot-e3a418419bd7fcf34bed25113111f06ec86ab9bb.tar.gz
talos-hostboot-e3a418419bd7fcf34bed25113111f06ec86ab9bb.zip
Hostboot memory mirroring support
Change-Id: I20a5de367b33c657abdc5c6aef29cecab940a8ca RTC: 102529 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/10641 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf')
-rw-r--r--src/usr/hwpf/hwp/core_activate/core_activate.C10
-rw-r--r--src/usr/hwpf/hwp/dram_initialization/dram_initialization.C197
-rw-r--r--src/usr/hwpf/hwp/dram_initialization/proc_setup_bars/mss_setup_bars.C31
-rw-r--r--src/usr/hwpf/hwp/mc_config/mc_config.C22
4 files changed, 201 insertions, 59 deletions
diff --git a/src/usr/hwpf/hwp/core_activate/core_activate.C b/src/usr/hwpf/hwp/core_activate/core_activate.C
index 40e0758c5..f728954fc 100644
--- a/src/usr/hwpf/hwp/core_activate/core_activate.C
+++ b/src/usr/hwpf/hwp/core_activate/core_activate.C
@@ -779,16 +779,6 @@ void* call_host_ipl_complete( void *io_pArgs )
} // endfor
-
- //If Sapphire Payload need to set payload base to zero
- if (is_sapphire_load())
- {
- TARGETING::Target* sys = NULL;
- TARGETING::targetService().getTopLevelTarget(sys);
- assert( sys != NULL );
- sys->setAttr<ATTR_PAYLOAD_BASE>(0x0);
- }
-
// Sync attributes to Fsp
l_err = syncAllAttributesToFsp();
diff --git a/src/usr/hwpf/hwp/dram_initialization/dram_initialization.C b/src/usr/hwpf/hwp/dram_initialization/dram_initialization.C
index 557de278e..7d5f77d14 100644
--- a/src/usr/hwpf/hwp/dram_initialization/dram_initialization.C
+++ b/src/usr/hwpf/hwp/dram_initialization/dram_initialization.C
@@ -743,54 +743,179 @@ void* call_proc_exit_cache_contained( void *io_pArgs )
// set up loops to go through all targets (if parallel, spin off a task)
// extend the memory space from 8MEG to 32Meg
- // call the HWP with each fapi::Target
- FAPI_INVOKE_HWP( l_errl,
- proc_exit_cache_contained
- );
- if ( l_errl )
+ //if mirrored then check that there is going to be memory at that location.
+ //For sapphire with mirrored location flipped and at zero,
+ //this also insures there is memory available to 'exit_cache' to.
+ //Also set ATTR_PAYLOAD_BASE here.
+ TARGETING::Target* l_sys = NULL;
+ targetService().getTopLevelTarget(l_sys);
+ assert( l_sys != NULL );
+
+ uint8_t l_mpipl = l_sys->getAttr<ATTR_IS_MPIPL_HB>();
+ ATTR_PAYLOAD_BASE_type payloadBase = 0;
+
+ if(!l_mpipl)
{
- TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
- "ERROR : call_proc_exit_cache_contained, errorlog PLID=0x%x",
- l_errl->plid() );
+ ATTR_PAYLOAD_IN_MIRROR_MEM_type l_mirrored = false;
+
+ // In Sapphire mode disable mirroring for now - @todo-RTC:108314
+ // and force payload to zero
+ if(!is_sapphire_load())
+ {
+ payloadBase = l_sys->getAttr<ATTR_PAYLOAD_BASE>();
+ l_mirrored = l_sys->getAttr<ATTR_PAYLOAD_IN_MIRROR_MEM>();
+ }
+
+ if(l_mirrored)
+ {
+ ATTR_MIRROR_BASE_ADDRESS_type l_mirrorBaseAddr = 0;
+ if(!is_sapphire_load())
+ {
+ l_mirrorBaseAddr = l_sys->getAttr<ATTR_MIRROR_BASE_ADDRESS>();
+ }
+
+ // Verify there is memory at the mirrored location
+ bool mirroredMemExists = false;
+ TARGETING::TargetHandleList l_procList;
+ getAllChips(l_procList, TYPE_PROC);
+
+ for (TargetHandleList::const_iterator proc = l_procList.begin();
+ proc != l_procList.end() && !mirroredMemExists;
+ ++proc)
+ {
+ uint64_t mirrorBase[4];
+ uint64_t mirrorSize[4];
+ bool rc = (*proc)->
+ tryGetAttr<TARGETING::ATTR_PROC_MIRROR_BASES>(mirrorBase);
+ if(false == rc)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Failed to get ATTR_PROC_MIRROR_BASES");
+ assert(0);
+ }
+
+ rc = (*proc)->
+ tryGetAttr<TARGETING::ATTR_PROC_MIRROR_SIZES>(mirrorSize);
+ if(false == rc)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Failed to get ATTR_PROC_MIRROR_SIZES");
+ assert(0);
+ }
+
+ for(uint64_t i = 0; i < 4 && !mirroredMemExists; ++i)
+ {
+ if(mirrorSize[i] != 0 &&
+ l_mirrorBaseAddr >= mirrorBase[i] &&
+ l_mirrorBaseAddr < (mirrorBase[i] + mirrorSize[i]))
+ {
+ mirroredMemExists = true;
+ }
+ }
+ }
+
+ if (mirroredMemExists)
+ {
+ // ATTR_PAYLOAD_BASE is in MB
+ payloadBase += l_mirrorBaseAddr/MEGABYTE;
+ }
+ else
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace, ERR_MRK
+ "Request to load payload into mirrored memory,"
+ " but no memory exists at address 0x%016lx",
+ l_mirrorBaseAddr);
+
+ /*@
+ * @errortype ERRL_SEV_CRITICAL_SYS_TERM
+ * @moduleid fapi::MOD_EXIT_CACHE_CONTAINED,
+ * @reasoncode fapi::RC_NO_MIRRORED_MEMORY,
+ * @userdata1 Mirrored Memory Address
+ * @userdata2 0
+ *
+ * @devdesc Request given to load payload into mirrored
+ * memory, but no mirrored memory exists at
+ * that location.
+ */
+ l_errl = new ERRORLOG::ErrlEntry
+ (
+ ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM,
+ fapi::MOD_EXIT_CACHE_CONTAINED,
+ fapi::RC_NO_MIRRORED_MEMORY,
+ l_mirrorBaseAddr,
+ 0,
+ true); // callout firmware
+ }
+ }
}
- // no errors so extend VMM.
- else
+
+ if(!l_errl)
{
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "SUCCESS : call_proc_exit_cache_contained" );
+ if(!l_mpipl)
+ {
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "Payload base address is 0x%016lx",
+ payloadBase * MEGABYTE);
+ l_sys->setAttr<ATTR_PAYLOAD_BASE>(payloadBase);
+ }
+ // call the HWP with each fapi::Target
+ FAPI_INVOKE_HWP( l_errl,
+ proc_exit_cache_contained
+ );
- // Call the function to extend VMM to 32MEG
- int rc = mm_extend();
- if (rc!=0)
- {
- /*@
- * @errortype
- * @moduleid fapi::MOD_EXIT_CACHE_CONTAINED
- * @reasoncode fapi::RC_MM_EXTEND_FAILED
- * @userdata1 rc from mm_extend
- * @userdata2 <UNUSED>
- *
- * @devdesc Failure extending memory to 32MEG after
- * exiting cache contained mode.
- */
- l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
- fapi::MOD_EXIT_CACHE_CONTAINED,
- fapi::RC_MM_EXTEND_FAILED,
- rc,
- 0);
+ if ( l_errl )
+ {
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
- "ERROR : call_proc_exit_cache_contained - extendVMM, rc=0x%x",
- rc );
+ "ERROR : call_proc_exit_cache_contained, "
+ "errorlog PLID=0x%x",
+ l_errl->plid() );
}
+ // no errors so extend VMM.
else
{
- // trace out the extend VMM was successful
- TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
- "SUCCESS : call_proc_exit_cache_contained - extendVMM");
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "SUCCESS : call_proc_exit_cache_contained" );
+
+
+
+ // Call the function to extend VMM to 32MEG
+ int rc = mm_extend();
+
+ if (rc!=0)
+ {
+ /*@
+ * @errortype
+ * @moduleid fapi::MOD_EXIT_CACHE_CONTAINED
+ * @reasoncode fapi::RC_MM_EXTEND_FAILED
+ * @userdata1 rc from mm_extend
+ * @userdata2 <UNUSED>
+ *
+ * @devdesc Failure extending memory to 32MEG after
+ * exiting cache contained mode.
+ */
+ l_errl = new ERRORLOG::ErrlEntry
+ (ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ fapi::MOD_EXIT_CACHE_CONTAINED,
+ fapi::RC_MM_EXTEND_FAILED,
+ rc,
+ 0);
+
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "ERROR : call_proc_exit_cache_contained"
+ " - extendVMM, rc=0x%x",
+ rc );
+ }
+ else
+ {
+ // trace out the extend VMM was successful
+ TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
+ "SUCCESS : call_proc_exit_cache_contained"
+ " - extendVMM");
+ }
}
}
if ( l_errl )
diff --git a/src/usr/hwpf/hwp/dram_initialization/proc_setup_bars/mss_setup_bars.C b/src/usr/hwpf/hwp/dram_initialization/proc_setup_bars/mss_setup_bars.C
index 95ee41f59..a864f112e 100644
--- a/src/usr/hwpf/hwp/dram_initialization/proc_setup_bars/mss_setup_bars.C
+++ b/src/usr/hwpf/hwp/dram_initialization/proc_setup_bars/mss_setup_bars.C
@@ -20,7 +20,7 @@
/* permissions and limitations under the License. */
/* */
/* IBM_PROLOG_END_TAG */
-// $Id: mss_setup_bars.C,v 1.40 2014/04/15 16:05:47 jdsloat Exp $
+// $Id: mss_setup_bars.C,v 1.42 2014/05/21 13:43:45 gpaulraj Exp $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2012
// *! All Rights Reserved -- Property of IBM
@@ -38,8 +38,10 @@
//------------------------------------------------------------------------------
// Version:| Author: | Date: | Comment:
//---------|----------|---------|-----------------------------------------------
-// 1.39 | gpaulraj | 04/08/14| 5/5 FW review feedback - gerrit process - SW251227
-// 1.33 | | 03/09/14| RAS review
+// 1.42 | gpaulraj | 05/21/14| fixed on 1 MCS mirror BAR EN issue -SW261358
+// 1.40 | gpaulraj | 05/06/14| fixed on mirror configuration issue
+// 1.39 | gpaulraj | 04/08/14| 5/5 FW review feedback - gerrit process - SW251227
+// 1.33 | | 03/09/14| RAS review
// 1.32 | gpaulraj | 08/16/13| fixed code
// 1.31 | gpaulraj | 08/13/13| fix HW259884 Mirror BAR Scom Parity Error
// 1.30 | gpaulraj | 08/13/13| added fix HW259884 Mirror BAR Scom Parity Error
@@ -703,7 +705,7 @@ fapi::ReturnCode mss_setup_bars(const fapi::Target& i_pu_target, std::vector<f
}
// determine mirrored member group
- if(M_valid)
+ if(!M_valid)
{
bool m_bar_valid = false;
uint8_t m_bar_group_index = 0x0;
@@ -712,19 +714,21 @@ fapi::ReturnCode mss_setup_bars(const fapi::Target& i_pu_target, std::vector<f
i++)
{
// only process valid groups
- if (group_data[i-8][MSS_MCS_GROUP_32_SIZE_INDEX] == 0)
- {
+ if (group_data[i-8][MSS_MCS_GROUP_32_SIZE_INDEX] == 0)
+ {
continue;
- }
+ }
- uint32_t mcs_in_group = group_data[i-8][MSS_MCS_GROUP_32_MCS_IN_GROUP_INDEX];
+ uint32_t mcs_in_group = group_data[i-8][MSS_MCS_GROUP_32_MCS_IN_GROUP_INDEX];
+ if( mcs_in_group > 1)
+ {
for (size_t j = MSS_MCS_GROUP_32_MEMBERS_START_INDEX;
(j < MSS_MCS_GROUP_32_MEMBERS_START_INDEX+mcs_in_group);
j++)
- {
- if (mcs_pos == group_data[i-8][j])
- {
- if (m_bar_valid)
+ {
+ if (mcs_pos == group_data[i-8][j])
+ {
+ if (m_bar_valid)
{
const uint8_t& MCS_POS = mcs_pos;
const uint8_t& GROUP_INDEX_A = m_bar_group_index;
@@ -738,12 +742,13 @@ fapi::ReturnCode mss_setup_bars(const fapi::Target& i_pu_target, std::vector<f
}
m_bar_valid = true;
m_bar_group_index = i;
- }
+ }
}
if (!rc.ok())
{
break;
}
+ }
}
if (!rc.ok())
{
diff --git a/src/usr/hwpf/hwp/mc_config/mc_config.C b/src/usr/hwpf/hwp/mc_config/mc_config.C
index 44393f630..9d6f9a460 100644
--- a/src/usr/hwpf/hwp/mc_config/mc_config.C
+++ b/src/usr/hwpf/hwp/mc_config/mc_config.C
@@ -55,6 +55,7 @@
// fapi support
#include <fapi.H>
#include <fapiPlatHwpInvoker.H>
+#include <fapiAttributeIds.H>
#include "mc_config.H"
@@ -456,6 +457,27 @@ void* call_mss_eff_config( void *io_pArgs )
TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "call_mss_eff_config entry" );
+ TARGETING::Target* l_sys = NULL;
+ targetService().getTopLevelTarget(l_sys);
+ assert( l_sys != NULL );
+
+ // The attribute ATTR_MEM_MIRROR_PLACEMENT_POLICY should already be
+ // correctly set by default for all platforms except for sapphire.
+ // Don't allow mirroring on sapphire yet @todo-RTC:108314
+ //
+ //ATTR_PAYLOAD_IN_MIRROR_MEM_type l_mirrored =
+ // l_sys->getAttr<ATTR_PAYLOAD_IN_MIRROR_MEM>();
+ //
+ //if(l_mirrored && is_sapphire_load())
+ //{
+ // TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, "Mirroring is enabled");
+
+ // uint8_t l_mmPolicy =
+ // fapi::ENUM_ATTR_MEM_MIRROR_PLACEMENT_POLICY_FLIPPED;
+ // l_sys->
+ // setAttr<TARGETING::ATTR_MEM_MIRROR_PLACEMENT_POLICY>(l_mmPolicy);
+ //}
+
// Get all functional MBA chiplets
TARGETING::TargetHandleList l_mbaTargetList;
getAllChiplets(l_mbaTargetList, TYPE_MBA);
OpenPOWER on IntegriCloud