diff options
-rw-r--r-- | src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.C | 20 | ||||
-rw-r--r-- | src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.H | 13 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.C b/src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.C index 810a6fa72..8cbd018fa 100644 --- a/src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.C +++ b/src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.C @@ -641,6 +641,26 @@ fapi_try_exit: //----------------------------------------------------------------------------- +fapi2::ReturnCode ppe_isHalted( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, + const uint64_t i_base_address, + bool* o_halted) +{ + fapi2::buffer<uint64_t> l_data64; + + FAPI_TRY(getScom ( i_target, + i_base_address + PPE_XIRAMDBG, + l_data64 ), + "Failed reading XIRAMDBG register!" ); + + *o_halted = l_data64.getBit<0>(); + +fapi_try_exit: + return fapi2::current_err; +} + +//----------------------------------------------------------------------------- + #ifndef __HOSTBOOT_MODULE fapi2::ReturnCode scom_regs_populate_name( diff --git a/src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.H b/src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.H index cad4f3dd2..8d80ca0d8 100644 --- a/src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.H +++ b/src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.H @@ -491,6 +491,19 @@ fapi2::ReturnCode ppe_write_iar( const uint64_t i_base_address, const uint64_t i_address ); + +///-------------------------------------------------------------------------------------- +/// @brief Determine if the PPE is halted +/// @param[in] i_target target +/// @param[in] i_base_address base SCOM address of the PPE +/// @param[out] o_halted boolean true if halted; false otherwise +/// @return fapi2::ReturnCode +///-------------------------------------------------------------------------------------- +fapi2::ReturnCode ppe_isHalted( + const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target, + const uint64_t i_base_address, + bool* o_halted); + #ifndef __HOSTBOOT_MODULE ///-------------------------------------------------------------------------------------- |