diff options
Diffstat (limited to 'firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c')
-rw-r--r-- | firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c index a1985472a0..76929e603e 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c | |||
@@ -126,8 +126,10 @@ void GIO2(void) | |||
126 | 126 | ||
127 | #define VFAT_SECTOR_SIZE(x) ( (x)/0x8000 ) /* 1GB array requires 80kB of RAM */ | 127 | #define VFAT_SECTOR_SIZE(x) ( (x)/0x8000 ) /* 1GB array requires 80kB of RAM */ |
128 | 128 | ||
129 | extern int ata_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf); | 129 | extern int ata_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf); |
130 | extern int ata_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf); | 130 | extern int ata_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf); |
131 | |||
132 | // XXX 64-bit: Due to this it's not likely that this target will ever handle 64-bit storage. | ||
131 | 133 | ||
132 | struct main_header | 134 | struct main_header |
133 | { | 135 | { |
@@ -253,9 +255,9 @@ static void cfs_init(void) | |||
253 | /* Read root inode */ | 255 | /* Read root inode */ |
254 | _ata_read_sectors(CFS_CLUSTER2CLUSTER(cfs->first_inode), 64, §or2); | 256 | _ata_read_sectors(CFS_CLUSTER2CLUSTER(cfs->first_inode), 64, §or2); |
255 | root_inode = (struct cfs_inode*)§or2; | 257 | root_inode = (struct cfs_inode*)§or2; |
256 | 258 | ||
257 | logf("Root inode = 0x%x", root_inode); | 259 | logf("Root inode = 0x%x", root_inode); |
258 | 260 | ||
259 | logf("0x%x 0x%x", CFS_CLUSTER2CLUSTER(root_inode->first_class_chain[0]), root_inode->first_class_chain[0]); | 261 | logf("0x%x 0x%x", CFS_CLUSTER2CLUSTER(root_inode->first_class_chain[0]), root_inode->first_class_chain[0]); |
260 | 262 | ||
261 | /* Read root inode's first sector */ | 263 | /* Read root inode's first sector */ |
@@ -277,9 +279,9 @@ static void cfs_init(void) | |||
277 | vfat_inode_nr = root_direntry_items[i].inode_number; | 279 | vfat_inode_nr = root_direntry_items[i].inode_number; |
278 | } | 280 | } |
279 | } | 281 | } |
280 | 282 | ||
281 | logf("VFAT inode = 0x%x", vfat_inode_nr); | 283 | logf("VFAT inode = 0x%x", vfat_inode_nr); |
282 | 284 | ||
283 | if(vfat_inode_nr != 0) | 285 | if(vfat_inode_nr != 0) |
284 | { | 286 | { |
285 | /* Read VFAT inode */ | 287 | /* Read VFAT inode */ |
@@ -384,19 +386,19 @@ static void cfs_init(void) | |||
384 | cfs_inited = true; | 386 | cfs_inited = true; |
385 | } | 387 | } |
386 | 388 | ||
387 | static inline unsigned long map_sector(unsigned long sector) | 389 | static inline sector_t map_sector(sector_t sector) |
388 | { | 390 | { |
389 | /* | 391 | /* |
390 | * Sector mapping: start of CFS + FAT_SECTOR2CFS_SECTOR(sector) + missing part | 392 | * Sector mapping: start of CFS + FAT_SECTOR2CFS_SECTOR(sector) + missing part |
391 | * FAT works with sectors of 0x200 bytes, CFS with sectors of 0x8000 bytes. | 393 | * FAT works with sectors of 0x200 bytes, CFS with sectors of 0x8000 bytes. |
392 | */ | 394 | */ |
393 | #ifndef BOOTLOADER | 395 | #ifndef BOOTLOADER |
394 | unsigned long *sectors = core_get_data(sectors_handle); | 396 | sector_t *sectors = core_get_data(sectors_handle); |
395 | #endif | 397 | #endif |
396 | return cfs_start+sectors[sector/64]*64+sector%64; | 398 | return cfs_start+sectors[sector/64]*64+sector%64; |
397 | } | 399 | } |
398 | 400 | ||
399 | int ata_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf) | 401 | int ata_read_sectors(IF_MD(int drive,) sector_t start, int count, void* buf) |
400 | { | 402 | { |
401 | if(!cfs_inited) | 403 | if(!cfs_inited) |
402 | cfs_init(); | 404 | cfs_init(); |
@@ -423,7 +425,7 @@ int ata_read_sectors(IF_MD(int drive,) unsigned long start, int count, void* buf | |||
423 | } | 425 | } |
424 | } | 426 | } |
425 | 427 | ||
426 | int ata_write_sectors(IF_MD(int drive,) unsigned long start, int count, const void* buf) | 428 | int ata_write_sectors(IF_MD(int drive,) sector_t start, int count, const void* buf) |
427 | { | 429 | { |
428 | if(!cfs_inited) | 430 | if(!cfs_inited) |
429 | cfs_init(); | 431 | cfs_init(); |