diff options
-rw-r--r-- | apps/debug_menu.c | 4 | ||||
-rw-r--r-- | firmware/drivers/ata.c | 7 | ||||
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c | 18 |
3 files changed, 23 insertions, 6 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 427df27e3e..32c34942e6 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1567,9 +1567,9 @@ static int disk_callback(int btn, struct gui_synclist *lists) | |||
1567 | '0' + (i & 7)); | 1567 | '0' + (i & 7)); |
1568 | } | 1568 | } |
1569 | #endif /* HAVE_ATA_DMA */ | 1569 | #endif /* HAVE_ATA_DMA */ |
1570 | i = identify_info[0] & (1 << 15); | 1570 | i = identify_info[83] & (1 << 2); |
1571 | simplelist_addline( | 1571 | simplelist_addline( |
1572 | "CF compatible: %s", i ? "yes" : "no"); | 1572 | "CFA compatible: %s", i ? "yes" : "no"); |
1573 | i = identify_info[0] & (1 << 6); | 1573 | i = identify_info[0] & (1 << 6); |
1574 | simplelist_addline( | 1574 | simplelist_addline( |
1575 | "Fixed device: %s", i ? "yes" : "no"); | 1575 | "Fixed device: %s", i ? "yes" : "no"); |
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 5331e7f589..cb857158ca 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -1116,8 +1116,13 @@ static int set_features(void) | |||
1116 | 1116 | ||
1117 | #ifdef HAVE_ATA_DMA | 1117 | #ifdef HAVE_ATA_DMA |
1118 | if (identify_info[53] & (1<<2)) { | 1118 | if (identify_info[53] & (1<<2)) { |
1119 | int max_udma = ATA_MAX_UDMA; | ||
1120 | #if ATA_MAX_UDMA > 2 | ||
1121 | if (!(ata_identify_data[93] & BIT(13))) | ||
1122 | max_udma = 2; | ||
1123 | #endif | ||
1119 | /* Ultra DMA mode info present, find a mode */ | 1124 | /* Ultra DMA mode info present, find a mode */ |
1120 | dma_mode = ata_get_best_mode(identify_info[88], ATA_MAX_UDMA, 0x40); | 1125 | dma_mode = ata_get_best_mode(identify_info[88], max_udma, 0x40); |
1121 | } | 1126 | } |
1122 | 1127 | ||
1123 | if (!dma_mode) { | 1128 | if (!dma_mode) { |
diff --git a/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c b/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c index 97a55eba10..87450aca73 100644 --- a/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c +++ b/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c | |||
@@ -609,15 +609,22 @@ static int ata_set_feature(uint32_t feature, uint32_t param) | |||
609 | static int udmatimes[ATA_MAX_UDMA + 1] = { | 609 | static int udmatimes[ATA_MAX_UDMA + 1] = { |
610 | 0x4071152, | 610 | 0x4071152, |
611 | 0x2050d52, | 611 | 0x2050d52, |
612 | #if ATA_MAX_UDMA >= 2 | ||
612 | 0x2030a52, | 613 | 0x2030a52, |
614 | #endif | ||
615 | #if ATA_MAX_UDMA >= 3 | ||
613 | 0x1020a52, | 616 | 0x1020a52, |
614 | 0x1010a52 | 617 | #endif |
618 | #if ATA_MAX_UDMA >= 4 | ||
619 | 0x1010a52, | ||
620 | #endif | ||
615 | }; | 621 | }; |
616 | static int mwdmatimes[ATA_MAX_MWDMA + 1] = { | 622 | static int mwdmatimes[ATA_MAX_MWDMA + 1] = { |
617 | 0x1c175, | 623 | 0x1c175, |
618 | 0x7083, | 624 | 0x7083, |
619 | 0x5072 | 625 | 0x5072, |
620 | }; | 626 | }; |
627 | |||
621 | static int ata_get_best_mode(unsigned short identword, int max, int modetype) | 628 | static int ata_get_best_mode(unsigned short identword, int max, int modetype) |
622 | { | 629 | { |
623 | unsigned short testbit = BIT_N(max); | 630 | unsigned short testbit = BIT_N(max); |
@@ -719,7 +726,12 @@ static int ata_power_up(void) | |||
719 | #ifdef HAVE_ATA_DMA | 726 | #ifdef HAVE_ATA_DMA |
720 | if ((ata_identify_data[53] & BIT(2)) && (ata_identify_data[88] & BITRANGE(0, 4))) /* Any UDMA */ | 727 | if ((ata_identify_data[53] & BIT(2)) && (ata_identify_data[88] & BITRANGE(0, 4))) /* Any UDMA */ |
721 | { | 728 | { |
722 | param = ata_get_best_mode(ata_identify_data[88], ATA_MAX_UDMA, 0x40); | 729 | int max_udma = ATA_MAX_UDMA; |
730 | #if ATA_MAX_UDMA > 2 | ||
731 | if (!(ata_identify_data[93] & BIT(13))) | ||
732 | max_udma = 2; | ||
733 | #endif | ||
734 | param = ata_get_best_mode(ata_identify_data[88], max_udma, 0x40); | ||
723 | ATA_UDMA_TIME = udmatimes[param & 0xf]; | 735 | ATA_UDMA_TIME = udmatimes[param & 0xf]; |
724 | ata_dma_flags = BIT(2) | BIT(3) | BIT(9) | BIT(10); | 736 | ata_dma_flags = BIT(2) | BIT(3) | BIT(9) | BIT(10); |
725 | } | 737 | } |