Added a >2ms delay in ata_hard_reset() before reading status, as per ATA specificatione (pedantic mode entered)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2902 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-12-03 11:26:39 +00:00
parent cd89646e58
commit 1ea00d1a03

View file

@ -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 */