freemyipod r836 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r835‎ | r836 | r837 >
Date:23:34, 25 December 2011
Author:theseven
Status:new
Tags:
Comment:
emCORE: iPod Classic: Fix HDD endianness
Modified paths:
  • /emcore/trunk/target/ipodclassic/storage_ata.c (modified) (history)

Diff [purge]

Index: emcore/trunk/target/ipodclassic/storage_ata.c
@@ -526,11 +526,7 @@
527527 ata_write_cbr(&ATA_PIO_DVR, 0);
528528 ata_write_cbr(&ATA_PIO_CSD, 0xec);
529529 PASS_RC(ata_wait_for_start_of_transfer(10000000), 1, 1);
530 - for (i = 0; i < 0x100; i++)
531 - {
532 - uint16_t word = ata_read_cbr(&ATA_PIO_DTR);
533 - buf[i] = (word >> 8) | (word << 8);
534 - }
 530+ for (i = 0; i < 0x100; i++) buf[i] = ata_read_cbr(&ATA_PIO_DTR);
535531 }
536532 return 0;
537533 }
@@ -594,6 +590,7 @@
595591 sleep(200000);
596592 ATA_PIO_TIME = 0x191f7;
597593 ATA_PIO_LHR = 0;
 594+ ATA_CFG = BIT(6);
598595 while (!(ATA_PIO_READY & BIT(1))) sleep(100);
599596 PASS_RC(ata_identify(ata_identify_data), 2, 0);
600597 uint32_t piotime = 0x11f3;