diff options
| author | Björn Stenberg <bjorn@haxx.se> | 2002-08-14 16:37:28 +0000 |
|---|---|---|
| committer | Björn Stenberg <bjorn@haxx.se> | 2002-08-14 16:37:28 +0000 |
| commit | 63457c5c638e52349eebdce8ce16bba84723118b (patch) | |
| tree | 9927d0ed62fdc27890fa8d5b7cb7196c29508565 /firmware/drivers/ata.c | |
| parent | 9ab90eabd1053a7ba8fbbd0ace579b519f2338fa (diff) | |
| download | rockbox-63457c5c638e52349eebdce8ce16bba84723118b.zip rockbox-63457c5c638e52349eebdce8ce16bba84723118b.tar.gz rockbox-63457c5c638e52349eebdce8ce16bba84723118b.tar.bz2 rockbox-63457c5c638e52349eebdce8ce16bba84723118b.tar.xz | |
Added support for reading/writing 256 sectors
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1736 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
| -rw-r--r-- | firmware/drivers/ata.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 8e2aa48..ebe9602 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -136,10 +136,10 @@ static int wait_for_end_of_transfer(void) } int ata_read_sectors(unsigned long start, - unsigned char count, + int count, void* buf) __attribute__ ((section (".icode"))); int ata_read_sectors(unsigned long start, - unsigned char count, + int count, void* buf) { int i; @@ -169,7 +169,11 @@ int ata_read_sectors(unsigned long start, led(true); - ATA_NSECTOR = count; + if ( count == 256 ) + ATA_NSECTOR = 0; /* 0 means 256 sectors */ + else + ATA_NSECTOR = (unsigned char)count; + ATA_SECTOR = start & 0xff; ATA_LCYL = (start >> 8) & 0xff; ATA_HCYL = (start >> 16) & 0xff; @@ -215,7 +219,7 @@ int ata_read_sectors(unsigned long start, } int ata_write_sectors(unsigned long start, - unsigned char count, + int count, void* buf) { int i; @@ -242,7 +246,10 @@ int ata_write_sectors(unsigned long start, led(true); - ATA_NSECTOR = count; + if ( count == 256 ) + ATA_NSECTOR = 0; /* 0 means 256 sectors */ + else + ATA_NSECTOR = (unsigned char)count; ATA_SECTOR = start & 0xff; ATA_LCYL = (start >> 8) & 0xff; ATA_HCYL = (start >> 16) & 0xff; |