diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 0fbc418c2f..5cff8af19e 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -523,16 +523,20 @@ static void ata_thread(void) } } +/* Hardware reset protocol as specified in chapter 9.1, ATA spec draft v5 */ int ata_hard_reset(void) { int ret; - PADR &= ~0x0200; + /* state HRR0 */ + PADR &= ~0x0200; /* assert _RESET */ + sleep(1); /* > 25us */ - sleep(2); - - PADR |= 0x0200; + /* state HRR1 */ + PADR |= 0x0200; /* negate _RESET */ + sleep(1); /* > 2ms */ + /* state HRR2 */ ret = wait_for_bsy(); /* Massage the return code so it is 0 on success and -1 on failure */