diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-11-25 18:57:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-11-25 18:57:51 +0000 |
commit | 7110b42478d81b71a5f1f70a27c770243fce03c6 (patch) | |
tree | 033ce6246be17aaccb9067bce27b4dc5e288368f /sys/dev | |
parent | 035f44f9912a9a63d05fa4130ec35812db4328bd (diff) |
If some rather important registers read as 0xffffffff then the device
is probably not there and we should not attach cardbus. Viao TZ-series
with a Ricoh cardbus+ofw+MMC/SD/MS/.. chip
ok kettenis jsg
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/pccbb.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index 2fa6c6f06bc..21e09a491f2 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccbb.c,v 1.49 2007/11/25 12:18:34 deraadt Exp $ */ +/* $OpenBSD: pccbb.c,v 1.50 2007/11/25 18:57:50 deraadt Exp $ */ /* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */ /* @@ -572,12 +572,19 @@ pccbb_pci_callback(self) sc->sc_flags |= CBB_MEMHMAPPED; } - /* bus bridge initialization */ - pccbb_chipinit(sc); - base_memt = sc->sc_base_memt; /* socket regs memory tag */ base_memh = sc->sc_base_memh; /* socket regs memory handle */ + /* check for dead device? */ + if (bus_space_read_4(base_memt, base_memh, CB_SOCKET_EVENT) == 0xffffffff && + bus_space_read_4(base_memt, base_memh, CB_SOCKET_MASK) == 0xffffffff) { + printf("%s: controller is missing\n", sc->sc_dev.dv_xname); + return; + } + + /* bus bridge initialization */ + pccbb_chipinit(sc); + /* clear data structure for child device interrupt handlers */ sc->sc_pil = NULL; sc->sc_pil_intr_enable = 1; |