| Message ID | 20260118104912.1672642-1-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path:
<linux-amarula+bncBCQ4XFG47UFRB77IWPFQMGQENMGJICI@amarulasolutions.com>
X-Original-To: linux-amarula@patchwork.amarulasolutions.com
Delivered-To: linux-amarula@patchwork.amarulasolutions.com
Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com
[209.85.218.69])
by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 21FD33F0D7
for <linux-amarula@patchwork.amarulasolutions.com>;
Sun, 18 Jan 2026 15:56:01 +0100 (CET)
Received: by mail-ej1-f69.google.com with SMTP id
a640c23a62f3a-b873b0bfe9dsf334943466b.0
for <linux-amarula@patchwork.amarulasolutions.com>;
Sun, 18 Jan 2026 06:56:01 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1768748160; cv=pass;
d=google.com; s=arc-20240605;
b=FC6nipkQJpZTrGyVY/hFlW3T/RAP41dFNUgWzXqUNn34E229C1ttbRC/QcGCrKnl+D
mwJKEicx2CMPFeeMsNgXOaf6FOGFa2UbMucdHydavvs+4ds8tH46ZBqx2Hehq5wUQjbR
RBJW6Hn6OFM/9FKhvoTGjn8AViFvp6St8lfNUn2fAy1aKuAGjgpg64hR6A60XI+aYRY5
8zKHk9hkELnbbKc1mXudv+ciuL5uuVKMZHUbKJcsu0DfRKyoi/gxqV8P05WTIPeN0hjO
l4kQxwrZIXJeiTumYP98jT8Ec1C+0Xlw2+tp13zXLfBoQwMA/tfiL4GzE2p6TVspu1LP
E6ow==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:content-transfer-encoding:mime-version
:message-id:date:subject:cc:to:from:dkim-signature;
bh=pJMf7C0p8Cc3tPT/0/C6DI1ZLEnbZk/23YPEqA5792g=;
fh=Sz69pJwWnxuWg9E1dGKQc/kcihCqU4oy7z0bWqh5Uqk=;
b=SjxToxLjeuNuLo3KChbEEEDVZvnz4eI/Y2J9BL3yYg3prirZjzlLWS94FVYTYHZvq6
Nl1jTt/4Pt9gpyvQ07tfi9b2xpQrPPOs+UJwKdt91W8uE4HiRUQ0I/TOeYhHAy02LmqH
6lymiEfmn1cmv/AwmZXNcsfMaxXAQacLRP/9u0V3miJSYL8qyekN8/EVkeuh6AbCV5Iq
YuCfW/Ii1Zo/p3muFkUXIYX9cAE+Q/iGNV/9gzZCnw8e9D+u7yXTH8fCneSbdDnauWOd
9tSv0zSy7IN24iZL2WytPt3pmBo1ReRRYJNaOKn0twO6tsqYWQBAwJYFPEaID+dT3KT9
/oeQ==;
darn=patchwork.amarulasolutions.com
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=J2YGZUMe;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=neutral header.i=@amarulasolutions.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=amarulasolutions.com; s=google; t=1768748160; x=1769352960;
darn=patchwork.amarulasolutions.com;
h=list-unsubscribe:list-archive:list-help:list-post:list-id
:mailing-list:precedence:x-original-authentication-results
:x-original-sender:content-transfer-encoding:mime-version:message-id
:date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=pJMf7C0p8Cc3tPT/0/C6DI1ZLEnbZk/23YPEqA5792g=;
b=fBF7ioFAdryBW9y4cYlAIdM3BhgLw16BSz6WsjVDnvoBGiXok8H82fXU5moMhTyCSQ
3IWlg7y1g2VksFBr3gEYHidcD5vXH7jIXSkI4Ccu1Y5flcro9zbwvOuy7ucCsveW9i6I
1TWMdYRuJRmmfW7e/EG/EKahdpN4yLINBuv3g=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1768748160; x=1769352960;
h=list-unsubscribe:list-archive:list-help:list-post
:x-spam-checked-in-group:list-id:mailing-list:precedence
:x-original-authentication-results:x-original-sender
:content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-beenthere:x-gm-message-state:from:to:cc:subject
:date:message-id:reply-to;
bh=pJMf7C0p8Cc3tPT/0/C6DI1ZLEnbZk/23YPEqA5792g=;
b=O8gRaDU8BSs1VHIJbFXZ3e92IgwO6gDKZ7aNWSrqaJ6kX/VXFlVGR6+I1yAxOL6g8b
5hMSqInTNvJPuPSlL8U9ut8FV6cU48/p0eOTNzC8YMGNbT/g/e12i4LVRLj0cDYWN7MK
L7b5SR5VYaMXR2agHLD4FAetsFewPyOZ6q/yAqymXSZZiOSGVE6UVKPP6BTDZJKU5h3L
4KKxIPCVIuVXR3vw8v5MREGDMVRIaCBnkN3NkWdUgNStkfSCbkqsz0UJj+DwoS51z12X
Kq61UBMykr5AMAAXc4OhuHKNeZpPTAhsG9VPu7jCW06wVVgNrYigDrjds7SwVSeRMbPg
zIkg==
X-Forwarded-Encrypted: i=2;
AJvYcCUYqKu/mEc7skQSVnthOWnYZc2eqqNUI1Txaph+AdN9vUrdA8/1AmvoW2F6Zr54pW3z1zbgF8tRtegJGors@patchwork.amarulasolutions.com
X-Gm-Message-State: AOJu0YyMdUqc1m5rGFSg26pXVW+06wkeaXbH/7gZTTJRPQHmtxKTgUEO
0UiPkR2mdpb+ibL15QjLeX1RILP1FoGZiQBlQghD/lgj2YAFaU/flw6QyFnvD9abYBSk6A==
X-Received: by 2002:a17:907:702:b0:b87:2b61:b036 with SMTP id
a640c23a62f3a-b8792ddb994mr747096066b.18.1768748160446;
Sun, 18 Jan 2026 06:56:00 -0800 (PST)
X-BeenThere: linux-amarula@amarulasolutions.com;
h="AV1CL+EAQKxobDn2bxTcY5kzD6ApnUfiGq2trzkruuexNTRgUA=="
Received: by 2002:a05:6402:4052:20b0:64b:643e:9559 with SMTP id
4fb4d7f45d1cf-6541c5d6f86ls2248172a12.1.-pod-prod-07-eu; Sun, 18 Jan 2026
06:55:58 -0800 (PST)
X-Received: by 2002:a17:907:e104:b0:b87:d3af:de5f with SMTP id
a640c23a62f3a-b87d3afe217mr43339666b.1.1768748158319;
Sun, 18 Jan 2026 06:55:58 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1768748158; cv=none;
d=google.com; s=arc-20240605;
b=Fh+8F3iMF9MtZpkJYQnH3Z+C1u2COE5iXA4FuoIFLWXdtS+b2GUSM4qxwNefXGczB+
Nf5applDdxByCa+0bio3kedUyR8Vm3ppN2ORNSEXB7YYK+198qFnNsuOmJp5weisFCqa
sNDKwNRIQ+ZGhS72+bULCoXruThMQWOUYzdDvMR5JfKLb9u/PiMdvz5ro5jwKJciFpBX
UbzA6ULl/p1hpL6Zksmq99flWDLWm190mnI2qWuzi5lstu188h9ttOl5oZm+StdoVUP4
m69eAackkyyKLO5ytiBMdNjQMTLG7IWy/WSSWz9pFwcwzxf6A+nnAv1aFXhu2cDwgNET
4LCQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:dkim-signature;
bh=VVPjRYAdNTUCCylsfyHSbISrRELr4ncnQIVEfeEPAic=;
fh=P0T43WSHh4IkPH4o+rKoZpCCgSzfpgHn3kVJLCACSkI=;
b=DkQE1shCkn6lcMsLOx+hfzM6e2+x9Qq22eGLHcQIWBPqmTvR6HTfeeobNnZPiiHh0t
h5levHqGrZUUKUmgkzw9oUMENf1IgHvy1kq0tHFsnos3etulsTzonkwDKYUruAfT4hk1
KWVyjDl/cbyzP2QkfJ2JBfEEl/lQ7dh/tR5gJh7omgvcP7fnZv8SY3wUvzyuQW4FumA6
nGu0B4Arnw68QaKbP7SHDj7Xge+JR++rz/i9d2HFhA4tyZvXYN2aP/6FHYbaPkFGdQDX
LqYM/FIDosTQQWD/KBhQ1rRhpJqGVYTmFlOHUzYjAGz6hh++i0x7BKP8SUDPKp+GPXQh
8MhQ==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b=J2YGZUMe;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=neutral header.i=@amarulasolutions.com
Received: from mail-sor-f41.google.com (mail-sor-f41.google.com.
[209.85.220.41])
by mx.google.com with SMTPS id
a640c23a62f3a-b879513bd47sor154269766b.4.2026.01.18.06.55.58
for <linux-amarula@amarulasolutions.com>
(Google Transport Security);
Sun, 18 Jan 2026 06:55:58 -0800 (PST)
Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Gm-Gg: AY/fxX41hwbLuMJZXBM3lAbDuu7WC+33SUHZo5Qe5jFghNjtVdMFKuLjfjKTp46/k2E
6PS9krEQFFggKnyRyrxVBRWj1JvSOeVrYtpIL1Gf9oUjV2qaTsmuqk6Rcegeh93MsO8J4ZDC0RS
rMlejzzaTbfXquzhVZUfFSR+QmB1ZBYOyC3Ut/v5c33B2dKKAnH87lIU3Gt6DB9HWRV8uI1SzK1
WUK2nwdJF5X7BksPlYYpqaERx0N4+znrgPe94QZur3LyhwQRHFHNfu4LpzARHXavlLyACZWZ5Zj
71w2buPKEjwYVIiML3XnfSrZ8qerTLuQxh2l7DKShA+q+K7JB3SgCX4wjCimJ5TwEJM/BPOjiww
UYlHGgLTZeo8twXd270K3WkoIzy0+av1W7+l6QOv8DCB5Byt06QkRKT3fVoMXGWxHbkofY1kDWG
jCgGw3tmug/B3QJqB8Cl7lBW3auYRBQdFmtEQ0IN9RNSuxLmyUN+zFLNqmmqWo3qqFkvzKw1fwO
6ma9xA0dlPJYOO6E6rHdCHsf/Rkm6oGnXPtgoGTacP8d6OK2iLs+fFFVJJTfmLTbY9DdvHzRrdI
Ks08WU6Jo4Y=
X-Received: by 2002:a17:907:3f8a:b0:b87:7e8:e287 with SMTP id
a640c23a62f3a-b87930086d4mr661659366b.30.1768748157653;
Sun, 18 Jan 2026 06:55:57 -0800 (PST)
Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it
(host-95-248-31-95.retail.telecomitalia.it. [95.248.31.95])
by smtp.gmail.com with ESMTPSA id
a640c23a62f3a-b8795a31322sm854760166b.63.2026.01.18.06.55.56
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 18 Jan 2026 06:55:57 -0800 (PST)
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: u-boot@lists.denx.de
Cc: linux-amarula@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Marek Vasut <marek.vasut@mailbox.org>,
Patrice Chotard <patrice.chotard@foss.st.com>,
Patrick Delaunay <patrick.delaunay@foss.st.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Tom Rini <trini@konsulko.com>,
uboot-stm32@st-md-mailman.stormreply.com
Subject: [RESEND PATCH] board: stm32mp2: read boot index from backup register
Date: Sun, 18 Jan 2026 11:48:43 +0100
Message-ID: <20260118104912.1672642-1-dario.binacchi@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Original-Sender: dario.binacchi@amarulasolutions.com
X-Original-Authentication-Results: mx.google.com; dkim=pass
header.i=@amarulasolutions.com header.s=google header.b=J2YGZUMe;
spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com
designates 209.85.220.41 as permitted sender)
smtp.mailfrom=dario.binacchi@amarulasolutions.com;
dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com;
dara=neutral header.i=@amarulasolutions.com
Precedence: list
Mailing-list: list linux-amarula@amarulasolutions.com;
contact linux-amarula+owners@amarulasolutions.com
List-ID: <linux-amarula.amarulasolutions.com>
X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com
X-Google-Group-Id: 476853432473
List-Post:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>,
<mailto:linux-amarula@amarulasolutions.com>
List-Help:
<https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>,
<mailto:linux-amarula+help@amarulasolutions.com>
List-Archive:
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/>
List-Unsubscribe:
<mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>,
<https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe>
|
| Series |
[RESEND] board: stm32mp2: read boot index from backup register
|
|
Commit Message
Dario Binacchi
Jan. 18, 2026, 10:48 a.m. UTC
Following the commit 95b5a7de30f6 (“FWU: STM32MP1: Add support to read
boot index from backup register”), this patch enables reading the boot
index from backup registers on STM32MP2 platforms.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
arch/arm/mach-stm32mp/include/mach/stm32.h | 4 ++++
board/st/stm32mp2/stm32mp2.c | 21 +++++++++++++++++++++
2 files changed, 25 insertions(+)
Comments
On 1/18/26 11:48, Dario Binacchi wrote: > Following the commit 95b5a7de30f6 (“FWU: STM32MP1: Add support to read > boot index from backup register”), this patch enables reading the boot > index from backup registers on STM32MP2 platforms. > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> > > --- > > arch/arm/mach-stm32mp/include/mach/stm32.h | 4 ++++ > board/st/stm32mp2/stm32mp2.c | 21 +++++++++++++++++++++ > 2 files changed, 25 insertions(+) > > diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h > index 2bf50c755cbd..90f06a052d3f 100644 > --- a/arch/arm/mach-stm32mp/include/mach/stm32.h > +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h > @@ -188,8 +188,12 @@ enum forced_boot_mode { > /* TAMP registers x = 0 to 127 : hardcoded description, waiting NVMEM node in DT */ > #define TAMP_BACKUP_REGISTER(x) (STM32_TAMP_BASE + 0x100 + 4 * (x)) > > +#define TAMP_FWU_BOOT_INFO_REG TAMP_BACKUP_REGISTER(48) > /* TAMP registers zone 3 RIF 1 (RW) at 96*/ > #define TAMP_BOOT_CONTEXT TAMP_BACKUP_REGISTER(96) > + > +#define TAMP_FWU_BOOT_IDX_MASK GENMASK(3, 0) > +#define TAMP_FWU_BOOT_IDX_OFFSET 0 > #endif /* defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X) */ > > /* offset used for BSEC driver: misc_read and misc_write */ > diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c > index 7bc7d2a608fd..43bc583378e6 100644 > --- a/board/st/stm32mp2/stm32mp2.c > +++ b/board/st/stm32mp2/stm32mp2.c > @@ -188,3 +188,24 @@ void board_quiesce_devices(void) > { > led_boot_off(); > } > + > +#if defined(CONFIG_FWU_MULTI_BANK_UPDATE) > + > +#include <fwu.h> > + > +/** > + * fwu_plat_get_bootidx() - Get the value of the boot index > + * @boot_idx: Boot index value > + * > + * Get the value of the bank(partition) from which the platform > + * has booted. This value is passed to U-Boot from the earlier > + * stage bootloader which loads and boots all the relevant > + * firmware images > + * > + */ > +void fwu_plat_get_bootidx(uint *boot_idx) > +{ > + *boot_idx = (readl(TAMP_FWU_BOOT_INFO_REG) >> > + TAMP_FWU_BOOT_IDX_OFFSET) & TAMP_FWU_BOOT_IDX_MASK; > +} > +#endif /* CONFIG_FWU_MULTI_BANK_UPDATE */ Hi Dario Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Thanks Patrice To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
On 1/19/26 09:38, Patrice CHOTARD wrote: > > > On 1/18/26 11:48, Dario Binacchi wrote: >> Following the commit 95b5a7de30f6 (“FWU: STM32MP1: Add support to read >> boot index from backup register”), this patch enables reading the boot >> index from backup registers on STM32MP2 platforms. >> >> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> >> >> --- >> >> arch/arm/mach-stm32mp/include/mach/stm32.h | 4 ++++ >> board/st/stm32mp2/stm32mp2.c | 21 +++++++++++++++++++++ >> 2 files changed, 25 insertions(+) >> >> diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h >> index 2bf50c755cbd..90f06a052d3f 100644 >> --- a/arch/arm/mach-stm32mp/include/mach/stm32.h >> +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h >> @@ -188,8 +188,12 @@ enum forced_boot_mode { >> /* TAMP registers x = 0 to 127 : hardcoded description, waiting NVMEM node in DT */ >> #define TAMP_BACKUP_REGISTER(x) (STM32_TAMP_BASE + 0x100 + 4 * (x)) >> >> +#define TAMP_FWU_BOOT_INFO_REG TAMP_BACKUP_REGISTER(48) >> /* TAMP registers zone 3 RIF 1 (RW) at 96*/ >> #define TAMP_BOOT_CONTEXT TAMP_BACKUP_REGISTER(96) >> + >> +#define TAMP_FWU_BOOT_IDX_MASK GENMASK(3, 0) >> +#define TAMP_FWU_BOOT_IDX_OFFSET 0 >> #endif /* defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X) */ >> >> /* offset used for BSEC driver: misc_read and misc_write */ >> diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c >> index 7bc7d2a608fd..43bc583378e6 100644 >> --- a/board/st/stm32mp2/stm32mp2.c >> +++ b/board/st/stm32mp2/stm32mp2.c >> @@ -188,3 +188,24 @@ void board_quiesce_devices(void) >> { >> led_boot_off(); >> } >> + >> +#if defined(CONFIG_FWU_MULTI_BANK_UPDATE) >> + >> +#include <fwu.h> >> + >> +/** >> + * fwu_plat_get_bootidx() - Get the value of the boot index >> + * @boot_idx: Boot index value >> + * >> + * Get the value of the bank(partition) from which the platform >> + * has booted. This value is passed to U-Boot from the earlier >> + * stage bootloader which loads and boots all the relevant >> + * firmware images >> + * >> + */ >> +void fwu_plat_get_bootidx(uint *boot_idx) >> +{ >> + *boot_idx = (readl(TAMP_FWU_BOOT_INFO_REG) >> >> + TAMP_FWU_BOOT_IDX_OFFSET) & TAMP_FWU_BOOT_IDX_MASK; >> +} >> +#endif /* CONFIG_FWU_MULTI_BANK_UPDATE */ > > Hi Dario > > Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> > > Thanks > Patrice > Applied to u-boot-stm32/master Thanks Patrice To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
diff --git a/arch/arm/mach-stm32mp/include/mach/stm32.h b/arch/arm/mach-stm32mp/include/mach/stm32.h index 2bf50c755cbd..90f06a052d3f 100644 --- a/arch/arm/mach-stm32mp/include/mach/stm32.h +++ b/arch/arm/mach-stm32mp/include/mach/stm32.h @@ -188,8 +188,12 @@ enum forced_boot_mode { /* TAMP registers x = 0 to 127 : hardcoded description, waiting NVMEM node in DT */ #define TAMP_BACKUP_REGISTER(x) (STM32_TAMP_BASE + 0x100 + 4 * (x)) +#define TAMP_FWU_BOOT_INFO_REG TAMP_BACKUP_REGISTER(48) /* TAMP registers zone 3 RIF 1 (RW) at 96*/ #define TAMP_BOOT_CONTEXT TAMP_BACKUP_REGISTER(96) + +#define TAMP_FWU_BOOT_IDX_MASK GENMASK(3, 0) +#define TAMP_FWU_BOOT_IDX_OFFSET 0 #endif /* defined(CONFIG_STM32MP23X) || defined(CONFIG_STM32MP25X) */ /* offset used for BSEC driver: misc_read and misc_write */ diff --git a/board/st/stm32mp2/stm32mp2.c b/board/st/stm32mp2/stm32mp2.c index 7bc7d2a608fd..43bc583378e6 100644 --- a/board/st/stm32mp2/stm32mp2.c +++ b/board/st/stm32mp2/stm32mp2.c @@ -188,3 +188,24 @@ void board_quiesce_devices(void) { led_boot_off(); } + +#if defined(CONFIG_FWU_MULTI_BANK_UPDATE) + +#include <fwu.h> + +/** + * fwu_plat_get_bootidx() - Get the value of the boot index + * @boot_idx: Boot index value + * + * Get the value of the bank(partition) from which the platform + * has booted. This value is passed to U-Boot from the earlier + * stage bootloader which loads and boots all the relevant + * firmware images + * + */ +void fwu_plat_get_bootidx(uint *boot_idx) +{ + *boot_idx = (readl(TAMP_FWU_BOOT_INFO_REG) >> + TAMP_FWU_BOOT_IDX_OFFSET) & TAMP_FWU_BOOT_IDX_MASK; +} +#endif /* CONFIG_FWU_MULTI_BANK_UPDATE */