i.MX6 USDHC: Use the ESDHC clock
[oweals/u-boot.git] / arch / arm / lib / bootm.c
index 160ba55111177f3f3f803c159e43ab2c9744fde4..599547d2c8a3b2cf5b825203e93fd408d14dba2a 100644 (file)
@@ -256,6 +256,7 @@ static int create_fdt(bootm_headers_t *images)
 
        fdt_chosen(*of_flat_tree, 1);
        fixup_memory_node(*of_flat_tree);
+       fdt_fixup_ethernet(*of_flat_tree);
        fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1);
 
        return 0;
@@ -317,6 +318,7 @@ static void boot_jump_linux(bootm_headers_t *images)
        unsigned long machid = gd->bd->bi_arch_number;
        char *s;
        void (*kernel_entry)(int zero, int arch, uint params);
+       unsigned long r2;
 
        kernel_entry = (void (*)(int, int, uint))images->ep;
 
@@ -330,7 +332,15 @@ static void boot_jump_linux(bootm_headers_t *images)
                "...\n", (ulong) kernel_entry);
        bootstage_mark(BOOTSTAGE_ID_RUN_OS);
        announce_and_cleanup();
-       kernel_entry(0, machid, gd->bd->bi_boot_params);
+
+#ifdef CONFIG_OF_LIBFDT
+       if (images->ft_len)
+               r2 = (unsigned long)images->ft_addr;
+       else
+#endif
+               r2 = gd->bd->bi_boot_params;
+
+       kernel_entry(0, machid, r2);
 }
 
 /* Main Entry point for arm bootm implementation
@@ -359,3 +369,33 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
        boot_jump_linux(images);
        return 0;
 }
+
+#ifdef CONFIG_CMD_BOOTZ
+
+struct zimage_header {
+       uint32_t        code[9];
+       uint32_t        zi_magic;
+       uint32_t        zi_start;
+       uint32_t        zi_end;
+};
+
+#define        LINUX_ARM_ZIMAGE_MAGIC  0x016f2818
+
+int bootz_setup(void *image, void **start, void **end)
+{
+       struct zimage_header *zi = (struct zimage_header *)image;
+
+       if (zi->zi_magic != LINUX_ARM_ZIMAGE_MAGIC) {
+               puts("Bad Linux ARM zImage magic!\n");
+               return 1;
+       }
+
+       *start = (void *)zi->zi_start;
+       *end = (void *)zi->zi_end;
+
+       debug("Kernel image @ 0x%08x [ 0x%08x - 0x%08x ]\n",
+               (uint32_t)image, (uint32_t)*start, (uint32_t)*end);
+
+       return 0;
+}
+#endif /* CONFIG_CMD_BOOTZ */