On Wed, Dec 02, 2015 at 02:48:48PM +0100, Markus Pargmann wrote: > The memory calculations used are all hardcoded into three different > files, start-pbl.c, uncompress.c and start.c. To make this more readable > and reliable, this patch gathers these information in barebox-arm.h with > static inline functions for the calculation of the memory offsets. > > This patch also adds proper handling of different barebox/board data > sizes. Currently only 1MB+Alignment of RAM is reserved for Barebox and > board data. This could be too small for bigger devicetrees and barebox. > > Signed-off-by: Markus Pargmann <mpa@xxxxxxxxxxxxxx> > --- > + > +static inline unsigned long arm_mem_barebox_image(unsigned long membase, > + unsigned long endmem, > + unsigned long size) > +{ > + endmem = arm_mem_ttb(membase, endmem); > + > +#ifdef CONFIG_RELOCATABLE > + endmem -= size; > endmem &= ~(SZ_1M - 1); > +#endif if (IS_ENABLED(CONFIG_RELOCATABLE)) please Otherwise this is a nice cleanup. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox