summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2018-09-11 12:17:10 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2018-09-18 16:07:46 -0500
commitf04d03f76595e24029a292ed122554c1cdf60760 (patch)
tree96a7856b7f67d9b4d36bd731b73bf50981cead5d
parent1f6ed77b32b629f5cd316f2f3e1d8a432f037881 (diff)
downloadtalos-hostboot-f04d03f76595e24029a292ed122554c1cdf60760.tar.gz
talos-hostboot-f04d03f76595e24029a292ed122554c1cdf60760.zip
Clear out HOMER attributes and reset PM in PHYP mode
During the IPL, Hostboot will initialize part of the PM Complex and setup the HOMER memory spaces. At runtime, PHYP will reinit the complex with its own memory spaces. This change explicitly resets the complex and clears any related HOMER attributes before jumping to PHYP so that the first call at runtime starts completely fresh. Change-Id: I540b79143d5fbba876ffc0ac72721639153a1cfa CQ: SW444669 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65983 Reviewed-by: Matt Derksen <mderkse1@us.ibm.com> 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: Corey V. Swenson <cswenson@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
-rw-r--r--src/include/usr/isteps/pm/pm_common_ext.H17
-rw-r--r--src/usr/isteps/istep21/call_host_runtime_setup.C28
-rw-r--r--src/usr/isteps/pm/pm_common.C47
3 files changed, 80 insertions, 12 deletions
diff --git a/src/include/usr/isteps/pm/pm_common_ext.H b/src/include/usr/isteps/pm/pm_common_ext.H
index f93e4dc77..35e726c63 100644
--- a/src/include/usr/isteps/pm/pm_common_ext.H
+++ b/src/include/usr/isteps/pm/pm_common_ext.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -84,6 +84,17 @@ namespace HBPM
};
/**
+ * @brief Enumeration of the attribute
+ *
+ */
+ enum resetOptions_t
+ {
+ RESET_HW = 0x1,
+ CLEAR_ATTRIBUTES = 0x2,
+ RESET_AND_CLEAR_ATTRIBUTES = (RESET_HW | CLEAR_ATTRIBUTES),
+ };
+
+ /**
* @brief Convert HOMER physical address space to a vitual address
* @param[in] i_proc_target Processsor target
* @param[in] i_phys_addr Physical address
@@ -106,9 +117,11 @@ namespace HBPM
/**
* @brief Reset PM Complex for all proc targets.
*
+ * @param[in] i_opt Option to reset HW, attributes, or both
+ *
* @return errlHndl_t Error log if resetPMAll failed
*/
- errlHndl_t resetPMAll();
+ errlHndl_t resetPMAll( resetOptions_t i_opt = RESET_HW );
/**
* @brief Verify all OCCs at checkpoint.
diff --git a/src/usr/isteps/istep21/call_host_runtime_setup.C b/src/usr/isteps/istep21/call_host_runtime_setup.C
index c3c77666a..4be32a7fd 100644
--- a/src/usr/isteps/istep21/call_host_runtime_setup.C
+++ b/src/usr/isteps/istep21/call_host_runtime_setup.C
@@ -52,6 +52,7 @@
#include <sys/misc.h>
#include <hbotcompid.H>
+#include <util/misc.H>
#include "freqAttrData.H"
@@ -736,6 +737,33 @@ void* call_host_runtime_setup (void *io_pArgs)
}
#endif
}
+ // No support for OCC
+ else if( !Util::isSimicsRunning() )
+ {
+ // Since we are not leaving the PM complex alive, we will
+ // explicitly put it into reset and clean up any memory
+ l_err = HBPM::resetPMAll(HBPM::RESET_AND_CLEAR_ATTRIBUTES);
+ if (l_err)
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "resetPMAll failed");
+
+ // Commit the error and continue with the istep
+ errlCommit(l_err, ISTEP_COMP_ID);
+
+ // Force an attribute clear here even if the rest failed
+ l_err = HBPM::resetPMAll(HBPM::CLEAR_ATTRIBUTES);
+ if( l_err )
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ "Explicit attribute clear failed");
+ // no reason to keep this log around, most likely it
+ // is the same fail we hit above
+ delete l_err;
+ l_err = nullptr;
+ }
+ }
+ }
#ifdef CONFIG_IPLTIME_CHECKSTOP_ANALYSIS
if(TARGETING::is_phyp_load() )
diff --git a/src/usr/isteps/pm/pm_common.C b/src/usr/isteps/pm/pm_common.C
index 05613a654..495cda3b7 100644
--- a/src/usr/isteps/pm/pm_common.C
+++ b/src/usr/isteps/pm/pm_common.C
@@ -148,8 +148,16 @@ namespace HBPM
}
}
- l_virt_addr = HBPM_MAP(HBPM_PHYS_ADDR,
- sizeof(Homerlayout_t));
+ // Remap unless we're zeroing things out
+ if( i_phys_addr )
+ {
+ l_virt_addr = HBPM_MAP(HBPM_PHYS_ADDR,
+ sizeof(Homerlayout_t));
+ }
+ else
+ {
+ l_virt_addr = nullptr;
+ }
// Update the attributes for the current values
i_proc_target->setAttr<ATTR_HOMER_PHYS_ADDR>(i_phys_addr);
@@ -1110,7 +1118,7 @@ namespace HBPM
/**
* @brief Reset PM complex for all chips
*/
- errlHndl_t resetPMAll()
+ errlHndl_t resetPMAll( resetOptions_t i_opt )
{
errlHndl_t l_errl = nullptr;
@@ -1118,18 +1126,37 @@ namespace HBPM
getAllChips(l_procChips, TYPE_PROC, true);
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- "resetPMAll: %d proc(s) found",
+ "resetPMAll(%d): %d proc(s) found",
+ i_opt,
l_procChips.size());
for (const auto & l_procChip: l_procChips)
{
- l_errl = resetPMComplex(l_procChip);
- if( l_errl )
+ if( RESET_HW & i_opt )
{
- TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
- ERR_MRK"resetPMAll: "
- "reset PM complex failed!" );
- break;
+ l_errl = resetPMComplex(l_procChip);
+ if( l_errl )
+ {
+ TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
+ ERR_MRK"resetPMAll: "
+ "reset PM complex failed!" );
+ break;
+ }
+ }
+
+ if( CLEAR_ATTRIBUTES & i_opt )
+ {
+ (void) convertHomerPhysToVirt( l_procChip, 0 );
+ }
+ }
+
+ if( !l_errl )
+ {
+ if( CLEAR_ATTRIBUTES & i_opt )
+ {
+ TARGETING::Target* sys = nullptr;
+ TARGETING::targetService().getTopLevelTarget(sys);
+ sys->setAttr<ATTR_OCC_COMMON_AREA_PHYS_ADDR>(0);
}
}
OpenPOWER on IntegriCloud