[PATCH 0/7] Re-organize linker layouts

Nicolas Pitre nico at fluxnic.net
Mon Jul 11 18:14:38 EDT 2011


On Mon, 11 Jul 2011, Stephen Boyd wrote:

> On 7/8/2011 11:24 AM, Nicolas Pitre wrote:
> > On Fri, 8 Jul 2011, Stephen Boyd wrote:
> >> Why can't this work via atags (or DT for that matter)? atags have always
> >> said where ram starts and we should be able to write some code that
> >> parses the atags/DT and figures out the final resting place of the
> >> decompressed image.
> > Possibly.  But that would be an MSM special case.
> >
> 
> Hmm. I thought ST-Erricson folks had something similar.
> 
> Anyway, maybe we've been going about this the wrong way. Couldn't we
> just make TEXT_OFFSET be 0x00208000 and then make sure to remove the
> first 2MB of memory in a machine->reserve() routine if we're MSM?

I think that would certainly be a worthwhile thing to do.  This would 
even make ARM_PATCH_PHYS_VIRT more efficient as you won't have to enable 
ARM_PATCH_PHYS_VIRT_16BIT anymore.  And even without 
ARM_PATCH_PHYS_VIRT, the compiled code for virt_to_phys() and 
phys_to_virt() would be more efficient.

Whether or not we would like to still keep the ARM_PATCH_PHYS_VIRT_16BIT 
code around is a separate question.

> Something like PHYS_OFFSET=0xN0000000 and TEXT_OFFSET=0x00208000 so that
> our text ends up at the right place (0xN0208000) and AUTO_ZRELADDR will
> be happy. This seems to work as long as I fixup the atags to say memory
> starts at 0xN000000 instead of 0xN0200000.

As long as you are fixing it up in the kernel not in the bootloader, 
given that it is the kernel who is cheating.  The mdesc->fixup callback 
is perfect for that.


Nicolas



More information about the linux-arm-kernel mailing list