summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2013-04-20 08:42:46 +0000
committerTom Rini <trini@ti.com>2013-05-01 11:17:21 -0400
commitc309c2da147c2f166132341d578a41d3d9132966 (patch)
tree6607da92ae32bb036da36b5a71ad14433d0eecab /lib
parenta92fd6577ea17751ead9b50243e3c562125cf581 (diff)
downloadu-boot-c309c2da147c2f166132341d578a41d3d9132966.tar.gz
u-boot-c309c2da147c2f166132341d578a41d3d9132966.tar.xz
u-boot-c309c2da147c2f166132341d578a41d3d9132966.zip
fdt: Skip checking FDT if the pointer is NULL
If we have no FDT, don't attempt to read from it. This allows sandbox to run without an FDT if required. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/fdtdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 60369fbc57..ac1fe0be20 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -354,7 +354,8 @@ int fdtdec_check_fdt(void)
*/
int fdtdec_prepare_fdt(void)
{
- if (((uintptr_t)gd->fdt_blob & 3) || fdt_check_header(gd->fdt_blob)) {
+ if (!gd->fdt_blob || ((uintptr_t)gd->fdt_blob & 3) ||
+ fdt_check_header(gd->fdt_blob)) {
printf("No valid FDT found - please append one to U-Boot "
"binary, use u-boot-dtb.bin or define "
"CONFIG_OF_EMBED. For sandbox, use -d <file.dtb>\n");