summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorCástor Muñoz <cmvidal@gmail.com>2015-07-16 23:10:38 +0200
committerCástor Muñoz <cmvidal@gmail.com>2015-07-17 01:03:51 +0200
commit983c8084c9a64e48b29fb1e826cc84c35d2c9849 (patch)
tree27a535d53a84254c8682dd5017a529b22e8f1d1c /firmware/target
parentd68ecccd8880cbcf98e186d81bcbedbcd0fbedbc (diff)
downloadrockbox-983c8084c9a64e48b29fb1e826cc84c35d2c9849.tar.gz
rockbox-983c8084c9a64e48b29fb1e826cc84c35d2c9849.zip
iPod Classic: do not use HDD features on CE-ATA drives
Fix an 'ATA error' issue that affects CE-ATA devices. Change-Id: I246348bb0506155b096ed8559dcf1b0b0fab3596
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c
index 58060403d5..c629fd583a 100644
--- a/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c
+++ b/firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c
@@ -688,14 +688,14 @@ static int ata_power_up(void)
688 ata_dma = param ? true : false; 688 ata_dma = param ? true : false;
689 dma_mode = param; 689 dma_mode = param;
690 PASS_RC(ata_set_feature(0x03, param), 3, 4); 690 PASS_RC(ata_set_feature(0x03, param), 3, 4);
691 if (ata_identify_data[82] & BIT(5))
692 PASS_RC(ata_set_feature(ata_bbt ? 0x82 : 0x02, 0), 3, 5);
693 if (ata_identify_data[82] & BIT(6)) PASS_RC(ata_set_feature(0xaa, 0), 3, 6);
691 ATA_PIO_TIME = piotime; 694 ATA_PIO_TIME = piotime;
692 ATA_MDMA_TIME = mdmatime; 695 ATA_MDMA_TIME = mdmatime;
693 ATA_UDMA_TIME = udmatime; 696 ATA_UDMA_TIME = udmatime;
694 } 697 }
695 spinup_time = current_tick - spinup_start; 698 spinup_time = current_tick - spinup_start;
696 if (ata_identify_data[82] & BIT(5))
697 PASS_RC(ata_set_feature(ata_bbt ? 0x82 : 0x02, 0), 3, 5);
698 if (ata_identify_data[82] & BIT(6)) PASS_RC(ata_set_feature(0xaa, 0), 3, 6);
699 if (ata_lba48) 699 if (ata_lba48)
700 ata_total_sectors = ata_identify_data[100] 700 ata_total_sectors = ata_identify_data[100]
701 | (((uint64_t)ata_identify_data[101]) << 16) 701 | (((uint64_t)ata_identify_data[101]) << 16)
@@ -1139,7 +1139,8 @@ int ata_bbt_reload(void)
1139 ata_virtual_sectors = ata_total_sectors; 1139 ata_virtual_sectors = ata_total_sectors;
1140 else if (!memcmp(buf, "emBIbbth", 8)) 1140 else if (!memcmp(buf, "emBIbbth", 8))
1141 { 1141 {
1142 if (ata_identify_data[82] & BIT(5)) PASS_RC(ata_set_feature(0x02, 0), 1, 1); 1142 if (!ceata)
1143 if (ata_identify_data[82] & BIT(5)) PASS_RC(ata_set_feature(0x02, 0), 1, 1);
1143 ata_virtual_sectors = (((uint64_t)buf[0x1fd]) << 32) | buf[0x1fc]; 1144 ata_virtual_sectors = (((uint64_t)buf[0x1fd]) << 32) | buf[0x1fc];
1144 uint32_t count = buf[0x1ff]; 1145 uint32_t count = buf[0x1ff];
1145 if (count > ATA_BBT_PAGES / 64) 1146 if (count > ATA_BBT_PAGES / 64)