[U-Boot] [PATCH] vexpress: qemu can load the fdt to ram base

Gerd Hoffmann kraxel at redhat.com
Tue Oct 21 12:36:12 CEST 2014


On Di, 2014-10-21 at 12:05 +0200, Gerd Hoffmann wrote:
> Check if the fdt is there (happens only when passed via -dtb cmd line
> switch to qemu), then setup env accordingly.  If present use it.
> Otherwise try to load from disk.

Oops, wrong patch, correct one just send.
It shows what I'm doing though to automatically use the qemu fdt:

> +int board_late_init(void)
> +{
> +	struct fdt_header *fdt = (void*)V2M_BASE;
> +
> +	if (fdt_magic(fdt) == FDT_MAGIC) {
> +		setenv_addr("fdt_addr", (void*)(ulong)V2M_BASE);
> +		printf("QEMU: fdt found at %s, using it.\n", getenv("fdt_addr"));
> +	} else {
> +		setenv_addr("fdt_addr_r", (void*)((ulong)V2M_BASE + 0x27f00000));
> +		setenv("fdtfile", CONFIG_DEFAULT_FDT_FILE);
> +		printf("QEMU: will try to load %s from disk.\n",
> +		       getenv("fdtfile"));
> +	}
> +
> +	return 0;
> +}

[ This one depends on other non-upstream patches so no plans to submit
  this upstream atm ]

cheers,
  Gerd




More information about the U-Boot mailing list