summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-05-06 10:02:46 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-05-06 10:02:46 +0000
commit6edb95d0509afc2bd66b2cb1b3feee5e363c3d62 (patch)
tree9ba2afed4ada34aa03e90728d3e235ebf3e84ab7 /firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
parentc95adecb0770a7eebcb1a9f945c7bc2e8ff302ed (diff)
Gigabeat S: Make sure ATA interface is idle before a reset.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17396 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/ata-imx31.c')
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/ata-imx31.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c b/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
index 92cc048d57..9c3c72e2c5 100644
--- a/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
@@ -106,6 +106,9 @@ void ata_set_pio_timings(int mode)
void ata_reset(void)
{
+ /* Be sure we're not busy */
+ while (!(ATA_INTERRUPT_PENDING & ATA_CONTROLLER_IDLE));
+
ATA_INTF_CONTROL &= ~ATA_ATA_RST;
sleep(1);
ATA_INTF_CONTROL |= ATA_ATA_RST;