forked from len0rd/rockbox
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
This commit is contained in:
parent
aaf3f5fd01
commit
2d8813e26b
2 changed files with 14 additions and 7 deletions
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue