summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-08 12:03:40 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-08 17:08:08 +0000
commitc79f658125a7b53251820d866d8b6dfc004c4bff (patch)
tree1b3ee453abd4f1c2a0006952750c3151f786690e
parent4dcd1a9ed8638f248f4e7c650300a531a608b7a4 (diff)
downloadrockbox-c79f658125a7b53251820d866d8b6dfc004c4bff.tar.gz
rockbox-c79f658125a7b53251820d866d8b6dfc004c4bff.zip
ATA: In picking PIO modes, word 64 is only valid if word 53 bit 1 is set.
Change-Id: I0a7681be7d703c1baa7f8bd7b5e31f04f20f299d
-rw-r--r--firmware/drivers/ata.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 373078d8f9..2116855233 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -1046,15 +1046,16 @@ static int set_features(void)
int pio_mode = 2;
/* Find out the highest supported PIO mode */
- if(identify_info[64] & 2)
+ if (identify_info[53] & (1<<1)) { /* Is word 64 valid? */
+ if (identify_info[64] & 2)
pio_mode = 4;
- else
- if(identify_info[64] & 1)
- pio_mode = 3;
+ else if(identify_info[64] & 1)
+ pio_mode = 3;
+ }
/* Update the table: set highest supported pio mode that we also support */
features[0].parameter = 8 + pio_mode;
-
+
#ifdef HAVE_ATA_DMA
if (identify_info[53] & (1<<2))
/* Ultra DMA mode info present, find a mode */