Skip to contentSkip to conversation

arm: mvebu: turris_omnia: Fix RESET button message

PATCH In review Pali Rohár 3 participants 19 messages Apr 6, 2022 – May 2, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 arm: mvebu: turris_omnia: Fix RESET button message

---
 board/CZ.NIC/turris_omnia/turris_omnia.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/CZ.NIC/turris_omnia/turris_omnia.c +1 -1
index 83cfc80d1930..97292456f148 100644
@@ -488,7 +488,7 @@ static void handle_reset_button(void)
 		/* Ensure bootcmd_rescue is used by distroboot */
 		env_set("boot_targets", "rescue");
 
-		printf("RESET button was pressed, overwriting bootcmd!\n");
+		printf("RESET button was pressed, overwriting boot_targets!\n");
 	} else {
 		/*
 		 * In case the user somehow managed to save environment with
Signature · 1 line
2.20.1
#14 lore raw

PATCH 5/5 arm: mvebu: turris_mox: Add NVMe and SCSI to boot targets

U-Boot for Turris Mox has already enabled NVMe and SCSI support. So add NVMe and SCSI to boot targets.

---
 include/configs/turris_mox.h | 2 ++
 1 file changed, 2 insertions(+)
include/configs/turris_mox.h +2 -0
index 3cfad7cca985..69f295b5cefe 100644
@@ -28,6 +28,8 @@
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
+	func(NVME, nvme, 0) \
+	func(SCSI, scsi, 0) \
 	func(USB, usb, 0) \
 	func(PXE, pxe, na) \
 	func(DHCP, dhcp, na)
Signature · 1 line
2.20.1
#5 lore raw

PATCH 3/5 arm: mvebu: turris_omnia: Always enable MMC, SCSI and USB boot targets

In reply to Pali Rohár

U-Boot for Turris Omnia is always compiled with MMC, SCSI and USB support, so always enable macros for booting from these devices.

---
 include/configs/turris_omnia.h | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)
include/configs/turris_omnia.h +3 -21
index 15f874ea22e1..25aa0d0f9075 100644
@@ -54,28 +54,10 @@
 /* Include the common distro boot environment */
 #ifndef CONFIG_SPL_BUILD
 
-#ifdef CONFIG_MMC
-#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
-#else
-#define BOOT_TARGET_DEVICES_MMC(func)
-#endif
-
-#ifdef CONFIG_USB_STORAGE
-#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
-#else
-#define BOOT_TARGET_DEVICES_USB(func)
-#endif
-
-#ifdef CONFIG_SCSI
-#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
-#else
-#define BOOT_TARGET_DEVICES_SCSI(func)
-#endif
-
 #define BOOT_TARGET_DEVICES(func) \
-	BOOT_TARGET_DEVICES_MMC(func) \
-	BOOT_TARGET_DEVICES_SCSI(func) \
-	BOOT_TARGET_DEVICES_USB(func) \
+	func(MMC, mmc, 0) \
+	func(SCSI, scsi, 0) \
+	func(USB, usb, 0) \
 	func(PXE, pxe, na) \
 	func(DHCP, dhcp, na)
 
Signature · 1 line
2.20.1
#11 lore raw

PATCH 4/5 arm: mvebu: turris_omnia: Add NVMe to boot targets

In reply to Pali Rohár

U-Boot for Turris Omnia has already enabled NVMe support. So add NVMe to boot targets.

---
 include/configs/turris_omnia.h | 1 +
 1 file changed, 1 insertion(+)
include/configs/turris_omnia.h +1 -0
index 25aa0d0f9075..99e39531509f 100644
@@ -56,6 +56,7 @@
 
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 0) \
+	func(NVME, nvme, 0) \
 	func(SCSI, scsi, 0) \
 	func(USB, usb, 0) \
 	func(PXE, pxe, na) \
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/5 arm: mvebu: turris_omnia: Define CONFIG_ETHPRIME instead of ethact= ENV

