[PATCH 3/3] bootm: add initial FIT support

Jan Lübbe jlu at pengutronix.de
Thu Jan 7 09:00:40 PST 2016


On Mi, 2016-01-06 at 17:09 +0100, Marc Kleine-Budde wrote:
[...]
> >> +	/*
> >> +	 * Put oftree/initrd close behind compressed kernel image to avoid
> >> +	 * placing it outside of the kernels lowmem.
> >> +	 */
> >> +	if (handle->initrd_size) {
> >> +		data->initrd_address = PAGE_ALIGN(data->os_res->end + SZ_1M);
> >> +		data->initrd_res = request_sdram_region("fit-initrd", data->initrd_address, handle->initrd_size);
> >> +		if (!data->initrd_res) {
> >> +			ret = -ENOMEM;
> >> +			goto err_out;
> >> +		}
> >> +		memcpy((void *)data->initrd_res->start, handle->initrd, handle->initrd_size);
> >> +	}
> >> +
> >> +	data->of_root_node = of_unflatten_dtb(handle->oftree);
> >> +	if (!data->of_root_node) {
> >> +		pr_err("unable to unflatten devicetree\n");
> >> +		ret = -EINVAL;
> >> +		goto err_out;
> >> +	}
> >> +
> >> +	/*
> >> +	 * Put devicetree right after initrd if present or after the kernel
> >> +	 * if not.
> >> +	 */
> >> +	if (data->initrd_res)
> >> +		mem_free = PAGE_ALIGN(data->initrd_res->end);
> >> +	else
> >> +		mem_free = PAGE_ALIGN(data->os_res->end + SZ_1M);
> > Why the extra 1M?
> 
> Let's see if Jan remembers, he has coded this.

This is the same as in arch/arm/lib/bootm.c. I wanted to avoid having
different behaviors.

Regards,
Jan
-- 
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 |




More information about the barebox mailing list