[PATCH 2/2] bootm: add u-boot support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Tue Sep 17 03:52:19 EDT 2013


Simply do the same as barebox and hope for the best as u-boot does not handle
runtime address detection for boot quite often. It does only execpt you to
choose as compiling time.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/lib/bootm.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 599b09a..71200be 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -315,6 +315,12 @@ static struct image_handler barebox_handler = {
 	.filetype = filetype_arm_barebox,
 };
 
+static struct image_handler uboot_handler = {
+	.name = "ARM u-boot",
+	.bootm = do_bootm_barebox,
+	.filetype = filetype_arm_uboot,
+};
+
 #include <aimage.h>
 
 static int aimage_load_resource(int fd, struct resource *r, void* buf, int ps)
@@ -470,9 +476,15 @@ static struct binfmt_hook binfmt_barebox_hook = {
 	.exec = "bootm",
 };
 
+static struct binfmt_hook binfmt_uboot_hook = {
+	.type = filetype_arm_uboot,
+	.exec = "bootm",
+};
+
 static int armlinux_register_image_handler(void)
 {
 	register_image_handler(&barebox_handler);
+	register_image_handler(&uboot_handler);
 	register_image_handler(&uimage_handler);
 	register_image_handler(&rawimage_handler);
 	register_image_handler(&zimage_handler);
@@ -482,6 +494,7 @@ static int armlinux_register_image_handler(void)
 	}
 	binfmt_register(&binfmt_arm_zimage_hook);
 	binfmt_register(&binfmt_barebox_hook);
+	binfmt_register(&binfmt_uboot_hook);
 
 	return 0;
 }
-- 
1.8.4.rc1




More information about the barebox mailing list