Skip to content

Commit

Permalink
Enable platSpecialWakeup during IPL time and add support
Browse files Browse the repository at this point in the history
Previously we only supported platSpecialWakeup at runtime because
we were not worried about needed special wakeup as the cores would
not go into stop state during the IPL. However, now PM code is expecting
bits to be set by the p9 special wakeup hwp so we need to call it during
the IPL. This code makes the handleSpecialWakeup.C/H files compatible
with IPL time build environment and enables the call on the IPL time path

CQ: SW415949
Change-Id: I94cca8a84946bea464b21cb95cdbbb075f766c3d
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52858
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>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Christian R. Geddes <crgeddes@us.ibm.com>
  • Loading branch information
crgeddes committed Feb 17, 2018
1 parent e7c2ef3 commit b542fd6
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 44 deletions.
3 changes: 2 additions & 1 deletion src/include/usr/isteps/istep15list.H
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace INITSERVICE
ISTEPNAME(15,02,"proc_set_pba_homer_bar"),
ISTEP_15::proc_set_pba_homer_bar,
{ START_FN, EXT_IMAGE, NORMAL_IPL_OP | MPIPL_OP, true }
},
},
{
ISTEPNAME(15,03,"host_establish_ex_chiplet"),
ISTEP_15::host_establish_ex_chiplet,
Expand All @@ -137,6 +137,7 @@ const DepModInfo g_istep15Dependancies = {
DEP_LIB(libistep15.so),
DEP_LIB(libp9_stop_util.so),
DEP_LIB(libnestmemutils.so),
DEP_LIB(libp9_cpuWkup.so),
DEP_LIB(libpm.so),
DEP_LIB(libsbe.so),
NULL
Expand Down
4 changes: 2 additions & 2 deletions src/include/usr/scom/scomreasoncodes.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2012,2017 */
/* Contributors Listed Below - COPYRIGHT 2012,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -62,7 +62,7 @@ namespace SCOM
SCOM_FORM_1_READ_REQUEST = SCOM_COMP_ID | 0x10,
SCOM_RUNTIME_WAKEUP_ERR = SCOM_COMP_ID | 0x11,
SCOM_RUNTIME_INTERFACE_ERR = SCOM_COMP_ID | 0x12,
SCOM_RUNTIME_SPCWKUP_COUNT_ERR = SCOM_COMP_ID | 0x13,
SCOM_SPCWKUP_COUNT_ERR = SCOM_COMP_ID | 0x13,
SCOM_CEN_TRANS_INVALID_TYPE = SCOM_COMP_ID | 0x14,
};

Expand Down
1 change: 1 addition & 0 deletions src/usr/fapi2/fapi2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ EXTRAINCDIR += ${HWP_PATH_2}/hwp/memory/lib/
EXTRAINCDIR += ${HWP_PATH_2}/hwp/memory/lib/shared/
EXTRAINCDIR += ${HWP_PATH_2}/hwp/memory/lib/utils/
EXTRAINCDIR += ${HWP_PATH_2}/vpd_accessors/
EXTRAINCDIR += ${ROOTPATH}/src/usr/scom/

include ${ROOTPATH}/src/build/mkrules/verbose.rules.mk
define __CLEAN_TARGET
Expand Down
6 changes: 1 addition & 5 deletions src/usr/fapi2/plat_utils.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@
// remove when get_ring is using the hw image
#include <ring_data.H>

#if __HOSTBOOT_RUNTIME
#include "handleSpecialWakeup.H"
#endif
#include "handleSpecialWakeup.H"

//******************************************************************************
// Trace descriptors
Expand Down Expand Up @@ -1135,7 +1133,6 @@ fapi2::ReturnCode platSpecialWakeup(const Target<TARGET_TYPE_ALL>& i_target,
fapi2::ReturnCode fapi_rc = fapi2::FAPI2_RC_SUCCESS;
FAPI_INF("platSpecialWakeup");

#ifdef __HOSTBOOT_RUNTIME
TARGETING::Target* l_target =
reinterpret_cast<TARGETING::Target*>(i_target.get());

Expand All @@ -1144,7 +1141,6 @@ fapi2::ReturnCode platSpecialWakeup(const Target<TARGET_TYPE_ALL>& i_target,
{
fapi_rc.setPlatDataPtr(reinterpret_cast<void *>(err_SW));
}
#endif

// On Hostboot, processor cores cannot sleep so return success to the
// fapiSpecialWakeup enable/disable calls
Expand Down
4 changes: 1 addition & 3 deletions src/usr/fapi2/runtime/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2015,2016
# Contributors Listed Below - COPYRIGHT 2015,2018
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -33,8 +33,6 @@ ROOTPATH = ../../../..

MODULE = fapi2_rt

EXTRAINCDIR += ${ROOTPATH}/src/usr/scom/runtime

SUBDIRS += test.d

include ../fapi2.mk
Expand Down
2 changes: 1 addition & 1 deletion src/usr/isteps/istep15/host_build_stop_image.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down
4 changes: 2 additions & 2 deletions src/usr/isteps/pm/runtime/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016,2017
# Contributors Listed Below - COPYRIGHT 2016,2018
# [+] International Business Machines Corp.
#
#
Expand All @@ -31,7 +31,7 @@ VPATH += ../

MODULE = pm_rt

EXTRAINCDIR += ${ROOTPATH}/src/usr/scom/runtime
EXTRAINCDIR += ${ROOTPATH}/src/usr/scom/

## Objects unique to HBRT
OBJS += rt_pm.o
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/scom/runtime/handleSpecialWakeup.C $ */
/* $Source: src/usr/scom/handleSpecialWakeup.C $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -35,8 +35,11 @@

#include <scom/scomreasoncodes.H>
#include <initservice/initserviceif.H>

#ifdef __HOSTBOOT_RUNTIME
#include <runtime/rt_targeting.H>
#include <runtime/interface.h>
#endif // __HOSTBOOT_RUNTIME

#include <fapi2/plat_hwp_invoker.H>
#include <p9_cpu_special_wakeup.H>
Expand All @@ -60,9 +63,11 @@ using namespace SCOM;
errlHndl_t handleSpecialWakeup(TARGETING::Target* i_target, bool i_enable)
{
errlHndl_t l_errl = NULL;
fapi2::ReturnCode l_rc;

TARGETING::TYPE l_type = i_target->getAttr<TARGETING::ATTR_TYPE>();

#ifdef __HOSTBOOT_RUNTIME
// FSP
if(INITSERVICE::spBaseServicesEnabled())
{
Expand Down Expand Up @@ -171,6 +176,7 @@ errlHndl_t handleSpecialWakeup(TARGETING::Target* i_target, bool i_enable)
// BMC
else
{
#endif // __HOSTBOOT_RUNTIME
if(l_type == TARGETING::TYPE_PROC)
{
// Call wakeup on all core targets
Expand Down Expand Up @@ -204,15 +210,15 @@ errlHndl_t handleSpecialWakeup(TARGETING::Target* i_target, bool i_enable)
/*@
* @errortype
* @moduleid SCOM_HANDLE_SPECIAL_WAKEUP
* @reasoncode SCOM_RUNTIME_SPCWKUP_COUNT_ERR
* @reasoncode SCOM_SPCWKUP_COUNT_ERR
* @userdata1 Target HUID
* @userdata2[0:31] Wakeup Enable
* @userdata2[32:63] Wakeup Count
* @devdesc Disabling special wakeup when not enabled.
*/
l_errl = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_INFORMATIONAL,
SCOM_HANDLE_SPECIAL_WAKEUP,
SCOM_RUNTIME_SPCWKUP_COUNT_ERR,
SCOM_SPCWKUP_COUNT_ERR,
get_huid(i_target),
TWO_UINT32_TO_UINT64(
i_enable, l_count));
Expand All @@ -233,6 +239,16 @@ errlHndl_t handleSpecialWakeup(TARGETING::Target* i_target, bool i_enable)
// bit because HOST/OCC are already in use.

p9specialWakeup::PROC_SPCWKUP_OPS l_spcwkupType;
p9specialWakeup::PROC_SPCWKUP_ENTITY l_spcwkupSrc;
if(! INITSERVICE::spBaseServicesEnabled())
{
l_spcwkupSrc = p9specialWakeup::FSP;
}
else
{
l_spcwkupSrc = p9specialWakeup::HOST;
}

if(i_enable)
{
l_spcwkupType = p9specialWakeup::SPCWKUP_ENABLE;
Expand All @@ -247,33 +263,36 @@ errlHndl_t handleSpecialWakeup(TARGETING::Target* i_target, bool i_enable)
fapi2::Target<fapi2::TARGET_TYPE_EQ>
l_fapi_target(const_cast<TARGETING::Target*>(i_target));

FAPI_INVOKE_HWP( l_errl,
p9_cpu_special_wakeup_eq,
l_fapi_target,
l_spcwkupType,
p9specialWakeup::FSP );
FAPI_EXEC_HWP(l_rc,
p9_cpu_special_wakeup_eq,
l_fapi_target,
l_spcwkupType,
l_spcwkupSrc );
l_errl = rcToErrl(l_rc, ERRORLOG::ERRL_SEV_UNRECOVERABLE);
}
else if(l_type == TARGETING::TYPE_EX)
{
fapi2::Target<fapi2::TARGET_TYPE_EX_CHIPLET>
l_fapi_target(const_cast<TARGETING::Target*>(i_target));

FAPI_INVOKE_HWP( l_errl,
p9_cpu_special_wakeup_ex,
l_fapi_target,
l_spcwkupType,
p9specialWakeup::FSP );
FAPI_EXEC_HWP(l_rc,
p9_cpu_special_wakeup_ex,
l_fapi_target,
l_spcwkupType,
l_spcwkupSrc );
l_errl = rcToErrl(l_rc, ERRORLOG::ERRL_SEV_UNRECOVERABLE);
}
else if(l_type == TARGETING::TYPE_CORE)
{
fapi2::Target<fapi2::TARGET_TYPE_CORE>
l_fapi_target(const_cast<TARGETING::Target*>(i_target));

FAPI_INVOKE_HWP( l_errl,
p9_cpu_special_wakeup_core,
l_fapi_target,
l_spcwkupType,
p9specialWakeup::FSP );
FAPI_EXEC_HWP(l_rc,
p9_cpu_special_wakeup_core,
l_fapi_target,
l_spcwkupType,
l_spcwkupSrc );
l_errl = rcToErrl(l_rc, ERRORLOG::ERRL_SEV_UNRECOVERABLE);
}

if(l_errl)
Expand Down Expand Up @@ -301,7 +320,9 @@ errlHndl_t handleSpecialWakeup(TARGETING::Target* i_target, bool i_enable)
}
i_target->setAttr<ATTR_SPCWKUP_COUNT>(l_count);
}
#ifdef __HOSTBOOT_RUNTIME
}
#endif

