diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 8dfc8d965d..ec04ac1426 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -1016,6 +1016,35 @@ static int STORAGE_INIT_ATTR ata_hard_reset(void) return ret; } +// not putting this into STORAGE_INIT_ATTR, as ATA spec recommends to +// re-read identify_info after soft reset. So we'll do that. +static int identify(void) +{ + int i; + + ATA_OUT8(ATA_SELECT, ata_device); + + if(!wait_for_rdy()) { + DEBUGF("identify() - not RDY\n"); + return -1; + } + ATA_OUT8(ATA_COMMAND, CMD_IDENTIFY); + + if (!wait_for_start_of_transfer()) + { + DEBUGF("identify() - CMD failed\n"); + return -2; + } + + for (i=0; i