diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-06-12 22:29:30 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-06-12 22:29:30 -0400 |
commit | 2e3eeebc33bcf780912f3b10fb23f82d4f9afb22 (patch) | |
tree | f17f99e4de0deebd421e91c2b47f3863c266a94e /src | |
parent | 93479e42900e05a6aafcefa6a6ed80f4e1ee97db (diff) | |
download | seabios-hppa-2e3eeebc33bcf780912f3b10fb23f82d4f9afb22.zip seabios-hppa-2e3eeebc33bcf780912f3b10fb23f82d4f9afb22.tar.gz seabios-hppa-2e3eeebc33bcf780912f3b10fb23f82d4f9afb22.tar.bz2 |
Wait for RDY bit when resetting ata hard drives.
If the reset doesn't wait for RDY, apparently irqs can get generated
later in the boot which can confuse the OS.
Diffstat (limited to 'src')
-rw-r--r-- | src/ata.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -132,6 +132,15 @@ ata_reset(int driveid) // select device outb(slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0, iobase1+ATA_CB_DH); msleep(50); + u8 sc = inb(iobase1+ATA_CB_SC); + u8 sn = inb(iobase1+ATA_CB_SN); + + // For predetermined ATA drives - wait for ready. + if (sc==0x01 && sn==0x01) { + u8 type=GET_EBDA(ata.devices[driveid].type); + if (type == ATA_TYPE_ATA) + await_ide(NOT_BSY_RDY, iobase1, IDE_TIMEOUT); + } // 8.2.1 (h) -- wait for not BSY status = await_ide(NOT_BSY, iobase1, IDE_TIMEOUT); |