Patchwork [2/2] PPC: e500: calculate initrd_base like dt_base

login
register
mail settings
Submitter Scott Wood
Date Aug. 23, 2012, 12:55 a.m.
Message ID <1345683341-8236-2-git-send-email-scottwood@freescale.com>
Download mbox | patch
Permalink /patch/179476/
State New
Headers show

Comments

Scott Wood - Aug. 23, 2012, 12:55 a.m.
While investigating dtb pad issues, I noticed that initrd_base wasn't taking
loadaddr into account the way dt_base was.  This seems wrong.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 hw/ppc/e500.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Alexander Graf - Sept. 25, 2012, 7:49 a.m.
On 23.08.2012, at 02:55, Scott Wood wrote:

> While investigating dtb pad issues, I noticed that initrd_base wasn't taking
> loadaddr into account the way dt_base was.  This seems wrong.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Ah, all the images I tested start off from address 0. But yes, we should add the kernel load offset as well.

Thanks, applied to ppc-next.


Alex

> ---
> hw/ppc/e500.c |    3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index 1ccfd7c..60ddd85 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -553,7 +553,8 @@ void ppce500_init(PPCE500Params *params)
> 
>     /* Load initrd. */
>     if (params->initrd_filename) {
> -        initrd_base = (kernel_size + INITRD_LOAD_PAD) & ~INITRD_PAD_MASK;
> +        initrd_base = (loadaddr + kernel_size + INITRD_LOAD_PAD) &
> +            ~INITRD_PAD_MASK;
>         initrd_size = load_image_targphys(params->initrd_filename, initrd_base,
>                                           ram_size - initrd_base);
> 
> -- 
> 1.7.9.5
> 
>
Folkert van Heusden - Sept. 28, 2012, 7:52 p.m.
On Tue, Sep 25, 2012 at 09:49:08AM +0200, Alexander Graf wrote:
> > While investigating dtb pad issues, I noticed that initrd_base wasn't taking
> > loadaddr into account the way dt_base was.  This seems wrong.
> > 
> > Signed-off-by: Scott Wood <scottwood@freescale.com>
> 
> Ah, all the images I tested start off from address 0. But yes, we should add the kernel load offset as well.
> Thanks, applied to ppc-next.

Isn't the aix kernel starting at offset 16384?


Folkert van Heusden
Scott Wood - Sept. 28, 2012, 8:11 p.m.
On 09/28/2012 02:52:15 PM, folkert wrote:
> On Tue, Sep 25, 2012 at 09:49:08AM +0200, Alexander Graf wrote:
> > > While investigating dtb pad issues, I noticed that initrd_base  
> wasn't taking
> > > loadaddr into account the way dt_base was.  This seems wrong.
> > >
> > > Signed-off-by: Scott Wood <scottwood@freescale.com>
> >
> > Ah, all the images I tested start off from address 0. But yes, we  
> should add the kernel load offset as well.
> > Thanks, applied to ppc-next.
> 
> Isn't the aix kernel starting at offset 16384?

I doubt the AIX kernel will run on e500. :-)

-Scott
Alexander Graf - Sept. 29, 2012, 1:52 a.m.
On 28.09.2012, at 21:52, folkert <folkert@vanheusden.com> wrote:

> On Tue, Sep 25, 2012 at 09:49:08AM +0200, Alexander Graf wrote:
>>> While investigating dtb pad issues, I noticed that initrd_base wasn't taking
>>> loadaddr into account the way dt_base was.  This seems wrong.
>>> 
>>> Signed-off-by: Scott Wood <scottwood@freescale.com>
>> 
>> Ah, all the images I tested start off from address 0. But yes, we should add the kernel load offset as well.
>> Thanks, applied to ppc-next.
> 
> Isn't the aix kernel starting at offset 16384?

AIX does not run on e500 style cores :)

Alex

> 
> 
> Folkert van Heusden
> 
> -- 
> MultiTail na wan makriki wrokosani fu tan luku den logfile nanga san
> den commando spiti puru. Piki puru spesrutu sani, wroko nanga difrenti
> kroru, tya kon makandra, nanga wan lo moro.
> http://www.vanheusden.com/multitail/
> ----------------------------------------------------------------------
> Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com

Patch

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 1ccfd7c..60ddd85 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -553,7 +553,8 @@  void ppce500_init(PPCE500Params *params)
 
     /* Load initrd. */
     if (params->initrd_filename) {
-        initrd_base = (kernel_size + INITRD_LOAD_PAD) & ~INITRD_PAD_MASK;
+        initrd_base = (loadaddr + kernel_size + INITRD_LOAD_PAD) &
+            ~INITRD_PAD_MASK;
         initrd_size = load_image_targphys(params->initrd_filename, initrd_base,
                                           ram_size - initrd_base);