From 34fa70e321c19b8d5c1da0d6252e920780dc41fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= Date: Fri, 6 Sep 2002 17:20:44 +0000 Subject: 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 --- firmware/drivers/ata.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'firmware/drivers/ata.c') 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; -- cgit v1.2.3