diff options
Diffstat (limited to 'firmware/target/arm/imx233/sdmmc-imx233.c')
-rw-r--r-- | firmware/target/arm/imx233/sdmmc-imx233.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c index cff801f6b9..24bf69e332 100644 --- a/firmware/target/arm/imx233/sdmmc-imx233.c +++ b/firmware/target/arm/imx233/sdmmc-imx233.c | |||
@@ -672,6 +672,12 @@ static int transfer_sectors(int drive, unsigned long start, int count, void *buf | |||
672 | return ret; | 672 | return ret; |
673 | } | 673 | } |
674 | 674 | ||
675 | // user specificies the sdmmc drive | ||
676 | static int part_read_fn(intptr_t user, unsigned long start, int count, void* buf) | ||
677 | { | ||
678 | return transfer_sectors(user, start, count, buf, true); | ||
679 | } | ||
680 | |||
675 | static int init_drive(int drive) | 681 | static int init_drive(int drive) |
676 | { | 682 | { |
677 | int ret; | 683 | int ret; |
@@ -693,8 +699,8 @@ static int init_drive(int drive) | |||
693 | { | 699 | { |
694 | /* NOTE: at this point the window shows the whole disk so raw disk | 700 | /* NOTE: at this point the window shows the whole disk so raw disk |
695 | * accesses can be made to lookup partitions */ | 701 | * accesses can be made to lookup partitions */ |
696 | ret = imx233_partitions_compute_window(IF_MD(drive,) IMX233_PART_USER, | 702 | ret = imx233_partitions_compute_window(IF_MD_DRV(drive), part_read_fn, |
697 | &window_start[drive], &window_end[drive]); | 703 | IMX233_PART_USER, &window_start[drive], &window_end[drive]); |
698 | if(ret) | 704 | if(ret) |
699 | panicf("cannot compute partitions window: %d", ret); | 705 | panicf("cannot compute partitions window: %d", ret); |
700 | SDMMC_INFO(drive).numblocks = window_end[drive] - window_start[drive]; | 706 | SDMMC_INFO(drive).numblocks = window_end[drive] - window_start[drive]; |