Skip to contentSkip to conversation

bootm: mips: Remove boot_reloc_ramdisk

PATCH New Horatiu Vultur 2 participants 5 messages Mar 7, 2019 – Mar 15, 2019 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bootm: mips: Remove boot_reloc_ramdisk

Remove the function boot_reloc_ramdisk in the file arch/mips/lib/bootm because it is relocating again the ramdisk. The function do_bootm_states() already relocates the ramdisk even if it is a legacy uImage or a FIT image.

The relocation in the function do_bootm_states() was introduce in the commit c2e7e72bb9f0cb47d024997b381cb64786eb5402 ("bootm: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH set")

---
 arch/mips/lib/bootm.c | 19 -------------------
 1 file changed, 19 deletions(-)
arch/mips/lib/bootm.c +0 -19
index deca518..35152cb 100644
@@ -215,23 +215,6 @@ static void linux_env_legacy(bootm_headers_t *images)
 	}
 }
 
-static int boot_reloc_ramdisk(bootm_headers_t *images)
-{
-	ulong rd_len = images->rd_end - images->rd_start;
-
-	/*
-	 * In case of legacy uImage's, relocation of ramdisk is already done
-	 * by do_bootm_states() and should not repeated in 'bootm prep'.
-	 */
-	if (images->state & BOOTM_STATE_RAMDISK) {
-		debug("## Ramdisk already relocated\n");
-		return 0;
-	}
-
-	return boot_ramdisk_high(&images->lmb, images->rd_start,
-		rd_len, &images->initrd_start, &images->initrd_end);
-}
-
 static int boot_reloc_fdt(bootm_headers_t *images)
 {
 	/*
@@ -270,8 +253,6 @@ static int boot_setup_fdt(bootm_headers_t *images)
 
 static void boot_prep_linux(bootm_headers_t *images)
 {
-	boot_reloc_ramdisk(images);
-
 	if (CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && images->ft_len) {
 		boot_reloc_fdt(images);
 		boot_setup_fdt(images);
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 bootm: mips: Remove boot_reloc_ramdisk

Am Do., 7. März 2019 um 16:49 Uhr schrieb Horatiu Vultur <[email protected]>:

Quoted 52 lines

Remove the function boot_reloc_ramdisk in the file arch/mips/lib/bootm because it is relocating again the ramdisk. The function do_bootm_states() already relocates the ramdisk even if it is a legacy uImage or a FIT image.

The relocation in the function do_bootm_states() was introduce in the commit c2e7e72bb9f0cb47d024997b381cb64786eb5402 ("bootm: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH set")

---
 arch/mips/lib/bootm.c | 19 -------------------
 1 file changed, 19 deletions(-)
arch/mips/lib/bootm.c +0 -20
index deca518..35152cb 100644
@@ -215,23 +215,6 @@ static void linux_env_legacy(bootm_headers_t *images)
        }
 }
 
-static int boot_reloc_ramdisk(bootm_headers_t *images)
-{
-       ulong rd_len = images->rd_end - images->rd_start;
-
-       /*
-        * In case of legacy uImage's, relocation of ramdisk is already done
-        * by do_bootm_states() and should not repeated in 'bootm prep'.
-        */
-       if (images->state & BOOTM_STATE_RAMDISK) {
-               debug("## Ramdisk already relocated\n");
-               return 0;
-       }
-
-       return boot_ramdisk_high(&images->lmb, images->rd_start,
-               rd_len, &images->initrd_start, &images->initrd_end);
-}
-
 static int boot_reloc_fdt(bootm_headers_t *images)
 {
        /*
@@ -270,8 +253,6 @@ static int boot_setup_fdt(bootm_headers_t *images)
 
 static void boot_prep_linux(bootm_headers_t *images)
 {
-       boot_reloc_ramdisk(images);
-
        if (CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && images->ft_len) {
                boot_reloc_fdt(images);
                boot_setup_fdt(images);
--
Quoted 2 lines

2.7.4

Combined with c2e7e72bb9f0cb47d024997b381cb64786eb5402 it looks right. But could you please verify that following scenarios still work?

- bootm uImage_legacy_addr initrd_addr
- bootm start uImage_legacy_addr initrd_addr + bootm loados ramdisk fdt prep go (single step)
- bootm uImage_fit_addr
- bootm start uImage_fit_addr (single step) + bootm loados ramdisk fdt prep go (single step)

Signature · 1 line
- Daniel
#2 lore raw

PATCH 1/1 bootm: mips: Remove boot_reloc_ramdisk

Hi Daniel,

Quoted 60 lines · Daniel Schwierzeck

Am Do., 7. März 2019 um 16:49 Uhr schrieb Horatiu Vultur <[email protected]>:

Quoted 52 lines

Remove the function boot_reloc_ramdisk in the file arch/mips/lib/bootm because it is relocating again the ramdisk. The function do_bootm_states() already relocates the ramdisk even if it is a legacy uImage or a FIT image.

The relocation in the function do_bootm_states() was introduce in the commit c2e7e72bb9f0cb47d024997b381cb64786eb5402 ("bootm: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH set")

---
 arch/mips/lib/bootm.c | 19 -------------------
 1 file changed, 19 deletions(-)
arch/mips/lib/bootm.c +0 -20
index deca518..35152cb 100644
@@ -215,23 +215,6 @@ static void linux_env_legacy(bootm_headers_t *images)
        }
 }
 
-static int boot_reloc_ramdisk(bootm_headers_t *images)
-{
-       ulong rd_len = images->rd_end - images->rd_start;
-
-       /*
-        * In case of legacy uImage's, relocation of ramdisk is already done
-        * by do_bootm_states() and should not repeated in 'bootm prep'.
-        */
-       if (images->state & BOOTM_STATE_RAMDISK) {
-               debug("## Ramdisk already relocated\n");
-               return 0;
-       }
-
-       return boot_ramdisk_high(&images->lmb, images->rd_start,
-               rd_len, &images->initrd_start, &images->initrd_end);
-}
-
 static int boot_reloc_fdt(bootm_headers_t *images)
 {
        /*
@@ -270,8 +253,6 @@ static int boot_setup_fdt(bootm_headers_t *images)
 
 static void boot_prep_linux(bootm_headers_t *images)
 {
-       boot_reloc_ramdisk(images);
-
        if (CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && images->ft_len) {
                boot_reloc_fdt(images);
                boot_setup_fdt(images);
--
Quoted 2 lines

2.7.4

Combined with c2e7e72bb9f0cb47d024997b381cb64786eb5402 it looks right. But could you please verify that following scenarios still work?

Quoted 6 lines

- bootm uImage_legacy_addr initrd_addr
- bootm start uImage_legacy_addr initrd_addr + bootm loados ramdisk fdt prep go (single step)
- bootm uImage_fit_addr
- bootm start uImage_fit_addr (single step) + bootm loados ramdisk fdt prep go (single step)

I tried all the above cases and all seems to work fine. I managed to start the linux kernel and it found the ramdisk. One observation in my case I used also a DT, but I don't see how this can influence the tests.

Quoted 3 lines
Signature · 2 lines
-- 
- Daniel
Signature · 1 line
/Horatiu
#3 lore raw

PATCH 1/1 bootm: mips: Remove boot_reloc_ramdisk

Am 08.03.19 um 13:30 schrieb Horatiu Vultur:

Quoted 18 lines

Hi Daniel,

Quoted 15 lines · Daniel Schwierzeck

Am Do., 7. März 2019 um 16:49 Uhr schrieb Horatiu Vultur <[email protected]>:

Quoted 13 lines

Remove the function boot_reloc_ramdisk in the file arch/mips/lib/bootm because it is relocating again the ramdisk. The function do_bootm_states() already relocates the ramdisk even if it is a legacy uImage or a FIT image.

The relocation in the function do_bootm_states() was introduce in the commit c2e7e72bb9f0cb47d024997b381cb64786eb5402 ("bootm: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH set")

---
 arch/mips/lib/bootm.c | 19 -------------------
 1 file changed, 19 deletions(-)
Quoted 52 lines
Quoted 45 lines
Quoted 39 lines
arch/mips/lib/bootm.c +0 -20
index deca518..35152cb 100644
@@ -215,23 +215,6 @@ static void linux_env_legacy(bootm_headers_t *images)
        }
 }
 
-static int boot_reloc_ramdisk(bootm_headers_t *images)
-{
-       ulong rd_len = images->rd_end - images->rd_start;
-
-       /*
-        * In case of legacy uImage's, relocation of ramdisk is already done
-        * by do_bootm_states() and should not repeated in 'bootm prep'.
-        */
-       if (images->state & BOOTM_STATE_RAMDISK) {
-               debug("## Ramdisk already relocated\n");
-               return 0;
-       }
-
-       return boot_ramdisk_high(&images->lmb, images->rd_start,
-               rd_len, &images->initrd_start, &images->initrd_end);
-}
-
 static int boot_reloc_fdt(bootm_headers_t *images)
 {
        /*
@@ -270,8 +253,6 @@ static int boot_setup_fdt(bootm_headers_t *images)
 
 static void boot_prep_linux(bootm_headers_t *images)
 {
-       boot_reloc_ramdisk(images);
-
        if (CONFIG_IS_ENABLED(MIPS_BOOT_FDT) && images->ft_len) {
                boot_reloc_fdt(images);
                boot_setup_fdt(images);
--
Quoted 2 lines

2.7.4

Combined with c2e7e72bb9f0cb47d024997b381cb64786eb5402 it looks right. But could you please verify that following scenarios still work?

Quoted 6 lines

- bootm uImage_legacy_addr initrd_addr
- bootm start uImage_legacy_addr initrd_addr + bootm loados ramdisk fdt prep go (single step)
- bootm uImage_fit_addr
- bootm start uImage_fit_addr (single step) + bootm loados ramdisk fdt prep go (single step)

Quoted 5 lines

I tried all the above cases and all seems to work fine. I managed to start the linux kernel and it found the ramdisk. One observation in my case I used also a DT, but I don't see how this can influence the tests.

thanks for testing

Signature · 1 line
- Daniel
#4 lore raw

PATCH 1/1 bootm: mips: Remove boot_reloc_ramdisk

In reply to Horatiu Vultur

Am 07.03.19 um 16:49 schrieb Horatiu Vultur:

Quoted 4 lines

Remove the function boot_reloc_ramdisk in the file arch/mips/lib/bootm because it is relocating again the ramdisk. The function do_bootm_states() already relocates the ramdisk even if it is a legacy uImage or a FIT image.

Quoted 9 lines

The relocation in the function do_bootm_states() was introduce in the commit c2e7e72bb9f0cb47d024997b381cb64786eb5402 ("bootm: relocate ramdisk if CONFIG_SYS_BOOT_RAMDISK_HIGH set")

---
 arch/mips/lib/bootm.c | 19 -------------------
 1 file changed, 19 deletions(-)

applied to u-boot-mips/next, thanks.

Signature · 1 line
- Daniel