In reply to Pali Rohár

CONFIG_ETHPRIME defines primary ethernet device and env variable $ethact stores currently active ethernet device.

So there is no point to set ethact= in default environment. Instead set CONFIG_ETHPRIME properly.

---
 include/configs/turris_omnia.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/configs/turris_omnia.h +2 -1
index b35299b2fbb3..15f874ea22e1 100644
@@ -26,6 +26,8 @@
 	"fdt_high=0x10000000\0"		\
 	"initrd_high=0x10000000\0"
 
+#define CONFIG_ETHPRIME		"ethernet@34000"
+
 /* Defines for SPL */
 #define CONFIG_SPL_SIZE			(140 << 10)
 #define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
@@ -119,7 +121,6 @@
 	LOAD_ADDRESS_ENV_SETTINGS \
 	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
 	"console=ttyS0,115200\0" \
-	"ethact=ethernet@34000\0" \
 	"bootcmd_rescue=" TURRIS_OMNIA_BOOTCMD_RESCUE "\0" \
 	BOOTENV
 
Signature · 1 line
2.20.1
Reviewed-by on v1 2/5
#2 lore raw

Re: [PATCH 2/5] arm: mvebu: turris_omnia: Define CONFIG_ETHPRIME instead of ethact= ENV

In reply to Pali Rohár
Quoted 7 lines · On Wed, 6 Apr 2022 11:39:33 +0200 Pali Rohár <[email protected]> wrote:

CONFIG_ETHPRIME defines primary ethernet device and env variable $ethact stores currently active ethernet device.

So there is no point to set ethact= in default environment. Instead set CONFIG_ETHPRIME properly.

#6 lore raw

Re: [PATCH 3/5] arm: mvebu: turris_omnia: Always enable MMC, SCSI and USB boot targets

In reply to Pali Rohár
Quoted 2 lines · On Wed, 6 Apr 2022 11:39:34 +0200 Pali Rohár <[email protected]> wrote:

U-Boot for Turris Omnia is always compiled with MMC, SCSI and USB support, so always enable macros for booting from these devices.

This is not true. Attaching config where scsi is disabled.

If we want to enforce MMC, SCSI and USB, we should add
select MMC
and others to Kconfig under TURRIS_OMNIA. But do we want to enfore these?

Marek

#12 lore raw

Re: [PATCH 4/5] arm: mvebu: turris_omnia: Add NVMe to boot targets

In reply to Pali Rohár
Quoted 2 lines · On Wed, 6 Apr 2022 11:39:35 +0200 Pali Rohár <[email protected]> wrote:

U-Boot for Turris Omnia has already enabled NVMe support. So add NVMe to boot targets.

As in my previous message, an user may want to compile U-Boot without NVMe support. They can do this now with menuconfig. If NVME support is to be mandatory, it should be enforced in Kconfig.

But I don't think it should be mandatory.

Marek

#15 lore raw

Re: [PATCH 5/5] arm: mvebu: turris_mox: Add NVMe and SCSI to boot targets

In reply to Pali Rohár
Quoted 4 lines · On Wed, 6 Apr 2022 11:39:36 +0200 Pali Rohár <[email protected]> wrote:

U-Boot for Turris Mox has already enabled NVMe and SCSI support. So add NVMe and SCSI to boot targets.

And for MOX I am not sure whether NVME and SCSI can be disabled in menuconfig. Either we need to update the BOOT_TARET macro or enforce all of these (MMC, NVME, SCSI, USB, NET) in Kconfig.

Marek

#7 lore raw

Re: [PATCH 3/5] arm: mvebu: turris_omnia: Always enable MMC, SCSI and USB boot targets

In reply to Marek Behún
Quoted 6 lines · On Wednesday 06 April 2022 21:31:18 Marek Behún wrote:
Quoted 2 lines · On Wed, 6 Apr 2022 11:39:34 +0200 Pali Rohár <[email protected]> wrote:

