summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2006-01-29 17:29:31 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2006-01-29 17:29:31 +0000
commitffaecc25b227281d46a1db7e86e04e9174ba4017 (patch)
tree5002d2365e683d5d7423b459c529d5046d9e314b /sys/dev
parent8853b2988adaf32bd6f8bbbe4b4b5f27d93bcce6 (diff)
Disable iic whenever ipmi is enabled. This fixes boxes like Sun x4200 that
freak out when more than one device driver touch the i2c devices. Reported by: Srebrenko Sehic <ssehic at gmail dot com> ok kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/i2c/i2c.c11
-rw-r--r--sys/dev/ipmi.c6
2 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c
index d6549ae1f33..90efd50f0f6 100644
--- a/sys/dev/i2c/i2c.c
+++ b/sys/dev/i2c/i2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i2c.c,v 1.11 2006/01/01 20:52:25 deraadt Exp $ */
+/* $OpenBSD: i2c.c,v 1.12 2006/01/29 17:29:30 marco Exp $ */
/* $NetBSD: i2c.c,v 1.1 2003/09/30 00:35:31 thorpej Exp $ */
/*
@@ -48,6 +48,8 @@
#define IICCF_ADDR 0
#define IICCF_SIZE 1
+#include "ipmi.h"
+
struct iic_softc {
struct device sc_dev;
i2c_tag_t sc_tag;
@@ -115,6 +117,13 @@ iic_match(struct device *parent, void *arg, void *aux)
struct cfdata *cf = arg;
struct i2cbus_attach_args *iba = aux;
+#if NIPMI > 0
+ extern int ipmi_enabled;
+
+ if (ipmi_enabled)
+ return (0);
+#endif
+
/* Just make sure we're looking for i2c. */
return (strcmp(iba->iba_name, cf->cf_driver->cd_name) == 0);
}
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index f82fdd3d3c5..fc5dc6ba467 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.33 2006/01/19 17:08:39 grange Exp $ */
+/* $OpenBSD: ipmi.c,v 1.34 2006/01/29 17:29:29 marco Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -59,6 +59,7 @@ struct ipmi_sensor {
int ipmi_nintr;
int ipmi_dbg = 0;
int ipmi_poll = 1;
+int ipmi_enabled = 0;
#define SENSOR_REFRESH_RATE (10 * hz)
@@ -1750,6 +1751,9 @@ ipmi_attach(struct device *parent, struct device *self, void *aux)
printf(" irq %d", ia->iaa_if_irq);
printf("\n");
+ /* setup flag to exclude iic */
+ ipmi_enabled = 1;
+
/* Setup Watchdog timer */
sc->sc_wdog_period = 0;
wdog_register(sc, ipmi_watchdog);