diff mbox

hw/ipmi: Fix FW Boot Progress sensor

Message ID 1428550207-4177-1-git-send-email-joel@jms.id.au
State Accepted
Headers show

Commit Message

Joel Stanley April 9, 2015, 3:30 a.m. UTC
Experiments determined that we need to set the assertion bits as well as
the event data bytes.

To verify the sensor is being set on your BMC, use ipmitool to query the
SEL logs:

    $ ipmitool sel list
    System Firmware Progress #0x05 | Motherboard initialization | Asserted
    System Firmware Progress #0x05 | Memory initialization | Asserted
    System Firmware Progress #0x05 | System boot initiated | Asserted

Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 hw/ipmi/ipmi-sensor.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Jeremy Kerr April 9, 2015, 3:44 a.m. UTC | #1
Hi Joel,

> Experiments determined that we need to set the assertion bits as well as
> the event data bytes.
> 
> To verify the sensor is being set on your BMC, use ipmitool to query the
> SEL logs:
> 
>     $ ipmitool sel list
>     System Firmware Progress #0x05 | Motherboard initialization | Asserted
>     System Firmware Progress #0x05 | Memory initialization | Asserted
>     System Firmware Progress #0x05 | System boot initiated | Asserted

Looks good, thanks.

Acked-by: Jeremy Kerr <jk@ozlabs.org>

Cheers,


Jeremy
Joel Stanley April 9, 2015, 4:39 a.m. UTC | #2
On Thu, Apr 9, 2015 at 1:14 PM, Jeremy Kerr <jk@ozlabs.org> wrote:
> Looks good, thanks.

Thanks for your help debugging it.

Cheers,

Joel
diff mbox

Patch

diff --git a/hw/ipmi/ipmi-sensor.c b/hw/ipmi/ipmi-sensor.c
index 7d88637..d890534 100644
--- a/hw/ipmi/ipmi-sensor.c
+++ b/hw/ipmi/ipmi-sensor.c
@@ -21,8 +21,6 @@ 
 #include <string.h>
 
 #define IPMI_WRITE_SENSOR		(1 << 0)
-#define IPMI_WRITE_EVENT_BYTES		(1 << 7)
-#define IPMI_SET_ASSERTION		(1 << 4)
 
 #define FW_PROGRESS_SENSOR_TYPE	0x0F
 #define BOOT_COUNT_SENSOR_TYPE	0xC3
@@ -85,11 +83,11 @@  int ipmi_set_fw_progress_sensor(uint8_t state)
 	memset(&request, 0, sizeof(request));
 
 	request.sensor_number = fw_sensor_num;
-	request.operation = IPMI_WRITE_EVENT_BYTES;
-	request.assertion_mask[0] = 0x02; /* Firmware progress offset */
+	request.operation = 0xa0; /* Set event data bytes, assertion bits */
+	request.assertion_mask[0] = 0x04; /* Firmware progress offset */
 	request.event_data[1] = state;
 
-	prlog(PR_INFO, "IPMI: fw progress sensor (%02x) to %02x ...\n",
+	prlog(PR_INFO, "IPMI: setting fw progress sensor %02x to %02x\n",
 			request.sensor_number, request.event_data[1]);
 
 	msg = ipmi_mkmsg_simple(IPMI_SET_SENSOR_READING, &request,