summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap/xload.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-08-24 12:48:50 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-08-27 07:12:32 +0200
commitbe322768f04603df371c9c1f08b9621690dd74c6 (patch)
tree2b979963307e675747520e14152583993a03cc34 /arch/arm/mach-omap/xload.c
parentc2ef4788732b680ee370b7197c9982ac0345e782 (diff)
downloadbarebox-be322768f04603df371c9c1f08b9621690dd74c6.tar.gz
barebox-be322768f04603df371c9c1f08b9621690dd74c6.tar.xz
ARM: omap: Allow to set mmc devname used for booting
This adds a omap_set_bootmmc_devname function which can be used to specify the MMC boot device. In an xload configuration this is then used to load the next stage. In a regular build this is used to mount /boot. Also a device_detect_by_name is added to allow to disable probing for sd/mmc cards during startup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-omap/xload.c')
-rw-r--r--arch/arm/mach-omap/xload.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
index 76746e27bd..b4d1b55e57 100644
--- a/arch/arm/mach-omap/xload.c
+++ b/arch/arm/mach-omap/xload.c
@@ -8,6 +8,7 @@
#include <fs.h>
#include <fcntl.h>
#include <sizes.h>
+#include <malloc.h>
#include <filetype.h>
#include <mach/generic.h>
@@ -98,11 +99,23 @@ static void *omap_xload_boot_mmc(void)
int ret;
void *buf;
int len;
- const char *diskdev = "disk0.0";
+ const char *diskdev;
+ char *partname;
+
+ diskdev = omap_get_bootmmc_devname();
+ if (!diskdev)
+ diskdev = "disk0";
+
+ device_detect_by_name(diskdev);
+
+ partname = asprintf("%s.0", diskdev);
+
+ ret = mount(partname, "fat", "/");
+
+ free(partname);
- ret = mount(diskdev, "fat", "/");
if (ret) {
- printf("Unable to mount %s (%d)\n", diskdev, ret);
+ printf("Unable to mount %s (%d)\n", partname, ret);
return NULL;
}