summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2005-12-28 20:10:45 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2005-12-28 20:10:45 +0000
commit09b1b145ada8890f3da48c38fcabfb589321a31c (patch)
treedd80ff9ff2e874e75861bf6c4dad6e550a0a25d9
parent14d7c9e8762315637c9ca3742901cfee3ed79cdf (diff)
Use corrent size for io mapping. Problem reported by
steve.shockley@shockley.net.
-rw-r--r--sys/dev/pci/piixpm.c10
-rw-r--r--sys/dev/pci/piixreg.h4
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c
index 4045d57240f..a9abf0c22d7 100644
--- a/sys/dev/pci/piixpm.c
+++ b/sys/dev/pci/piixpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: piixpm.c,v 1.7 2005/12/25 18:46:24 grange Exp $ */
+/* $OpenBSD: piixpm.c,v 1.8 2005/12/28 20:10:44 grange Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -107,16 +107,14 @@ piixpm_attach(struct device *parent, struct device *self, void *aux)
struct pci_attach_args *pa = aux;
struct i2cbus_attach_args iba;
pcireg_t base, conf;
- bus_size_t iosize;
pci_intr_handle_t ih;
const char *intrstr = NULL;
/* Map I/O space */
- base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_BASE);
- iosize = PCI_MAPREG_IO_SIZE(base);
sc->sc_iot = pa->pa_iot;
+ base = pci_conf_read(pa->pa_pc, pa->pa_tag, PIIX_SMB_BASE);
if (bus_space_map(sc->sc_iot, PCI_MAPREG_IO_ADDR(base),
- iosize, 0, &sc->sc_ioh)) {
+ PIIX_SMB_SIZE, 0, &sc->sc_ioh)) {
printf(": can't map I/O space\n");
return;
}
@@ -169,7 +167,7 @@ piixpm_attach(struct device *parent, struct device *self, void *aux)
return;
fail:
- bus_space_unmap(sc->sc_iot, sc->sc_ioh, iosize);
+ bus_space_unmap(sc->sc_iot, sc->sc_ioh, PIIX_SMB_SIZE);
}
int
diff --git a/sys/dev/pci/piixreg.h b/sys/dev/pci/piixreg.h
index ccad3a6c094..314fd9ab02b 100644
--- a/sys/dev/pci/piixreg.h
+++ b/sys/dev/pci/piixreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: piixreg.h,v 1.1 2005/12/25 15:04:48 grange Exp $ */
+/* $OpenBSD: piixreg.h,v 1.2 2005/12/28 20:10:44 grange Exp $ */
/*
* Copyright (c) 2005 Alexander Yurchenko <grange@openbsd.org>
@@ -59,4 +59,6 @@
#define PIIX_SMB_HD1 0x06 /* host data 1 */
#define PIIX_SMB_HBDB 0x07 /* host block data byte */
+#define PIIX_SMB_SIZE 0x10 /* SMBus I/O space size */
+
#endif /* !_DEV_PCI_PIIXREG_H_ */