Skip to contentSkip to conversation

xilinx: zynqmp: Allow multiboot environment write even in saved environment

PATCH Superseded Kory Maincent 2 participants 4 messages May 28, 2024 – May 29, 2024 Arm/Zynq architecture

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xilinx: zynqmp: Allow multiboot environment write even in saved environment

Once the environment was saved, we could not retrieve information about the multiboot image used. When dealing with firmware updates, this information is necessary alongside the saved environment.

Move the multiboot environment set operation before the saved environment check to ensure this information is always available.

---
 board/xilinx/zynqmp/zynqmp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
board/xilinx/zynqmp/zynqmp.c +4 -4
index f370fb7347a..16292ed1c7e 100644
@@ -519,6 +519,10 @@ int board_late_init(void)
 	usb_ether_init();
 #endif
 
+	multiboot = multi_boot();
+	if (multiboot >= 0)
+		env_set_hex("multiboot", multiboot);
+
 	if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
 		debug("Saved variables - Skipping\n");
 		return 0;
@@ -531,10 +535,6 @@ int board_late_init(void)
 	if (ret)
 		return ret;
 
-	multiboot = multi_boot();
-	if (multiboot >= 0)
-		env_set_hex("multiboot", multiboot);
-
 	if (IS_ENABLED(CONFIG_DISTRO_DEFAULTS)) {
 		ret = boot_targets_setup();
 		if (ret)
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 1 line · Kory Maincent

Once the environment was saved, we could not retrieve information about

nit: use imperative mood.

Quoted 2 lines

the multiboot image used. When dealing with firmware updates, this information is necessary alongside the saved environment.

what exactly are you trying to do?

Quoted 3 lines

Move the multiboot environment set operation before the saved environment check to ensure this information is always available.

that make sense.

Quoted 11 lines
---
  board/xilinx/zynqmp/zynqmp.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
board/xilinx/zynqmp/zynqmp.c +0 -0
index f370fb7347a..16292ed1c7e 100644

board/xilinx/zynqmp/zynqmp.c int board_late_init(void) · line 523

Quoted 5 lines
board/xilinx/zynqmp/zynqmp.c +2 -0
@@ -519,6 +519,10 @@ int board_late_init(void)
  	usb_ether_init();
  #endif
 
+	multiboot = multi_boot();
+	if (multiboot >= 0)

likely make sense to remove this check to because you want to have even multiboot=0 too.

Quoted 6 lines
board/xilinx/zynqmp/zynqmp.c +2 -0
+		env_set_hex("multiboot", multiboot);
+
  	if (!(gd->flags & GD_FLG_ENV_DEFAULT)) {
  		debug("Saved variables - Skipping\n");
  		return 0;

board/xilinx/zynqmp/zynqmp.c int board_late_init(void) · line 540

Quoted 10 lines
board/xilinx/zynqmp/zynqmp.c +0 -4
@@ -531,10 +535,6 @@ int board_late_init(void)
  	if (ret)
  		return ret;
 
-	multiboot = multi_boot();
-	if (multiboot >= 0)
-		env_set_hex("multiboot", multiboot);
-
  	if (IS_ENABLED(CONFIG_DISTRO_DEFAULTS)) {
  		ret = boot_targets_setup();
  		if (ret)

M

#2 lore raw
Quoted 4 lines · On Tue, 28 May 2024 16:53:42 +0200 Michal Simek <[email protected]> wrote:
Quoted 1 line · Kory Maincent

Once the environment was saved, we could not retrieve information about

nit: use imperative mood.

Ah indeed.

Quoted 5 lines
Quoted 3 lines

the multiboot image used. When dealing with firmware updates, this information is necessary alongside the saved environment.

what exactly are you trying to do?

Retrieving the multiboot information to know which boot000x.bin image we have booted. This would allow to check the boot status of a firmware update.

Quoted 19 lines
Quoted 2 lines

Move the multiboot environment set operation before the saved environment check to ensure this information is always available.

that make sense.

Quoted 14 lines
---
  board/xilinx/zynqmp/zynqmp.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
board/xilinx/zynqmp/zynqmp.c +0 -0
index f370fb7347a..16292ed1c7e 100644
@@ -519,6 +519,10 @@ int board_late_init(void)
  	usb_ether_init();
  #endif
 
Quoted 5 lines

board/xilinx/zynqmp/zynqmp.c int board_late_init(void) · line 523

Quoted 2 lines
board/xilinx/zynqmp/zynqmp.c +2 -0
+	multiboot = multi_boot();
+	if (multiboot >= 0)  

likely make sense to remove this check to because you want to have even multiboot=0 too.

I don't understand, this check is >= so it supports multiboot=0.

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
maintainer
#3 lore raw
Quoted 38 lines · Kory Maincent
Quoted 4 lines · On Tue, 28 May 2024 16:53:42 +0200 Michal Simek <[email protected]> wrote:
Quoted 1 line · Kory Maincent

Once the environment was saved, we could not retrieve information about

nit: use imperative mood.

Ah indeed.

Quoted 5 lines
Quoted 3 lines

the multiboot image used. When dealing with firmware updates, this information is necessary alongside the saved environment.

what exactly are you trying to do?

Retrieving the multiboot information to know which boot000x.bin image we have booted. This would allow to check the boot status of a firmware update.

Quoted 19 lines
Quoted 2 lines

Move the multiboot environment set operation before the saved environment check to ensure this information is always available.

that make sense.

Quoted 14 lines
---
   board/xilinx/zynqmp/zynqmp.c | 8 ++++----
   1 file changed, 4 insertions(+), 4 deletions(-)
board/xilinx/zynqmp/zynqmp.c +0 -0
index f370fb7347a..16292ed1c7e 100644
@@ -519,6 +519,10 @@ int board_late_init(void)
   	usb_ether_init();
   #endif
 
Quoted 7 lines
Quoted 5 lines

board/xilinx/zynqmp/zynqmp.c int board_late_init(void) · line 523

Quoted 2 lines
board/xilinx/zynqmp/zynqmp.c +2 -0
+	multiboot = multi_boot();
+	if (multiboot >= 0)

likely make sense to remove this check to because you want to have even multiboot=0 too.

I don't understand, this check is >= so it supports multiboot=0.

Sorry my fault. You are right. It was there for catching the fault.

Thanks,
Michal