diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/arm/imx233/sdmmc-imx233.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c index f552246245..8f293543ab 100644 --- a/firmware/target/arm/imx233/sdmmc-imx233.c +++ b/firmware/target/arm/imx233/sdmmc-imx233.c | |||
@@ -554,7 +554,7 @@ static int init_mmc_drive(int drive) | |||
554 | } | 554 | } |
555 | #endif | 555 | #endif |
556 | 556 | ||
557 | // low-level function, don't call directly! | 557 | /* low-level function, don't call directly! */ |
558 | static int __xfer_sectors(int drive, unsigned long start, int count, void *buf, bool read) | 558 | static int __xfer_sectors(int drive, unsigned long start, int count, void *buf, bool read) |
559 | { | 559 | { |
560 | uint32_t resp; | 560 | uint32_t resp; |
@@ -596,7 +596,7 @@ static int __xfer_sectors(int drive, unsigned long start, int count, void *buf, | |||
596 | static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read) | 596 | static int transfer_sectors(int drive, unsigned long start, int count, void *buf, bool read) |
597 | { | 597 | { |
598 | int ret = 0; | 598 | int ret = 0; |
599 | // the function doesn't work when count is 0 | 599 | /* the function doesn't work when count is 0 */ |
600 | if(count == 0) | 600 | if(count == 0) |
601 | return ret; | 601 | return ret; |
602 | 602 | ||
@@ -663,12 +663,12 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf | |||
663 | void *ptr = CACHEALIGN_UP(buf); | 663 | void *ptr = CACHEALIGN_UP(buf); |
664 | if(buf != ptr) | 664 | if(buf != ptr) |
665 | { | 665 | { |
666 | // copy count-1 sector and then move within the buffer | 666 | /* copy count-1 sector and then move within the buffer */ |
667 | ret = __xfer_sectors(drive, start, count - 1, ptr, read); | 667 | ret = __xfer_sectors(drive, start, count - 1, ptr, read); |
668 | memmove(buf, ptr, 512 * (count - 1)); | 668 | memmove(buf, ptr, 512 * (count - 1)); |
669 | if(ret >= 0) | 669 | if(ret >= 0) |
670 | { | 670 | { |
671 | // transfer the last sector the aligned_buffer and copy | 671 | /* transfer the last sector the aligned_buffer and copy */ |
672 | ret = __xfer_sectors(drive, start + count - 1, 1, | 672 | ret = __xfer_sectors(drive, start + count - 1, 1, |
673 | aligned_buffer[drive], read); | 673 | aligned_buffer[drive], read); |
674 | memcpy(buf + 512 * (count - 1), aligned_buffer[drive], 512); | 674 | memcpy(buf + 512 * (count - 1), aligned_buffer[drive], 512); |
@@ -682,15 +682,15 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf | |||
682 | void *ptr = CACHEALIGN_UP(buf); | 682 | void *ptr = CACHEALIGN_UP(buf); |
683 | if(buf != ptr) | 683 | if(buf != ptr) |
684 | { | 684 | { |
685 | // transfer the first sector to aligned_buffer and copy | 685 | /* transfer the first sector to aligned_buffer and copy */ |
686 | memcpy(aligned_buffer[drive], buf, 512); | 686 | memcpy(aligned_buffer[drive], buf, 512); |
687 | ret = __xfer_sectors(drive, start, 1, aligned_buffer[drive], read); | 687 | ret = __xfer_sectors(drive, start, 1, aligned_buffer[drive], read); |
688 | if(ret >= 0) | 688 | if(ret >= 0) |
689 | { | 689 | { |
690 | // move within the buffer and transfer | 690 | /* move within the buffer and transfer */ |
691 | memmove(ptr, buf + 512, 512 * (count - 1)); | 691 | memmove(ptr, buf + 512, 512 * (count - 1)); |
692 | ret = __xfer_sectors(drive, start + 1, count - 1, ptr, read); | 692 | ret = __xfer_sectors(drive, start + 1, count - 1, ptr, read); |
693 | // move back | 693 | /* move back */ |
694 | memmove(buf + 512, ptr, 512 * (count - 1)); | 694 | memmove(buf + 512, ptr, 512 * (count - 1)); |
695 | memcpy(buf, aligned_buffer[drive], 512); | 695 | memcpy(buf, aligned_buffer[drive], 512); |
696 | } | 696 | } |
@@ -712,7 +712,7 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf | |||
712 | return ret; | 712 | return ret; |
713 | } | 713 | } |
714 | 714 | ||
715 | // user specificies the sdmmc drive | 715 | /* user specifies the sdmmc drive */ |
716 | static int part_read_fn(intptr_t user, unsigned long start, int count, void* buf) | 716 | static int part_read_fn(intptr_t user, unsigned long start, int count, void* buf) |
717 | { | 717 | { |
718 | return transfer_sectors(user, start, count, buf, true); | 718 | return transfer_sectors(user, start, count, buf, true); |