Soft reset on IDE device 1 causes the assertion of PDIAG- which causes the error register of device 0 to also be set to 1, indicating diagnostics passed successfully (+ a PIIX3 fix), fixes #4002.
This commit is contained in:
@@ -597,6 +597,12 @@ piix_write(int func, int addr, uint8_t val, void *priv)
|
||||
pci_set_mirq_routing(PCI_MIRQ0 + (addr & 0x01), PCI_IRQ_DISABLED);
|
||||
else
|
||||
pci_set_mirq_routing(PCI_MIRQ0 + (addr & 0x01), val & 0xf);
|
||||
if (dev->type == 3) {
|
||||
if (val & 0x20)
|
||||
sff_set_irq_mode(dev->bm[1], IRQ_MODE_MIRQ_0);
|
||||
else
|
||||
sff_set_irq_mode(dev->bm[1], IRQ_MODE_LEGACY);
|
||||
}
|
||||
piix_log("MIRQ%i is %s\n", addr & 0x01, (val & 0x20) ? "disabled" : "enabled");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1397,6 +1397,7 @@ ide_write_devctl(UNUSED(uint16_t addr), uint8_t val, void *priv)
|
||||
} else
|
||||
ide->tf->atastat = DRDY_STAT | DSC_STAT;
|
||||
ide->tf->error = 1;
|
||||
ide_other->tf->error = 1; /* Assert PDIAG-. */
|
||||
dev->cur_dev &= ~1;
|
||||
ch = dev->cur_dev;
|
||||
|
||||
@@ -1410,7 +1411,8 @@ ide_write_devctl(UNUSED(uint16_t addr), uint8_t val, void *priv)
|
||||
|
||||
old = dev->devctl;
|
||||
dev->devctl = val;
|
||||
if (!(val & 0x02) && (old & 0x02))
|
||||
// if (!(val & 0x02) && (old & 0x02))
|
||||
if ((old ^ val) & 0x02)
|
||||
ide_irq_update(ide_boards[ide->board], 1);
|
||||
}
|
||||
|
||||
@@ -1566,6 +1568,7 @@ ide_writeb(uint16_t addr, uint8_t val, void *priv)
|
||||
if ((ide->type == IDE_NONE) || ((ide->type & IDE_SHADOW) && (val != WIN_DRIVE_DIAGNOSTICS)))
|
||||
break;
|
||||
|
||||
pclog("IRQ lower\n");
|
||||
ide_irq_lower(ide);
|
||||
ide->command = val;
|
||||
|
||||
@@ -2459,6 +2462,7 @@ ide_callback(void *priv)
|
||||
else {
|
||||
ide->blocksize = ide->tf->secount;
|
||||
ide->tf->atastat = DRDY_STAT | DSC_STAT;
|
||||
pclog("IRQ raise\n");
|
||||
ide_irq_raise(ide);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user