1ac1faa40SAndrew Geissler# System Boot Progress on OpenBMC 2ac1faa40SAndrew Geissler 3ac1faa40SAndrew GeisslerAuthor: Andrew Geissler (geissonator) 4ac1faa40SAndrew Geissler 5ac1faa40SAndrew GeisslerOther contributors: None 6ac1faa40SAndrew Geissler 7ac1faa40SAndrew GeisslerCreated: May 27, 2020 8ac1faa40SAndrew Geissler 9ac1faa40SAndrew Geissler## Problem Description 10*f4febd00SPatrick Williams 11*f4febd00SPatrick WilliamsThe boot progress of an OpenBMC managed system is complex. There are a mix of 12*f4febd00SPatrick Williamsphosphor D-Bus properties, IPMI sensors, PLDM sensors, and Redfish properties to 13*f4febd00SPatrick Williamsrepresent it. The goal of this design document is to highlight these different 14*f4febd00SPatrick Williamsentities and provide a base for system implementors on what to implement. 15ac1faa40SAndrew Geissler 16ac1faa40SAndrew Geissler## Background and References 17*f4febd00SPatrick Williams 18*f4febd00SPatrick Williams[phosphor-state-manager][1] implements D-Bus properties which track the state of 19*f4febd00SPatrick Williamsthe BMC, Chassis, and Host. This design is primarily focused on the status of 20*f4febd00SPatrick Williamsthe Host since it is the most complex. Specifically the goal is to provide 21ac1faa40SAndrew Geisslerdetailed information on what the host is doing during a boot. 22ac1faa40SAndrew Geissler 23*f4febd00SPatrick Williams[HostState][2] provides basic `Off`/`Running` type information along with an 24*f4febd00SPatrick Williamserror state (`Quiesced`) and debug state (`DiagnosticMode`). The focus of this 25*f4febd00SPatrick Williamsdocument is the `Running` state. This simply indicates whether something is 26*f4febd00SPatrick Williamsrunning on the host processors. 27ac1faa40SAndrew Geissler 28*f4febd00SPatrick Williamsphosphor-state-manager implements some other D-Bus properties that represent the 29*f4febd00SPatrick Williamshost boot progress: 30ac1faa40SAndrew Geissler 31ac1faa40SAndrew Geissler- [xyz.openbmc_project.State.Boot.Progress][3] 32ac1faa40SAndrew Geissler- [xyz.openbmc_project.State.OperatingSystem.Status][4] 33ac1faa40SAndrew Geissler 34*f4febd00SPatrick WilliamsThese two D-Bus properties are very IPMI-centric. They were defined based on two 35*f4febd00SPatrick WilliamsIPMI sensors which are set by the host firmware as it boots the system. 36ac1faa40SAndrew Geissler 37ac1faa40SAndrew GeisslerPLDM also has a boot progress sensor. Search for "Boot Progress" in this 38*f4febd00SPatrick Williams[doc][5]. A subset of this maps fairly well to the IPMI sensors above. This PLDM 39*f4febd00SPatrick Williamssensor is not implemented yet in OpenBMC code. 40ac1faa40SAndrew Geissler 41*f4febd00SPatrick WilliamsRedfish represents system state in a variety of ways. The BMC, Chassis, and 42*f4febd00SPatrick WilliamsSystem all implement a [Status][6] object. This provides a list of generic 43ac1faa40SAndrew Geissler`State` options which are applicable to Redfish objects. OpenBMC has the 44ac1faa40SAndrew Geisslerfollowing mapping for phosphor-state-manager to the Redfish System 45*f4febd00SPatrick Williams[Status][state]: 46*f4febd00SPatrick Williams 47ac1faa40SAndrew Geissler- `xyz.openbmc_project.State.Host.HostState.Running` : `Enabled` 48ac1faa40SAndrew Geissler- `xyz.openbmc_project.State.Host.HostState.Quiesced` : `Quiesced` 49ac1faa40SAndrew Geissler- `xyz.openbmc_project.State.Host.HostState.DiagnosticMode` : `InTest` 50ac1faa40SAndrew Geissler 51ac1faa40SAndrew GeisslerAs of [ComputerSystem.v1_13_0][7], the `BootProgress` object is officially in 52ac1faa40SAndrew Geisslerthe Redfish ComputerSystem schema. 53ac1faa40SAndrew Geissler 54ac1faa40SAndrew GeisslerTo summarize, the `LastState` property under this new `BootProgress` object 55ac1faa40SAndrew Geisslertracks the following boot states of the system: 56ac1faa40SAndrew Geissler 57ac1faa40SAndrew Geissler- None 58ac1faa40SAndrew Geissler- PrimaryProcessorInitializationStarted 59ac1faa40SAndrew Geissler- BusInitializationStarted 60ac1faa40SAndrew Geissler- MemoryInitializationStarted 61ac1faa40SAndrew Geissler- SecondaryProcessorInitializationStarted 62ac1faa40SAndrew Geissler- PCIResourceConfigStarted 63ac1faa40SAndrew Geissler- SystemHardwareInitializationComplete 64ac1faa40SAndrew Geissler- OSBootStarted 65ac1faa40SAndrew Geissler- OSRunning 66ac1faa40SAndrew Geissler- OEM 67ac1faa40SAndrew Geissler 68ac1faa40SAndrew GeisslerThere is also a `LastStateTime` associated with this new BootProgress object 69*f4febd00SPatrick Williamswhich should be updated with the date and time the `LastState` was last updated. 70ac1faa40SAndrew Geissler 71ac1faa40SAndrew GeisslerIn the end, the goal is to be able to map either the IPMI or PLDM boot sensors 72ac1faa40SAndrew Geisslerinto all or some of the values in this new Redfish property. 73ac1faa40SAndrew Geissler 74ac1faa40SAndrew GeisslerNote that this design does not include multi-host computer system concepts but 75ac1faa40SAndrew Geisslerit also does not preclude them. The `BootProgress` D-Bus property is associated 76ac1faa40SAndrew Geisslerwith a `/xyz/openbmc_project/state/host<X>` instance where <X> is the host 77*f4febd00SPatrick Williamsinstance. Similarly, the Redfish system object is also an instance based object. 78ac1faa40SAndrew Geissler 79ac1faa40SAndrew Geissler## Requirements 80*f4febd00SPatrick Williams 81ac1faa40SAndrew Geissler- Enhance the existing [BootProgress][3] D-Bus property to cover all supported 82ac1faa40SAndrew Geissler PLDM boot progress codes 83*f4febd00SPatrick Williams- Create a new `BootProgressLastUpdate` D-Bus property that will hold the date 84*f4febd00SPatrick Williams and time of the last update to `BootProgress` 85ac1faa40SAndrew Geissler- Ensure the `BootProgress` and `BootProgressLastUpdate` properties are updated 86ac1faa40SAndrew Geissler appropriately in both IPMI and PLDM based stacks 87*f4febd00SPatrick Williams - It is the responsibility of the IPMI or PLDM implementation to update the 88*f4febd00SPatrick Williams `BootProgress` property on D-Bus 89146f9098SGeorge Keishing - It is the responsibility the phosphor-state-manager to update the 90ac1faa40SAndrew Geissler `BootProgressLastUpdate` property on D-Bus when it sees `BootProgress` 91ac1faa40SAndrew Geissler updated 92*f4febd00SPatrick Williams- Ensure the new Redfish `LastState` and `LastStateTime` properties have the 93*f4febd00SPatrick Williams appropriate mappings to the `BootProgress` and `BootProgressLastUpdate D-Bus 94*f4febd00SPatrick Williams properties 95ac1faa40SAndrew Geissler 96ac1faa40SAndrew GeisslerDifferent OpenBMC systems could support different boot progress codes, and 97ac1faa40SAndrew Geisslersupport them in different orders. This document does not try to set any 98*f4febd00SPatrick Williamsrequirements on this other than that they must all be defined within the 99*f4febd00SPatrick Williams`BootProgress` D-Bus property and the ones which have a mapping to the Redfish 100*f4febd00SPatrick WilliamsBootProgress object will be shown via the Redfish interface. 101ac1faa40SAndrew Geissler 102ac1faa40SAndrew Geissler## Proposed Design 103ac1faa40SAndrew Geissler 104*f4febd00SPatrick Williams[BootProgress][3] will be enhanced to support a superset of what is provided by 105*f4febd00SPatrick WilliamsIPMI and PLDM. 106*f4febd00SPatrick Williams 107*f4febd00SPatrick WilliamsIPMI code already sets the `BootProgress` D-Bus property based on a config file. 108*f4febd00SPatrick WilliamsLook for `fw_boot_sensor` in this [file][8] for an example of how a particular 109*f4febd00SPatrick WilliamsIPMI sensor is mapped to this D-Bus property. 110ac1faa40SAndrew Geissler 111ac1faa40SAndrew GeisslerPLDM software will do something similar. 112ac1faa40SAndrew Geissler 113ac1faa40SAndrew Geisslerbmcweb will then use this `BootProgress` D-Bus interface to respond 114ac1faa40SAndrew Geisslerappropriately to Redfish requests. 115ac1faa40SAndrew Geissler 116ac1faa40SAndrew Geissler## Alternatives Considered 117*f4febd00SPatrick Williams 118ac1faa40SAndrew GeisslerA lot of system BIOS's provided some form of a detailed boot progress codes. 119ac1faa40SAndrew GeisslerUEFI has POST codes, POWER has istep progress codes. If more fine grained 120*f4febd00SPatrick Williamsdetails were needed, we could look into using these. Currently though the need 121*f4febd00SPatrick Williamsis just high level boot progress. Note that these POST/istep codes could be 122*f4febd00SPatrick Williamsmapped to the appropriate BootProgress value if desired (or for cases where the 123*f4febd00SPatrick Williamshost does not support an IPMI or PLDM stack that has BootProgress in it). 124ac1faa40SAndrew Geissler 125ac1faa40SAndrew Geissler## Impacts 126*f4febd00SPatrick Williams 127*f4febd00SPatrick WilliamsEach system will need to document which `BootProgress` codes they support and 128*f4febd00SPatrick Williamsthe expected order of them when a system is booting. 129ac1faa40SAndrew Geissler 130ac1faa40SAndrew Geissler## Testing 131*f4febd00SPatrick Williams 132ac1faa40SAndrew GeisslerEnsure an IPMI and PLDM based system boot and update the `BootProgress` D-Bus 133ac1faa40SAndrew Geisslerproperty as expected. 134ac1faa40SAndrew Geissler 135*f4febd00SPatrick Williams[1]: 136*f4febd00SPatrick Williams https://github.com/openbmc/phosphor-state-manager#state-tracking-and-control 137*f4febd00SPatrick Williams[2]: 138*f4febd00SPatrick Williams https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/State/Host.interface.yaml 139*f4febd00SPatrick Williams[3]: 140*f4febd00SPatrick Williams https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/State/Boot/Progress.interface.yaml 141*f4febd00SPatrick Williams[4]: 142*f4febd00SPatrick Williams https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/State/OperatingSystem/Status.interface.yaml 143*f4febd00SPatrick Williams[5]: 144*f4febd00SPatrick Williams https://www.dmtf.org/sites/default/files/standards/documents/DSP0249_1.0.0.pdf 145ac1faa40SAndrew Geissler[6]: http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Status 146ac1faa40SAndrew Geissler[7]: https://redfish.dmtf.org/schemas/v1/ComputerSystem.v1_13_0.json 147*f4febd00SPatrick Williams[8]: 148*f4febd00SPatrick Williams https://github.com/openbmc/meta-ibm/blob/master/recipes-phosphor/configuration/acx22-yaml-config/acx22-ipmi-sensors-mrw.yaml 149