summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c58
-rw-r--r--firmware/target/arm/ata-nand-telechips.c51
-rw-r--r--firmware/target/arm/ata-sd-pp.c36
-rw-r--r--firmware/target/arm/s5l8700/ata-nand-s5l8700.c15
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c16
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/ata-target.h4
6 files changed, 128 insertions, 52 deletions
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 8a18a70826..bca52a09f1 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -24,7 +24,7 @@
24 24
25/* TODO: Find the real capacity of >2GB models (will be useful for USB) */ 25/* TODO: Find the real capacity of >2GB models (will be useful for USB) */
26 26
27#include "config.h" /* for HAVE_MULTIVOLUME & AMS_OF_SIZE */ 27#include "config.h" /* for HAVE_MULTIDRIVE & AMS_OF_SIZE */
28#include "fat.h" 28#include "fat.h"
29#include "thread.h" 29#include "thread.h"
30#include "led.h" 30#include "led.h"
@@ -88,9 +88,9 @@
88#define INTERNAL_AS3525 0 /* embedded SD card */ 88#define INTERNAL_AS3525 0 /* embedded SD card */
89#define SD_SLOT_AS3525 1 /* SD slot if present */ 89#define SD_SLOT_AS3525 1 /* SD slot if present */
90 90
91static const int pl180_base[NUM_VOLUMES] = { 91static const int pl180_base[NUM_DRIVES] = {
92 NAND_FLASH_BASE 92 NAND_FLASH_BASE
93#ifdef HAVE_MULTIVOLUME 93#ifdef HAVE_MULTIDRIVE
94 , SD_MCI_BASE 94 , SD_MCI_BASE
95#endif 95#endif
96}; 96};
@@ -101,7 +101,7 @@ static void init_pl180_controller(const int drive);
101#define SECTOR_SIZE 512 /* XXX: different sector sizes ? */ 101#define SECTOR_SIZE 512 /* XXX: different sector sizes ? */
102#define BLOCKS_PER_BANK 0x7a7800 102#define BLOCKS_PER_BANK 0x7a7800
103 103
104static tCardInfo card_info[NUM_VOLUMES]; 104static tCardInfo card_info[NUM_DRIVES];
105 105
106/* maximum timeouts recommanded in the SD Specification v2.00 */ 106/* maximum timeouts recommanded in the SD Specification v2.00 */
107#define SD_MAX_READ_TIMEOUT ((AS3525_PCLK_FREQ) / 1000 * 100) /* 100 ms */ 107#define SD_MAX_READ_TIMEOUT ((AS3525_PCLK_FREQ) / 1000 * 100) /* 100 ms */
@@ -169,7 +169,7 @@ void INT_NAND(void)
169 MCI_CLEAR(INTERNAL_AS3525) = status; 169 MCI_CLEAR(INTERNAL_AS3525) = status;
170} 170}
171 171
172#ifdef HAVE_MULTIVOLUME 172#ifdef HAVE_MULTIDRIVE
173void INT_MCI0(void) 173void INT_MCI0(void)
174{ 174{
175 const int status = MCI_STATUS(SD_SLOT_AS3525); 175 const int status = MCI_STATUS(SD_SLOT_AS3525);
@@ -436,7 +436,7 @@ static void init_pl180_controller(const int drive)
436 436
437 MCI_MASK0(drive) = MCI_MASK1(drive) = MCI_ERROR | MCI_DATA_END; 437 MCI_MASK0(drive) = MCI_MASK1(drive) = MCI_ERROR | MCI_DATA_END;
438 438
439#ifdef HAVE_MULTIVOLUME 439#ifdef HAVE_MULTIDRIVE
440 VIC_INT_ENABLE |= 440 VIC_INT_ENABLE |=
441 (drive == INTERNAL_AS3525) ? INTERRUPT_NAND : INTERRUPT_MCI0; 441 (drive == INTERNAL_AS3525) ? INTERRUPT_NAND : INTERRUPT_MCI0;
442 442
@@ -478,7 +478,7 @@ int sd_init(void)
478 478
479 479
480 CGU_PERI |= CGU_NAF_CLOCK_ENABLE; 480 CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
481#ifdef HAVE_MULTIVOLUME 481#ifdef HAVE_MULTIDRIVE
482 CGU_PERI |= CGU_MCI_CLOCK_ENABLE; 482 CGU_PERI |= CGU_MCI_CLOCK_ENABLE;
483 CCU_IO &= ~(1<<3); /* bits 3:2 = 01, xpd is SD interface */ 483 CCU_IO &= ~(1<<3); /* bits 3:2 = 01, xpd is SD interface */
484 CCU_IO |= (1<<2); 484 CCU_IO |= (1<<2);
@@ -490,7 +490,7 @@ int sd_init(void)
490 ret = sd_init_card(INTERNAL_AS3525); 490 ret = sd_init_card(INTERNAL_AS3525);
491 if(ret < 0) 491 if(ret < 0)
492 return ret; 492 return ret;
493#ifdef HAVE_MULTIVOLUME 493#ifdef HAVE_MULTIDRIVE
494 init_pl180_controller(SD_SLOT_AS3525); 494 init_pl180_controller(SD_SLOT_AS3525);
495#endif 495#endif
496 496
@@ -509,17 +509,17 @@ int sd_init(void)
509} 509}
510 510
511#ifdef HAVE_HOTSWAP 511#ifdef HAVE_HOTSWAP
512bool sd_removable(IF_MV_NONVOID(int drive)) 512bool sd_removable(IF_MD_NONVOID(int drive))
513{ 513{
514#ifndef HAVE_MULTIVOLUME 514#ifndef HAVE_MULTIDRIVE
515 const int drive=0; 515 const int drive=0;
516#endif 516#endif
517 return (drive==1); 517 return (drive==1);
518} 518}
519 519
520bool sd_present(IF_MV_NONVOID(int drive)) 520bool sd_present(IF_MD_NONVOID(int drive))
521{ 521{
522#ifndef HAVE_MULTIVOLUME 522#ifndef HAVE_MULTIDRIVE
523 const int drive=0; 523 const int drive=0;
524#endif 524#endif
525 return (card_info[drive].initialized && card_info[drive].numblocks > 0); 525 return (card_info[drive].initialized && card_info[drive].numblocks > 0);
@@ -619,10 +619,10 @@ static int sd_select_bank(signed char bank)
619 return 0; 619 return 0;
620} 620}
621 621
622static int sd_transfer_sectors(IF_MV2(int drive,) unsigned long start, 622static int sd_transfer_sectors(IF_MD2(int drive,) unsigned long start,
623 int count, void* buf, const bool write) 623 int count, void* buf, const bool write)
624{ 624{
625#ifndef HAVE_MULTIVOLUME 625#ifndef HAVE_MULTIDRIVE
626 const int drive = 0; 626 const int drive = 0;
627#endif 627#endif
628 int ret = 0; 628 int ret = 0;
@@ -774,18 +774,18 @@ sd_transfer_error:
774 return ret; 774 return ret;
775} 775}
776 776
777int sd_read_sectors(IF_MV2(int drive,) unsigned long start, int count, 777int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count,
778 void* buf) 778 void* buf)
779{ 779{
780 return sd_transfer_sectors(IF_MV2(drive,) start, count, buf, false); 780 return sd_transfer_sectors(IF_MD2(drive,) start, count, buf, false);
781} 781}
782 782
783int sd_write_sectors(IF_MV2(int drive,) unsigned long start, int count, 783int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
784 const void* buf) 784 const void* buf)
785{ 785{
786 786
787#ifdef BOOTLOADER /* we don't need write support in bootloader */ 787#ifdef BOOTLOADER /* we don't need write support in bootloader */
788#ifdef HAVE_MULTIVOLUME 788#ifdef HAVE_MULTIDRIVE
789 (void) drive; 789 (void) drive;
790#endif 790#endif
791 (void) start; 791 (void) start;
@@ -793,7 +793,7 @@ int sd_write_sectors(IF_MV2(int drive,) unsigned long start, int count,
793 (void) buf; 793 (void) buf;
794 return -1; 794 return -1;
795#else 795#else
796 return sd_transfer_sectors(IF_MV2(drive,) start, count, (void*)buf, true); 796 return sd_transfer_sectors(IF_MD2(drive,) start, count, (void*)buf, true);
797#endif 797#endif
798} 798}
799 799
@@ -807,7 +807,7 @@ void sd_enable(bool on)
807{ 807{
808 /* buttonlight AMSes need a bit of special handling for the buttonlight here, 808 /* buttonlight AMSes need a bit of special handling for the buttonlight here,
809 * due to the dual mapping of GPIOD and XPD */ 809 * due to the dual mapping of GPIOD and XPD */
810#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIVOLUME) 810#if defined(HAVE_BUTTON_LIGHT) && defined(HAVE_MULTIDRIVE)
811 extern int buttonlight_is_on; 811 extern int buttonlight_is_on;
812#endif 812#endif
813 if (sd_enabled == on) 813 if (sd_enabled == on)
@@ -815,7 +815,7 @@ void sd_enable(bool on)
815 if(on) 815 if(on)
816 { 816 {
817 CGU_PERI |= CGU_NAF_CLOCK_ENABLE; 817 CGU_PERI |= CGU_NAF_CLOCK_ENABLE;
818#ifdef HAVE_MULTIVOLUME 818#ifdef HAVE_MULTIDRIVE
819 CGU_PERI |= CGU_MCI_CLOCK_ENABLE; 819 CGU_PERI |= CGU_MCI_CLOCK_ENABLE;
820#ifdef HAVE_BUTTON_LIGHT 820#ifdef HAVE_BUTTON_LIGHT
821 CCU_IO |= (1<<2); 821 CCU_IO |= (1<<2);
@@ -832,7 +832,7 @@ void sd_enable(bool on)
832 else 832 else
833 { 833 {
834 CGU_PERI &= ~CGU_NAF_CLOCK_ENABLE; 834 CGU_PERI &= ~CGU_NAF_CLOCK_ENABLE;
835#ifdef HAVE_MULTIVOLUME 835#ifdef HAVE_MULTIDRIVE
836#ifdef HAVE_BUTTON_LIGHT 836#ifdef HAVE_BUTTON_LIGHT
837 CCU_IO &= ~(1<<2); 837 CCU_IO &= ~(1<<2);
838 if (buttonlight_is_on) 838 if (buttonlight_is_on)
@@ -882,3 +882,17 @@ void card_enable_monitoring_target(bool on)
882#endif 882#endif
883 883
884#endif /* BOOTLOADER */ 884#endif /* BOOTLOADER */
885
886#ifdef CONFIG_STORAGE_MULTI
887int sd_num_drives(int first_drive)
888{
889 /* We don't care which logical drive number(s) we have been assigned */
890 (void)first_drive;
891
892#ifdef HAVE_MULTIDRIVE
893 return 2;
894#else
895 return 1;
896#endif
897}
898#endif
diff --git a/firmware/target/arm/ata-nand-telechips.c b/firmware/target/arm/ata-nand-telechips.c
index 8bef57ee21..ffe6de897e 100644
--- a/firmware/target/arm/ata-nand-telechips.c
+++ b/firmware/target/arm/ata-nand-telechips.c
@@ -696,10 +696,10 @@ static void read_inplace_writes_cache(int bank, int phys_segment)
696} 696}
697 697
698 698
699int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int incount, 699int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int incount,
700 void* inbuf) 700 void* inbuf)
701{ 701{
702#ifdef HAVE_MULTIVOLUME 702#ifdef HAVE_MULTIDRIVE
703 (void)drive; /* unused for now */ 703 (void)drive; /* unused for now */
704#endif 704#endif
705 705
@@ -753,11 +753,10 @@ nand_read_error:
753 return ret; 753 return ret;
754} 754}
755 755
756 756int nand_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
757int nand_write_sectors(IF_MV2(int drive,) unsigned long start, int count,
758 const void* outbuf) 757 const void* outbuf)
759{ 758{
760#ifdef HAVE_MULTIVOLUME 759#ifdef HAVE_MULTIDRIVE
761 (void)drive; /* unused for now */ 760 (void)drive; /* unused for now */
762#endif 761#endif
763 762
@@ -770,8 +769,12 @@ int nand_write_sectors(IF_MV2(int drive,) unsigned long start, int count,
770 769
771 770
772#ifdef STORAGE_GET_INFO 771#ifdef STORAGE_GET_INFO
773void nand_get_info(struct storage_info *info) 772void nand_get_info(IF_MD2(int drive,) struct storage_info *info)
774{ 773{
774#ifdef HAVE_MULTIDRIVE
775 (void)drive; /* unused for now */
776#endif
777
775 /* firmware version */ 778 /* firmware version */
776 info->revision="0.00"; 779 info->revision="0.00";
777 780
@@ -913,3 +916,39 @@ void nand_spindown(int seconds)
913{ 916{
914 (void)seconds; 917 (void)seconds;
915} 918}
919
920#ifdef CONFIG_STORAGE_MULTI
921
922int nand_num_drives(int first_drive)
923{
924 /* We don't care which logical drive number we have been assigned */
925 (void)first_drive;
926
927 return 1;
928}
929
930void nand_sleepnow(void)
931{
932}
933
934bool nand_disk_is_active(void)
935{
936 return false;
937}
938
939int nand_soft_reset(void)
940{
941 return 0;
942}
943
944int nand_spinup_time(void)
945{
946 return 0;
947}
948
949void nand_enable(bool onoff)
950{
951 (void)onoff;
952}
953
954#endif /* CONFIG_STORAGE_MULTI */
diff --git a/firmware/target/arm/ata-sd-pp.c b/firmware/target/arm/ata-sd-pp.c
index 1a76eeeba2..77d3c3dc31 100644
--- a/firmware/target/arm/ata-sd-pp.c
+++ b/firmware/target/arm/ata-sd-pp.c
@@ -18,7 +18,7 @@
18 * KIND, either express or implied. 18 * KIND, either express or implied.
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "config.h" /* for HAVE_MULTIVOLUME */ 21#include "config.h" /* for HAVE_MULTIDRIVE */
22#include "fat.h" 22#include "fat.h"
23#include "hotswap.h" 23#include "hotswap.h"
24#ifdef HAVE_HOTSWAP 24#ifdef HAVE_HOTSWAP
@@ -166,10 +166,10 @@ struct sd_card_status
166 int retry_max; 166 int retry_max;
167}; 167};
168 168
169static struct sd_card_status sd_status[NUM_VOLUMES] = 169static struct sd_card_status sd_status[NUM_DRIVES] =
170{ 170{
171 { 0, 1 }, 171 { 0, 1 },
172#ifdef HAVE_MULTIVOLUME 172#ifdef HAVE_MULTIDRIVE
173 { 0, 10 } 173 { 0, 10 }
174#endif 174#endif
175}; 175};
@@ -839,10 +839,10 @@ static void sd_select_device(int card_no)
839 839
840/* API Functions */ 840/* API Functions */
841 841
842int sd_read_sectors(IF_MV2(int drive,) unsigned long start, int incount, 842int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int incount,
843 void* inbuf) 843 void* inbuf)
844{ 844{
845#ifndef HAVE_MULTIVOLUME 845#ifndef HAVE_MULTIDRIVE
846 const int drive = 0; 846 const int drive = 0;
847#endif 847#endif
848 int ret; 848 int ret;
@@ -956,13 +956,13 @@ sd_read_error:
956 } 956 }
957} 957}
958 958
959int sd_write_sectors(IF_MV2(int drive,) unsigned long start, int count, 959int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
960 const void* outbuf) 960 const void* outbuf)
961{ 961{
962/* Write support is not finished yet */ 962/* Write support is not finished yet */
963/* TODO: The standard suggests using ACMD23 prior to writing multiple blocks 963/* TODO: The standard suggests using ACMD23 prior to writing multiple blocks
964 to improve performance */ 964 to improve performance */
965#ifndef HAVE_MULTIVOLUME 965#ifndef HAVE_MULTIDRIVE
966 const int drive = 0; 966 const int drive = 0;
967#endif 967#endif
968 int ret; 968 int ret;
@@ -1330,19 +1330,33 @@ long sd_last_disk_activity(void)
1330} 1330}
1331 1331
1332#ifdef HAVE_HOTSWAP 1332#ifdef HAVE_HOTSWAP
1333bool sd_removable(IF_MV_NONVOID(int drive)) 1333bool sd_removable(IF_MD_NONVOID(int drive))
1334{ 1334{
1335#ifndef HAVE_MULTIVOLUME 1335#ifndef HAVE_MULTIDRIVE
1336 const int drive=0; 1336 const int drive=0;
1337#endif 1337#endif
1338 return (drive==1); 1338 return (drive==1);
1339} 1339}
1340 1340
1341bool sd_present(IF_MV_NONVOID(int drive)) 1341bool sd_present(IF_MD_NONVOID(int drive))
1342{ 1342{
1343#ifndef HAVE_MULTIVOLUME 1343#ifndef HAVE_MULTIDRIVE
1344 const int drive=0; 1344 const int drive=0;
1345#endif 1345#endif
1346 return (card_info[drive].initialized && card_info[drive].numblocks > 0); 1346 return (card_info[drive].initialized && card_info[drive].numblocks > 0);
1347} 1347}
1348#endif 1348#endif
1349
1350#ifdef CONFIG_STORAGE_MULTI
1351int sd_num_drives(int first_drive)
1352{
1353 /* We don't care which logical drive number(s) we have been assigned */
1354 (void)first_drive;
1355
1356#ifdef HAVE_MULTIDRIVE
1357 return 2;
1358#else
1359 return 1;
1360#endif
1361}
1362#endif
diff --git a/firmware/target/arm/s5l8700/ata-nand-s5l8700.c b/firmware/target/arm/s5l8700/ata-nand-s5l8700.c
index 3fc3c0efea..f268558128 100644
--- a/firmware/target/arm/s5l8700/ata-nand-s5l8700.c
+++ b/firmware/target/arm/s5l8700/ata-nand-s5l8700.c
@@ -46,7 +46,7 @@ void nand_led(bool onoff)
46 led(onoff); 46 led(onoff);
47} 47}
48 48
49int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int incount, 49int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int incount,
50 void* inbuf) 50 void* inbuf)
51{ 51{
52 (void)start; 52 (void)start;
@@ -55,7 +55,7 @@ int nand_read_sectors(IF_MV2(int drive,) unsigned long start, int incount,
55 return 0; 55 return 0;
56} 56}
57 57
58int nand_write_sectors(IF_MV2(int drive,) unsigned long start, int count, 58int nand_write_sectors(IF_MD2(int drive,) unsigned long start, int count,
59 const void* outbuf) 59 const void* outbuf)
60{ 60{
61 (void)start; 61 (void)start;
@@ -82,7 +82,7 @@ void nand_enable(bool on)
82 (void)on; 82 (void)on;
83} 83}
84 84
85void nand_get_info(IF_MV2(int drive,) struct storage_info *info) 85void nand_get_info(IF_MD2(int drive,) struct storage_info *info)
86{ 86{
87 (void)info; 87 (void)info;
88} 88}
@@ -98,3 +98,12 @@ int nand_init(void)
98 return 0; 98 return 0;
99} 99}
100 100
101#ifdef CONFIG_STORAGE_MULTI
102int nand_num_drives(int first_drive)
103{
104 /* We don't care which logical drive number(s) we have been assigned */
105 (void)first_drive;
106
107 return 1;
108}
109#endif
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c
index f9acdf5eb2..f84d904205 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c
@@ -125,8 +125,8 @@ void GIO2(void)
125 125
126#define VFAT_SECTOR_SIZE(x) ( (x)/0x8000 ) /* 1GB array requires 80kB of RAM */ 126#define VFAT_SECTOR_SIZE(x) ( (x)/0x8000 ) /* 1GB array requires 80kB of RAM */
127 127
128extern int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); 128extern int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf);
129extern int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); 129extern int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf);
130 130
131struct main_header 131struct main_header
132{ 132{
@@ -378,14 +378,14 @@ static inline unsigned long map_sector(unsigned long sector)
378 return cfs_start+sectors[sector/64]*64+sector%64; 378 return cfs_start+sectors[sector/64]*64+sector%64;
379} 379}
380 380
381int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf) 381int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf)
382{ 382{
383 if(!cfs_inited) 383 if(!cfs_inited)
384 cfs_init(); 384 cfs_init();
385 385
386 /* Check if count is lesser than or equal to 1 native CFS sector */ 386 /* Check if count is lesser than or equal to 1 native CFS sector */
387 if(count <= 64) 387 if(count <= 64)
388 return _ata_read_sectors(IF_MV2(drive,) map_sector(start), count, buf); 388 return _ata_read_sectors(IF_MD2(drive,) map_sector(start), count, buf);
389 else 389 else
390 { 390 {
391 int i, ret; 391 int i, ret;
@@ -394,7 +394,7 @@ int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* bu
394 /* Read sectors in parts of 0x8000 */ 394 /* Read sectors in parts of 0x8000 */
395 for(i=0; i<count; i+=64) 395 for(i=0; i<count; i+=64)
396 { 396 {
397 ret = _ata_read_sectors(IF_MV2(drive,) map_sector(start+i), (count-i >= 64 ? 64 : count-i), (void*)dest); 397 ret = _ata_read_sectors(IF_MD2(drive,) map_sector(start+i), (count-i >= 64 ? 64 : count-i), (void*)dest);
398 if(ret != 0) 398 if(ret != 0)
399 return ret; 399 return ret;
400 400
@@ -405,7 +405,7 @@ int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* bu
405 } 405 }
406} 406}
407 407
408int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf) 408int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf)
409{ 409{
410 if(!cfs_inited) 410 if(!cfs_inited)
411 cfs_init(); 411 cfs_init();
@@ -413,7 +413,7 @@ int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const v
413#if 0 /* Disabled for now */ 413#if 0 /* Disabled for now */
414 /* Check if count is lesser than or equal to 1 native CFS sector */ 414 /* Check if count is lesser than or equal to 1 native CFS sector */
415 if(count <= 64) 415 if(count <= 64)
416 return _ata_write_sectors(IF_MV2(drive,) map_sector(start), count, buf); 416 return _ata_write_sectors(IF_MD2(drive,) map_sector(start), count, buf);
417 else 417 else
418 { 418 {
419 int i, ret; 419 int i, ret;
@@ -422,7 +422,7 @@ int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const v
422 /* Read sectors in parts of 0x8000 */ 422 /* Read sectors in parts of 0x8000 */
423 for(i=0; i<count; i+=64) 423 for(i=0; i<count; i+=64)
424 { 424 {
425 ret = _ata_write_sectors(IF_MV2(drive,) map_sector(start+i), (count-i >= 64 ? 64 : count-i), (const void*)dest); 425 ret = _ata_write_sectors(IF_MD2(drive,) map_sector(start+i), (count-i >= 64 ? 64 : count-i), (const void*)dest);
426 if(ret != 0) 426 if(ret != 0)
427 return ret; 427 return ret;
428 428
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h b/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h
index 64c49fe68e..a1d4a90cb8 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h
+++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-target.h
@@ -38,8 +38,8 @@ void copy_write_sectors(const unsigned char* buf, int wordcount);
38/* Nasty hack, but Creative is nasty... */ 38/* Nasty hack, but Creative is nasty... */
39#define ata_read_sectors _ata_read_sectors 39#define ata_read_sectors _ata_read_sectors
40#define ata_write_sectors _ata_write_sectors 40#define ata_write_sectors _ata_write_sectors
41extern int _ata_read_sectors(IF_MV2(int drive,) unsigned long start, int count, void* buf); 41extern int _ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf);
42extern int _ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count, const void* buf); 42extern int _ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf);
43 43
44/* General purpose memory region #1 */ 44/* General purpose memory region #1 */
45#define ATA_IOBASE 0x50FEE000 45#define ATA_IOBASE 0x50FEE000