U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ryan Harkin <ryan.harkin@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 09/10] vexpress64: juno: add alternate kernel and device tree filenames
Date: Fri,  9 Oct 2015 17:18:07 +0100	[thread overview]
Message-ID: <1444407488-32646-10-git-send-email-ryan.harkin@linaro.org> (raw)
In-Reply-To: <1444407488-32646-1-git-send-email-ryan.harkin@linaro.org>

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 <ryan.harkin@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 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 "\
-- 
2.1.0

  parent reply	other threads:[~2015-10-09 16:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 16:17 [U-Boot] [PATCH v4 00/10] vexpress64 FVP and Juno configuration updates Ryan Harkin
2015-10-09 16:17 ` [U-Boot] [PATCH v4 01/10] vexpress64: fix checkpatch warnings Ryan Harkin
2015-10-12 15:16   ` [U-Boot] [U-Boot,v4,01/10] " Tom Rini
2015-10-09 16:18 ` [U-Boot] [PATCH v4 02/10] vexpress64: Kconfig: tidy up Ryan Harkin
2015-10-12 15:17   ` [U-Boot] [U-Boot,v4,02/10] " Tom Rini
2015-10-12 16:47     ` Ryan Harkin
2015-10-12 17:56       ` Tom Rini
2015-10-09 16:18 ` [U-Boot] [PATCH v4 03/10] vexpress64: increase max gunzip size Ryan Harkin
2015-10-12 15:17   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-09 16:18 ` [U-Boot] [PATCH v4 04/10] vexpress64: fvp dram: add DRAM configuration Ryan Harkin
2015-10-12 15:17   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-09 16:18 ` [U-Boot] [PATCH v4 05/10] vexpress64: juno: add androidboot.hardware=juno Ryan Harkin
2015-10-12 15:17   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-09 16:18 ` [U-Boot] [PATCH v4 06/10] common/armflash: add command to check if image exists Ryan Harkin
2015-10-12 15:17   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-09 16:18 ` [U-Boot] [PATCH v4 07/10] common/armflash: load_image returns success or failure Ryan Harkin
2015-10-12 15:17   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-09 16:18 ` [U-Boot] [PATCH v4 08/10] vexpress64: juno: add optional initrd Ryan Harkin
2015-10-12 15:18   ` [U-Boot] [U-Boot, v4, " Tom Rini
2015-10-09 16:18 ` Ryan Harkin [this message]
2015-10-12 15:18   ` [U-Boot] [U-Boot, v4, 09/10] vexpress64: juno: add alternate kernel and device tree filenames Tom Rini
2015-10-09 16:18 ` [U-Boot] [PATCH v4 10/10] vexpress64: juno: use /dev/sda2 Ryan Harkin
2015-10-12 15:18   ` [U-Boot] [U-Boot,v4,10/10] " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444407488-32646-10-git-send-email-ryan.harkin@linaro.org \
    --to=ryan.harkin@linaro.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox