diff mbox

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

Message ID 1345683341-8236-2-git-send-email-scottwood@freescale.com
State New
Headers show

Commit Message

Scott Wood Aug. 23, 2012, 12:55 a.m. UTC
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(-)

Comments

Alexander Graf Sept. 25, 2012, 7:49 a.m. UTC | #1
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. UTC | #2
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. UTC | #3
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. UTC | #4
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
diff mbox

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