U-Boot for Turris Omnia is always compiled with MMC, SCSI and USB support, so always enable macros for booting from these devices.

Quoted 8 lines

This is not true. Attaching config where scsi is disabled.

If we want to enforce MMC, SCSI and USB, we should add
select MMC
and others to Kconfig under TURRIS_OMNIA. But do we want to enfore these?

Marek

IIRC macro BOOT_TARGET_DEVICES just defines default values for ENV. So in default ENV would be macros for booting from SCSI, MMC and USB targets. Which means that if you call saveenv on U-Boot compiled with all these options and then replace U-Boot with the one without e.g. MMC support, it does not replace env variables for MMC booting.

Anyway, does not defining e.g. SCSI booting env variables on U-Boot without SCSI support result in the same state as defining SCSI booting env variables on U-Boot with SCSI support with disconnected SCSI controllers or disks? In both cases there would be no SCSI suitable boot device.

#8 lore raw

Re: [PATCH 3/5] arm: mvebu: turris_omnia: Always enable MMC, SCSI and USB boot targets

Quoted 22 lines · On Friday 08 April 2022 11:00:24 Pali Rohár wrote:
Quoted 6 lines · On Wednesday 06 April 2022 21:31:18 Marek Behún wrote:
Quoted 2 lines · On Wed, 6 Apr 2022 11:39:34 +0200 Pali Rohár <[email protected]> wrote:

U-Boot for Turris Omnia is always compiled with MMC, SCSI and USB support, so always enable macros for booting from these devices.

Quoted 8 lines

This is not true. Attaching config where scsi is disabled.

If we want to enforce MMC, SCSI and USB, we should add
select MMC
and others to Kconfig under TURRIS_OMNIA. But do we want to enfore these?

Marek

IIRC macro BOOT_TARGET_DEVICES just defines default values for ENV. So in default ENV would be macros for booting from SCSI, MMC and USB targets. Which means that if you call saveenv on U-Boot compiled with all these options and then replace U-Boot with the one without e.g. MMC support, it does not replace env variables for MMC booting.

Quoted 5 lines

Anyway, does not defining e.g. SCSI booting env variables on U-Boot without SCSI support result in the same state as defining SCSI booting env variables on U-Boot with SCSI support with disconnected SCSI controllers or disks? In both cases there would be no SCSI suitable boot device.

So, any issues with it?

#9 lore raw

Re: [PATCH 3/5] arm: mvebu: turris_omnia: Always enable MMC, SCSI and USB boot targets

Quoted 23 lines · On Sun, 1 May 2022 16:52:31 +0200 Pali Rohár <[email protected]> wrote:
Quoted 22 lines · On Friday 08 April 2022 11:00:24 Pali Rohár wrote:
Quoted 6 lines · On Wednesday 06 April 2022 21:31:18 Marek Behún wrote:
Quoted 2 lines · On Wed, 6 Apr 2022 11:39:34 +0200 Pali Rohár <[email protected]> wrote:

U-Boot for Turris Omnia is always compiled with MMC, SCSI and USB support, so always enable macros for booting from these devices.

Quoted 8 lines

This is not true. Attaching config where scsi is disabled.

If we want to enforce MMC, SCSI and USB, we should add
select MMC
and others to Kconfig under TURRIS_OMNIA. But do we want to enfore these?

Marek

IIRC macro BOOT_TARGET_DEVICES just defines default values for ENV. So in default ENV would be macros for booting from SCSI, MMC and USB targets. Which means that if you call saveenv on U-Boot compiled with all these options and then replace U-Boot with the one without e.g. MMC support, it does not replace env variables for MMC booting.

Quoted 7 lines
Quoted 5 lines

Anyway, does not defining e.g. SCSI booting env variables on U-Boot without SCSI support result in the same state as defining SCSI booting env variables on U-Boot with SCSI support with disconnected SCSI controllers or disks? In both cases there would be no SCSI suitable boot device.

