diff options
author | Prem Shanker Jha <premjha2@in.ibm.com> | 2018-08-08 10:13:39 -0500 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2018-08-21 14:07:45 -0500 |
commit | 15641e1a1fae0e60f9d74a5ef9ddf6f1fb6d5efc (patch) | |
tree | 94c6aa7d9427aafd8d544a2004e6e91e4445d269 /src | |
parent | 1a7732ad4182924ef20fe48288406afdf2b4ed69 (diff) | |
download | talos-hostboot-15641e1a1fae0e60f9d74a5ef9ddf6f1fb6d5efc.tar.gz talos-hostboot-15641e1a1fae0e60f9d74a5ef9ddf6f1fb6d5efc.zip |
UV Support: HWP inits runtime wakeup mode for each functional core.
Commit initializes CPMMR[59] with 1 if SMF is not enabled otherwise
with 0. This bit is read by CME in STOP 4/5 exit path. Based on the
bit value, sets the runtime wakeup mode for core in thread scratch
register.
Change-Id: If339c62e2e2bb504b5bf8e6b5e864d6ca6b4dc75
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64119
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/64234
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: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src')
3 files changed, 177 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.C b/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.C new file mode 100644 index 000000000..6f2fdb0f4 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.C @@ -0,0 +1,92 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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 */ +/// +/// @file p9_setup_runtime_wakeup_mode.H +/// @brief describes HWP interface that configures runtime wakeup mode of core. +/// +/// *HWP HWP Owner: Greg Still <stillgs@us.ibm.com> +/// *HWP FW Owner: Prem S Jha <premjha2@in.ibm.com> +/// *HWP Team: PM +/// *HWP Level: 2 +/// *HWP Consumed by: Hostboot +// + +#if 0 +#include <p9_setup_runtime_wakeup_mode.H> +#include <p9_quad_scom_addresses.H> + +enum +{ + RUN_TIME_WAKEUP_MODE_BIT_POS = 59, +}; + + +fapi2::ReturnCode p9_setup_runtime_wakeup_mode( + const fapi2::Target < fapi2::TARGET_TYPE_PROC_CHIP>& i_procTarget ) +{ + FAPI_INF("> p9_setup_runtime_wakeup_mode" ); + fapi2::buffer<uint64_t> l_wakeupMode; + uint8_t l_smfEnabled; + const fapi2::Target<fapi2::TARGET_TYPE_SYSTEM> FAPI_SYSTEM; + auto l_coreList = + i_procTarget.getChildren<fapi2::TARGET_TYPE_CORE>(fapi2::TARGET_STATE_FUNCTIONAL); + + FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SMF_ENABLED, + FAPI_SYSTEM, + l_smfEnabled), + "Error from FAPI_ATTR_GET for attribute ATTR_SMF_ENABLED "); + + for( auto core : l_coreList ) + { + FAPI_TRY(fapi2::getScom(i_procTarget, C_CPPM_CPMMR, l_wakeupMode), + "Failed To Read CPMMR"); + + FAPI_DBG( "Initial CPMMR Value 0x%016llx", l_wakeupMode ); + + if( l_smfEnabled ) + { + FAPI_DBG("SMF Enabled"); + //Wakeup in Ultravisor mode + l_wakeupMode.clearBit( RUN_TIME_WAKEUP_MODE_BIT_POS ); + } + else + { + //Wakeup in Hypervisor mode + l_wakeupMode.setBit( RUN_TIME_WAKEUP_MODE_BIT_POS ); + } + + FAPI_TRY(fapi2::putScom(core, C_CPPM_CPMMR, l_wakeupMode), + "Failed To Write CPMMR"); + + FAPI_DBG( "Final CPMMR Value 0x%016llx", l_wakeupMode ); + + } + +fapi_try_exit: + FAPI_INF("< p9_setup_runtime_wakeup_mode" ); + return fapi2::current_err; +} + +#endif diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.H b/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.H new file mode 100644 index 000000000..27e9086ad --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.H @@ -0,0 +1,59 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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 */ + +#if 0 +#ifndef __RUN_TIME_WAKEUP_MODE_ +#define __RUN_TIME_WAKEUP_MODE_ + +/// +/// @file p9_setup_runtime_wakeup_mode.H +/// @brief describes HWP interface that configures runtime wakeup mode of core. +/// +/// *HWP HWP Owner: Greg Still <stillgs@us.ibm.com> +/// *HWP FW Owner: Prem S Jha <premjha2@in.ibm.com> +/// *HWP Team: PM +/// *HWP Level: 2 +/// *HWP Consumed by: Hostboot +// + + +#include <fapi2.H> + +extern "C" +{ + + typedef fapi2::ReturnCode( *p9_setup_runtime_wakeup_mode_FP_t ) ( + const fapi2::Target < fapi2::TARGET_TYPE_PROC_CHIP>& i_procTarget ); + + /// @brief sets runtime wakeup mode for all functional cores in the proc. + /// @param[in] i_procTarget fapi2 target for P9 chip. + /// @return FAPI2_RC_SUCCESS if HWP succeeds, error code otherwise. + fapi2::ReturnCode p9_setup_runtime_wakeup_mode( const fapi2::Target < fapi2::TARGET_TYPE_PROC_CHIP>& i_procTarget ); + +} //extern "C" + +#endif //__RUN_TIME_WAKEUP_MODE_ + +#endif diff --git a/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.mk b/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.mk new file mode 100644 index 000000000..9c4f8cd26 --- /dev/null +++ b/src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.mk @@ -0,0 +1,26 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/import/chips/p9/procedures/hwp/pm/p9_setup_runtime_wakeup_mode.mk $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2018 +# [+] 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 +#PROCEDURE = p9_setup_runtime_wakeup_mode +#$(call BUILD_PROCEDURE) |