meta-ampere: power control: refactor power soft/off functions

The current ampere-hostctl package removes the power off/on services
of phosphor-state-manager and uses Ampere services. This solution is
not correct. Ampere platform should use power control functions of
phosphor-state-manager. And only appends or overides the default
services by Ampere's services if need.

By default, to handle power soft action, phosphor-state-manager will
trigger obmc-host-shutdown@0.target. This target then call
xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service to request OS
shutdown. When the host OS shutdown is already done, the target will
trigger obmc-chassis-poweroff@0.target to turn off the chassis. The
default xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service uses
Ipmi inband to communicate with the host. It is different with Ampere
Mt.Jade platform. We use the GPIO pin SHD_REQ to request shutdown the
host OS. The host will trigger SHD_ACK when shutdown is done. So
*.Ipmi.Internal.SoftPowerOff.service will be overide by Ampere service
named ampere.*.Ipmi.Internal.SoftPowerOff.service. This service will
trigger SHD_REQ pin and wait for SHD_ACK before start
obmc-chassis-poweroff@0.target.

This commit removes ampere-chassis-poweroff, ampere-host-shutdown
serives which handle power off/soft actions and restore
phosphor-state-manager's services. It also supports
ampere.xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service which
will overide xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service.

Tested:
    1. Create "power soft" actions use ipmitool, redfish and BMC web.
    2. Make sure the power order will be shutdown the host then power
       of the chassis.
    3. Create "power off" actions use ipmitool, redfish and BMC web.
    4. Make sure the power action will be power off the chassis.

Signed-off-by: ThuBaNguyen <thu@os.amperecomputing.com>
Change-Id: Ibc0dc8c62408e8282520c9b70e41ab75c10137f6
8 files changed
tree: 42263dff9d99d2676103ff4fbae0888fd622cbab
  1. .github/
  2. meta-alibaba/
  3. meta-amd/
  4. meta-ampere/
  5. meta-arm/
  6. meta-aspeed/
  7. meta-asrock/
  8. meta-bytedance/
  9. meta-evb/
  10. meta-facebook/
  11. meta-fii/
  12. meta-google/
  13. meta-hpe/
  14. meta-hxt/
  15. meta-ibm/
  16. meta-ingrasys/
  17. meta-inspur/
  18. meta-intel-openbmc/
  19. meta-inventec/
  20. meta-lenovo/
  21. meta-microsoft/
  22. meta-nuvoton/
  23. meta-openembedded/
  24. meta-openpower/
  25. meta-phosphor/
  26. meta-portwell/
  27. meta-qualcomm/
  28. meta-quanta/
  29. meta-raspberrypi/
  30. meta-security/
  31. meta-supermicro/
  32. meta-wistron/
  33. meta-x86/
  34. meta-xilinx/
  35. meta-yadro/
  36. poky/
  37. .gitignore
  38. .gitreview
  39. .templateconf
  40. MAINTAINERS
  41. openbmc-env
  42. OWNERS
  43. README.md
  44. setup
README.md

OpenBMC

Build Status

OpenBMC is a Linux distribution for management controllers used in devices such as servers, top of rack switches or RAID appliances. It uses Yocto, OpenEmbedded, systemd, and D-Bus to allow easy customization for your platform.

Setting up your OpenBMC project

1) Prerequisite

  • Ubuntu 14.04
sudo apt-get install -y git build-essential libsdl1.2-dev texinfo gawk chrpath diffstat
  • Fedora 28
sudo dnf install -y git patch diffstat texinfo chrpath SDL-devel bitbake \
    rpcgen perl-Thread-Queue perl-bignum perl-Crypt-OpenSSL-Bignum
sudo dnf groupinstall "C Development Tools and Libraries"

2) Download the source

git clone git@github.com:openbmc/openbmc.git
cd openbmc

3) Target your hardware

Any build requires an environment set up according to your hardware target. There is a special script in the root of this repository that can be used to configure the environment as needed. The script is called setup and takes the name of your hardware target as an argument.

The script needs to be sourced while in the top directory of the OpenBMC repository clone, and, if run without arguments, will display the list of supported hardware targets, see the following example:

$ . setup <machine> [build_dir]
Target machine must be specified. Use one of:

centriq2400-rep         f0b                     fp5280g2
gsj                     hr630                   hr855xg2
lanyang                 mihawk                  msn
neptune                 nicole                  olympus
olympus-nuvoton         on5263m5                p10bmc
palmetto                qemuarm                 quanta-q71l
romulus                 s2600wf                 stardragon4800-rep2
swift                   tiogapass               vesnin
witherspoon             witherspoon-tacoma      yosemitev2
zaius

Once you know the target (e.g. romulus), source the setup script as follows:

. setup romulus

For evb-ast2500, please use the below command to specify the machine config, because the machine in meta-aspeed layer is in a BSP layer and does not build the openbmc image.

TEMPLATECONF=meta-evb/meta-evb-aspeed/meta-evb-ast2500/conf . openbmc-env

4) Build

bitbake obmc-phosphor-image

Additional details can be found in the docs repository.

OpenBMC Development

The OpenBMC community maintains a set of tutorials new users can go through to get up to speed on OpenBMC development out here

Build Validation and Testing

Commits submitted by members of the OpenBMC GitHub community are compiled and tested via our Jenkins server. Commits are run through two levels of testing. At the repository level the makefile make check directive is run. At the system level, the commit is built into a firmware image and run with an arm-softmmu QEMU model against a barrage of CI tests.

Commits submitted by non-members do not automatically proceed through CI testing. After visual inspection of the commit, a CI run can be manually performed by the reviewer.

Automated testing against the QEMU model along with supported systems are performed. The OpenBMC project uses the Robot Framework for all automation. Our complete test repository can be found here.

Submitting Patches

Support of additional hardware and software packages is always welcome. Please follow the contributing guidelines when making a submission. It is expected that contributions contain test cases.

Bug Reporting

Issues are managed on GitHub. It is recommended you search through the issues before opening a new one.

Questions

First, please do a search on the internet. There's a good chance your question has already been asked.

For general questions, please use the openbmc tag on Stack Overflow. Please review the discussion on Stack Overflow licensing before posting any code.

For technical discussions, please see contact info below for Discord and mailing list information. Please don't file an issue to ask a question. You'll get faster results by using the mailing list or Discord.

Features of OpenBMC

Feature List

  • Host management: Power, Cooling, LEDs, Inventory, Events, Watchdog
  • Full IPMI 2.0 Compliance with DCMI
  • Code Update Support for multiple BMC/BIOS images
  • Web-based user interface
  • REST interfaces
  • D-Bus based interfaces
  • SSH based SOL
  • Remote KVM
  • Hardware Simulation
  • Automated Testing
  • User management
  • Virtual media

Features In Progress

  • OpenCompute Redfish Compliance
  • Verified Boot

Features Requested but need help

  • OpenBMC performance monitoring

Finding out more

Dive deeper into OpenBMC by opening the docs repository.

Technical Steering Committee

The Technical Steering Committee (TSC) guides the project. Members are:

  • Brad Bishop (chair), IBM
  • Nancy Yuen, Google
  • Sai Dasari, Facebook
  • James Mihm, Intel
  • Sagar Dharia, Microsoft
  • Supreeth Venkatesh, Arm

Contact