So, any issues with it?

No. If this cannot cause compilation failures, then I am okay with it.

#3 lore raw

Re: [PATCH 2/5] arm: mvebu: turris_omnia: Define CONFIG_ETHPRIME instead of ethact= ENV

In reply to Pali Rohár
Quoted 16 lines · Pali Rohár

CONFIG_ETHPRIME defines primary ethernet device and env variable $ethact stores currently active ethernet device.

So there is no point to set ethact= in default environment. Instead set CONFIG_ETHPRIME properly.

---
  include/configs/turris_omnia.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
include/configs/turris_omnia.h +0 -0
index b35299b2fbb3..15f874ea22e1 100644

include/configs/turris_omnia.h line 30

Quoted 5 lines
include/configs/turris_omnia.h +2 -0
@@ -26,6 +26,8 @@
  	"fdt_high=0x10000000\0"		\
  	"initrd_high=0x10000000\0"
 
+#define CONFIG_ETHPRIME		"ethernet@34000"
+

This was moved to Kconfig in the meantime. I'll make the necessary myself, no need to resend.

Thanks,
Stefan

include/configs/turris_omnia.h line 126

Quoted 11 lines
include/configs/turris_omnia.h +0 -1
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
  #define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
@@ -119,7 +121,6 @@
  	LOAD_ADDRESS_ENV_SETTINGS \
  	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
  	"console=ttyS0,115200\0" \
-	"ethact=ethernet@34000\0" \
  	"bootcmd_rescue=" TURRIS_OMNIA_BOOTCMD_RESCUE "\0" \
  	BOOTENV
 

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#18 lore raw
In reply to Pali Rohár
Quoted 10 lines · Pali Rohár
---
  board/CZ.NIC/turris_omnia/turris_omnia.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/CZ.NIC/turris_omnia/turris_omnia.c +0 -0
index 83cfc80d1930..97292456f148 100644

board/CZ.NIC/turris_omnia/turris_omnia.c static void handle_reset_button(void) · line 494

Quoted 8 lines
board/CZ.NIC/turris_omnia/turris_omnia.c +1 -1
@@ -488,7 +488,7 @@ static void handle_reset_button(void)
  		/* Ensure bootcmd_rescue is used by distroboot */
  		env_set("boot_targets", "rescue");
 
