]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/nds32/lib/bootm.c
nds32: Support AE3XX platform.
[people/ms/u-boot.git] / arch / nds32 / lib / bootm.c
index 7999167f4cef10ec95a2a0768d2b695ac7621748..4c95a418a8e9c5598086297f6ab4de299cb9aec9 100644 (file)
@@ -11,6 +11,7 @@
 #include <image.h>
 #include <u-boot/zlib.h>
 #include <asm/byteorder.h>
+#include <asm/bootm.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -73,6 +74,15 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
        debug("## Transferring control to Linux (at address %08lx) ...\n",
               (ulong)theKernel);
 
+       if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len) {
+#ifdef CONFIG_OF_LIBFDT
+               debug("using: FDT\n");
+               if (image_setup_linux(images)) {
+                       printf("FDT creation failed! hanging...");
+                       hang();
+               }
+#endif
+       } else if (BOOTM_ENABLE_TAGS) {
 #if defined(CONFIG_SETUP_MEMORY_TAGS) || \
        defined(CONFIG_CMDLINE_TAG) || \
        defined(CONFIG_INITRD_TAG) || \
@@ -107,16 +117,17 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
                udc_disconnect();
        }
 #endif
-
+       }
        cleanup_before_linux();
-
-       theKernel(0, machid, bd->bi_boot_params);
+       if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len)
+               theKernel(0, machid, (unsigned long)images->ft_addr);
+       else
+               theKernel(0, machid, bd->bi_boot_params);
        /* does not return */
 
        return 1;
 }
 
-
 #if defined(CONFIG_SETUP_MEMORY_TAGS) || \
        defined(CONFIG_CMDLINE_TAG) || \
        defined(CONFIG_INITRD_TAG) || \
@@ -136,7 +147,6 @@ static void setup_start_tag(bd_t *bd)
        params = tag_next(params);
 }
 
-
 #ifdef CONFIG_SETUP_MEMORY_TAGS
 static void setup_memory_tags(bd_t *bd)
 {
@@ -154,7 +164,6 @@ static void setup_memory_tags(bd_t *bd)
 }
 #endif /* CONFIG_SETUP_MEMORY_TAGS */
 
-
 static void setup_commandline_tag(bd_t *bd, char *commandline)
 {
        char *p;
@@ -182,7 +191,6 @@ static void setup_commandline_tag(bd_t *bd, char *commandline)
        params = tag_next(params);
 }
 
-
 #ifdef CONFIG_INITRD_TAG
 static void setup_initrd_tag(bd_t *bd, ulong initrd_start, ulong initrd_end)
 {
@@ -230,7 +238,6 @@ void setup_revision_tag(struct tag **in_params)
 }
 #endif  /* CONFIG_REVISION_TAG */
 
-
 static void setup_end_tag(bd_t *bd)
 {
        params->hdr.tag = ATAG_NONE;