Now uses CMD_STANDBY again. CMD_SLEEP used more power than CMD_STANDBY for some reason
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1507 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
af6ceba2a3
commit
9d589401c1
1 changed files with 12 additions and 8 deletions
|
@ -26,6 +26,7 @@
|
|||
#include "debug.h"
|
||||
#include "panic.h"
|
||||
#include "usb.h"
|
||||
#include "power.h"
|
||||
|
||||
#define SECTOR_SIZE 512
|
||||
#define ATA_DATA (*((volatile unsigned short*)0x06104100))
|
||||
|
@ -290,16 +291,15 @@ static int ata_perform_sleep(void)
|
|||
return -1;
|
||||
}
|
||||
|
||||
ATA_SELECT = ata_device;
|
||||
#ifdef DEBUG
|
||||
ATA_COMMAND = CMD_STANDBY;
|
||||
#ifdef ATA_POWER_OFF
|
||||
ide_power_enable(false);
|
||||
#else
|
||||
ATA_COMMAND = CMD_SLEEP;
|
||||
#endif
|
||||
ATA_SELECT = ata_device;
|
||||
ATA_COMMAND = CMD_STANDBY;
|
||||
|
||||
if (!wait_for_rdy())
|
||||
ret = -1;
|
||||
|
||||
#endif
|
||||
sleeping = true;
|
||||
sleep_timer = 0;
|
||||
mutex_unlock(&ata_mtx);
|
||||
|
@ -373,13 +373,17 @@ int ata_soft_reset(void)
|
|||
|
||||
mutex_lock(&ata_mtx);
|
||||
|
||||
#ifdef ATA_POWER_OFF
|
||||
ide_power_enable(true);
|
||||
sleep(HZ);
|
||||
#else
|
||||
ATA_SELECT = SELECT_LBA | ata_device;
|
||||
ATA_CONTROL = CONTROL_nIEN|CONTROL_SRST;
|
||||
sleep(HZ/20000); /* >= 5us */
|
||||
|
||||
ATA_CONTROL = CONTROL_nIEN;
|
||||
sleep(HZ/400); /* >2ms */
|
||||
|
||||
#endif
|
||||
/* This little sucker can take up to 30 seconds */
|
||||
retry_count = 8;
|
||||
do
|
||||
|
|
Loading…
Reference in a new issue