Subversion Repositories freemyipod

Rev

Rev 835 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 835 Rev 836
Line 524... Line 524...
524
    {
524
    {
525
        PASS_RC(ata_wait_for_not_bsy(10000000), 1, 0);
525
        PASS_RC(ata_wait_for_not_bsy(10000000), 1, 0);
526
        ata_write_cbr(&ATA_PIO_DVR, 0);
526
        ata_write_cbr(&ATA_PIO_DVR, 0);
527
        ata_write_cbr(&ATA_PIO_CSD, 0xec);
527
        ata_write_cbr(&ATA_PIO_CSD, 0xec);
528
        PASS_RC(ata_wait_for_start_of_transfer(10000000), 1, 1);
528
        PASS_RC(ata_wait_for_start_of_transfer(10000000), 1, 1);
529
        for (i = 0; i < 0x100; i++)
-
 
530
        {
-
 
531
            uint16_t word = ata_read_cbr(&ATA_PIO_DTR);
529
        for (i = 0; i < 0x100; i++) buf[i] = ata_read_cbr(&ATA_PIO_DTR);
532
            buf[i] = (word >> 8) | (word << 8);
-
 
533
        }
-
 
534
    }
530
    }
535
    return 0;
531
    return 0;
536
}
532
}
537
 
533
 
538
void ata_set_active(void)
534
void ata_set_active(void)
Line 592... Line 588...
592
        sleep(90000);
588
        sleep(90000);
593
        ATA_CONTROL = BIT(0);
589
        ATA_CONTROL = BIT(0);
594
        sleep(200000);
590
        sleep(200000);
595
        ATA_PIO_TIME = 0x191f7;
591
        ATA_PIO_TIME = 0x191f7;
596
        ATA_PIO_LHR = 0;
592
        ATA_PIO_LHR = 0;
-
 
593
        ATA_CFG = BIT(6);
597
        while (!(ATA_PIO_READY & BIT(1))) sleep(100);
594
        while (!(ATA_PIO_READY & BIT(1))) sleep(100);
598
        PASS_RC(ata_identify(ata_identify_data), 2, 0);
595
        PASS_RC(ata_identify(ata_identify_data), 2, 0);
599
        uint32_t piotime = 0x11f3;
596
        uint32_t piotime = 0x11f3;
600
        uint32_t mdmatime = 0x1c175;
597
        uint32_t mdmatime = 0x1c175;
601
        uint32_t udmatime = 0x5071152;
598
        uint32_t udmatime = 0x5071152;