nand: Fix access to last block in NAND devices
[platform/kernel/u-boot.git] / lib_avr32 / bootm.c
index 762701f..6a3172a 100644 (file)
@@ -22,9 +22,9 @@
 #include <common.h>
 #include <command.h>
 #include <image.h>
-#include <zlib.h>
+#include <u-boot/zlib.h>
 #include <asm/byteorder.h>
-#include <asm/addrspace.h>
+#include <asm/arch/addrspace.h>
 #include <asm/io.h>
 #include <asm/setup.h>
 #include <asm/arch/clk.h>
@@ -34,8 +34,6 @@ DECLARE_GLOBAL_DATA_PTR;
 /* CPU-specific hook to allow flushing of caches, etc. */
 extern void prepare_to_boot(void);
 
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-
 static struct tag *setup_start_tag(struct tag *params)
 {
        params->hdr.tag = ATAG_CORE;
@@ -173,13 +171,14 @@ static void setup_end_tag(struct tag *params)
        params->hdr.size = 0;
 }
 
-void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
-                   bootm_headers_t *images)
+int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
        void    (*theKernel)(int magic, void *tagtable);
        struct  tag *params, *params_start;
        char    *commandline = getenv("bootargs");
-       int     ret;
+
+       if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
+               return 1;
 
        theKernel = (void *)images->ep;
 
@@ -205,9 +204,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 
        theKernel(ATAG_MAGIC, params_start);
        /* does not return */
-       return;
 
-error:
-       do_reset (cmdtp, flag, argc, argv);
-       return;
+       return 1;
 }