From: Kevin O'Connor Date: Sun, 13 Dec 2009 17:02:55 +0000 (-0500) Subject: ATA 48bit LBA should only be activated on read/write commands. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=d43e1788502dc99d46bb634424ac70137874f517;p=seabios.git ATA 48bit LBA should only be activated on read/write commands. Check explicitly for an extended read/write command instead of 0x04 bit set. The identify command has that bit set, but doesn't need the 48bit lba registers set. --- diff --git a/src/ata.c b/src/ata.c index 6c2fc98..d87072d 100644 --- a/src/ata.c +++ b/src/ata.c @@ -209,7 +209,8 @@ send_cmd(struct drive_s *drive_g, struct ata_pio_command *cmd) return status; } - if (cmd->command & 0x04) { + if (cmd->command == ATA_CMD_READ_SECTORS_EXT + || cmd->command == ATA_CMD_WRITE_SECTORS_EXT) { outb(0x00, iobase1 + ATA_CB_FR); outb(cmd->sector_count2, iobase1 + ATA_CB_SC); outb(cmd->lba_low2, iobase1 + ATA_CB_SN); diff --git a/src/ata.h b/src/ata.h index f8d86aa..d0a2f8b 100644 --- a/src/ata.h +++ b/src/ata.h @@ -112,6 +112,7 @@ void describe_atapi(struct drive_s *drive_g); #define ATA_CMD_READ_DMA_QUEUED 0xC7 #define ATA_CMD_READ_MULTIPLE 0xC4 #define ATA_CMD_READ_SECTORS 0x20 +#define ATA_CMD_READ_SECTORS_EXT 0x24 #define ATA_CMD_READ_VERIFY_SECTORS 0x40 #define ATA_CMD_RECALIBRATE 0x10 #define ATA_CMD_REQUEST_SENSE 0x03 @@ -129,6 +130,7 @@ void describe_atapi(struct drive_s *drive_g); #define ATA_CMD_WRITE_DMA_QUEUED 0xCC #define ATA_CMD_WRITE_MULTIPLE 0xC5 #define ATA_CMD_WRITE_SECTORS 0x30 +#define ATA_CMD_WRITE_SECTORS_EXT 0x34 #define ATA_CMD_WRITE_VERIFY 0x3C #endif // ata.h