return l_errl;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/scom/runtime/handleSpecialWakeup.H $ */
/* $Source: src/usr/scom/handleSpecialWakeup.H $ */
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2015,2016 */
/* Contributors Listed Below - COPYRIGHT 2015,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down
9 changes: 1 addition & 8 deletions src/usr/scom/runtime/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2013,2017
# Contributors Listed Below - COPYRIGHT 2013,2018
# [+] International Business Machines Corp.
#
#
Expand All @@ -29,14 +29,7 @@ MODULE = scom_rt
#include common ojects between hostboot and runtime hostboot
include ../scom.mk

EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/

#include unique object modules - currently none
OBJS += handleSpecialWakeup.o

SUBDIRS += test.d

Expand Down
12 changes: 11 additions & 1 deletion src/usr/scom/scom.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2013,2017
# Contributors Listed Below - COPYRIGHT 2013,2018
# [+] International Business Machines Corp.
#
#
Expand All @@ -29,13 +29,23 @@ VPATH += ${ROOTPATH}/src/import/chips/centaur/common/scominfo/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/scominfo/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/centaur/common/scominfo/
EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/


EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/


# Local Objects
OBJS += scom.o
OBJS += scomtrans.o
OBJS += errlud_pib.o
OBJS += postopchecks.o
OBJS += DmiScomWorkaround.o
OBJS += ibscom_retry.o
OBJS += handleSpecialWakeup.o

# Objects From Import Directory
OBJS += p9_scominfo.o
Expand Down

0 comments on commit b542fd6

Please sign in to comment.