diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-07-29 20:09:12 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-07-29 20:09:12 +0000 |
commit | c20f14473b7e5d6aba1d3b38a27dc3c801f5abbb (patch) | |
tree | 0a063e62cdb04932065ef43769daa8dc185fe2a6 | |
parent | b8dc197adc12e93026b921e8cb874f859680c8e9 (diff) |
Add an ugly hack to disable DMA on the Tadpole SPARCLE laptop. It doesn't
work and this way we fall back on PIO which does work. I'm pretty sure
this is caused by bugs in our code, but I cannot find them.
ok deraadt@, marco@
-rw-r--r-- | sys/dev/pci/pciide.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c index 86901285a2e..cea7d1497bc 100644 --- a/sys/dev/pci/pciide.c +++ b/sys/dev/pci/pciide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pciide.c,v 1.286 2008/07/08 05:59:39 brad Exp $ */ +/* $OpenBSD: pciide.c,v 1.287 2008/07/29 20:09:11 kettenis Exp $ */ /* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */ /* @@ -131,6 +131,11 @@ int wdcdebug_pciide_mask = WDCDEBUG_PCIIDE_MASK; #include <dev/pci/pciide_jmicron_reg.h> #include <dev/pci/cy82c693var.h> +#ifdef __sparc64__ +#include <machine/autoconf.h> +#include <machine/openfirm.h> +#endif + /* functions for reading/writing 8-bit PCI registers */ u_int8_t pciide_pci_read(pci_chipset_tag_t, pcitag_t, @@ -5342,12 +5347,27 @@ acer_chip_map(struct pciide_softc *sc, struct pci_attach_args *pa) pcireg_t cr, interface; bus_size_t cmdsize, ctlsize; int rev = sc->sc_rev; +#ifdef __sparc64__ + char buf[32]; +#endif printf(": DMA"); pciide_mapreg_dma(sc, pa); sc->sc_wdcdev.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32 | WDC_CAPABILITY_MODE; +#ifdef __sparc64__ + /* + * XXX The Tadpole SPARCLE doesn't want to do DMA. PIO works + * fine, so we have this ugly hack to make the machine work. + * It is likely the real cause is still lurking somewhere in + * the code. + */ + if (OF_getprop(findroot(), "name", buf, sizeof(buf)) > 0 && + strcmp(buf, "TAD,SPARCLE") == 0) + sc->sc_dma_ok = 0; +#endif + if (sc->sc_dma_ok) { sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA; if (rev >= 0x20) { |