From 4f991fd676f091018135da8533bf8efd47863aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Wed, 30 Aug 2006 11:50:22 +0000 Subject: [PATCH] Properly initialize the nVidia MCP5X interrupts etc. Suggested by: nVidia --- sys/dev/ata/ata-chipset.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index bd9af15ec11..56800ee02d9 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -2863,7 +2863,11 @@ ata_nvidia_chipinit(device_t dev) ATA_OUTL(ctlr->r_res2, offset, 0x00ff00ff); /* enable device and PHY state change interrupts */ - ATA_OUTL(ctlr->r_res2, offset + 4, 0x00dd00dd); + ATA_OUTL(ctlr->r_res2, offset + 4, 0x000d000d); + + /* disable NCQ support */ + ATA_OUTL(ctlr->r_res2, 0x0400, + ATA_INL(ctlr->r_res2, 0x0400) & 0xfffffff9); } else { /* clear interrupt status */ @@ -2924,7 +2928,7 @@ ata_nvidia_status(device_t dev) /* get and clear interrupt status */ if (ctlr->chip->cfg2 & NVQ) { status = ATA_INL(ctlr->r_res2, offset); - ATA_OUTL(ctlr->r_res2, offset, (0x0f << shift)); + ATA_OUTL(ctlr->r_res2, offset, (0x0f << shift) | 0x00f000f0); } else { status = ATA_INB(ctlr->r_res2, offset); @@ -2947,6 +2951,7 @@ ata_nvidia_status(device_t dev) /* check for and handle disconnect events */ if ((status & (0x08 << shift)) && + !((status & (0x04 << shift) && ATA_IDX_INL(ch, ATA_SSTATUS))) && (tp = (struct ata_connect_task *) malloc(sizeof(struct ata_connect_task), M_ATA, M_NOWAIT | M_ZERO))) {