xref: /openbmc/phosphor-pid-control/ipmi.md (revision d8c5a45c)
1# OEM-IPMI Commands to talk to Phosphor-pid-control
2
3## Sensor Data Pushing Advice
4
5For temperature sensors not reachable by the BMC, sensor readings can be
6pushed to the BMC from the host, by using the IPMI SDR as shared storage.
7
8To do this, it is recommended that
9[ExternalSensor](https://github.com/openbmc/docs/blob/master/designs/external-sensor.md)
10be used. ExternalSensor can add virtual sensors to the IPMI SDR. The host
11can then write values to these virtual sensors, to keep them up to date. Thus,
12these sensors will become visible on the BMC, and can be used normally,
13similar to other temperature sensors already on the BMC.
14
15For temperature sensors on the BMC, including those added with
16ExternalSensor as mentioned above, these can be manipulated through
17normal IPMI commands, and are already supported. The same applies to fan RPM
18and PWM sensors. No additional OEM commands are required to use these.
19
20## IPMI OEM Command Specification
21
22### OEM Get/Set Control Mode
23
24A host tool needs to be able to set the control of the thermal system to either
25automatic or manual. When manual, the daemon will effectively wait to be told to
26be put back in automatic mode. It is expected in this manual mode that something
27will be controlling the fans via the other commands.
28
29Manual mode is controlled by zone through the following OEM command:
30
31#### Request
32
33Byte | Purpose      | Value
34---- | ------------ | -----------------------------------------------------
35`00` | `netfn`      | `0x2e`
36`01` | `command`    | `0x04 (also using manual command)`
37`02` | `oem1`       | `0xcf`
38`03` | `oem2`       | `0xc2`
39`04` | `padding`    | `0x00`
40`05` | `SubCommand` | `Get or Set. Get == 0, Set == 1`
41`06` | `ZoneId`     |
42`07` | `Mode`       | `If Set, Value 1 == Manual Mode, 0 == Automatic Mode`
43
44#### Response
45
46Byte | Purpose   | Value
47---- | --------- | -----------------------------------------------------
48`02` | `oem1`    | `0xcf`
49`03` | `oem2`    | `0xc2`
50`04` | `padding` | `0x00`
51`07` | `Mode`    | `If Set, Value 1 == Manual Mode, 0 == Automatic Mode`
52
53### OEM Get Failsafe Mode
54
55A host tool needs to be able to read back whether a zone is in failsafe mode.
56This setting is read-only because it's dynamically determined within
57phosphor-pid-control per zone.
58
59Byte | Purpose      | Value
60---- | ------------ | ----------------------------------
61`00` | `netfn`      | `0x2e`
62`01` | `command`    | `0x04 (also using manual command)`
63`02` | `oem1`       | `0xcf`
64`03` | `oem2`       | `0xc2`
65`04` | `padding`    | `0x00`
66`05` | `SubCommand` | `Get == 2`
67`06` | `ZoneId`     |
68
69#### Response
70
71Byte | Purpose    | Value
72---- | ---------- | -----------------------------------------------
73`02` | `oem1`     | `0xcf`
74`03` | `oem2`     | `0xc2`
75`04` | `padding`  | `0x00`
76`07` | `failsafe` | `1 == in Failsafe Mode, 0 not in failsafe mode`
77