From patchwork Thu Oct 1 17:43:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harkin X-Patchwork-Id: 525213 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 EFC8D140D6D for ; Fri, 2 Oct 2015 03:45:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D19234B9D8; Thu, 1 Oct 2015 19:44:38 +0200 (CEST) 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 bajTcPcuXsp0; Thu, 1 Oct 2015 19:44:38 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0279F4B9D5; Thu, 1 Oct 2015 19:44:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2EA3A4B9BA for ; Thu, 1 Oct 2015 19:44:05 +0200 (CEST) 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 8eXSwQr2SSTO for ; Thu, 1 Oct 2015 19:44:05 +0200 (CEST) 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-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by theia.denx.de (Postfix) with ESMTPS id 1818E4B998 for ; Thu, 1 Oct 2015 19:43:54 +0200 (CEST) Received: by wicfx3 with SMTP id fx3so118176wic.0 for ; Thu, 01 Oct 2015 10:43:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hgx+ADMz28h1rDfaR0JWGfXRRBpEhzh9Gzo0xR2cXe8=; b=gIUFFXnphYqzxOMiK+pKuvyZsJ5/pC83oX63RIeG2A9xejjsoIYEmtA3AFP3PRVeWY S4f2L0bEOELQ65SgPkWzak7mJotzJH70q0OQB8oeHO0IHof6iztcPimCGxxhEa4FwKTp DMkKc1tAfwNd7J/P9ccQ8kcL48VksquTL8BqNZ/obv5TYHDxZ/EBN7nkIE6ik37HSM4d Gey5rf+nZaKQS9iCXcGSandiGQdPr2EKfGTv2CjrCslPz+CoUVYuUEQlzook05+je3ne UoLB/opTMf8kNsLxhOYWaBeXbJr0yj3YkIu5T/9A5Q5SP28ptERaF+MpllHT1N4emsN5 xm2Q== X-Gm-Message-State: ALoCoQlr5XTdF8Un02xC0nEhV1kUoe1kR8eeikIq0igstrK3n9VIzFJ+uETzUgUwC6uEE45wTtQo X-Received: by 10.180.8.68 with SMTP id p4mr91734wia.16.1443721434084; Thu, 01 Oct 2015 10:43:54 -0700 (PDT) Received: from localhost.localdomain (82-69-54-187.dsl.in-addr.zen.co.uk. [82.69.54.187]) by smtp.gmail.com with ESMTPSA id xt1sm7198426wjb.32.2015.10.01.10.43.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Oct 2015 10:43:53 -0700 (PDT) From: Ryan Harkin To: ryan.harkin@linaro.org, u-boot@lists.denx.de, Albert Aribaud , Tom Rini Date: Thu, 1 Oct 2015 18:43:35 +0100 Message-Id: <1443721416-725-10-git-send-email-ryan.harkin@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1443721416-725-1-git-send-email-ryan.harkin@linaro.org> References: <1443721416-725-1-git-send-email-ryan.harkin@linaro.org> Cc: Steve Rae Subject: [U-Boot] [PATCH v3 09/10] vexpress64: juno: add alternate kernel and device tree filenames X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The default Juno firmware has renamed the kernel and device tree filenames to norkern and board.dtb. Rather than change the default configuration to use the new names, breaking those with the old firmware, attempt to load the existing filename first. If that fails, attempt to load the alternate filename. I've echo'd that we are loading the alternate file to counter the output from "afs load" when the first load attempt fails. For example, I see this output on my Juno board: image "Image" not found in flash Loading norkern instead of Image loaded region 0 from 08500000 to 80000000, 00AB6318 bytes image "juno" not found in flash Loading board.dtb instead of juno loaded region 0 from 0A000000 to 83000000, 00003188 bytes Signed-off-by: Ryan Harkin Reviewed-by: Linus Walleij CC: David Feng CC: Bhupesh Sharma CC: Linus Walleij --- include/configs/vexpress_aemv8a.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h index c62c3ac..192568a 100644 --- a/include/configs/vexpress_aemv8a.h +++ b/include/configs/vexpress_aemv8a.h @@ -185,11 +185,13 @@ * be copied into DRAM */ #define CONFIG_EXTRA_ENV_SETTINGS \ - "kernel_name=Image\0" \ + "kernel_name=norkern\0" \ + "kernel_alt_name=Image\0" \ "kernel_addr=0x80000000\0" \ "initrd_name=ramdisk.img\0" \ "initrd_addr=0x84000000\0" \ - "fdt_name=juno\0" \ + "fdt_name=board.dtb\0" \ + "fdt_alt_name=juno\0" \ "fdt_addr=0x83000000\0" \ "fdt_high=0xffffffffffffffff\0" \ "initrd_high=0xffffffffffffffff\0" \ @@ -205,7 +207,17 @@ /* Copy the kernel and FDT to DRAM memory and boot */ #define CONFIG_BOOTCOMMAND "afs load ${kernel_name} ${kernel_addr} ; " \ + "if test $? -eq 1; then "\ + " echo Loading ${kernel_alt_name} instead of "\ + "${kernel_name}; "\ + " afs load ${kernel_alt_name} ${kernel_addr};"\ + "fi ; "\ "afs load ${fdt_name} ${fdt_addr} ; " \ + "if test $? -eq 1; then "\ + " echo Loading ${fdt_alt_name} instead of "\ + "${fdt_name}; "\ + " afs load ${fdt_alt_name} ${fdt_addr}; "\ + "fi ; "\ "fdt addr ${fdt_addr}; fdt resize; " \ "if afs load ${initrd_name} ${initrd_addr} ; "\ "then "\