| Message ID | 20260328171624.2377527-4-dario.binacchi@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path:
<linux-amarula+bncBCQ4XFG47UFRBE42UDHAMGQE4VRAV2I@amarulasolutions.com>
X-Original-To: linux-amarula@patchwork.amarulasolutions.com
Delivered-To: linux-amarula@patchwork.amarulasolutions.com
Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com
[209.85.128.69])
by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 212B43F0C6
for <linux-amarula@patchwork.amarulasolutions.com>;
Sat, 28 Mar 2026 18:17:08 +0100 (CET)
Received: by mail-wm1-f69.google.com with SMTP id
5b1f17b1804b1-4853a9467c5sf14700215e9.2
for <linux-amarula@patchwork.amarulasolutions.com>;
Sat, 28 Mar 2026 10:17:08 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1774718228; cv=pass;
d=google.com; s=arc-20240605;
b=iyjSwupYvwaMicjG2SCyCxM5/RM4EQ3/QFTGPeRbPvfZLCrGpCuOmtk4JEJ0ytOQpy
WzmqYcBYxnu6iUTx9rXktQ1ly3ZAsD9jsU0txwn7Zux3U9Ug6agqp/Hdx9jVzVuC9zZO
fbHaYxv0VrxJcy+1y1F5zm+ajSeWFYr1Tj0uSs1T4vXoyf2CMI/uIAwVhHEp+brdk4fI
y2rDUcuPHb6SA5dw6u6uF+8M6/hR3FDtElVlzl4aVzd0/aawFFzOkFAAiRsI+409iC2U
xw0x2n/JHTmG/Q2zzY6cNenKKjtJ50Mlcpu/eh4NA7Nthh/BMuUJgm+o18c1env9hJxj
EHUw==
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:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=H+Z5DChG4+uYhGmwaZB0EQZcoq2jFiUePBT3ED2QHyc=;
fh=qObaImOrzi0Yy+c6ieRe2+WZbliF/7HwZ+SQWPgrtl0=;
b=ZcOk3bE9RZIiEEhL3te/XWu9WwtmC2zh+JX733cIipJtd5f+OKX2oy2kBhCpUseZrh
WYI5DxX62LzPml8RkWVNX/icb490tAmt+aEWfiJTxhmvSXUzJC+VIJbwwAYtG88Rv3er
GQzs8oOl9YXypb89CcFKwWCa0WdzEH1G+2mDMVwM86exx1jdpLX7F6yJMLyj8Msbt0Vz
De474PSANnj72rxjWZs1j7Uw21VS1yRZ7/32PnQxYrPzXtSzKmkJYGITBEoAaZnxUR2O
ndmCqPaTlQKE7ljbGKLoxVD0oWQNFWnvdNzO1UzR/pmawCAx9Pjr+GlkPadZC/QwypCw
3gOg==;
darn=patchwork.amarulasolutions.com
ARC-Authentication-Results: i=2; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b="SV/5FbFx";
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=1774718228; x=1775323028;
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:mime-version:references:in-reply-to:message-id
:date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
bh=H+Z5DChG4+uYhGmwaZB0EQZcoq2jFiUePBT3ED2QHyc=;
b=mJzKDQh/QnpqQPaSHVHuadD1gVe0+L3MAimtWG25E4GBou3miQIKSFIAGBeTp+ZXhl
2Xj3fbMPe2a47wjkUH1i5fCnze5M3HKhsg/rxBeb94RSWqhNT/oy9wxeSh+jeT+lUiAg
S0881uv6vsWWDjGK38d3IcIdWGuwTjx4lMs0w=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20251104; t=1774718228; x=1775323028;
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:mime-version
:references:in-reply-to: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=H+Z5DChG4+uYhGmwaZB0EQZcoq2jFiUePBT3ED2QHyc=;
b=nGdX7Qp6yeDqG/7fq1lr8XaorPl71S/ydEV61fpIiE4J7VpkNFy8SgM6ZRNPQF2Sfg
wxe63HumSjH/KZk3gPgViODq9VZDwyJLMG/LXSMwDmEz33L6eTa4c+TJEOJTVOVAJOvW
JHm+MmNfEWBExyvsNwI/aJPQoi8+lJ9jIGrxO4IqsWwL0F9Okd6z5xLv2ZECXGOjYDWV
asFmQ78Why+ZfchR6ej+LTC4spck0a9EdiiBv9Zt4Xk86F7JXDSf/neXF2CB8uy8ieiQ
RMTc00Rl8/pjYX/B7EiOsUaniFW2SQMkhThk7bxUwlC+YLQ+oH78H5vXTr6RcvLwuTuU
l9Wg==
X-Forwarded-Encrypted: i=2;
AJvYcCWi2MjAZycWjUC5nG1Ul2KvdHKSFPr/nhzcK+ckT7E2dygEfGtHskqD4zJLkbOFVBx/AiaKbWSzc7miJa55@patchwork.amarulasolutions.com
X-Gm-Message-State: AOJu0YxR9m4ngAPhIFy93ONsguuwsQWYpH7okk7q9ftsvMqmBdh5nnLb
HytSX/GFLzP/hQQ5ydQNAC46MaeQOsFzDahaYt+Lzia21UNuI1M0yjnZrNAlGvbG/47xvQ==
X-Received: by 2002:a05:600c:4e0d:b0:487:1c2:6a4f with SMTP id
5b1f17b1804b1-487280c2c50mr118471815e9.31.1774718227725;
Sat, 28 Mar 2026 10:17:07 -0700 (PDT)
X-BeenThere: linux-amarula@amarulasolutions.com;
h="AYAyTiJKcLfWwRg1IGKvguYrpnDvZBAuR+ZmKYbWWcO1Eayw1g=="
Received: by 2002:a05:600c:414c:b0:483:a26d:128e with SMTP id
5b1f17b1804b1-4871f388497ls16205315e9.1.-pod-prod-01-eu; Sat, 28 Mar 2026
10:17:06 -0700 (PDT)
X-Received: by 2002:a05:600c:3510:b0:486:ffa3:593 with SMTP id
5b1f17b1804b1-487280abccdmr99521925e9.28.1774718226055;
Sat, 28 Mar 2026 10:17:06 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1774718226; cv=none;
d=google.com; s=arc-20240605;
b=Zb4KXcSeA8YaASugtknjlgyO4Eu4xNyr9BSZMo7COup04YQZFTdEtjp/0K7zCvycsc
joeeEVL1dFj2RkG0CM1BbmZlNb2W09mbRU4MCbgH9TTUWdqcW/8JRhROr5IhgrkUO0+P
RxR38xoosEzrHCOM7xZFlOAsQGpoOxabkSKOOF+AwO3JI4xTbHOIaLrv2UvcoV6FfSio
HRO7ArIKL1e2tRHf2qeT1xljaVxr2AXbsMxTGOJR4vxe8Tyrfq/SSIeVojjg/Cvs3Kd/
vwTBW296Zi/ZTYDQGd2WynNn02CUmYJ3rFVmcpDGzimqlX0p/Z73ou0ZiJWcMq3Y9g2y
7b/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:dkim-signature;
bh=1ANRuDcH5uj8PwGl9AVCV/OxTcpSsUjtUcNfGEbS7lw=;
fh=wRznwKej01d9+6aGazqmxhW1igj4DDLjIcwKUY4qreg=;
b=iEtyo3ykjPrmfZjEM6//BHUUf2DZ1TdBGWqEI6rxmBB1nRtmWxrhHz3WgT4ffev9lk
48L+u8022nsyKBodTU58v5BMc/V2Sy8HlrZeEILmUIaGs8OJLoJYLFk40fNmlIS4s36U
t1ivwdQEdZF9HSQENF+fDtaNEG2bAJEOhL5Jvci5i8b7t8Kd5Lw5jmSOL2QBX778oy+o
KMe4MxjxIELxBy+Xcp+a43o6eTpgS3S+M5WYoQuE+DYK3oTdKXxFI8Ho+tQcnpqanu4i
SrJEKk+7tHw9w42/NEBpSDAStbBav370FTmJB40yQWiSKyKj1t9RyU/pYtcxXoww5Nqv
F3Lg==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@amarulasolutions.com header.s=google
header.b="SV/5FbFx";
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
5b1f17b1804b1-48730636e8fsor2362975e9.5.2026.03.28.10.17.06
for <linux-amarula@amarulasolutions.com>
(Google Transport Security);
Sat, 28 Mar 2026 10:17:06 -0700 (PDT)
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: ATEYQzzeVbc6eCr2PUAhX9iGQ602Sv0f5Miv8AVd2vwjZQltirA92Ukda/uCbDYMiGR
PcaN++7x/Z9ftlVvIZL+p/roeDUFoIay1q+0HTabnuriZkSBhOZP9shJoizP6k3fdyWxphIqk2s
OvP6AeOoyyeFQj57vFfKp9r11YB0H4uAKCG6xXIMnxjKx/aZiZmsCIQK6q+f4G2o6Ijb3E9Kq0n
LnJ2JkuUjj8/7nrmqMjsj5kgFt5Aal+Qg21gQxzk4QIt0Mq+e3SJX6RyhiJ5r8q2/IcaBuxu1CU
IjFYEX1umB/PN8Lykc5e5c6VrsQ9bgCZKN6RLcHYhsJMCSOeMcxBo1aw/eqBgwapprbRUB45n4P
igY0IWxAifplFTpdoidmvoai/ZQitLpG9KnrAL8gbkjf3SH2/IuPHW/fTvvwkqPKoREIQwx5vjT
LYOob8P6PvrJBaSAyVB5HxufRjJTauDzxOh+xGGobentjczShvm2kn2NTSE26IgLeNNpkhhClli
+HEpMzIJxsktnm78nY5FYUGayG/YdTWlFZJc/LtcfIMGFDxjC5JEbHSUi5mGCnJ3Ik1Mcv8jINb
LQzv9w+p1LFt/alak3B9D6kW
X-Received: by 2002:a05:600c:6287:b0:485:3eba:ab96 with SMTP id
5b1f17b1804b1-48727ef1782mr113553035e9.3.1774718225558;
Sat, 28 Mar 2026 10:17:05 -0700 (PDT)
Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it
(host-87-9-100-184.retail.telecomitalia.it. [87.9.100.184])
by smtp.gmail.com with ESMTPSA id
5b1f17b1804b1-48722c6b105sm332432465e9.1.2026.03.28.10.17.02
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sat, 28 Mar 2026 10:17:05 -0700 (PDT)
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: u-boot@lists.denx.de
Cc: linux-amarula@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Michal Simek <michal.simek@amd.com>,
Padmarao Begari <padmarao.begari@amd.com>,
Sughosh Ganu <sughosh.ganu@arm.com>,
Tom Rini <trini@konsulko.com>
Subject: [PATCH 3/4] fwu: add helper to get image GUID by type and bank index
Date: Sat, 28 Mar 2026 18:15:16 +0100
Message-ID: <20260328171624.2377527-4-dario.binacchi@amarulasolutions.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20260328171624.2377527-1-dario.binacchi@amarulasolutions.com>
References: <20260328171624.2377527-1-dario.binacchi@amarulasolutions.com>
MIME-Version: 1.0
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="SV/5FbFx";
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
Content-Type: text/plain; charset="UTF-8"
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 |
Support metadata-driven A/B boot for STM32MP25
|
|
Commit Message
Dario Binacchi
March 28, 2026, 5:15 p.m. UTC
Introduce fwu_mdata_get_image_guid() to retrieve a specific image GUID
from the FWU metadata based on the bank index and image type GUID.
This allows identifying the correct partition in multi-bank (A/B)
scenarios, ensuring the correct image is targeted depending on the
current bank.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
include/fwu.h | 3 +++
lib/fwu_updates/fwu.c | 24 ++++++++++++++++++++++++
2 files changed, 27 insertions(+)
Comments
Hi Dario, On 2026-03-28T17:15:13, Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > diff --git a/include/fwu.h b/include/fwu.h > @@ -394,6 +394,9 @@ int fwu_get_mdata_size(uint32_t *mdata_size); > +int fwu_mdata_get_image_guid(efi_guid_t *image_guid, efi_guid_t image_type_guid, > + u32 bank_index); Please add a function comment like the other. Also, all other functions in this file pass efi_guid_t by pointer. How about 'const efi_guid_t *image_type_guid' instead? > diff --git a/lib/fwu_updates/fwu.c b/lib/fwu_updates/fwu.c > @@ -243,6 +243,30 @@ int fwu_sync_mdata(struct fwu_mdata *mdata, int part) > +} > /** > * fwu_mdata_copies_allocate() - Allocate memory for metadata Missing blank line between the closing brace of the new function and the doc comment of fwu_mdata_copies_allocate(). Regards, Simon To unsubscribe from this group and stop receiving emails from it, send an email to linux-amarula+unsubscribe@amarulasolutions.com.
diff --git a/include/fwu.h b/include/fwu.h index e7bd1d492af1..47242629e404 100644 --- a/include/fwu.h +++ b/include/fwu.h @@ -394,6 +394,9 @@ void fwu_populate_mdata_image_info(struct fwu_data *data); */ int fwu_get_mdata_size(uint32_t *mdata_size); +int fwu_mdata_get_image_guid(efi_guid_t *image_guid, efi_guid_t image_type_guid, + u32 bank_index); + /** * fwu_state_machine_updates() - Update FWU state of the platform * @trial_state: Is platform transitioning into Trial State diff --git a/lib/fwu_updates/fwu.c b/lib/fwu_updates/fwu.c index 0f5ef2ba5153..a2857d369b92 100644 --- a/lib/fwu_updates/fwu.c +++ b/lib/fwu_updates/fwu.c @@ -243,6 +243,30 @@ int fwu_sync_mdata(struct fwu_mdata *mdata, int part) return 0; } +int fwu_mdata_get_image_guid(efi_guid_t *image_guid, efi_guid_t image_type_guid, + u32 bank_index) +{ + struct fwu_data *data = &g_fwu_data; + struct fwu_image_entry *image; + int i; + + if (bank_index >= data->num_banks) + return -EINVAL; + + for (i = 0; i < data->num_images; i++) { + image = &data->fwu_images[i]; + + if (!guidcmp(&image_type_guid, &image->image_type_guid)) { + struct fwu_image_bank_info *bank; + + bank = &image->img_bank_info[bank_index]; + guidcpy(image_guid, &bank->image_guid); + return 0; + } + } + + return -ENOENT; +} /** * fwu_mdata_copies_allocate() - Allocate memory for metadata * @mdata_size: Size of the metadata structure