From: kettenis Date: Tue, 29 Jul 2008 20:09:11 +0000 (+0000) Subject: Add an ugly hack to disable DMA on the Tadpole SPARCLE laptop. It doesn't X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6ed2a37b644d60c3c558ef8353b16387f131236f;p=openbsd 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@ --- 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 #include +#ifdef __sparc64__ +#include +#include +#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) {