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 pushed 6to 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 can 11then write values to these virtual sensors, to keep them up to date. Thus, these 12sensors will become visible on the BMC, and can be used normally, similar to 13other temperature sensors already on the BMC. 14 15For temperature sensors on the BMC, including those added with ExternalSensor as 16mentioned above, these can be manipulated through normal IPMI commands, and are 17already supported. The same applies to fan RPM and PWM sensors. No additional 18OEM 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 33| Byte | 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 46| Byte | 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 59| Byte | 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 71| Byte | 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