aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-08-09 16:38:13 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-11 19:54:22 +1000
commitc8fc681aa2ed5dc5584518d213eeecb2eef7b22c (patch)
treeac312aa93b378d62a143e774b57723120334c707
parentbc8817ede97fde4bc4f1cabd5ea9794d21571098 (diff)
downloadskiboot-c8fc681aa2ed5dc5584518d213eeecb2eef7b22c.zip
skiboot-c8fc681aa2ed5dc5584518d213eeecb2eef7b22c.tar.gz
skiboot-c8fc681aa2ed5dc5584518d213eeecb2eef7b22c.tar.bz2
platform: Add BT to Generic platform
Instantiate if if it's in the device-tree... Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/platform.c6
-rw-r--r--doc/device-tree/examples/power9-phb4.dts6
-rw-r--r--hw/bt.c10
3 files changed, 19 insertions, 3 deletions
diff --git a/core/platform.c b/core/platform.c
index de6e406..de700e7 100644
--- a/core/platform.c
+++ b/core/platform.c
@@ -23,6 +23,7 @@
#include <chip.h>
#include <xscom.h>
#include <errorlog.h>
+#include <bt.h>
struct platform platform;
@@ -105,6 +106,11 @@ static void generic_platform_init(void)
uart_setup_opal_console();
else
force_dummy_console();
+
+ /* Enable a BT interface if we find one too */
+ bt_init();
+
+ /* Fake a real time clock */
fake_rtc_init();
}
diff --git a/doc/device-tree/examples/power9-phb4.dts b/doc/device-tree/examples/power9-phb4.dts
index e5743f3..8da1cbc 100644
--- a/doc/device-tree/examples/power9-phb4.dts
+++ b/doc/device-tree/examples/power9-phb4.dts
@@ -192,6 +192,12 @@
clock-frequency = < 1843200 >;
interrupts = <4>;
};
+
+ impi@ie4 {
+ compatible = "ipmi-bt";
+ reg = < 1 0xe4 0x3 >;
+ interrupts = <10>;
+ };
};
};
diff --git a/hw/bt.c b/hw/bt.c
index 19a34e9..2ecc7d3 100644
--- a/hw/bt.c
+++ b/hw/bt.c
@@ -26,6 +26,7 @@
#include <timer.h>
#include <ipmi.h>
#include <timebase.h>
+#include <chip.h>
/* BT registers */
#define BT_CTRL 0
@@ -379,8 +380,9 @@ static void bt_expire_old_msg(uint64_t tb)
bt_msg = list_top(&bt.msgq, struct bt_msg, link);
- if (bt_msg && bt_msg->tb > 0 &&
- (tb_compare(tb, bt_msg->tb + secs_to_tb(bt.caps.msg_timeout)) == TB_AAFTERB)) {
+ if (bt_msg && bt_msg->tb > 0 && !chip_quirk(QUIRK_SIMICS) &&
+ (tb_compare(tb, bt_msg->tb +
+ secs_to_tb(bt.caps.msg_timeout)) == TB_AAFTERB)) {
if (bt_msg->send_count <= bt.caps.max_retries) {
/* A message timeout is usually due to the BMC
* clearing the H2B_ATN flag without actually
@@ -626,8 +628,10 @@ void bt_init(void)
/* We support only one */
n = dt_find_compatible_node(dt_root, NULL, "ipmi-bt");
- if (!n)
+ if (!n) {
+ prerror("No BT device\n");
return;
+ }
/* Get IO base */
prop = dt_find_property(n, "reg");