diff options
Diffstat (limited to 'firmware/drivers/ata_flash.c')
-rw-r--r-- | firmware/drivers/ata_flash.c | 89 |
1 files changed, 30 insertions, 59 deletions
diff --git a/firmware/drivers/ata_flash.c b/firmware/drivers/ata_flash.c index d77e05647b..9b1b64145d 100644 --- a/firmware/drivers/ata_flash.c +++ b/firmware/drivers/ata_flash.c | |||
@@ -19,7 +19,7 @@ | |||
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include "ata.h" | 22 | #include "storage.h" |
23 | #include <stdbool.h> | 23 | #include <stdbool.h> |
24 | #include <string.h> | 24 | #include <string.h> |
25 | 25 | ||
@@ -42,8 +42,6 @@ | |||
42 | 42 | ||
43 | #define SECTOR_SIZE (512) | 43 | #define SECTOR_SIZE (512) |
44 | 44 | ||
45 | static unsigned short identify_info[SECTOR_SIZE]; | ||
46 | int ata_spinup_time = 0; | ||
47 | long last_disk_activity = -1; | 45 | long last_disk_activity = -1; |
48 | 46 | ||
49 | #if CONFIG_FLASH == FLASH_IFP7XX | 47 | #if CONFIG_FLASH == FLASH_IFP7XX |
@@ -386,7 +384,7 @@ int flash_disk_read_sectors(unsigned long start, | |||
386 | return done; | 384 | return done; |
387 | } | 385 | } |
388 | 386 | ||
389 | int ata_read_sectors(IF_MV2(int drive,) | 387 | int nand_read_sectors(IF_MV2(int drive,) |
390 | unsigned long start, | 388 | unsigned long start, |
391 | int incount, | 389 | int incount, |
392 | void* inbuf) | 390 | void* inbuf) |
@@ -403,7 +401,7 @@ int ata_read_sectors(IF_MV2(int drive,) | |||
403 | return 0; | 401 | return 0; |
404 | } | 402 | } |
405 | 403 | ||
406 | int ata_write_sectors(IF_MV2(int drive,) | 404 | int nand_write_sectors(IF_MV2(int drive,) |
407 | unsigned long start, | 405 | unsigned long start, |
408 | int count, | 406 | int count, |
409 | const void* buf) | 407 | const void* buf) |
@@ -414,60 +412,7 @@ int ata_write_sectors(IF_MV2(int drive,) | |||
414 | return -1; | 412 | return -1; |
415 | } | 413 | } |
416 | 414 | ||
417 | /* schedule a single sector write, executed with the the next spinup | 415 | int nand_init(void) |
418 | (volume 0 only, used for config sector) */ | ||
419 | extern void ata_delayed_write(unsigned long sector, const void* buf) | ||
420 | { | ||
421 | (void)sector; | ||
422 | (void)buf; | ||
423 | } | ||
424 | |||
425 | /* write the delayed sector to volume 0 */ | ||
426 | extern void ata_flush(void) | ||
427 | { | ||
428 | |||
429 | } | ||
430 | |||
431 | void ata_spindown(int seconds) | ||
432 | { | ||
433 | (void)seconds; | ||
434 | } | ||
435 | |||
436 | bool ata_disk_is_active(void) | ||
437 | { | ||
438 | return 0; | ||
439 | } | ||
440 | |||
441 | void ata_sleep(void) | ||
442 | { | ||
443 | } | ||
444 | |||
445 | void ata_spin(void) | ||
446 | { | ||
447 | } | ||
448 | |||
449 | /* Hardware reset protocol as specified in chapter 9.1, ATA spec draft v5 */ | ||
450 | int ata_hard_reset(void) | ||
451 | { | ||
452 | return 0; | ||
453 | } | ||
454 | |||
455 | int ata_soft_reset(void) | ||
456 | { | ||
457 | return 0; | ||
458 | } | ||
459 | |||
460 | void ata_enable(bool on) | ||
461 | { | ||
462 | (void)on; | ||
463 | } | ||
464 | |||
465 | unsigned short* ata_get_identify(void) | ||
466 | { | ||
467 | return identify_info; | ||
468 | } | ||
469 | |||
470 | int ata_init(void) | ||
471 | { | 416 | { |
472 | int i, id, id2; | 417 | int i, id, id2; |
473 | 418 | ||
@@ -499,3 +444,29 @@ int ata_init(void) | |||
499 | 444 | ||
500 | return 0; | 445 | return 0; |
501 | } | 446 | } |
447 | |||
448 | long nand_last_disk_activity(void) | ||
449 | { | ||
450 | return last_disk_activity; | ||
451 | } | ||
452 | |||
453 | void nand_get_info(struct storage_info *info) | ||
454 | { | ||
455 | unsigned long blocks; | ||
456 | int i; | ||
457 | |||
458 | /* firmware version */ | ||
459 | info->revision="0.00"; | ||
460 | |||
461 | /* vendor field, need better name? */ | ||
462 | info->vendor="Rockbox"; | ||
463 | /* model field, need better name? */ | ||
464 | info->product="TNFL"; | ||
465 | |||
466 | /* blocks count */ | ||
467 | info->num_sectors = 0; | ||
468 | info->sector_size=SECTOR_SIZE; | ||
469 | |||
470 | info->serial=0; | ||
471 | } | ||
472 | |||