All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hoyes <peter.hoyes@arm.com>
To: u-boot@lists.denx.de
Cc: andre.przywara@arm.com, diego.sueiro@arm.com,
	Peter Hoyes <Peter.Hoyes@arm.com>
Subject: [PATCH v2 3/5] vexpress64: Clean up BASE_FVP boot configuration
Date: Thu, 11 Nov 2021 09:26:01 +0000	[thread overview]
Message-ID: <20211111092603.774415-4-peter.hoyes@arm.com> (raw)
In-Reply-To: <20211111092603.774415-1-peter.hoyes@arm.com>

From: Peter Hoyes <Peter.Hoyes@arm.com>

Move env var address values to #defines so they can be reused elsewhere.

Rename env var names to those recommended in the README and modify
addresses to allow more space for the kernel.

Fix issue where fdt is called with invalid arguments when booting
without a ramdisk.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
 include/configs/vexpress_aemv8.h | 50 ++++++++++++++++++++------------
 1 file changed, 31 insertions(+), 19 deletions(-)

diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h
index 49517a60b0..7cdfc30649 100644
--- a/include/configs/vexpress_aemv8.h
+++ b/include/configs/vexpress_aemv8.h
@@ -7,6 +7,8 @@
 #ifndef __VEXPRESS_AEMV8_H
 #define __VEXPRESS_AEMV8_H
 
+#include <linux/stringify.h>
+
 #define CONFIG_REMAKE_ELF
 
 /* Link Definitions */
@@ -172,33 +174,43 @@
 				BOOTENV
 
 #elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
+
+#define VEXPRESS_KERNEL_ADDR	0x80080000
+#define VEXPRESS_FDT_ADDR	0x8fc00000
+#define VEXPRESS_BOOT_ADDR	0x8fd00000
+#define VEXPRESS_RAMDISK_ADDR	0x8fe00000
+
 #define CONFIG_EXTRA_ENV_SETTINGS	\
 				"kernel_name=Image\0"		\
-				"kernel_addr=0x80080000\0"	\
-				"initrd_name=ramdisk.img\0"	\
-				"initrd_addr=0x88000000\0"	\
-				"fdtfile=devtree.dtb\0"		\
-				"fdt_addr=0x83000000\0"		\
-				"boot_name=boot.img\0"		\
-				"boot_addr=0x8007f800\0"
+				"kernel_addr_r=" __stringify(VEXPRESS_KERNEL_ADDR) "\0"	\
+				"ramdisk_name=ramdisk.img\0"	\
+				"ramdisk_addr_r=" __stringify(VEXPRESS_RAMDISK_ADDR) "\0" \
+				"fdtfile=devtree.dtb\0"	\
+				"fdt_addr_r=" __stringify(VEXPRESS_FDT_ADDR) "\0"	\
+				"boot_name=boot.img\0" \
+				"boot_addr_r=" __stringify(VEXPRESS_BOOT_ADDR) "\0"
 
 #ifndef CONFIG_BOOTCOMMAND
-#define CONFIG_BOOTCOMMAND	"if smhload ${boot_name} ${boot_addr}; then " \
+#define CONFIG_BOOTCOMMAND	"if smhload ${boot_name} ${boot_addr_r}; then " \
 				"  set bootargs; " \
-				"  abootimg addr ${boot_addr}; " \
-				"  abootimg get dtb --index=0 fdt_addr; " \
-				"  bootm ${boot_addr} ${boot_addr} " \
-				"  ${fdt_addr}; " \
+				"  abootimg addr ${boot_addr_r}; " \
+				"  abootimg get dtb --index=0 fdt_addr_r; " \
+				"  bootm ${boot_addr_r} ${boot_addr_r} " \
+				"  ${fdt_addr_r}; " \
 				"else; " \
 				"  set fdt_high 0xffffffffffffffff; " \
 				"  set initrd_high 0xffffffffffffffff; " \
-				"  smhload ${kernel_name} ${kernel_addr}; " \
-				"  smhload ${fdtfile} ${fdt_addr}; " \
-				"  smhload ${initrd_name} ${initrd_addr} "\
-				"  initrd_end; " \
-				"  fdt addr ${fdt_addr}; fdt resize; " \
-				"  fdt chosen ${initrd_addr} ${initrd_end}; " \
-				"  booti $kernel_addr - $fdt_addr; " \
+				"  smhload ${kernel_name} ${kernel_addr_r}; " \
+				"  smhload ${fdtfile} ${fdt_addr_r}; " \
+				"  smhload ${ramdisk_name} ${ramdisk_addr_r} "\
+				"  ramdisk_end; " \
+				"  fdt addr ${fdt_addr_r}; fdt resize; " \
+				"  if test -n ${ramdisk_end}; then "\
+				"    fdt chosen ${ramdisk_addr_r} ${ramdisk_end}; " \
+				"  else; " \
+				"    fdt chosen; " \
+				"  fi; " \
+				"  booti $kernel_addr_r - $fdt_addr_r; " \
 				"fi"
 #endif
 
-- 
2.25.1


  parent reply	other threads:[~2021-11-11  9:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11  9:25 [PATCH v2 0/5] VExpress64 board family improvements Peter Hoyes
2021-11-11  9:25 ` [PATCH v2 1/5] doc: Add documentation for the Arm VExpress64 board configs Peter Hoyes
2021-11-11 17:10   ` Andre Przywara
2022-01-07 17:03   ` Tom Rini
2021-11-11  9:26 ` [PATCH v2 2/5] vexpress64: Refactor header file to make it easier to add new FVPs Peter Hoyes
2021-11-11 17:10   ` Andre Przywara
2022-01-07 17:03   ` Tom Rini
2021-11-11  9:26 ` Peter Hoyes [this message]
2021-11-11 17:10   ` [PATCH v2 3/5] vexpress64: Clean up BASE_FVP boot configuration Andre Przywara
2022-01-07 17:04   ` Tom Rini
2021-11-11  9:26 ` [PATCH v2 4/5] vexpress64: Enable OF_CONTROL and OF_BOARD for VExpress64 Peter Hoyes
2021-11-11 17:10   ` Andre Przywara
2022-01-07 17:03   ` Tom Rini
2021-11-11  9:26 ` [PATCH v2 5/5] vexpress64: Enable VIRTIO_NET network driver Peter Hoyes
2021-11-11 17:11   ` Andre Przywara
2022-01-07 17:03   ` 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=20211111092603.774415-4-peter.hoyes@arm.com \
    --to=peter.hoyes@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=diego.sueiro@arm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.