Commit 167b861b authored by Jonathan Currier's avatar Jonathan Currier

With this, the OCCs are able to be onlined.

Note that this embeds a power limit, which may be board/system specific.
parent adf45fa7
......@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <uart.h>
#include <endian.h>
#ifdef WITH_SPI
#include "micron_n25q_flash.h"
#include "tercel_spi.h"
......@@ -814,8 +815,32 @@ static void process_host_to_bmc_ipmi_bt_transactions(void)
unhandled_ipmi_command = 1;
break;
case IPMI_NETFN_DCMI_GP_REQ:
unhandled_ipmi_command = 1;
break;
switch (ipmi_bt_current_request.command) {
case DCMI_CMD_GET_POWER_CAP:
{
/* This *should* be enough to IPL the P9 and bring the OCCs online.
* NOTE: The power limits are probably board/design specific: hard coding this
* in a removable BMC is... probably a poor idea.*/
static const int power_limits_struct_size = 14;
/* This should use htole16, however that isn't provide atm,
* and 0 is 0. However if it's ever made a non-zero value,
* it needs to be little endian encoded.
*/
uint16_t power_limit = 0;
memset(response.data, 0, power_limits_struct_size);
response.data[3] = 1;
memcpy(response.data + 4, &power_limit, sizeof(power_limit));
/* TODO: This completion code is required, however the exact meaning isn't
* recorded here.
*/
response.completion_code = 0x80;
response.length = BASE_DCMI_RESPONSE_LENGTH + power_limits_struct_size;
}
break;
default:
unhandled_ipmi_command = 1;
break;
}
case IPMI_NETFN_OEM_IBM_REQ:
switch (ipmi_bt_current_request.command)
{
......
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