Patchwork [U-Boot,v2,REPOST,3/3] tegra2: Enable CONFIG_SYS_RELATIVE_IMAGES

login
register
mail settings
Submitter Stephen Warren
Date Oct. 18, 2011, 9:11 p.m.
Message ID <1318972311-673-3-git-send-email-swarren@nvidia.com>
Download mbox | patch
Permalink /patch/120516/
State Not Applicable, archived
Delegated to: Tom Warren
Headers show

Comments

Stephen Warren - Oct. 18, 2011, 9:11 p.m.
v2: New patch

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 include/configs/tegra2-common.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Simon Glass - Oct. 19, 2011, 1:03 a.m.
Hi Stephen,

On Tue, Oct 18, 2011 at 2:11 PM, Stephen Warren <swarren@nvidia.com> wrote:
> v2: New patch
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Looks good - how do I make such an image so I can test it?

Acked-by: Simon Glass <sjg@chromium.org>

Regards,
Simon
Stephen Warren - Oct. 19, 2011, 3:24 p.m.
Simon Glass wrote at Tuesday, October 18, 2011 7:04 PM:
> On Tue, Oct 18, 2011 at 2:11 PM, Stephen Warren <swarren@nvidia.com> wrote:
> > v2: New patch
> >
> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
> 
> Looks good - how do I make such an image so I can test it?

Simply run the mkimage tool with '-T kernel_rel' instead of '-T kernel',
or for a FIT image, use 'type = "kernel_rel"'.

When testing, I tested the code as in the patch I sent, and with 
image_addr_raw_to_abs() hacked to add in an additional 0x100 offset,
just to make sure the offset showed up everywhere expected; I've been
testing on Tegra20 where the SDRAM base is 0. Luckily, the kernel
images I boot can run at any address, so didn't mind that random offset.
Simon Glass - Oct. 20, 2011, 8:27 p.m.
Hi Stephen,

On Wed, Oct 19, 2011 at 8:24 AM, Stephen Warren <swarren@nvidia.com> wrote:
> Simon Glass wrote at Tuesday, October 18, 2011 7:04 PM:
>> On Tue, Oct 18, 2011 at 2:11 PM, Stephen Warren <swarren@nvidia.com> wrote:
>> > v2: New patch
>> >
>> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>
>> Looks good - how do I make such an image so I can test it?
>
> Simply run the mkimage tool with '-T kernel_rel' instead of '-T kernel',
> or for a FIT image, use 'type = "kernel_rel"'.

OK thanks. My mkimage doesn't support this for some reason. The
problem I seem to have is that CONFIG_SYS_RELATIVE_IMAGES is not
defined for host C compiler builds. Is that right? How do you get the
code you added in image.c to compile with HOSTCC?

Regards,
Simon

>
> When testing, I tested the code as in the patch I sent, and with
> image_addr_raw_to_abs() hacked to add in an additional 0x100 offset,
> just to make sure the offset showed up everywhere expected; I've been
> testing on Tegra20 where the SDRAM base is 0. Luckily, the kernel
> images I boot can run at any address, so didn't mind that random offset.
>
> --
> nvpublic
>
>
Stephen Warren - Oct. 20, 2011, 8:47 p.m.
Simon Glass wrote at Thursday, October 20, 2011 2:27 PM:
> Hi Stephen,
> 
> On Wed, Oct 19, 2011 at 8:24 AM, Stephen Warren <swarren@nvidia.com> wrote:
> > Simon Glass wrote at Tuesday, October 18, 2011 7:04 PM:
> >> On Tue, Oct 18, 2011 at 2:11 PM, Stephen Warren <swarren@nvidia.com> wrote:
> >> > v2: New patch
> >> >
> >> > Signed-off-by: Stephen Warren <swarren@nvidia.com>
> >>
> >> Looks good - how do I make such an image so I can test it?
> >
> > Simply run the mkimage tool with '-T kernel_rel' instead of '-T kernel',
> > or for a FIT image, use 'type = "kernel_rel"'.
> 
> OK thanks. My mkimage doesn't support this for some reason. The
> problem I seem to have is that CONFIG_SYS_RELATIVE_IMAGES is not
> defined for host C compiler builds. Is that right? How do you get the
> code you added in image.c to compile with HOSTCC?

Oh dear. I tested mkimage before I added all the ifdefs, and then re-used
those images when I re-tested the target U-Boot after adding all the ifdefs
in. I guess I need to find some way of turning on the config option for
host builds.
Simon Glass - Oct. 20, 2011, 10:27 p.m.
On Thu, Oct 20, 2011 at 1:47 PM, Stephen Warren <swarren@nvidia.com> wrote:
> Simon Glass wrote at Thursday, October 20, 2011 2:27 PM:
>> Hi Stephen,
>>
>> On Wed, Oct 19, 2011 at 8:24 AM, Stephen Warren <swarren@nvidia.com> wrote:
>> > Simon Glass wrote at Tuesday, October 18, 2011 7:04 PM:
>> >> On Tue, Oct 18, 2011 at 2:11 PM, Stephen Warren <swarren@nvidia.com> wrote:
>> >> > v2: New patch
>> >> >
>> >> > Signed-off-by: Stephen Warren <swarren@nvidia.com>

I tested this on Seaboard with CONFIG_SYS_SDRAM_BASE set to 0x100.

Tested-by: Simon Glass <sjg@chromium.org>


>> >>
>> >> Looks good - how do I make such an image so I can test it?
>> >
>> > Simply run the mkimage tool with '-T kernel_rel' instead of '-T kernel',
>> > or for a FIT image, use 'type = "kernel_rel"'.
>>
>> OK thanks. My mkimage doesn't support this for some reason. The
>> problem I seem to have is that CONFIG_SYS_RELATIVE_IMAGES is not
>> defined for host C compiler builds. Is that right? How do you get the
>> code you added in image.c to compile with HOSTCC?
>
> Oh dear. I tested mkimage before I added all the ifdefs, and then re-used
> those images when I re-tested the target U-Boot after adding all the ifdefs
> in. I guess I need to find some way of turning on the config option for
> host builds.
>
> --
> nvpublic
>
>

Patch

diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 73e0f05..07546a4 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -136,6 +136,8 @@ 
 #define CONFIG_SYS_LOAD_ADDR		(0xA00800)	/* default */
 #define CONFIG_SYS_HZ			1000
 
+#define CONFIG_SYS_RELATIVE_IMAGES	/* Support IH_TYPE_KERNEL_REL */
+
 /*-----------------------------------------------------------------------
  * Stack sizes
  *