Commit c970dffedb9f7bf76d67157c8ceba64496b0c64a

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent 8e71443211

generic_board: do not set gd->fdt_blob unless CONFIG_OF_CONTROL=y

gd->fdt_blob is used for FDT control of U-Boot.
If CONFIG_OF_CONTROL is not defined, it is useless.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>

Showing 1 changed file with 6 additions and 4 deletions Side-by-side Diff

... ... @@ -341,21 +341,23 @@
341 341  
342 342 static int setup_fdt(void)
343 343 {
344   -#ifdef CONFIG_OF_EMBED
  344 +#ifdef CONFIG_OF_CONTROL
  345 +# ifdef CONFIG_OF_EMBED
345 346 /* Get a pointer to the FDT */
346 347 gd->fdt_blob = __dtb_dt_begin;
347   -#elif defined CONFIG_OF_SEPARATE
  348 +# elif defined CONFIG_OF_SEPARATE
348 349 /* FDT is at end of image */
349 350 gd->fdt_blob = (ulong *)&_end;
350   -#elif defined(CONFIG_OF_HOSTFILE)
  351 +# elif defined(CONFIG_OF_HOSTFILE)
351 352 if (read_fdt_from_file()) {
352 353 puts("Failed to read control FDT\n");
353 354 return -1;
354 355 }
355   -#endif
  356 +# endif
356 357 /* Allow the early environment to override the fdt address */
357 358 gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
358 359 (uintptr_t)gd->fdt_blob);
  360 +#endif
359 361 return 0;
360 362 }
361 363