[PATCH v2 02/13] scripts: Add Allwinner eGON image support

Sascha Hauer sha at pengutronix.de
Wed Jun 21 01:26:13 PDT 2023


On Sat, Jun 17, 2023 at 09:25:41AM +0200, Jules Maselbas wrote:
> Hi Marco,
> 
> On June 17, 2023 12:00:57 AM GMT+02:00, Marco Felsch <m.felsch at pengutronix.de> wrote:
> > > +	 * to the users.
> > > +	 */
> > > +	uint32_t dt_name_offset;/* since v0.2, set by mksunxiboot */
> > > +	uint32_t dram_size;/* in MiB, since v0.3, set by SPL */
> > > +	uint32_t boot_media;/* written here by the boot ROM */
> > > +	/* A padding area (may be used for storing text strings) */
> > > +	uint32_t string_pool[13];/* since v0.2, filled by mksunxiboot */
> > > +	/* The header must be a multiple of 32 bytes (for VBAR alignment) */
> > > +	/* And at least 64 byte (https://patchwork.ozlabs.org/patch/622173) */
> > > +};
> > > +#define EGON_HDR_BRANCH (0xea000000 | (sizeof(struct egon_header) / 4 - 2))
> > > +#define sunxi_egon_header(section) {					\
> > > +		__section(section) static const struct egon_header hdr= \
> > > +			{ .branch = EGON_HDR_BRANCH, .magic = "eGON" };	\
> > > +		__keep_symbolref(hdr);					\
> > > +	}
> > 
> > Using an additional sections seems a bit odd here. We can just write the
> > header within the image tool.
> That's what I wanted to do in the first place but I struggled a lot to get barebox relocation working.
> Having the eGON header embedded in the .text (since the header is
> loaded by bootrom) is the only solution i found to get the relocation
> working.

The barebox image (the .text section) needs a 4k alignment for relocation.
If you are pasting just a few bytes before the image then you are
breaking this alignment. Can you blow up the header to 4k?

You only have 32k space initially and I don't know how tight in space
you are already, so this might or or might not be an option.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list