diff options
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c')
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c b/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c index 7a3be20577..9629b3e30f 100644 --- a/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c +++ b/firmware/target/arm/s5l8702/ipod6g/storage_ata-6g.c | |||
@@ -58,10 +58,9 @@ | |||
58 | #define CEATA_DAT_NONBUSY_TIMEOUT 5000000 | 58 | #define CEATA_DAT_NONBUSY_TIMEOUT 5000000 |
59 | #define CEATA_MMC_RCA 1 | 59 | #define CEATA_MMC_RCA 1 |
60 | 60 | ||
61 | |||
62 | /** static, private data **/ | 61 | /** static, private data **/ |
63 | static uint8_t ceata_taskfile[16] STORAGE_ALIGN_ATTR; | 62 | static uint8_t ceata_taskfile[16] STORAGE_ALIGN_ATTR; |
64 | static uint16_t ata_identify_data[0x100] STORAGE_ALIGN_ATTR; | 63 | static uint16_t ata_identify_data[ATA_IDENTIFY_WORDS] STORAGE_ALIGN_ATTR; |
65 | static bool ceata; | 64 | static bool ceata; |
66 | static bool ata_lba48; | 65 | static bool ata_lba48; |
67 | static bool ata_dma; | 66 | static bool ata_dma; |
@@ -510,7 +509,7 @@ static int ata_identify(uint16_t* buf) | |||
510 | ata_write_cbr(&ATA_PIO_DVR, 0); | 509 | ata_write_cbr(&ATA_PIO_DVR, 0); |
511 | ata_write_cbr(&ATA_PIO_CSD, CMD_IDENTIFY); | 510 | ata_write_cbr(&ATA_PIO_CSD, CMD_IDENTIFY); |
512 | PASS_RC(ata_wait_for_start_of_transfer(10000000), 1, 1); | 511 | PASS_RC(ata_wait_for_start_of_transfer(10000000), 1, 1); |
513 | for (i = 0; i < 0x100; i++) buf[i] = ata_read_cbr(&ATA_PIO_DTR); | 512 | for (i = 0; i < ATA_IDENTIFY_WORDS; i++) buf[i] = ata_read_cbr(&ATA_PIO_DTR); |
514 | } | 513 | } |
515 | return 0; | 514 | return 0; |
516 | } | 515 | } |
@@ -701,7 +700,7 @@ static int ata_power_up(void) | |||
701 | | (((uint64_t)ata_identify_data[103]) << 48); | 700 | | (((uint64_t)ata_identify_data[103]) << 48); |
702 | else | 701 | else |
703 | ata_total_sectors = ata_identify_data[60] | (((uint32_t)ata_identify_data[61]) << 16); | 702 | ata_total_sectors = ata_identify_data[60] | (((uint32_t)ata_identify_data[61]) << 16); |
704 | ata_total_sectors >>= 3; | 703 | ata_total_sectors >>= 3; /* ie SECTOR_SIZE/512. */ |
705 | ata_powered = true; | 704 | ata_powered = true; |
706 | ata_set_active(); | 705 | ata_set_active(); |
707 | return 0; | 706 | return 0; |
@@ -966,7 +965,7 @@ static int ata_reset(void) | |||
966 | return rc; | 965 | return rc; |
967 | } | 966 | } |
968 | 967 | ||
969 | int ata_read_sectors(IF_MD(int drive,) unsigned long start, int incount, | 968 | int ata_read_sectors(IF_MD(int drive,) sector_t start, int incount, |
970 | void* inbuf) | 969 | void* inbuf) |
971 | { | 970 | { |
972 | mutex_lock(&ata_mutex); | 971 | mutex_lock(&ata_mutex); |
@@ -975,7 +974,7 @@ int ata_read_sectors(IF_MD(int drive,) unsigned long start, int incount, | |||
975 | return rc; | 974 | return rc; |
976 | } | 975 | } |
977 | 976 | ||
978 | int ata_write_sectors(IF_MD(int drive,) unsigned long start, int count, | 977 | int ata_write_sectors(IF_MD(int drive,) sector_t start, int count, |
979 | const void* outbuf) | 978 | const void* outbuf) |
980 | { | 979 | { |
981 | mutex_lock(&ata_mutex); | 980 | mutex_lock(&ata_mutex); |