From patchwork Fri Oct 9 16:18:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harkin X-Patchwork-Id: 54721 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id A7DBF22DB6 for ; Fri, 9 Oct 2015 16:20:10 +0000 (UTC) Received: by wicgi15 with SMTP id gi15sf24337049wic.2 for ; Fri, 09 Oct 2015 09:20:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=+NfldUMDUSYZrUr4Kg7ACiwslJUcC4adI7fYSWwoEO4=; b=L6g3rQs44x7ysgaXResMayEaXQctgIue30WcwxaFctyQH4sw45+N7wHGzRkuOYgdp5 h6HL3ZwDFMhT7coGRpjJWIGZyba4t0gdOcebRak84r18sG+28WEEbd6+oghQHV62hBjs 5Fbg1v8HUB3ypzDmElUJDNvnf4iRI8MO5HyqUpGxLDryG0UmqcDePbaAOiktoSHoleAw e4xLmzyPl7oOwnn0k21ut787C0eZdnyplr0f3kmdmQ11skQWJMdYqOtnM7AIIuCEF4jq YaCkjxGHxGC9fjffWZeIzbp+hlWi55j/wUwHOXCqP1LGChbWqsH70edYfd2V0jVOaGEw LTCw== X-Gm-Message-State: ALoCoQkZoO+v9GER2KV2sBqmswBjRgbJw3Rwhh5uuA8RLHnXf5euVDE1/Ndx7KDH03xQPuG1OnvV X-Received: by 10.112.144.99 with SMTP id sl3mr2760854lbb.12.1444407609943; Fri, 09 Oct 2015 09:20:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.167.140 with SMTP id q134ls336534lfe.23.gmail; Fri, 09 Oct 2015 09:20:09 -0700 (PDT) X-Received: by 10.25.147.209 with SMTP id v200mr4595375lfd.22.1444407609803; Fri, 09 Oct 2015 09:20:09 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id r8si1754051lbp.30.2015.10.09.09.20.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Oct 2015 09:20:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbos8 with SMTP id s8so85406643lbo.0 for ; Fri, 09 Oct 2015 09:20:09 -0700 (PDT) X-Received: by 10.112.139.201 with SMTP id ra9mr6970230lbb.29.1444407609660; Fri, 09 Oct 2015 09:20:09 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp85056lbq; Fri, 9 Oct 2015 09:20:08 -0700 (PDT) X-Received: by 10.180.184.138 with SMTP id eu10mr118537wic.25.1444407608866; Fri, 09 Oct 2015 09:20:08 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id gm5si19518060wib.16.2015.10.09.09.20.08; Fri, 09 Oct 2015 09:20:08 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8A4894B892; Fri, 9 Oct 2015 18:20:07 +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 3xOiaN_AIrjQ; Fri, 9 Oct 2015 18:20:07 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2129C4B894; Fri, 9 Oct 2015 18:19:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F04A64B8BB for ; Fri, 9 Oct 2015 18:18:41 +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 rzqROqA7icbp for ; Fri, 9 Oct 2015 18:18:41 +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 3CF364B89E for ; Fri, 9 Oct 2015 18:18:29 +0200 (CEST) Received: by wiclk2 with SMTP id lk2so74070452wic.1 for ; Fri, 09 Oct 2015 09:18:29 -0700 (PDT) X-Received: by 10.180.205.206 with SMTP id li14mr140961wic.76.1444407508971; Fri, 09 Oct 2015 09:18:28 -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 bf8sm2942173wjc.22.2015.10.09.09.18.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Oct 2015 09:18:28 -0700 (PDT) From: Ryan Harkin To: ryan.harkin@linaro.org, u-boot@lists.denx.de, Albert Aribaud , Tom Rini Date: Fri, 9 Oct 2015 17:18:07 +0100 Message-Id: <1444407488-32646-10-git-send-email-ryan.harkin@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444407488-32646-1-git-send-email-ryan.harkin@linaro.org> References: <1444407488-32646-1-git-send-email-ryan.harkin@linaro.org> Cc: Steve Rae Subject: [U-Boot] [PATCH v4 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: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ryan.harkin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 The latest Juno firmware stores the files in NOR flash as "norkern" for kernel binary, "board.dtb" for the device tree binary. The "old" firmware used the name "Image" for the kernel binary and "juno" for the device tree binary. Rather than just change the default U-Boot configuration to use the new names, breaking users with the old firmware, attempt to load the default 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" shown if the first load attempt fails. For example, I see output like this on my Juno board when it's configured the with the "old" firmware: image "norkern" not found in flash Loading Image instead of norkern loaded region 0 from 08500000 to 80000000, 00AB6318 bytes image "board.dtb" not found in flash Loading juno instead of board.dtb loaded region 0 from 0A000000 to 83000000, 00003188 bytes Signed-off-by: Ryan Harkin Reviewed-by: 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 99dd8b6..259f6ac 100644 --- a/include/configs/vexpress_aemv8a.h +++ b/include/configs/vexpress_aemv8a.h @@ -187,11 +187,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" \ @@ -207,7 +209,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 "\