arm: Check for valid FDT after console is up
authorSimon Glass <sjg@chromium.org>
Wed, 28 Mar 2012 10:08:25 +0000 (10:08 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Thu, 29 Mar 2012 06:12:49 +0000 (08:12 +0200)
When using CONFIG_OF_CONTROL, add a check that we have a valid FDT
and panic() if not. This must be done after the console is ready.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/lib/board.c

index b9b35de61adafb5c670a9448475a6a5c3a18153a..5270c112626a85ff7e2ae31d72e34a855fdacabc 100644 (file)
@@ -293,6 +293,14 @@ void board_init_f(ulong bootflag)
                }
        }
 
+#ifdef CONFIG_OF_CONTROL
+       /* For now, put this check after the console is ready */
+       if (fdtdec_prepare_fdt()) {
+               panic("** CONFIG_OF_CONTROL defined but no FDT - please see "
+                       "doc/README.fdt-control");
+       }
+#endif
+
        debug("monitor len: %08lX\n", gd->mon_len);
        /*
         * Ram is setup, size stored in gd !!