From d4e5c6b8a03d31c00084d38e40d9811267f00289 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 6 Dec 2011 08:53:26 +0100 Subject: bootm: use new uimage code This switches the bootm code to the new uimage code. Also bootm can now handle other types of images than uImages. Currently the only architecture making use of this is arm which allows to boot zImages, raw images and barebox images. I intended to make a more bisectable series from this but I failed becuase there are many dependencies and no matter how I tried the patches grew bigger and and bigger. So I decided to put this all in a single patch. Signed-off-by: Sascha Hauer --- arch/nios2/lib/bootm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'arch/nios2/lib') diff --git a/arch/nios2/lib/bootm.c b/arch/nios2/lib/bootm.c index b5b344f499..1cd43c81af 100644 --- a/arch/nios2/lib/bootm.c +++ b/arch/nios2/lib/bootm.c @@ -31,17 +31,20 @@ #include #include #include +#include #include #define NIOS_MAGIC 0x534f494e /* enable command line and initrd passing */ static int do_bootm_linux(struct image_data *idata) { - image_header_t *os_header = &idata->os->header; void (*kernel)(int, int, int, const char *); const char *commandline = getenv ("bootargs"); - kernel = (void (*)(int, int, int, const char *))ntohl(os_header->ih_ep); + if (!idata->os_res) + return -EINVAL; + + kernel = (void *)(idata->os_address + idata->os_entry); /* kernel parameters passing * r4 : NIOS magic @@ -63,8 +66,10 @@ static int do_bootm_linux(struct image_data *idata) } static struct image_handler handler = { + .name = "NIOS2 Linux", .bootm = do_bootm_linux, - .image_type = IH_OS_LINUX, + .filetype = filetype_uimage, + .ih_os = IH_OS_LINUX, }; int nios2_register_image_handler(void) -- cgit v1.2.3