discover/platform-powerpc: Set IPMI OS boot sensor
authorJoel Stanley <joel@jms.id.au>
Tue, 21 Apr 2015 06:17:57 +0000 (16:17 +1000)
committerSamuel Mendoza-Jonas <sam.mj@au1.ibm.com>
Tue, 21 Apr 2015 06:20:31 +0000 (16:20 +1000)
commit6600e73fe891d5006c34f694e97e37eefceb921d
tree9b74311c1e7c1a6511fe5848165cec0e4e15c1b8
parentf166fe2b62d781109e3a88736db96613af8c71d9
discover/platform-powerpc: Set IPMI OS boot sensor

This is to indicate to a BMC that we have initiated OS boot.

This patch manually parses the device tree for the sensor information.
In the future this could be replaced by libfdt or similar.

Discover the id of your OS Boot sensor:

$ sudo ipmitool sensor get "OS Boot"
Locating sensor record...
Sensor ID              : OS Boot (0x5a)
 Entity ID             : 35.0 (Operating System)
 Sensor Type (Discrete): OS Boot (0x1f)
 Sensor Reading        : 0h
 Event Message Control : Per-threshold
 Assertion Events      : OS Boot
                         [boot completed - device not specified]
 Assertions Enabled    : OS Boot
                         [A: boot completed]
                         [C: boot completed]
                         [PXE boot completed]
                         [Diagnostic boot completed]
                         [CD-ROM boot completed]
                         [ROM boot completed]
                         [boot completed - device not specified]
                         [Installation started]
                         [Installation completed]
                         [Installation aborted]
                         [Installation failed]
 OEM                   : 0

In this case it is 0x1f. Note that the sesnor is currently asserted iwth boot
completed - device not specified.

Test by clearing all assertions in the OS Boot sensor:

$ sudo ipmitool raw 0x04 0x30 0x5a 0x30 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
$ sudo ipmitool sensor get "OS Boot"
Locating sensor record...
Sensor ID              : OS Boot (0x5a)
 Entity ID             : 35.0 (Operating System)
 Sensor Type (Discrete): OS Boot (0x1f)
 Sensor Reading        : 0h
 Event Message Control : Per-threshold
 Assertions Enabled    : OS Boot
                         [A: boot completed]
                         [C: boot completed]
                         [PXE boot completed]
                         [Diagnostic boot completed]
                         [CD-ROM boot completed]
                         [ROM boot completed]
                         [boot completed - device not specified]
                         [Installation started]
                         [Installation completed]
                         [Installation aborted]
                         [Installation failed]
 OEM                   : 0

Then reboot your system. The assertion event should once more say "boot
completed - device not specified".

Signed-off-by: Joel Stanley <joel@jms.id.au>
discover/Makefile.am
discover/dt.c [new file with mode: 0644]
discover/dt.h [new file with mode: 0644]
discover/ipmi.h
discover/platform-powerpc.c