summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-03-28 10:08:24 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-03-29 08:12:49 +0200
commit9a263e55dc00f3277d8e82c906ee5c7a1dca0ba5 (patch)
tree01817ce4e4756f0b7b57cead40f06b59639d589d /include
parent87f938c9f7372f587a43fe7babcb171ee0a0672f (diff)
downloadu-boot-imx-9a263e55dc00f3277d8e82c906ee5c7a1dca0ba5.zip
u-boot-imx-9a263e55dc00f3277d8e82c906ee5c7a1dca0ba5.tar.gz
u-boot-imx-9a263e55dc00f3277d8e82c906ee5c7a1dca0ba5.tar.bz2
fdt: Avoid early panic() when there is no FDT present
CONFIG_OF_CONTROL requires a valid device tree. However, we cannot call panic() before the console is set up since the message does not appear, and we get a silent failure. Remove the panic from fdtdec_check_fdt() and provide a new function to prepare the fdt for use. This will be called after the console is ready. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/fdtdec.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/include/fdtdec.h b/include/fdtdec.h
index bde9873..6249f22 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -155,8 +155,21 @@ s32 fdtdec_get_int(const void *blob, int node, const char *prop_name,
int fdtdec_get_is_enabled(const void *blob, int node);
/**
- * Checks whether we have a valid fdt available to control U-Boot, and panic
- * if not.
+ * Make sure we have a valid fdt available to control U-Boot.
+ *
+ * If not, a message is printed to the console if the console is ready.
+ *
+ * @return 0 if all ok, -1 if not
+ */
+int fdtdec_prepare_fdt(void);
+
+/**
+ * Checks that we have a valid fdt available to control U-Boot.
+
+ * However, if not then for the moment nothing is done, since this function
+ * is called too early to panic().
+ *
+ * @returns 0
*/
int fdtdec_check_fdt(void);