summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2008-02-20 19:01:54 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2008-02-20 19:01:54 +0100
commitf95ec8a32dd811f314329da11ad0ae583233f43a (patch)
tree693ae6e150446d06cd430142898a91c8346f772d /common
parente912912a48c6aa127ef6fa79b6e1c41310c19840 (diff)
downloadbarebox-f95ec8a32dd811f314329da11ad0ae583233f43a.tar.gz
barebox-f95ec8a32dd811f314329da11ad0ae583233f43a.tar.xz
- Add functions to register image handlers for booting uImages
Diffstat (limited to 'common')
-rw-r--r--common/ft_build.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/common/ft_build.c b/common/ft_build.c
index c85082fa14..578a4b8ed3 100644
--- a/common/ft_build.c
+++ b/common/ft_build.c
@@ -20,6 +20,8 @@
*/
#include <common.h>
+#include <boot.h>
+#include <init.h>
#include <malloc.h>
#include <environment.h>
#include <asm/byteorder.h>
@@ -589,3 +591,29 @@ void ft_setup(void *blob, bd_t * bd, ulong initrd_start, ulong initrd_end)
#endif
}
+static int oftree_handler_cmdline_parse(struct image_data *data, int opt,
+ char *optarg)
+{
+ switch(opt) {
+ case 'o':
+ printf("using oftree %s\n", optarg);
+ data->oftree = optarg;
+ return 0;
+ default:
+ return 1;
+ }
+}
+
+static struct image_handler of_handler = {
+ .cmdline_options = "o:",
+ .cmdline_parse = oftree_handler_cmdline_parse,
+ .help_string = " -o <oftree> use oftree",
+};
+
+static int oftree_register_image_handler(void)
+{
+ return register_image_handler(&of_handler);
+}
+
+late_initcall(oftree_register_image_handler);
+