u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: vexpress64: juno: Enable distro_bootcmd functionality
@ 2021-07-11 23:25 Andre Przywara
  2021-07-20 18:32 ` Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andre Przywara @ 2021-07-11 23:25 UTC (permalink / raw)
  To: David Feng, Liviu Dudau, Linus Walleij
  Cc: u-boot, Simon Glass, Heinrich Schuchardt

The ARM Juno boards can be used as somewhat decent machines to run
off-the-shelf distributions, with USB, SATA, GBit Ethernet and 8GB of
DRAM.

With stable DTs in the board's NOR flash this would work really nicely,
however the default boot command is to fetch a kernel and an initrd from
the on-board NOR flash, which sounds somewhat embedded.

Include the config_distro_bootcmd.h header and define the available
devices (starting with USB, to catch USB installer sticks) to make
distributions and UEFI work out of the box.
The NOR flash kernel functionality is still preserved as the last
resort, should all other methods fail.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 include/configs/vexpress_aemv8a.h | 58 ++++++++++++++++++-------------
 1 file changed, 34 insertions(+), 24 deletions(-)

diff --git a/include/configs/vexpress_aemv8a.h b/include/configs/vexpress_aemv8a.h
index 7318fb6c585..54b5967a89d 100644
--- a/include/configs/vexpress_aemv8a.h
+++ b/include/configs/vexpress_aemv8a.h
@@ -126,6 +126,39 @@
 
 /* Initial environment variables */
 #ifdef CONFIG_TARGET_VEXPRESS64_JUNO
+/* Copy the kernel and FDT to DRAM memory and boot */
+#define BOOTENV_DEV_AFS(devtypeu, devtypel, instance) \
+	"bootcmd_afs="							\
+		"afs load ${kernel_name} ${kernel_addr_r} ;"\
+		"if test $? -eq 1; then "\
+		"  echo Loading ${kernel_alt_name} instead of ${kernel_name}; "\
+		"  afs load ${kernel_alt_name} ${kernel_addr_r};"\
+		"fi ; "\
+		"afs load ${fdtfile} ${fdt_addr_r} ;"\
+		"if test $? -eq 1; then "\
+		"  echo Loading ${fdt_alt_name} instead of ${fdtfile}; "\
+		"  afs load ${fdt_alt_name} ${fdt_addr_r}; "\
+		"fi ; "\
+		"fdt addr ${fdt_addr_r}; fdt resize; " \
+		"if afs load  ${ramdisk_name} ${ramdisk_addr_r} ; "\
+		"then "\
+		"  setenv ramdisk_param ${ramdisk_addr_r}; "\
+		"else "\
+		"  setenv ramdisk_param -; "\
+		"fi ; " \
+		"booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}\0"
+#define BOOTENV_DEV_NAME_AFS(devtypeu, devtypel, instance) "afs "
+
+#define BOOT_TARGET_DEVICES(func)	\
+	func(USB, usb, 0)		\
+	func(SATA, sata, 0)		\
+	func(SATA, sata, 1)		\
+	func(PXE, pxe, na)		\
+	func(DHCP, dhcp, na)		\
+	func(AFS, afs, na)
+
+#include <config_distro_bootcmd.h>
+
 /*
  * Defines where the kernel and FDT exist in NOR flash and where it will
  * be copied into DRAM
@@ -139,30 +172,7 @@
 				"fdtfile=board.dtb\0" \
 				"fdt_alt_name=juno\0" \
 				"fdt_addr_r=0x80000000\0" \
-
-#ifndef CONFIG_BOOTCOMMAND
-/* Copy the kernel and FDT to DRAM memory and boot */
-#define CONFIG_BOOTCOMMAND	"afs load ${kernel_name} ${kernel_addr_r} ;"\
-				"if test $? -eq 1; then "\
-				"  echo Loading ${kernel_alt_name} instead of "\
-				"${kernel_name}; "\
-				"  afs load ${kernel_alt_name} ${kernel_addr_r};"\
-				"fi ; "\
-				"afs load ${fdtfile} ${fdt_addr_r} ;"\
-				"if test $? -eq 1; then "\
-				"  echo Loading ${fdt_alt_name} instead of "\
-				"${fdtfile}; "\
-				"  afs load ${fdt_alt_name} ${fdt_addr_r}; "\
-				"fi ; "\
-				"fdt addr ${fdt_addr_r}; fdt resize; " \
-				"if afs load  ${ramdisk_name} ${ramdisk_addr_r} ; "\
-				"then "\
-				"  setenv ramdisk_param ${ramdisk_addr_r}; "\
-				"  else setenv ramdisk_param -; "\
-				"fi ; " \
-				"booti ${kernel_addr_r} ${ramdisk_param} ${fdt_addr_r}"
-#endif
-
+				BOOTENV
 
 #elif CONFIG_TARGET_VEXPRESS64_BASE_FVP
 #define CONFIG_EXTRA_ENV_SETTINGS	\
-- 
2.17.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: vexpress64: juno: Enable distro_bootcmd functionality
  2021-07-11 23:25 [PATCH] arm: vexpress64: juno: Enable distro_bootcmd functionality Andre Przywara
@ 2021-07-20 18:32 ` Simon Glass
  2021-07-21 13:58 ` Linus Walleij
  2021-07-23 12:34 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2021-07-20 18:32 UTC (permalink / raw)
  To: Andre Przywara
  Cc: David Feng, Liviu Dudau, Linus Walleij, U-Boot Mailing List,
	Heinrich Schuchardt

On Sun, 11 Jul 2021 at 17:26, Andre Przywara <andre.przywara@arm.com> wrote:
>
> The ARM Juno boards can be used as somewhat decent machines to run
> off-the-shelf distributions, with USB, SATA, GBit Ethernet and 8GB of
> DRAM.
>
> With stable DTs in the board's NOR flash this would work really nicely,
> however the default boot command is to fetch a kernel and an initrd from
> the on-board NOR flash, which sounds somewhat embedded.
>
> Include the config_distro_bootcmd.h header and define the available
> devices (starting with USB, to catch USB installer sticks) to make
> distributions and UEFI work out of the box.
> The NOR flash kernel functionality is still preserved as the last
> resort, should all other methods fail.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  include/configs/vexpress_aemv8a.h | 58 ++++++++++++++++++-------------
>  1 file changed, 34 insertions(+), 24 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: vexpress64: juno: Enable distro_bootcmd functionality
  2021-07-11 23:25 [PATCH] arm: vexpress64: juno: Enable distro_bootcmd functionality Andre Przywara
  2021-07-20 18:32 ` Simon Glass
