diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-10-22 00:03:04 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-10-22 00:07:07 +0200 |
commit | 7d62a78af47e77e3d4f6b8b37545d1abcc436f57 (patch) | |
tree | 0a47e503470ba46b2db5e9da8004b431ca3f399f /firmware/target/arm/imx233/sdmmc-imx233.c | |
parent | 5c7167c79c369973969f2199efa191cdf857a1a4 (diff) | |
download | rockbox-7d62a78af47e77e3d4f6b8b37545d1abcc436f57.tar.gz rockbox-7d62a78af47e77e3d4f6b8b37545d1abcc436f57.zip |
imx233: extend partition window support to be more generic
The new code can select among several types of window (user, system, ...).
Furthermore, the type of partitions to use is selectable in config file.
Currently, two types are support: Freescale style MBR and Creative MBLK
Change-Id: I969d60a3d08f2c9448fb4b9c440051b7801b94cd
Diffstat (limited to 'firmware/target/arm/imx233/sdmmc-imx233.c')
-rw-r--r-- | firmware/target/arm/imx233/sdmmc-imx233.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c index a4329b1416..978e5b7247 100644 --- a/firmware/target/arm/imx233/sdmmc-imx233.c +++ b/firmware/target/arm/imx233/sdmmc-imx233.c | |||
@@ -664,12 +664,10 @@ static int init_drive(int drive) | |||
664 | /* compute window */ | 664 | /* compute window */ |
665 | if((SDMMC_FLAGS(drive) & WINDOW) && imx233_partitions_is_window_enabled()) | 665 | if((SDMMC_FLAGS(drive) & WINDOW) && imx233_partitions_is_window_enabled()) |
666 | { | 666 | { |
667 | uint8_t mbr[512]; | 667 | /* NOTE: at this point the window shows the whole disk so raw disk |
668 | int ret = transfer_sectors(drive, 0, 1, mbr, true); | 668 | * accesses can be made to lookup partitions */ |
669 | if(ret) | 669 | ret = imx233_partitions_compute_window(IF_MD(drive,) IMX233_PART_USER, |
670 | panicf("Cannot read MBR: %d", ret); | 670 | &window_start[drive], &window_end[drive]); |
671 | ret = imx233_partitions_compute_window(mbr, &window_start[drive], | ||
672 | &window_end[drive]); | ||
673 | if(ret) | 671 | if(ret) |
674 | panicf("cannot compute partitions window: %d", ret); | 672 | panicf("cannot compute partitions window: %d", ret); |
675 | SDMMC_INFO(drive).numblocks = window_end[drive] - window_start[drive]; | 673 | SDMMC_INFO(drive).numblocks = window_end[drive] - window_start[drive]; |