aboutsummaryrefslogtreecommitdiff
path: root/core/ipmi.c
diff options
context:
space:
mode:
authorAlistair Popple <alistair@popple.id.au>2014-08-12 17:59:39 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-08-13 15:42:27 +1000
commit391291ba265ab36819ea10b2459bcf56468b07b3 (patch)
tree939f1869af96f58b1428214de5f4a1b052fdb71e /core/ipmi.c
parent793b06d73e1543350fc7c4c7c615c594ec1ddd62 (diff)
downloadskiboot-391291ba265ab36819ea10b2459bcf56468b07b3.zip
skiboot-391291ba265ab36819ea10b2459bcf56468b07b3.tar.gz
skiboot-391291ba265ab36819ea10b2459bcf56468b07b3.tar.bz2
ipmi: Add a base IPMI stack with a BT driver
This patch adds a basic IPMI layer to the sapphire core and support for a BT IPMI interface as found on the Aspeed BMC of the Palmetto platform [ Changed the compatible property -- BenH ] Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'core/ipmi.c')
-rw-r--r--core/ipmi.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/core/ipmi.c b/core/ipmi.c
new file mode 100644
index 0000000..b21a0f3
--- /dev/null
+++ b/core/ipmi.c
@@ -0,0 +1,36 @@
+/* Copyright 2013-2014 IBM Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdio.h>
+#include <bt.h>
+#include <ipmi.h>
+
+static void ipmi_cmd_done(struct ipmi_msg *msg)
+{
+ if (msg->cc != IPMI_CC_NO_ERROR) {
+ prerror("IPMI: Got error response 0x%02x\n", msg->cc);
+ }
+
+ switch (msg->netfn) {
+ default:
+ prerror("IPMI: Invalid IPMI function code in response\n");
+ }
+}
+
+void ipmi_init(void)
+{
+ bt_init(ipmi_cmd_done);
+}