summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-03-02 06:10:13 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-03-02 06:10:13 +0000
commit2d8813e26ba4c185996c9552f935a2de34566e17 (patch)
tree4f8bc591feaf01945592d078671e160e07dbd256
parentaaf3f5fd01be05d5e80c9e49512e2af4baf3ccb6 (diff)
downloadrockbox-2d8813e26ba4c185996c9552f935a2de34566e17.tar.gz
rockbox-2d8813e26ba4c185996c9552f935a2de34566e17.tar.bz2
rockbox-2d8813e26ba4c185996c9552f935a2de34566e17.zip
imx31 ATA: Correct a register #define error (due to error in user's manual). Fix timing for PIO tAX.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20169 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-xfirmware/export/imx31l.h5
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/ata-imx31.c16
2 files changed, 14 insertions, 7 deletions
diff --git a/firmware/export/imx31l.h b/firmware/export/imx31l.h
index cdae29f158..91e878e636 100755
--- a/firmware/export/imx31l.h
+++ b/firmware/export/imx31l.h
@@ -439,11 +439,12 @@
/* ATA */
#define ATA_TIME_OFF (*(REG8_PTR_T)(ATA_BASE_ADDR+0x00))
#define ATA_TIME_ON (*(REG8_PTR_T)(ATA_BASE_ADDR+0x01))
+ /* PIO */
#define ATA_TIME_1 (*(REG8_PTR_T)(ATA_BASE_ADDR+0x02))
#define ATA_TIME_2W (*(REG8_PTR_T)(ATA_BASE_ADDR+0x03))
- /* PIO */
#define ATA_TIME_2R (*(REG8_PTR_T)(ATA_BASE_ADDR+0x04))
#define ATA_TIME_AX (*(REG8_PTR_T)(ATA_BASE_ADDR+0x05))
+#define ATA_TIME_PIO_RDX (*(REG8_PTR_T)(ATA_BASE_ADDR+0x06))
#define ATA_TIME_4 (*(REG8_PTR_T)(ATA_BASE_ADDR+0x07))
#define ATA_TIME_9 (*(REG8_PTR_T)(ATA_BASE_ADDR+0x08))
/* MDMA */
@@ -454,7 +455,7 @@
/* UDMA */
#define ATA_TIME_ACK (*(REG8_PTR_T)(ATA_BASE_ADDR+0x0D))
#define ATA_TIME_ENV (*(REG8_PTR_T)(ATA_BASE_ADDR+0x0E))
-#define ATA_TIME_PIO_RDX (*(REG8_PTR_T)(ATA_BASE_ADDR+0x0F))
+#define ATA_TIME_RPX (*(REG8_PTR_T)(ATA_BASE_ADDR+0x0F))
#define ATA_TIME_ZAH (*(REG8_PTR_T)(ATA_BASE_ADDR+0x10))
#define ATA_TIME_MLIX (*(REG8_PTR_T)(ATA_BASE_ADDR+0x11))
#define ATA_TIME_DVH (*(REG8_PTR_T)(ATA_BASE_ADDR+0x12))
diff --git a/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c b/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
index 28a7c508f6..59b89c02c9 100644
--- a/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/ata-imx31.c
@@ -33,8 +33,8 @@ static const struct ata_pio_timings
{
uint16_t time_2w; /* t2 during write */
uint16_t time_2r; /* t2 during read */
+ uint8_t time_ax; /* tA */
uint8_t time_1; /* t1 */
- uint8_t time_pio_rdx; /* trd */
uint8_t time_4; /* t4 */
uint8_t time_9; /* t9 */
} pio_timings[5] =
@@ -44,6 +44,7 @@ static const struct ata_pio_timings
.time_1 = 70,
.time_2w = 290,
.time_2r = 290,
+ .time_ax = 35,
.time_4 = 30,
.time_9 = 20
},
@@ -52,6 +53,7 @@ static const struct ata_pio_timings
.time_1 = 50,
.time_2w = 290,
.time_2r = 290,
+ .time_ax = 35,
.time_4 = 20,
.time_9 = 15
},
@@ -60,6 +62,7 @@ static const struct ata_pio_timings
.time_1 = 30,
.time_2w = 290,
.time_2r = 290,
+ .time_ax = 35,
.time_4 = 15,
.time_9 = 10
},
@@ -68,6 +71,7 @@ static const struct ata_pio_timings
.time_1 = 30,
.time_2w = 80,
.time_2r = 80,
+ .time_ax = 35,
.time_4 = 10,
.time_9 = 10
},
@@ -76,6 +80,7 @@ static const struct ata_pio_timings
.time_1 = 25,
.time_2w = 70,
.time_2r = 70,
+ .time_ax = 35,
.time_4 = 10,
.time_9 = 10
},
@@ -99,13 +104,10 @@ void ata_set_pio_timings(int mode)
pio_mode = mode;
- ATA_TIME_OFF = 3;
- ATA_TIME_ON = 3;
-
ATA_TIME_1 = (timings->time_1 + T) / T;
ATA_TIME_2W = (timings->time_2w + T) / T;
ATA_TIME_2R = (timings->time_2r + T) / T;
- ATA_TIME_AX = (35 + T) / T; /* tA */
+ ATA_TIME_AX = (timings->time_ax + T) / T + 2; /* 1.5 + tAX */
ATA_TIME_PIO_RDX = 1;
ATA_TIME_4 = (timings->time_4 + T) / T;
ATA_TIME_9 = (timings->time_9 + T) / T;
@@ -154,6 +156,10 @@ void ata_device_init(void)
/* Make sure we're not in reset mode */
ata_enable(true);
+ /* All modes use same tOFF/tON */
+ ATA_TIME_OFF = 3;
+ ATA_TIME_ON = 3;
+
/* mode may be switched later once identify info is ready in which
* case the main driver calls back */
ata_set_pio_timings(pio_mode);