summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/ata-imx31.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c b/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
index 92c2300..965b447 100644
--- a/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
@@ -24,6 +24,7 @@
#include "power.h"
#include "panic.h"
#include "ata.h"
+#include "ata-target.h"
#include "clkctl-imx31.h"
static const struct ata_pio_timings
@@ -78,6 +79,8 @@ static const struct ata_pio_timings
},
};
+static bool initialized = false;
+
/* Setup the timing for PIO mode */
static void ata_set_pio_mode(int mode)
{
@@ -125,8 +128,19 @@ void ata_device_init(void)
{
ATA_INTF_CONTROL |= ATA_ATA_RST; /* Make sure we're not in reset mode */
- /* Setup mode 0 by default */
- ata_set_pio_mode(0);
+ if (!initialized)
+ {
+ initialized = true;
+ /* Setup mode 0 by default */
+ ata_set_pio_mode(0);
+ /* mode may be switched later once identify info is ready in which
+ * case the main driver calls back */
+ }
+ else
+ {
+ /* identify info will be ready */
+ ata_identify_ready();
+ }
}
void ata_identify_ready(void)