From 6c6ededed27870f024c4e46fecfcdd2b477d30ee Mon Sep 17 00:00:00 2001 From: Doug Gilbert Date: Thu, 6 Mar 2014 14:31:57 -0600 Subject: HBRT fapi wakeup support RTC: 98665 Change-Id: Ib9e9f8f3656989975cc08a29304ba7faa25c59e4 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9364 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell Reviewed-by: A. Patrick Williams III --- src/usr/hwpf/plat/fapiPlatUtil.C | 56 +++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 15 deletions(-) (limited to 'src/usr/hwpf/plat') diff --git a/src/usr/hwpf/plat/fapiPlatUtil.C b/src/usr/hwpf/plat/fapiPlatUtil.C index 452158127..1c85d0a54 100644 --- a/src/usr/hwpf/plat/fapiPlatUtil.C +++ b/src/usr/hwpf/plat/fapiPlatUtil.C @@ -41,6 +41,8 @@ #ifdef __HOSTBOOT_RUNTIME #include #include +#include +#include #endif //****************************************************************************** @@ -261,24 +263,48 @@ fapi::ReturnCode fapiSpecialWakeup(const fapi::Target & i_target, #ifdef __HOSTBOOT_RUNTIME if(g_hostInterfaces && g_hostInterfaces->wakeup) { - // TODO Support wakeup RTC = 98665 - // We need to merge all rt - sapphire tareting id stuff into a - // common runtime targeting util - right now some is in xscom and some - // is in RT_OCC. + TARGETING::Target* target = + reinterpret_cast(i_target.get()); - //TARGETING::Target* target = - // reinterpret_cast(i_target.get()); - - //uint64_t core_id = 0; - //int rc = g_hostInterfaces->wakeup(core_id,0); - //if(rc) - //{ - // FAPI_ERR("CPU core wakeup call to hypervisor returned rc = %d", - // rc); + RT_TARG::rtChipId_t core_id = 0; + errlHndl_t err = RT_TARG::getRtTarget(target, core_id); + if(err) + { + fapi_rc.setPlatError(reinterpret_cast(err)); + } + else + { + uint32_t mode = 0; //Force awake + if(!i_enable) + { + mode = 1; // clear force + } + int rc = g_hostInterfaces->wakeup(core_id, mode); - // Make error log + if(rc) + { + FAPI_ERR("CPU core wakeup call to hypervisor returned rc = %d", + rc); + /*@ + * @errortype + * @moduleid fapi::MOD_PLAT_SPECIAL_WAKEUP + * @reasoncode fapi::RC_RT_WAKEUP_FAILED + * @userdata1 Hypervisor return code + * @userdata2 Chiplet HUID + * @devdesc Error code from hypervisor wakeup call + */ + const bool hbSwError = true; + err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_UNRECOVERABLE, + fapi::MOD_PLAT_SPECIAL_WAKEUP, + fapi::RC_RT_WAKEUP_FAILED, + rc, + TARGETING::get_huid(target), + hbSwError); - //} + fapi_rc.setPlatError(reinterpret_cast(err)); + } + } } #endif // On Hostboot, processor cores cannot sleep so return success to the -- cgit v1.2.3