]> git.sur5r.net Git - u-boot/commitdiff
ARM: bootm: Try to use relocated ramdisk
authorJeffy Chen <jeffy.chen@rock-chips.com>
Thu, 14 Jan 2016 02:19:36 +0000 (10:19 +0800)
committerSimon Glass <sjg@chromium.org>
Fri, 22 Jan 2016 03:03:59 +0000 (20:03 -0700)
After boot_ramdisk_high(), ramdisk would be relocated to
initrd_start & initrd_end, so use them instead of rd_start & rd_end.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Acked-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/lib/bootm.c

index a477cae010db9da5d2f6a04f706e9b16342feaba..0838d89907b9a2eb81f4ebb31d8c045e031c5e11 100644 (file)
@@ -225,7 +225,17 @@ static void boot_prep_linux(bootm_headers_t *images)
                if (BOOTM_ENABLE_MEMORY_TAGS)
                        setup_memory_tags(gd->bd);
                if (BOOTM_ENABLE_INITRD_TAG) {
-                       if (images->rd_start && images->rd_end) {
+                       /*
+                        * In boot_ramdisk_high(), it may relocate ramdisk to
+                        * a specified location. And set images->initrd_start &
+                        * images->initrd_end to relocated ramdisk's start/end
+                        * addresses. So use them instead of images->rd_start &
+                        * images->rd_end when possible.
+                        */
+                       if (images->initrd_start && images->initrd_end) {
+                               setup_initrd_tag(gd->bd, images->initrd_start,
+                                                images->initrd_end);
+                       } else if (images->rd_start && images->rd_end) {
                                setup_initrd_tag(gd->bd, images->rd_start,
                                                 images->rd_end);
                        }