bmc-reset: check if host is running
This is the backup plan to ensuring the host is not running before the
BMC issues a power off to the system. Prior to this procedure being
called, the BMC has tried all other communication mechanisms to talk
with the host and they have failed. The design is that the host
firmware will write the value 0xA5000001 to Mailbox scratch register
12 when they are up and running to a point where communication to the
BMC is no longer required to function. On a power off or shutdown
this register is cleared by the host and BMC firmware. If the BMC sees
the 0xA5000001 pattern in the scratch register then it assumes the host
is running and will leave power on to the system.
Why not put this in phosphor-state-manager where the other checks are
for the host running?
- This is a very POWER10 specific piece of logic
- A lot of tight coupling would have been required between state-manager
and proc-control
- In the end, it was less work to just put this in proc-control
Tested:
- Verified when CFAM is not A5000001, call returns without error and
/run file is not created
- Verified when CFAM is A5000001, call returns without error and /run
file is created
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I3f6be9160d8d89e556a722d9f6cb00f94be2b994
diff --git a/procedures/phal/common_utils.hpp b/procedures/phal/common_utils.hpp
index 623d071..2d9d57b 100644
--- a/procedures/phal/common_utils.hpp
+++ b/procedures/phal/common_utils.hpp
@@ -25,11 +25,23 @@
/**
* @brief Check if primary processor or not
*
- * * @param[in] procTarget - Target to check if primary or not
+ * @param[in] procTarget - Target to check if primary or not
*
* @return True/False
*/
bool isPrimaryProc(struct pdbg_target* procTarget);
+/**
+ * @brief Read the input CFAM register
+ *
+ * @param[in] procTarget - The Target to perform the operation on
+ * @param[in] reg - The register address to read
+ * @param[out] val - The value read from the register
+ *
+ * @return 0 on success, non-0 on failure
+ */
+uint32_t getCFAM(struct pdbg_target* procTarget, const uint32_t reg,
+ uint32_t& val);
+
} // namespace phal
} // namespace openpower