From: Michal Simek <michal.simek@xilinx.com>
To: u-boot@lists.denx.de, git@xilinx.com
Cc: Jorge Ramirez-Ortiz <jorge@foundries.io>,
Michal Simek <monstr@monstr.eu>,
Mike Looijmans <mike.looijmans@topic.nl>,
Simon Glass <sjg@chromium.org>,
T Karthik Reddy <t.karthik.reddy@xilinx.com>
Subject: [PATCH v2] xilinx: zynqmp: Save multiboot as variable
Date: Mon, 25 Oct 2021 10:10:52 +0200 [thread overview]
Message-ID: <96556221443489c952717bcb340b4707901c9bdd.1635149450.git.michal.simek@xilinx.com> (raw)
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
next reply other threads:[~2021-10-25 8:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 8:10 Michal Simek [this message]
2021-10-25 8:19 ` [PATCH v2] xilinx: zynqmp: Save multiboot as variable Oleksandr Suvorov
2021-10-29 11:01 ` Michal Simek
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=96556221443489c952717bcb340b4707901c9bdd.1635149450.git.michal.simek@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=git@xilinx.com \
--cc=jorge@foundries.io \
--cc=mike.looijmans@topic.nl \
--cc=monstr@monstr.eu \
--cc=sjg@chromium.org \
--cc=t.karthik.reddy@xilinx.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 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).