All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] bootm: mips: Remove boot_reloc_ramdisk
@ 2019-03-07 15:49 Horatiu Vultur
  2019-03-07 17:33 ` Daniel Schwierzeck
  2019-03-15 11:35 ` Daniel Schwierzeck
  0 siblings, 2 replies; 5+ messages in thread
From: Horatiu Vultur @ 2019-03-07 15:49 UTC (permalink / raw)
  To: u-boot

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")

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 arch/mips/lib/bootm.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index deca518..35152cb 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] bootm: mips: Remove boot_reloc_ramdisk
  2019-03-07 15:49 [U-Boot] [PATCH] bootm: mips: Remove boot_reloc_ramdisk Horatiu Vultur
@ 2019-03-07 17:33 ` Daniel Schwierzeck
  2019-03-08 12:30   ` Horatiu Vultur
  2019-03-15 11:35 ` Daniel Schwierzeck
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Schwierzeck @ 2019-03-07 17:33 UTC (permalink / raw)
  To: u-boot

Am Do., 7. März 2019 um 16:49 Uhr schrieb Horatiu Vultur
<horatiu.vultur@microchip.com>:
>
> 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")
>
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
>  arch/mips/lib/bootm.c | 19 -------------------
>  1 file changed, 19 deletions(-)
>
> diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
> index deca518..35152cb 100644
> --- a/arch/mips/lib/bootm.c
> +++ b/arch/mips/lib/bootm.c
> @@ -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);
> --
> 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)

-- 
- Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] bootm: mips: Remove boot_reloc_ramdisk
  2019-03-07 17:33 ` Daniel Schwierzeck
@ 2019-03-08 12:30   ` Horatiu Vultur
  2019-03-15 11:17     ` Daniel Schwierzeck
  0 siblings, 1 reply; 5+ messages in thread
From: Horatiu Vultur @ 2019-03-08 12:30 UTC (permalink / raw)
  To: u-boot

Hi Daniel,

The 03/07/2019 18:33, Daniel Schwierzeck wrote:
> Am Do., 7. März 2019 um 16:49 Uhr schrieb Horatiu Vultur
> <horatiu.vultur@microchip.com>:
> >
> > 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")
> >
> > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> > ---
> >  arch/mips/lib/bootm.c | 19 -------------------
> >  1 file changed, 19 deletions(-)
> >
> > diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
> > index deca518..35152cb 100644
> > --- a/arch/mips/lib/bootm.c
> > +++ b/arch/mips/lib/bootm.c
> > @@ -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);
> > --
> > 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)

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.

> 
> -- 
> - Daniel

-- 
/Horatiu

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] bootm: mips: Remove boot_reloc_ramdisk
  2019-03-08 12:30   ` Horatiu Vultur
@ 2019-03-15 11:17     ` Daniel Schwierzeck
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Schwierzeck @ 2019-03-15 11:17 UTC (permalink / raw)
  To: u-boot



Am 08.03.19 um 13:30 schrieb Horatiu Vultur:
> Hi Daniel,
> 
> The 03/07/2019 18:33, Daniel Schwierzeck wrote:
>> Am Do., 7. März 2019 um 16:49 Uhr schrieb Horatiu Vultur
>> <horatiu.vultur@microchip.com>:
>>>
>>> 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")
>>>
>>> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
>>> ---
>>>  arch/mips/lib/bootm.c | 19 -------------------
>>>  1 file changed, 19 deletions(-)

Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

>>>
>>> diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
>>> index deca518..35152cb 100644
>>> --- a/arch/mips/lib/bootm.c
>>> +++ b/arch/mips/lib/bootm.c
>>> @@ -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);
>>> --
>>> 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)
> 
> 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

-- 
- Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] bootm: mips: Remove boot_reloc_ramdisk
  2019-03-07 15:49 [U-Boot] [PATCH] bootm: mips: Remove boot_reloc_ramdisk Horatiu Vultur
  2019-03-07 17:33 ` Daniel Schwierzeck
@ 2019-03-15 11:35 ` Daniel Schwierzeck
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Schwierzeck @ 2019-03-15 11:35 UTC (permalink / raw)
  To: u-boot



Am 07.03.19 um 16:49 schrieb Horatiu Vultur:
> 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")
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
>  arch/mips/lib/bootm.c | 19 -------------------
>  1 file changed, 19 deletions(-)
> 

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

-- 
- Daniel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-15 11:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 15:49 [U-Boot] [PATCH] bootm: mips: Remove boot_reloc_ramdisk Horatiu Vultur
2019-03-07 17:33 ` Daniel Schwierzeck
2019-03-08 12:30   ` Horatiu Vultur
2019-03-15 11:17     ` Daniel Schwierzeck
2019-03-15 11:35 ` Daniel Schwierzeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.