From 1ea00d1a0323745093442b889e33e5e82924726a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= Date: Tue, 3 Dec 2002 11:26:39 +0000 Subject: 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 --- firmware/drivers/ata.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'firmware/drivers/ata.c') 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 */ -- cgit v1.2.3