summaryrefslogtreecommitdiff
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)
1046 int pio_mode = 2; 1046 int pio_mode = 2;
1047 1047
1048 /* Find out the highest supported PIO mode */ 1048 /* Find out the highest supported PIO mode */
1049 if(identify_info[64] & 2) 1049 if (identify_info[53] & (1<<1)) { /* Is word 64 valid? */
1050 if (identify_info[64] & 2)
1050 pio_mode = 4; 1051 pio_mode = 4;
1051 else 1052 else if(identify_info[64] & 1)
1052 if(identify_info[64] & 1) 1053 pio_mode = 3;
1053 pio_mode = 3; 1054 }
1054 1055
1055 /* Update the table: set highest supported pio mode that we also support */ 1056 /* Update the table: set highest supported pio mode that we also support */
1056 features[0].parameter = 8 + pio_mode; 1057 features[0].parameter = 8 + pio_mode;
1057 1058
1058#ifdef HAVE_ATA_DMA 1059#ifdef HAVE_ATA_DMA
1059 if (identify_info[53] & (1<<2)) 1060 if (identify_info[53] & (1<<2))
1060 /* Ultra DMA mode info present, find a mode */ 1061 /* Ultra DMA mode info present, find a mode */