summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/sdmmc-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-10-22 00:03:04 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-10-22 00:07:07 +0200
commit7d62a78af47e77e3d4f6b8b37545d1abcc436f57 (patch)
tree0a47e503470ba46b2db5e9da8004b431ca3f399f /firmware/target/arm/imx233/sdmmc-imx233.c
parent5c7167c79c369973969f2199efa191cdf857a1a4 (diff)
downloadrockbox-7d62a78af47e77e3d4f6b8b37545d1abcc436f57.tar.gz
rockbox-7d62a78af47e77e3d4f6b8b37545d1abcc436f57.tar.bz2
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.c10
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)
/* compute window */
if((SDMMC_FLAGS(drive) & WINDOW) && imx233_partitions_is_window_enabled())
{
- uint8_t mbr[512];
- int ret = transfer_sectors(drive, 0, 1, mbr, true);
- if(ret)
- panicf("Cannot read MBR: %d", ret);
- ret = imx233_partitions_compute_window(mbr, &window_start[drive],
- &window_end[drive]);
+ /* NOTE: at this point the window shows the whole disk so raw disk
+ * accesses can be made to lookup partitions */
+ ret = imx233_partitions_compute_window(IF_MD(drive,) IMX233_PART_USER,
+ &window_start[drive], &window_end[drive]);
if(ret)
panicf("cannot compute partitions window: %d", ret);
SDMMC_INFO(drive).numblocks = window_end[drive] - window_start[drive];