summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-12-03 11:26:39 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-12-03 11:26:39 +0000
commit1ea00d1a0323745093442b889e33e5e82924726a (patch)
treee54436a9f3248b22824572db7a912e56e259cc32 /firmware/drivers/ata.c
parentcd89646e5821e4c752e2d1726477b8122a66bc3b (diff)
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
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c12
1 files changed, 8 insertions, 4 deletions
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 */