summaryrefslogtreecommitdiff
path: root/firmware/drivers/ata.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-01-22 09:23:31 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-01-22 09:23:31 +0000
commit060609a2023bfcc99472cfe4e94a2cc3704bd92c (patch)
treecc51f89e8dc4cca19ff4453195cd712888314368 /firmware/drivers/ata.c
parent5729be4017c6e6081069c56637c4339aaddddd0b (diff)
downloadrockbox-060609a2023bfcc99472cfe4e94a2cc3704bd92c.zip
rockbox-060609a2023bfcc99472cfe4e94a2cc3704bd92c.tar.gz
rockbox-060609a2023bfcc99472cfe4e94a2cc3704bd92c.tar.bz2
rockbox-060609a2023bfcc99472cfe4e94a2cc3704bd92c.tar.xz
i.MX31: Busy wait for a couple microseconds at most then sleep until next tick when polling drive status. This prevents pointless jumps to overdrive speed from perceived high load when waiting for lengthy ops to complete such as spinup and sleep.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29108 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r--firmware/drivers/ata.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 7d37d05..2cdd674 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -201,6 +201,7 @@ static int perform_soft_reset(void);
static int set_multiple_mode(int sectors);
static int set_features(void);
+#ifndef ATA_TARGET_POLLING
STATICIRAM ICODE_ATTR int wait_for_bsy(void)
{
long timeout = current_tick + HZ*30;
@@ -235,6 +236,12 @@ STATICIRAM ICODE_ATTR int wait_for_rdy(void)
return 0; /* timeout */
}
+#else
+extern int ata_wait_for_bsy(void);
+extern int ata_wait_for_rdy(void);
+#define wait_for_bsy ata_wait_for_bsy
+#define wait_for_rdy ata_wait_for_rdy
+#endif
STATICIRAM ICODE_ATTR int wait_for_start_of_transfer(void)
{