summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-06-11 09:54:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-06-17 08:30:38 +0200
commit72861584e33759ca4b531a47702d04ddbf730548 (patch)
tree2710bfabb19fe3e01bd098e98b7f104a7bc86139 /arch
parent9c827f121ac9073d58ab12c1901f5cd24406794d (diff)
downloadbarebox-72861584e33759ca4b531a47702d04ddbf730548.tar.gz
barebox-72861584e33759ca4b531a47702d04ddbf730548.tar.xz
bootu: Allow passing in devices as parameter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/lib/armlinux.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/arm/lib/armlinux.c b/arch/arm/lib/armlinux.c
index 75c65195bf..a38c6bf655 100644
--- a/arch/arm/lib/armlinux.c
+++ b/arch/arm/lib/armlinux.c
@@ -332,15 +332,21 @@ BAREBOX_CMD_END
#ifdef CONFIG_CMD_BOOTU
static int do_bootu(struct command *cmdtp, int argc, char *argv[])
{
- void (*theKernel)(int zero, int arch, void *params);
+ void (*theKernel)(int zero, int arch, void *params) = NULL;
const char *commandline = getenv("bootargs");
+ int fd;
if (argc != 2) {
barebox_cmd_usage(cmdtp);
return 1;
}
- theKernel = (void *)simple_strtoul(argv[1], NULL, 0);
+ fd = open(argv[1], O_RDONLY);
+ if (fd > 0)
+ theKernel = (void *)memmap(fd, PROT_READ);
+
+ if (!theKernel)
+ theKernel = (void *)simple_strtoul(argv[1], NULL, 0);
setup_start_tag();
setup_memory_tags();