Add special IRQ handler for CMD PCI0648 and PCI0649 taken from the

experimental version of Manuel Bouyer's driver.
This commit is contained in:
tron 2000-06-27 05:57:05 +00:00
parent bb2ed0f487
commit bddc013764
1 changed files with 24 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pciide.c,v 1.71 2000/06/26 14:21:12 mrg Exp $ */
/* $NetBSD: pciide.c,v 1.72 2000/06/27 05:57:05 tron Exp $ */
/*
@ -170,6 +170,7 @@ void cmd0643_9_setup_channel __P((struct channel_softc*));
void cmd_channel_map __P((struct pci_attach_args *,
struct pciide_softc *, int));
int cmd_pci_intr __P((void *));
void cmd648_9_irqack __P((struct channel_softc *));
void cy693_chip_map __P((struct pciide_softc*, struct pci_attach_args*));
void cy693_setup_channel __P((struct channel_softc*));
@ -2163,12 +2164,15 @@ cmd0643_9_chip_map(sc, pa)
WDC_CAPABILITY_MODE;
if (sc->sc_dma_ok) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_DMA | WDC_CAPABILITY_IRQACK;
sc->sc_wdcdev.irqack = pciide_irqack;
switch (sc->sc_pp->ide_product) {
case PCI_PRODUCT_CMDTECH_649:
case PCI_PRODUCT_CMDTECH_648:
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.UDMA_cap = 4;
sc->sc_wdcdev.irqack = cmd648_9_irqack;
break;
default:
sc->sc_wdcdev.irqack = pciide_irqack;
}
}
@ -2277,6 +2281,24 @@ cmd0643_9_setup_channel(chp)
pciide_print_modes(cp);
}
void
cmd648_9_irqack(chp)
struct channel_softc *chp;
{
u_int32_t priirq, secirq;
struct pciide_channel *cp = (struct pciide_channel*)chp;
struct pciide_softc *sc = (struct pciide_softc *)cp->wdc_channel.wdc;
if (chp->channel == 0) {
priirq = pciide_pci_read(sc->sc_pc, sc->sc_tag, CMD_CONF);
pciide_pci_write(sc->sc_pc, sc->sc_tag, CMD_CONF, priirq);
} else {
secirq = pciide_pci_read(sc->sc_pc, sc->sc_tag, CMD_ARTTIM23);
pciide_pci_write(sc->sc_pc, sc->sc_tag, CMD_ARTTIM23, secirq);
}
pciide_irqack(chp);
}
void
cy693_chip_map(sc, pa)
struct pciide_softc *sc;