diff options
Diffstat (limited to 'sys/dev')
-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) { |