summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-09-06 17:20:44 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-09-06 17:20:44 +0000
commit34fa70e321c19b8d5c1da0d6252e920780dc41fc (patch)
treea5aa9ea07f4df46ba89276854242910fb78f6be4 /firmware
parente82f701fa469732cab1c549c23a025903ed8cbd7 (diff)
downloadrockbox-34fa70e321c19b8d5c1da0d6252e920780dc41fc.tar.gz
rockbox-34fa70e321c19b8d5c1da0d6252e920780dc41fc.zip
Now runs SET_MULTIPLE_MODE after usb disconnect, since the windows driver sets it to a non-default value.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2214 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/ata.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 32048ef53d..9f025588ff 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -661,6 +661,26 @@ static int identify(void)
return 0;
}
+static int set_multiple_mode(int sectors)
+{
+ if(!wait_for_rdy()) {
+ DEBUGF("set_multiple_mode() - not RDY\n");
+ return -1;
+ }
+
+ ATA_SELECT = ata_device;
+ ATA_NSECTOR = sectors;
+ ATA_COMMAND = CMD_SET_MULTIPLE_MODE;
+
+ if (!wait_for_rdy())
+ {
+ DEBUGF("set_multiple_mode() - CMD failed\n");
+ return -2;
+ }
+
+ return 0;
+}
+
int ata_init(void)
{
mutex_init(&ata_mtx);
@@ -692,6 +712,8 @@ int ata_init(void)
sizeof(ata_stack), ata_thread_name);
initialized = true;
}
+ if (set_multiple_mode(multisectors))
+ return -6;
ATA_SELECT = SELECT_LBA;
ATA_CONTROL = CONTROL_nIEN;