From patchwork Thu Nov 20 23:55:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suriyan Ramasami X-Patchwork-Id: 412923 X-Patchwork-Delegate: sjg@chromium.org 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 DBAF2140158 for ; Fri, 21 Nov 2014 10:56:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 448334B7FC; Fri, 21 Nov 2014 00:56:04 +0100 (CET) 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 kw8oRTLTfiEw; Fri, 21 Nov 2014 00:56:03 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 94EA54B7F3; Fri, 21 Nov 2014 00:56:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8349D4B7F3 for ; Fri, 21 Nov 2014 00:56:01 +0100 (CET) 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 1+sFvHXTNc-q for ; Fri, 21 Nov 2014 00:56:01 +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-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) by theia.denx.de (Postfix) with ESMTPS id 0EE194B7F0 for ; Fri, 21 Nov 2014 00:55:58 +0100 (CET) Received: by mail-pa0-f53.google.com with SMTP id kq14so3586203pab.12 for ; Thu, 20 Nov 2014 15:55:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=fEVGdg7F4CokhZ7mnJ5CkI3XJcSTCMAYaQHg09ukE1A=; b=ZLZCzdKjR9O5Klo0TEUP18/0CRoAayTpPORMwsfvhNHPsVYPgbhiWB3sdm/FeGHpKX Ba5GtXN/6Dbd4G0GMnaZMFTwYKp+xfofVPN/WdqOj6KTyh26LwbQb9FYXmjwfZtkWSrU 5eHK2xQfTQorqfyKkskiLmMWcr65b2qfs2xSee0msVkiq4HtRoN1q73RtcnT2HpOMHVY M5dxyNHxhFIe75Mk9AFgW1AB1nVOZ1+CtXq/OwqpbeNLmTJxqCacRETQ0r5dOgQwl4sq gpsAu6G8I1a5UQpSOXfKvvGMm0Xph0j4i8EcFVWHvz4IPIOgjdY1Jql5+W7lFjF/618S X/wA== X-Received: by 10.66.159.201 with SMTP id xe9mr1619508pab.13.1416527756569; Thu, 20 Nov 2014 15:55:56 -0800 (PST) Received: from Stealth.localdomain ([73.170.223.86]) by mx.google.com with ESMTPSA id hb6sm3034021pbc.31.2014.11.20.15.55.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Nov 2014 15:55:55 -0800 (PST) From: Suriyan Ramasami To: Hans De Goede Date: Thu, 20 Nov 2014 15:55:49 -0800 Message-Id: <1416527749-3290-1-git-send-email-suriyan.r@gmail.com> X-Mailer: git-send-email 1.8.3.1 Cc: Suriyan Ramasami , u-boot@lists.denx.de, Noam Camus , Ma Haijun Subject: [U-Boot] [PATCH v1] fdt: Allow non-FDT kernels to boot when CONFIG_OF_LIBFDT is defined X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 The boot commands - bootz/bootm mandate a third argument which is the address to the FDT blob. In cases where this argument is not specified, boot fails with a message indicating a missing FDT. This causes non-FDT kernels to fail to boot. This patch allows both FDT and non-FDT kernels to boot by making the third parameter to the bootm/bootz optional. Signed-off-by: Suriyan Ramasami Acked-by: Heiko Schocher Tested-by: Heiko Schocher Tested-by: Hans de Goede Acked-by: Hans de Goede --- Changes in v1: - First try common/image-fdt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/image-fdt.c b/common/image-fdt.c index a39ae1b..1a02166 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -430,6 +430,10 @@ int boot_get_fdt(int flag, int argc, char * const argv[], uint8_t arch, error: *of_flat_tree = NULL; *of_size = 0; + if (argc <= 2) { + debug("Continuing to boot without FDT\n"); + return 0; + } return 1; }