@ 2021-07-21 13:58 ` Linus Walleij
  2021-07-23 12:34 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2021-07-21 13:58 UTC (permalink / raw)
  To: Andre Przywara
  Cc: David Feng, Liviu Dudau, U-Boot Mailing List, Simon Glass,
	Heinrich Schuchardt

On Mon, Jul 12, 2021 at 1:25 AM Andre Przywara <andre.przywara@arm.com> wrote:

> The ARM Juno boards can be used as somewhat decent machines to run
> off-the-shelf distributions, with USB, SATA, GBit Ethernet and 8GB of
> DRAM.
>
> With stable DTs in the board's NOR flash this would work really nicely,
> however the default boot command is to fetch a kernel and an initrd from
> the on-board NOR flash, which sounds somewhat embedded.
>
> Include the config_distro_bootcmd.h header and define the available
> devices (starting with USB, to catch USB installer sticks) to make
> distributions and UEFI work out of the box.
> The NOR flash kernel functionality is still preserved as the last
> resort, should all other methods fail.
>
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>

Looks helpful!

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: vexpress64: juno: Enable distro_bootcmd functionality
  2021-07-11 23:25 [PATCH] arm: vexpress64: juno: Enable distro_bootcmd functionality Andre Przywara
  2021-07-20 18:32 ` Simon Glass
  2021-07-21 13:58 ` Linus Walleij
@ 2021-07-23 12:34 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2021-07-23 12:34 UTC (permalink / raw)
  To: Andre Przywara
  Cc: David Feng, Liviu Dudau, Linus Walleij, u-boot, Simon Glass,
	Heinrich Schuchardt

[-- Attachment #1: Type: text/plain, Size: 951 bytes --]

On Mon, Jul 12, 2021 at 12:25:15AM +0100, Andre Przywara wrote:

> The ARM Juno boards can be used as somewhat decent machines to run
> off-the-shelf distributions, with USB, SATA, GBit Ethernet and 8GB of
> DRAM.
> 
> With stable DTs in the board's NOR flash this would work really nicely,
> however the default boot command is to fetch a kernel and an initrd from
> the on-board NOR flash, which sounds somewhat embedded.
> 
> Include the config_distro_bootcmd.h header and define the available
> devices (starting with USB, to catch USB installer sticks) to make
> distributions and UEFI work out of the box.
> The NOR flash kernel functionality is still preserved as the last
> resort, should all other methods fail.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-07-23 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-11 23:25 [PATCH] arm: vexpress64: juno: Enable distro_bootcmd functionality Andre Przywara
2021-07-20 18:32 ` Simon Glass
2021-07-21 13:58 ` Linus Walleij
2021-07-23 12:34 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).