[U-Boot] [RFC PATCH] arm: bootm: Boot kernel with U-Boot's FDT blob

Alexander Graf agraf at suse.de
Tue Jan 10 14:02:21 CET 2017


On 01/10/2017 01:58 PM, Michal Simek wrote:
> U-Boot configured via DTB can use the same DTB for booting the kernel.
> When OF_CONTROL is used fdtcontroladdr is setup and can be use for boot.
>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>
> Didn't check if there is any side effect or not but it looks weird when
> you have DT driver u-boot that you have to load dtb again.

I agree, and I think it's very reasonable to try and use the same device 
tree for U-Boot and Linux.

I'm not sure it's a great idea to check for the builtin device tree 
after ATAGs though. Shouldn't we prefer the built-in one over ATAGs?


Alex

>
> ---
>   arch/arm/lib/bootm.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
> index 43cc83ec95b6..9740045b0094 100644
> --- a/arch/arm/lib/bootm.c
> +++ b/arch/arm/lib/bootm.c
> @@ -245,6 +245,20 @@ static void boot_prep_linux(bootm_headers_t *images)
>   		}
>   		setup_board_tags(&params);
>   		setup_end_tag(gd->bd);
> +	} else if (IS_ENABLED(CONFIG_OF_CONTROL)) {
> +#ifdef CONFIG_OF_LIBFDT
> +		images->ft_addr = (char *)getenv_hex("fdtcontroladdr", 0);
> +		if (!images->ft_addr) {
> +			printf("FDT address failed! hanging...");
> +			hang();
> +		}
> +
> +		debug("using: U-Boot's FDT\n");
> +		if (image_setup_linux(images)) {
> +			printf("FDT creation failed! hanging...");
> +			hang();
> +		}
> +#endif
>   	} else {
>   		printf("FDT and ATAGS support not compiled in - hanging\n");
>   		hang();




More information about the U-Boot mailing list