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
5 files changed
tree: 0d10929f1dd4edc9cfec1d17118614b74f71d48d
  1. phalerror/
  2. procedures/
  3. service_files/
  4. test/
  5. .clang-format
  6. .gitignore
  7. .shellcheck
  8. cfam_access.cpp
  9. cfam_access.hpp
  10. ext_interface.cpp
  11. ext_interface.hpp
  12. filedescriptor.cpp
  13. filedescriptor.hpp
  14. LICENSE
  15. MAINTAINERS
  16. meson.build
  17. meson_options.txt
  18. nmi_interface.cpp
  19. nmi_interface.hpp
  20. nmi_main.cpp
  21. p10_cfam.hpp
  22. p9_cfam.hpp
  23. proc_control.cpp
  24. README.md
  25. registration.hpp
  26. targeting.cpp
  27. targeting.hpp
  28. util.cpp
  29. util.hpp
README.md

Contains procedures that interact with the OpenPower nest chipset.

To Build

To build this package, do the following steps:

    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS}
    3. make

To build with phal feature:
    1. ./bootstrap.sh
    2. ./configure ${CONFIGURE_FLAGS} --enable-phal --enable-openfsi
    3. make

To clean the repository run `./bootstrap.sh clean`.