-		printf("RESET button was pressed, overwriting bootcmd!\n");
+		printf("RESET button was pressed, overwriting boot_targets!\n");
  	} else {
  		/*
  		 * In case the user somehow managed to save environment with

Applied to u-boot-marvell/master

Thanks,
Stefan

#4 lore raw

Re: [PATCH 2/5] arm: mvebu: turris_omnia: Define CONFIG_ETHPRIME instead of ethact= ENV

In reply to Pali Rohár
Quoted 25 lines · Pali Rohár

CONFIG_ETHPRIME defines primary ethernet device and env variable $ethact stores currently active ethernet device.

So there is no point to set ethact= in default environment. Instead set CONFIG_ETHPRIME properly.

---
  include/configs/turris_omnia.h | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
include/configs/turris_omnia.h +2 -0
index b35299b2fbb3..15f874ea22e1 100644
@@ -26,6 +26,8 @@
  	"fdt_high=0x10000000\0"		\
  	"initrd_high=0x10000000\0"
 
+#define CONFIG_ETHPRIME		"ethernet@34000"
+
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
  #define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))

include/configs/turris_omnia.h line 126

Quoted 7 lines
include/configs/turris_omnia.h +0 -1
@@ -119,7 +121,6 @@
  	LOAD_ADDRESS_ENV_SETTINGS \
  	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
  	"console=ttyS0,115200\0" \
-	"ethact=ethernet@34000\0" \
  	"bootcmd_rescue=" TURRIS_OMNIA_BOOTCMD_RESCUE "\0" \
  	BOOTENV
 

Applied to u-boot-marvell/master

Thanks,
Stefan

#10 lore raw

Re: [PATCH 3/5] arm: mvebu: turris_omnia: Always enable MMC, SCSI and USB boot targets

In reply to Pali Rohár
Quoted 34 lines · Pali Rohár

U-Boot for Turris Omnia is always compiled with MMC, SCSI and USB support, so always enable macros for booting from these devices.

---
  include/configs/turris_omnia.h | 24 +++---------------------
  1 file changed, 3 insertions(+), 21 deletions(-)
include/configs/turris_omnia.h +0 -18
index 15f874ea22e1..25aa0d0f9075 100644
@@ -54,28 +54,10 @@
  /* Include the common distro boot environment */
  #ifndef CONFIG_SPL_BUILD
 
-#ifdef CONFIG_MMC
-#define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0)
-#else
-#define BOOT_TARGET_DEVICES_MMC(func)
-#endif
-
-#ifdef CONFIG_USB_STORAGE
-#define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0)
-#else
-#define BOOT_TARGET_DEVICES_USB(func)
-#endif
-
-#ifdef CONFIG_SCSI
-#define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
-#else
-#define BOOT_TARGET_DEVICES_SCSI(func)
-#endif
-

include/configs/turris_omnia.h line 63

Quoted 10 lines
include/configs/turris_omnia.h +3 -3
  #define BOOT_TARGET_DEVICES(func) \
-	BOOT_TARGET_DEVICES_MMC(func) \
-	BOOT_TARGET_DEVICES_SCSI(func) \
-	BOOT_TARGET_DEVICES_USB(func) \
+	func(MMC, mmc, 0) \
+	func(SCSI, scsi, 0) \
+	func(USB, usb, 0) \
  	func(PXE, pxe, na) \
  	func(DHCP, dhcp, na)
 

Applied to u-boot-marvell/master

Thanks,
Stefan

#13 lore raw

Re: [PATCH 4/5] arm: mvebu: turris_omnia: Add NVMe to boot targets

In reply to Pali Rohár
Quoted 13 lines · Pali Rohár

U-Boot for Turris Omnia has already enabled NVMe support. So add NVMe to boot targets.

---
  include/configs/turris_omnia.h | 1 +
  1 file changed, 1 insertion(+)
include/configs/turris_omnia.h +0 -0
index 25aa0d0f9075..99e39531509f 100644

include/configs/turris_omnia.h line 62

Quoted 7 lines
include/configs/turris_omnia.h +1 -0
@@ -56,6 +56,7 @@
 
  #define BOOT_TARGET_DEVICES(func) \
  	func(MMC, mmc, 0) \
+	func(NVME, nvme, 0) \
  	func(SCSI, scsi, 0) \
  	func(USB, usb, 0) \
  	func(PXE, pxe, na) \

Applied to u-boot-marvell/master

Thanks,
Stefan

#16 lore raw

Re: [PATCH 5/5] arm: mvebu: turris_mox: Add NVMe and SCSI to boot targets

In reply to Pali Rohár
Quoted 13 lines · Pali Rohár

U-Boot for Turris Mox has already enabled NVMe and SCSI support. So add NVMe and SCSI to boot targets.

---
  include/configs/turris_mox.h | 2 ++
  1 file changed, 2 insertions(+)
include/configs/turris_mox.h +0 -0
index 3cfad7cca985..69f295b5cefe 100644

include/configs/turris_mox.h line 35

Quoted 8 lines
include/configs/turris_mox.h +2 -0
@@ -28,6 +28,8 @@
 
  #define BOOT_TARGET_DEVICES(func) \
  	func(MMC, mmc, 0) \
+	func(NVME, nvme, 0) \
+	func(SCSI, scsi, 0) \
  	func(USB, usb, 0) \
  	func(PXE, pxe, na) \
  	func(DHCP, dhcp, na)

Applied to u-boot-marvell/master

Thanks,
Stefan