summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-09-28 18:19:15 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-09-28 18:19:15 +0000
commit9bc37f523540e08996c6f3965f553c7897bba9cb (patch)
tree07378cb28cedc5833461e93a623015b2cff73c95 /sys/dev
parentc24574ef8ee137207b9abf4f462e6bda4c734c78 (diff)
Provide more info in error messages so we can see what's going
on. And some cosmetics in debug messages while here.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/amdiic.c14
-rw-r--r--sys/dev/pci/amdpm.c15
-rw-r--r--sys/dev/pci/ichiic.c17
-rw-r--r--sys/dev/pci/piixpm.c17
4 files changed, 37 insertions, 26 deletions
diff --git a/sys/dev/pci/amdiic.c b/sys/dev/pci/amdiic.c
index 0007dbd3333..693a425b268 100644
--- a/sys/dev/pci/amdiic.c
+++ b/sys/dev/pci/amdiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amdiic.c,v 1.4 2006/01/15 10:06:06 grange Exp $ */
+/* $OpenBSD: amdiic.c,v 1.5 2006/09/28 18:19:14 grange Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -152,7 +152,7 @@ amdiic_attach(struct device *parent, struct device *self, void *aux)
/* Read configuration */
conf = pci_conf_read(pa->pa_pc, pa->pa_tag, AMD8111_SMB_MISC);
- DPRINTF((": conf 0x%x", conf));
+ DPRINTF((": conf 0x%08x", conf));
sc->sc_poll = 1;
if (conf & AMD8111_SMB_MISC_SCIEN) {
@@ -275,8 +275,8 @@ amdiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
u_int8_t proto, st;
int retries;
- DPRINTF(("%s: exec op %d, addr 0x%x, cmdlen %d, len %d, "
- "flags 0x%x\n", sc->sc_dev.dv_xname, op, addr,
+ DPRINTF(("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+ "flags 0x%02x\n", sc->sc_dev.dv_xname, op, addr,
cmdlen, len, flags));
if (cold || sc->sc_poll)
@@ -339,7 +339,9 @@ amdiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
DELAY(AMDIIC_DELAY);
}
if (st == 0) {
- printf("%s: timeout\n", sc->sc_dev.dv_xname);
+ printf("%s: exec: op %d, addr 0x%02x, cmdlen %d, "
+ "len %d, flags 0x%02x: timeout\n",
+ sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags);
return (1);
}
amdiic_intr(sc);
@@ -370,7 +372,7 @@ amdiic_intr(void *arg)
/* Interrupt was not for us */
return (0);
- DPRINTF(("%s: intr: st 0x%x\n", sc->sc_dev.dv_xname, st));
+ DPRINTF(("%s: intr: st 0x%02x\n", sc->sc_dev.dv_xname, st));
/* Check for errors */
if ((st & AMD8111_SMB_STAT_MASK) != 0) {
diff --git a/sys/dev/pci/amdpm.c b/sys/dev/pci/amdpm.c
index dfb417ae44e..0cd5a8b70c9 100644
--- a/sys/dev/pci/amdpm.c
+++ b/sys/dev/pci/amdpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amdpm.c,v 1.17 2006/03/09 00:39:04 dlg Exp $ */
+/* $OpenBSD: amdpm.c,v 1.18 2006/09/28 18:19:14 grange Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -385,8 +385,9 @@ amdpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
u_int16_t st, ctl, data;
int retries;
- DPRINTF("%s: exec: op %d, addr 0x%x, cmdlen %d, len %d, flags 0x%x\n",
- sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags);
+ DPRINTF("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+ "flags 0x%02x\n", sc->sc_dev.dv_xname, op, addr, cmdlen,
+ len, flags);
/* Wait for bus to be idle */
for (retries = 100; retries > 0; retries--) {
@@ -479,14 +480,16 @@ timeout:
/*
* Transfer timeout. Kill the transaction and clear status bits.
*/
- printf("%s: timeout, status 0x%b\n", sc->sc_dev.dv_xname, st,
- AMDPM_SMBSTAT_BITS);
+ printf("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+ "flags 0x%02x: timeout, status 0x%b\n",
+ sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags,
+ st, AMDPM_SMBSTAT_BITS);
bus_space_write_2(sc->sc_iot, sc->sc_i2c_ioh, AMDPM_SMBCTL,
AMDPM_SMBCTL_ABORT);
DELAY(AMDPM_SMBUS_DELAY);
st = bus_space_read_2(sc->sc_iot, sc->sc_i2c_ioh, AMDPM_SMBSTAT);
if ((st & AMDPM_SMBSTAT_ABRT) == 0)
- printf("%s: transaction abort failed, status 0x%b\n",
+ printf("%s: abort failed, status 0x%b\n",
sc->sc_dev.dv_xname, st, AMDPM_SMBSTAT_BITS);
bus_space_write_2(sc->sc_iot, sc->sc_i2c_ioh, AMDPM_SMBSTAT, st);
return (1);
diff --git a/sys/dev/pci/ichiic.c b/sys/dev/pci/ichiic.c
index a882ec62d8f..3093d24a729 100644
--- a/sys/dev/pci/ichiic.c
+++ b/sys/dev/pci/ichiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ichiic.c,v 1.16 2006/08/19 19:13:33 brad Exp $ */
+/* $OpenBSD: ichiic.c,v 1.17 2006/09/28 18:19:14 grange Exp $ */
/*
* Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -120,7 +120,7 @@ ichiic_attach(struct device *parent, struct device *self, void *aux)
/* Read configuration */
conf = pci_conf_read(pa->pa_pc, pa->pa_tag, ICH_SMB_HOSTC);
- DPRINTF((": conf 0x%x", conf));
+ DPRINTF((": conf 0x%08x", conf));
if ((conf & ICH_SMB_HOSTC_HSTEN) == 0) {
printf(": SMBus disabled\n");
@@ -201,8 +201,9 @@ ichiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
u_int8_t ctl, st;
int retries;
- DPRINTF(("%s: exec: op %d, addr 0x%x, cmdlen %d, len %d, flags 0x%x\n",
- sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags));
+ DPRINTF(("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+ "flags 0x%02x\n", sc->sc_dev.dv_xname, op, addr, cmdlen,
+ len, flags));
/* Wait for bus to be idle */
for (retries = 100; retries > 0; retries--) {
@@ -293,14 +294,16 @@ timeout:
/*
* Transfer timeout. Kill the transaction and clear status bits.
*/
- printf("%s: timeout, status 0x%b\n", sc->sc_dev.dv_xname, st,
- ICH_SMB_HS_BITS);
+ printf("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+ "flags 0x%02x: timeout, status 0x%b\n",
+ sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags,
+ st, ICH_SMB_HS_BITS);
bus_space_write_1(sc->sc_iot, sc->sc_ioh, ICH_SMB_HC,
ICH_SMB_HC_KILL);
DELAY(ICHIIC_DELAY);
st = bus_space_read_1(sc->sc_iot, sc->sc_ioh, ICH_SMB_HS);
if ((st & ICH_SMB_HS_FAILED) == 0)
- printf("%s: transaction abort failed, status 0x%b\n",
+ printf("%s: abort failed, status 0x%b\n",
sc->sc_dev.dv_xname, st, ICH_SMB_HS_BITS);
bus_space_write_1(sc->sc_iot, sc->sc_ioh, ICH_SMB_HS, st);
return (1);
diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c
index 45d78b08b3e..9635cc155e5 100644
--- a/sys/dev/pci/piixpm.c
+++ b/sys/dev/pci/piixpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: piixpm.c,v 1.23 2006/07/07 03:23:42 brad Exp $ */
+/* $OpenBSD: piixpm.c,v 1.24 2006/09/28 18:19:14 grange Exp $ */
/*
* Copyright (c) 2005, 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -117,7 +117,7 @@ piixpm_attach(struct device *parent, struct device *self, void *aux)
/* Read configuration */
conf = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_HOSTC);
- DPRINTF((": conf 0x%x", conf));
+ DPRINTF((": conf 0x%08x", conf));
if ((conf & PIIX_SMB_HOSTC_HSTEN) == 0) {
printf(": SMBus disabled\n");
@@ -203,8 +203,9 @@ piixpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
u_int8_t ctl, st;
int retries;
- DPRINTF(("%s: exec: op %d, addr 0x%x, cmdlen %d, len %d, flags 0x%x\n",
- sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags));
+ DPRINTF(("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+ "flags 0x%02x\n", sc->sc_dev.dv_xname, op, addr, cmdlen,
+ len, flags));
/* Wait for bus to be idle */
for (retries = 100; retries > 0; retries--) {
@@ -295,14 +296,16 @@ timeout:
/*
* Transfer timeout. Kill the transaction and clear status bits.
*/
- printf("%s: timeout, status 0x%b\n", sc->sc_dev.dv_xname, st,
- PIIX_SMB_HS_BITS);
+ printf("%s: exec: op %d, addr 0x%02x, cmdlen %d, len %d, "
+ "flags 0x%02x: timeout, status 0x%b\n",
+ sc->sc_dev.dv_xname, op, addr, cmdlen, len, flags,
+ st, PIIX_SMB_HS_BITS);
bus_space_write_1(sc->sc_iot, sc->sc_ioh, PIIX_SMB_HC,
PIIX_SMB_HC_KILL);
DELAY(PIIXPM_DELAY);
st = bus_space_read_1(sc->sc_iot, sc->sc_ioh, PIIX_SMB_HS);
if ((st & PIIX_SMB_HS_FAILED) == 0)
- printf("%s: transaction abort failed, status 0x%b\n",
+ printf("%s: abort failed, status 0x%b\n",
sc->sc_dev.dv_xname, st, PIIX_SMB_HS_BITS);
bus_space_write_1(sc->sc_iot, sc->sc_ioh, PIIX_SMB_HS, st);
return (1);