u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] xilinx: zynqmp: Save multiboot as variable
@ 2021-10-25  8:10 Michal Simek
  2021-10-25  8:19 ` Oleksandr Suvorov
  2021-10-29 11:01 ` Michal Simek
  0 siblings, 2 replies; 3+ messages in thread
From: Michal Simek @ 2021-10-25  8:10 UTC (permalink / raw)
  To: u-boot, git
  Cc: Jorge Ramirez-Ortiz, Michal Simek, Mike Looijmans, Simon Glass,
	T Karthik Reddy

Save multiboot register as u-boot variable. And use it as primary source
for composing dfu_alt_info for capsule update. If variable is not defined

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v2:
- Handle also error values from mult_boot() - Reported by Oleksandr Suvorov <oleksandr.suvorov@foundries.io>

 board/xilinx/zynqmp/zynqmp.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
index 5a1f8153409c..dfb5dab7afa3 100644
--- a/board/xilinx/zynqmp/zynqmp.c
+++ b/board/xilinx/zynqmp/zynqmp.c
@@ -640,7 +640,7 @@ int board_late_init(void)
 	const char *mode;
 	char *new_targets;
 	char *env_targets;
-	int ret;
+	int ret, multiboot;
 
 #if defined(CONFIG_USB_ETHER) && !defined(CONFIG_USB_GADGET_DOWNLOAD)
 	usb_ether_init();
@@ -658,6 +658,10 @@ int board_late_init(void)
 	if (ret)
 		return ret;
 
+	multiboot = multi_boot();
+	if (multiboot >= 0)
+		env_set_hex("multiboot", multiboot);
+
 	bootmode = zynqmp_get_bootmode();
 
 	puts("Bootmode: ");
@@ -864,6 +868,10 @@ void set_dfu_alt_info(char *interface, char *devstr)
 	memset(buf, 0, sizeof(buf));
 
 	multiboot = multi_boot();
+	if (multiboot < 0)
+		multiboot = 0;
+
+	multiboot = env_get_hex("multiboot", multiboot);
 	debug("Multiboot: %d\n", multiboot);
 
 	switch (zynqmp_get_bootmode()) {
-- 
2.33.1


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

* Re: [PATCH v2] xilinx: zynqmp: Save multiboot as variable
  2021-10-25  8:10 [PATCH v2] xilinx: zynqmp: Save multiboot as variable Michal Simek
@ 2021-10-25  8:19 ` Oleksandr Suvorov
  2021-10-29 11:01 ` Michal Simek
  1 sibling, 0 replies; 3+ messages in thread
From: Oleksandr Suvorov @ 2021-10-25  8:19 UTC (permalink / raw)
  To: Michal Simek
  Cc: U-Boot Mailing List, git, Jorge Ramirez-Ortiz, Michal Simek,
	Mike Looijmans, Simon Glass, T Karthik Reddy

On Mon, Oct 25, 2021 at 11:11 AM Michal Simek <michal.simek@xilinx.com> wrote:
>
> Save multiboot register as u-boot variable. And use it as primary source
> for composing dfu_alt_info for capsule update. If variable is not defined
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>

> ---
>
> Changes in v2:
> - Handle also error values from mult_boot() - Reported by Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
>
>  board/xilinx/zynqmp/zynqmp.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 5a1f8153409c..dfb5dab7afa3 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -640,7 +640,7 @@ int board_late_init(void)
>         const char *mode;
>         char *new_targets;
>         char *env_targets;
> -       int ret;
> +       int ret, multiboot;
>
>  #if defined(CONFIG_USB_ETHER) && !defined(CONFIG_USB_GADGET_DOWNLOAD)
>         usb_ether_init();
> @@ -658,6 +658,10 @@ int board_late_init(void)
>         if (ret)
>                 return ret;
>
> +       multiboot = multi_boot();
> +       if (multiboot >= 0)
> +               env_set_hex("multiboot", multiboot);
> +
>         bootmode = zynqmp_get_bootmode();
>
>         puts("Bootmode: ");
> @@ -864,6 +868,10 @@ void set_dfu_alt_info(char *interface, char *devstr)
>         memset(buf, 0, sizeof(buf));
>
>         multiboot = multi_boot();
> +       if (multiboot < 0)
> +               multiboot = 0;
> +
> +       multiboot = env_get_hex("multiboot", multiboot);
>         debug("Multiboot: %d\n", multiboot);
>
>         switch (zynqmp_get_bootmode()) {
> --
> 2.33.1
>


-- 
Best regards
Oleksandr

Oleksandr Suvorov
cryosay@gmail.com

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

* Re: [PATCH v2] xilinx: zynqmp: Save multiboot as variable
  2021-10-25  8:10 [PATCH v2] xilinx: zynqmp: Save multiboot as variable Michal Simek
  2021-10-25  8:19 ` Oleksandr Suvorov
@ 2021-10-29 11:01 ` Michal Simek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Simek @ 2021-10-29 11:01 UTC (permalink / raw)
  To: Michal Simek, u-boot, git
  Cc: Jorge Ramirez-Ortiz, Mike Looijmans, Simon Glass, T Karthik Reddy



On 10/25/21 10:10, Michal Simek wrote:
> Save multiboot register as u-boot variable. And use it as primary source
> for composing dfu_alt_info for capsule update. If variable is not defined
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Changes in v2:
> - Handle also error values from mult_boot() - Reported by Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> 
>   board/xilinx/zynqmp/zynqmp.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 5a1f8153409c..dfb5dab7afa3 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -640,7 +640,7 @@ int board_late_init(void)
>   	const char *mode;
>   	char *new_targets;
>   	char *env_targets;
> -	int ret;
> +	int ret, multiboot;
>   
>   #if defined(CONFIG_USB_ETHER) && !defined(CONFIG_USB_GADGET_DOWNLOAD)
>   	usb_ether_init();
> @@ -658,6 +658,10 @@ int board_late_init(void)
>   	if (ret)
>   		return ret;
>   
> +	multiboot = multi_boot();
> +	if (multiboot >= 0)
> +		env_set_hex("multiboot", multiboot);
> +
>   	bootmode = zynqmp_get_bootmode();
>   
>   	puts("Bootmode: ");
> @@ -864,6 +868,10 @@ void set_dfu_alt_info(char *interface, char *devstr)
>   	memset(buf, 0, sizeof(buf));
>   
>   	multiboot = multi_boot();
> +	if (multiboot < 0)
> +		multiboot = 0;
> +
> +	multiboot = env_get_hex("multiboot", multiboot);
>   	debug("Multiboot: %d\n", multiboot);
>   
>   	switch (zynqmp_get_bootmode()) {
> 

Applied,
Michal

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

end of thread, other threads:[~2021-10-29 11:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25  8:10 [PATCH v2] xilinx: zynqmp: Save multiboot as variable Michal Simek
2021-10-25  8:19 ` Oleksandr Suvorov
2021-10-29 11:01 ` Michal Simek

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).