From patchwork Sat Jan 5 01:51:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 209606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 28B6A2C0085 for ; Sat, 5 Jan 2013 12:58:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3AE434A04B; Sat, 5 Jan 2013 02:58:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ivBFpNkF51Eg; Sat, 5 Jan 2013 02:58:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 472264A0F0; Sat, 5 Jan 2013 02:56:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 57E034A0B7 for ; Sat, 5 Jan 2013 02:56:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DiQ2wBYeXhzL for ; Sat, 5 Jan 2013 02:56:48 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ea0-f202.google.com (mail-ea0-f202.google.com [209.85.215.202]) by theia.denx.de (Postfix) with ESMTPS id 2DD1E4A046 for ; Sat, 5 Jan 2013 02:56:38 +0100 (CET) Received: by mail-ea0-f202.google.com with SMTP id j12so1065319eaa.3 for ; Fri, 04 Jan 2013 17:56:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=sm4nvrnwFhu+1iOBkbfN5DD5Nod6u1xsJfpQqO0VMbI=; b=nxM9A8beGg9FoMpWck3b8SXtBxJNBwXEzlz2xz7ysd+Zi2vy36zXvoi3MBc8hPbUTL YBep8E8JrCT13usR37NzqB7VQPLzVERixsvW8qljJ/Ev4z5K0AynwsdLSalj0z+JVA7B pu4CpE/eSMPF22T5N4gHiUsH3eEYgJZb6aPSxHIWgLObHrHN8PW4WR22VStnb22YBy5g BWX/NcKXuXIEE8OY2RAskQmOUqXtTYRS63jYKfG+4ftxhCiFfLdnvHdSQtZs2XKYpX4d IA/zVY4oNvewSVjb5IaiYOSQSlQENjVuUCKVCiMnjNWVZBuVsNtgQxbom2QnrYbuD5sw Lv8Q== X-Received: by 10.14.179.198 with SMTP id h46mr69089840eem.4.1357350998258; Fri, 04 Jan 2013 17:56:38 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id z44si19167153een.0.2013.01.04.17.56.38 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 04 Jan 2013 17:56:38 -0800 (PST) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id DE8F120004E; Fri, 4 Jan 2013 17:56:37 -0800 (PST) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 9B11B160F56; Fri, 4 Jan 2013 17:56:37 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 4 Jan 2013 17:51:52 -0800 Message-Id: <1357350734-13737-24-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1357350734-13737-1-git-send-email-sjg@chromium.org> References: <1357350734-13737-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkH7zLS9TUi1ZMZu+Pj7KaDigyENEgvY0tXhl87nB67v50Sc+FjiXAZ0ypDDhE1Sfq1ucCAkM+eS89KdTxz5tFkONbpuEh+egCcYAvUCiQP9cbyIFaKeTJcTcgApMyrC90tG+rJEzF5WYXXgOUYvy0HV8q3/82clL6Pu+5JPH9KNm4n7IMJX1HQQLEToGhXoVz87z0S Cc: Joel A Fernandes , Jerry Van Baren , Tom Rini , Vadim Bendebury , =?UTF-8?q?Andreas=20B=C3=A4ck?= Subject: [U-Boot] [RFC PATCH 23/44] fdt: Skip checking FDT if the pointer is NULL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- lib/fdtdec.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 6dba438..740bd56 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -318,7 +318,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\n");