Attempt to determine host platform power status on initial BMC boot

This avoids a mismatch between BMC internal host state and the
actual physical state of the host if the BMC is rebooted / reloaded
while the host platform is online.
parent 025a386b
......@@ -3846,6 +3846,20 @@ int kestrel_init(void)
#endif
#endif
// Ensure internal host power status matches platform status
uint8_t byte;
int i2c_read_retcode;
byte = i2c_read_register_byte((uint8_t *)P9PS_I2C_MASTER_BASE_ADDR, HOST_PLATFORM_FPGA_I2C_ADDRESS, HOST_PLATFORM_FPGA_I2C_REG_STATUS, &i2c_read_retcode);
if (i2c_read_retcode || (((byte)&0x03) != 0x03))
{
host_power_status = HOST_POWER_STATUS_OFFLINE;
}
else
{
host_power_status = HOST_POWER_STATUS_RUNNING;
}
host_power_status_changed();
display_character('2', 0); // STATUS CODE: 2
kestrel_basic_init_complete = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment