From patchwork Thu Nov 20 19:41:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suriyan Ramasami X-Patchwork-Id: 412857 X-Patchwork-Delegate: trini@ti.com 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 2A85414011D for ; Fri, 21 Nov 2014 06:41:51 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 94C324B7D6; Thu, 20 Nov 2014 20:41:49 +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 Ig-8MMjxyWSQ; Thu, 20 Nov 2014 20:41:49 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 195024B7CF; Thu, 20 Nov 2014 20:41:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E7DB74B7CF for ; Thu, 20 Nov 2014 20:41:44 +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 Q-bruga1Kv2s for ; Thu, 20 Nov 2014 20:41:44 +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-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by theia.denx.de (Postfix) with ESMTPS id B082B4B7CD for ; Thu, 20 Nov 2014 20:41:40 +0100 (CET) Received: by mail-wi0-f180.google.com with SMTP id n3so6552836wiv.7 for ; Thu, 20 Nov 2014 11:41:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=5S3qVYJW7gGaCxxA3KLuZ3K7NODw/99paCz0SdSI5i8=; b=atYXyOxBVkywSzzO7Rdw8xXFvlMHTfyegX9GnACcJpdHJiR0e8NBJUoqi+tXRYJB4C znODje+fluyhIyRVPKPyftvH/pK0ehyo/nAw0tJdtFmXjs1L8OqRkDNlNDdCrEDGmrlq C0EgiGyjyVaEa7s5O8tsnxNLSAxajqxxZOO2lDXzJupz4X01UbP9jGEQ2qbAPGUJIfzH +fJ6+HGZ8oLkYwfx0UhLc1YGqIjvc50+uiONntURSDcpKQ6FV7T4//y49c9Ofy+Samlp jNhuP18slB1iQ/J6hv770rTF5X34btec3Rb+CgWPv9X0/WC4yA1Ea3NT7oVVaX3o16/M 9sKA== MIME-Version: 1.0 X-Received: by 10.180.205.196 with SMTP id li4mr749022wic.63.1416512500058; Thu, 20 Nov 2014 11:41:40 -0800 (PST) Received: by 10.216.205.73 with HTTP; Thu, 20 Nov 2014 11:41:40 -0800 (PST) In-Reply-To: References: <546E10F3.4090305@redhat.com> Date: Thu, 20 Nov 2014 11:41:40 -0800 Message-ID: From: Suriyan Ramasami To: Simon Glass X-Content-Filtered-By: Mailman/MimeDel 2.1.13 Cc: U-Boot Mailing List Subject: Re: [U-Boot] BUG: bootz/bootm command mandates a fdt blob 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Hello Simon, On Nov 20, 2014 8:38 AM, "Simon Glass" wrote: > > Hi, > > On 20 November 2014 16:04, Hans de Goede wrote: > > Hi Suriyan, > > > > On 11/20/2014 04:16 PM, Suriyan Ramasami wrote: > >> Hello Simon, > >> This mail is addressed to you as the FDT support was added by > >> you. I am not sure who else to address it to. > > Just to be clear, I didn't add FDT support, this predates my > involvement in U-Boot. I added CONFIG_OF_CONTROL etc. though. Han's > solution sounds good to me. > Sorry about that. In no way was I accusing you :-) I stand corrected though. > >> > >> I find that if CONFIG_OF_LIBFDT is defined then the user is > >> forced to provide a FDT blob. In most of the cases it makes sense. > >> However, this removes the ability to boot older linux (non FDT). > >> For example, I was looking at the Hardkernel Odroid kernels for > >> the U2/U3, and they are 3.8 based. Of course newer kernels 3.17 work. > >> For users to use the same boot loader for 3.8 and for 3.17, they > >> cannot use the mainline uboot. > > > > I've hit the same problem myself recently, see the thread titled: > > > > "Booting non devicetree enabled kernels using u-boot build with CONFIG_OF_LIBFDT" > > > >> I was wondering if teh third argument to bootz/bootm etc could > >> also take the route of initrd (optional if - is specified) could be > >> implemented. > >> > >> The fix seems to be trivial (or so I think), in file > >> common/image-fdt.c, but wanted to know your comments on this. Also the > >> command help (for bootz etc) states that if the 3rd argument is not > >> passed, then the bd_info struct is passed, and I do not see it being > >> passed in the code anywhere. In the absence of the third parameter, it > >> just gives a "No fdt found" message. > > > > Thanks for working on a fix, as discussed in the earlier thread, requiring > > a third argument which is '-' will break old boot.scr files and the likes, > > so a better fix is to: > > > > 1) Always try to find an ftd (to keep things like appended ftd-s working) > > 2) If not found see if there is a third argument, if there is, treat this > > as a fatal error, abort the bootm (iow behave as before) > > 3) If there is not a third argument warn and continue as before. > > > > If you could respin your patch to do this, then that would be great. > > Hello Hans/Simon, I have been tracing the code paths and see that function bootm_find_fdt() is the final fdt prep function. To retain all its previous functionality, but introducing a warning condition if no third argument is present, but go ahead and boot without fdt should keep the peace. The easiest way to achieve this is: (takes care of 2 and 3 above) For case 1, is this already handled in the code? I need some more information on this. I did run a 3.17 zImage with an appended dtb and it did boot up, but I am guessing that it is the linux kernel separating the dtb out? Thanks - Suriyan > > Regards, > > > > Hans > > > > > >> > >> diff --git a/common/image-fdt.c b/common/image-fdt.c > >> index a39ae1b..e685700 100644 > >> --- a/common/image-fdt.c > >> +++ b/common/image-fdt.c > >> @@ -243,7 +243,10 @@ int boot_get_fdt(int flag, int argc, char * const argv[], u > >> > >> if (argc > 2) > >> select = argv[2]; > >> - if (select || genimg_has_config(images)) { > >> + if (select && strcmp(select, "-") == 0) { > >> + debug("## Skipping fdt\n"); > >> + return 0; > >> + } else if (select || genimg_has_config(images)) { > >> #if defined(CONFIG_FIT) > >> if (select) { > >> /* > >> > >> Regards > >> - Suriyan > >> _______________________________________________ > >> U-Boot mailing list > >> U-Boot@lists.denx.de > >> http://lists.denx.de/mailman/listinfo/u-boot > >> > > Regards, > Simon 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[], u error: *of_flat_tree = NULL; *of_size = 0; + if (argc <= 2) { + debug("Continuing to boot without FDT\n"); + return 0; + } return 1; }