summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNan Li <william.bjlinan@hotmail.com>2016-11-10 20:12:37 +0800
committerPatrick Williams <patrick@stwcx.xyz>2016-11-22 17:07:31 +0000
commit41fa24a108cc3f1e6ecc1fb9cce6cf1d9c5a5764 (patch)
tree9f2fa7a42fe27affa7b31fd14320d7ade83cf9aa
parent5fba7a656884a7181901962614adff6f58cd57c4 (diff)
downloadphosphor-host-ipmid-41fa24a108cc3f1e6ecc1fb9cce6cf1d9c5a5764.tar.gz
phosphor-host-ipmid-41fa24a108cc3f1e6ecc1fb9cce6cf1d9c5a5764.zip
Add IPMI Get Self Test Results support
As discussed in design meeting, before the whole ipmi stack is implemented, we don't plan to support "self test". So just respond with self test function not implemented in this controller. Resolves openbmc/openbmc#436 Change-Id: Icd72e07674ce857f98ac036df2b7d6f6b93f1914 Signed-off-by: Nan Li <william.bjlinan@hotmail.com>
-rw-r--r--apphandler.cpp42
-rw-r--r--apphandler.h1
-rw-r--r--host-ipmid-whitelist.conf1
3 files changed, 44 insertions, 0 deletions
diff --git a/apphandler.cpp b/apphandler.cpp
index abf0bd3..9d94b1b 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -252,6 +252,45 @@ finish:
return rc;
}
+ipmi_ret_t ipmi_app_get_self_test_results(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
+ ipmi_request_t request, ipmi_response_t response,
+ ipmi_data_len_t data_len, ipmi_context_t context)
+{
+ ipmi_ret_t rc = IPMI_CC_OK;
+
+ // Byte 2:
+ // 55h - No error.
+ // 56h - Self Test funciton not implemented in this controller.
+ // 57h - Corrupted or inaccesssible data or devices.
+ // 58h - Fatal hardware error.
+ // FFh - reserved.
+ // all other: Device-specific 'internal failure'.
+ // Byte 3:
+ // For byte 2 = 55h, 56h, FFh: 00h
+ // For byte 2 = 58h, all other: Device-specific
+ // For byte 2 = 57h: self-test error bitfield.
+ // Note: returning 57h does not imply that all test were run.
+ // [7] 1b = Cannot access SEL device.
+ // [6] 1b = Cannot access SDR Repository.
+ // [5] 1b = Cannot access BMC FRU device.
+ // [4] 1b = IPMB signal lines do not respond.
+ // [3] 1b = SDR Repository empty.
+ // [2] 1b = Internal Use Area of BMC FRU corrupted.
+ // [1] 1b = controller update 'boot block' firmware corrupted.
+ // [0] 1b = controller operational firmware corrupted.
+
+ char selftestresults[2] = {0};
+
+ *data_len = 2;
+
+ selftestresults[0] = 0x56;
+ selftestresults[1] = 0;
+
+ memcpy(response, selftestresults, *data_len);
+
+ return rc;
+}
+
ipmi_ret_t ipmi_app_get_device_guid(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
ipmi_request_t request, ipmi_response_t response,
ipmi_data_len_t data_len, ipmi_context_t context)
@@ -585,6 +624,9 @@ void register_netfn_app_functions()
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_DEVICE_ID);
ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_DEVICE_ID, NULL, ipmi_app_get_device_id);
+ printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_SELF_TEST_RESULTS);
+ ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_SELF_TEST_RESULTS, NULL, ipmi_app_get_self_test_results);
+
printf("Registering NetFn:[0x%X], Cmd:[0x%X]\n",NETFUN_APP, IPMI_CMD_GET_DEVICE_GUID);
ipmi_register_callback(NETFUN_APP, IPMI_CMD_GET_DEVICE_GUID, NULL, ipmi_app_get_device_guid);
diff --git a/apphandler.h b/apphandler.h
index a17ee7f..f59e315 100644
--- a/apphandler.h
+++ b/apphandler.h
@@ -19,6 +19,7 @@ enum ipmi_netfn_app_cmds
{
// Get capability bits
IPMI_CMD_GET_DEVICE_ID = 0x01,
+ IPMI_CMD_GET_SELF_TEST_RESULTS = 0x04,
IPMI_CMD_SET_ACPI = 0x06,
IPMI_CMD_GET_DEVICE_GUID = 0x08,
IPMI_CMD_RESET_WD = 0x22,
diff --git a/host-ipmid-whitelist.conf b/host-ipmid-whitelist.conf
index d990a2e..d921145 100644
--- a/host-ipmid-whitelist.conf
+++ b/host-ipmid-whitelist.conf
@@ -8,6 +8,7 @@
0x04:0x2F //<Sensor/Event>:<Get Sensor Type>
0x04:0x30 //<Sensor/Event>:<Set Sensor Reading and Event Status>
0x06:0x01 //<App>:<Get Device ID>
+0x06:0x04 //<App>:<Get Self Test Results>
0x06:0x08 //<App>:<Get Device GUID>
0x06:0x22 //<App>:<Reset Watchdog Timer>
0x06:0x24 //<App>:<Set Watchdog Timer>
OpenPOWER on IntegriCloud