[PATCH 1/2] imx: Internal boot sources, handle all header offsets
marc at cpdesign.com.au
Fri Oct 1 22:20:47 EDT 2010
On Saturday, October 02, 2010 02:53:24 am Jean-Christophe PLAGNIOL-VILLARD
> On 14:58 Fri 01 Oct , Marc Reilly wrote:
> > Hi,
> > > > -#define __image_len_0x100 __section(.image_len_0x100)
> > > > +#if defined(CONFIG_ARCH_IMX_INTERNAL_BOOT_NOR)
> > > > + #define __flash_header_section __section(.flash_header_0x1000)
> > > > + #define __dcd_entry_section __section(.dcd_entry_0x1000)
> > > > + #define __image_len_section __section(.image_len_0x1000)
> > > > + #define FLASH_HEADER_OFFSET 0x1000
> > > > +#elif defined(CONFIG_ARCH_IMX_INTERNAL_BOOT_ONENAND)
> > > > + #define __flash_header_section __section(.flash_header_0x0100)
> > > > + #define __dcd_entry_section __section(.dcd_entry_0x0100)
> > > > + #define __image_len_section __section(.image_len_0x0100)
> > > > + #define FLASH_HEADER_OFFSET 0x0100
> > >
> > > nor and onenand are the same why duplicate them?
> > They look similar but, NOR offset is at 4Kb (0x1000), OneNand is 256b
> > (0x100).
> > (The leading zero for 0x0100 doesn't help, but is necessary otherwise the
(Clarification here, I meant that the leading zero potentially makes them look
> > blah_0x1000 matches the blah_0x100* linker section.)
> why do we need specific section name?
Only the the final link location really matters, there are three locations
that the internal boot ROM could look for the flash header info, depending on
the type of external media.
The way it was set up was that there were the three predefined sections that
would be located at the correct address. The approach I took with these
patches was to just keep that the same.
Looking back, possibly there is a simpler way to do it, but I've got to move
on to other things.
More information about the barebox