From patchwork Sun Apr 26 15:46:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4572 Return-Path: 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 A70663F206 for ; Sun, 26 Apr 2026 17:47:31 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-48a548b585csf39791685e9.2 for ; Sun, 26 Apr 2026 08:47:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1777218451; cv=pass; d=google.com; s=arc-20240605; b=aVFnP4d4zFKO3gvTYMgti6NVM/ynLM6Btjndwwpo4A12tFRcdz+9NWgq4WX+FmrBns gSLx9ZW8w2e7hI3EDXw+KfzU29wenoSmU6I6yWCy5D2QE6xb9BP6S0XhYzXnDWgTtvKD 82uKPiWIMs5Qr4trVWubp2TCoeRtYZufDA1PSQblgNS/k1koMbj56WXx/dR0gm3wcMXF mYWhCwuXE4J9F7YIVTSUJPr9JD4F7Jl15N5ziROiinTIZLZU2PuK94wagjTjb1W9Ab0L aXqN/lkfDspNRVT0iiaWhXW8isjZ0c1XFFe40O1YClrwXL2OEGD1j8ZxdGVsSTJ0YIbn qRJA== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=UKtMyoi0sbcuwpCzMbo8WrgaoZyv4hxafMRorLngD7g=; fh=YCsuwcrmaN0PBm8QGuG9nz3VGYLFCGgW1dTowr9P75I=; b=N5MAYTM1BqzGyO99SLLxCvVTyejid7nFVvJm+Zo3ziUbju6pdMFt1bMrCQycs5G1/2 13WSjAmIP6yfAUufiWbLxGfAlSCSsRDcsFuwJ+4awYqxOxgfUUneDkk2cAgrmRsyfkdQ 5SmxBM6tJoI4jYVSm+y/B1JFAU9Q1QMIG34J8zC12UWTrMMfTPdQ/HPc7Gfq8XbmVtuT VJTZ6IcF5a6Cd4hTckjy1jcM0IWfRm5YMtMYrhZat3Wa06CHU0T76WhY0KeDRDOe35mf uQHVuWfWypRVnFVdHmAzfFiMRoX+WUkFKBH9zA5JkZA6+7bS3vAtKWKh8W9F5ERBEuLZ 4i3w==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Mw8H+Rzv; 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=1777218451; x=1777823251; 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:message-id:date:subject:cc:to:from :from:to:cc:subject:date:message-id:reply-to; bh=UKtMyoi0sbcuwpCzMbo8WrgaoZyv4hxafMRorLngD7g=; b=iUrK+fkarkgkLBnplG+Q4BLxAAhGH2EhAR/wr8UUeyxjv3i2XVR7b+9JPomuxe9vbD UKq4BBvFNIkooOm1nidypRrwIlQYprf5/44sLiFvFt1FKBDR4wAPUxnf3ebszG2tnqfx Aiegiwvi5sjGyPicVtxXtGBmQo8CH+nrKxivQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777218451; x=1777823251; 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 :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=UKtMyoi0sbcuwpCzMbo8WrgaoZyv4hxafMRorLngD7g=; b=EdhuKHvSJl7tn9bj18wqlhm/VW+QU39rEtQ3tjSwZwiCJfK/PqyxCC9+ghlpz4zS8I NJ6tVaywyrws4TKxgMNtJM+Q59Z8/NjBs0qrvZnE1DWeyVqcIyPV15+YYMvXeNcrLCT5 LUbf+T0PjkBeJDYgilflUrQL/zk9rZ/S5atYibe0BfNF9+daK0WFkqgK4n4tG0PgOoW1 I3iz1r6uPX0wv+4Ul+iiMKp6j2GSWdGlrvh1EZnNdbEJne2zY/vkmsr02rJipgFZOmk9 SvlubPDbqxPLzkQrDruQVZraHicUyTRRTpH0XHyY6poAKe7yFkMzbjVORShKZZTVBpQ1 GLYQ== X-Forwarded-Encrypted: i=2; AFNElJ+KkkKM25r1rZ8S1ADnrhVVEjQowOP1VO40lsbv0worDWEzAAhAeDCSSpf7sdP/dhGB10DTRYXqowsx2ay9@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yx2hoNIfod2iu4KC5/BON8xsv2ANwYkZfu+0xCogFUU+Srqx+Ce V/wCpKkkEubt86JpkoNURFExwd0ty4i2xTSSqSf6ZMnGjbOBDH0kLGK7UoyeMZSAMU9amSUHI1Q w4g== X-Received: by 2002:a05:600c:4f13:b0:489:1a65:dd6e with SMTP id 5b1f17b1804b1-4891a65de3emr474009645e9.8.1777218451134; Sun, 26 Apr 2026 08:47:31 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiKrs5fR7VUpQOSKzWAt+jbVN/4H97Om4X5r6P8IKKZOsg==" Received: by 2002:a05:600c:687:b0:48a:58a1:abad with SMTP id 5b1f17b1804b1-48a58a1ad0bls23467235e9.0.-pod-prod-07-eu; Sun, 26 Apr 2026 08:47:29 -0700 (PDT) X-Received: by 2002:a05:600c:37c6:b0:48a:65a5:750f with SMTP id 5b1f17b1804b1-48a65a57563mr149082665e9.21.1777218449469; Sun, 26 Apr 2026 08:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777218449; cv=none; d=google.com; s=arc-20240605; b=N86mNIUm8Rbx/RPZ95tp+vRSpgSJ6OeRLo5plWdsnKEvpQPNm+/4o6STCxfEfldwYH qaqT0BKA74ZPPb3SLbviKWMst77AnPxOFrO4ezGPlqL14/hQ1uBcN13B1Z5WpiTR9f26 pw/OhsrMujn5ZHaHo0vzm954u3TApqGE0QBmwj+UZcJXT8qsPm6ZAVFPooYmyYPAFU4w rNlfk2d9hb/R0O9UCQyXZJSe9ypVIyMk75+XtjZb8iVAQofBR2IYy5O85eIyZd/h/ydN BI/RK6WsBVRwQN8oHENpx0UU6N/DqCCVSlLyQLFOSRldit/OkxHQKxlm5DDUuIm5S6WE b/dg== 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=Ay5BWKMwp9o/rxZeYsRX2pfTyaEApr2HS5FZb4AfA/Y=; fh=mt5GTj5JmZ2CtV6OBXgC7VsSU6VhF6iFjoJEbDMF2qg=; b=MdSkBgkFkB2UmCy83/P9rbbu34Gq1qLU5SUnJ/HQrnTAJZijfPIYVsoGj4H8z48iJI U3zHfs0z1wa2M+agGV6QQZVYR5hxOU7x0tXgUZxXowMgkERmDCMDKcIt5l5o3Dsb536J Qdb097xxn0KgcX7FaPg0GkkLCS0dzK6Swb2nmtKXyf6kez0NOB7F22wq17uOFNS1LBue 9PbjvQIdMNgDYVvrD0hLofUcE0aWHhGrC1gbb9o0rHrgKVPaIw4yZTGe+xHLuuZdTP35 0I83i0NzzvHo2s6R1EGg7ac74KqNzDpmY4pi6Q1F3UpHGc/awGWxU/EBY9ilEjSwAXc8 ePYw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Mw8H+Rzv; 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 ffacd0b85a97d-43fe4e170cesor3870124f8f.15.2026.04.26.08.47.29 for (Google Transport Security); Sun, 26 Apr 2026 08:47:29 -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: AeBDiesExT9EzKbnaekUan46D0xer7MmjTIP0jebuHBTh6lQqWuv4FvWWbLOJDTnDk4 cgJv0kUAX3K2miOt9anyb3a/RpIKzzQyp+/h8OsKGVxr3iSZMpd5UnVm9wLkeDf6CN4zKQ5aTQM PoeomZ6c0m9S+pwGx2xRsJKgoh/btuLwKwL7qHn3zS5wIqUUrCe7LnYNXf5zvNO1bSavP/BEC3l lveJThWqLts7KPPftzwgRQrGWMVikU6V8rNPIjMN/rQ4aElumOrwhMERQBew9CKsv5hZivB9w3/ tEdWDFiUDfSi5FKPt/Nb93mz26w+ahYXG4EidPXnjCHypPvfGNvaRm3o4oULv1BQJ3PlzeFYte8 XvsGf3c7K5+gdGBRBFSXnqgYZdDXXk62gFaYdkzkZnWMuQ+9STaQdETLsWNFlstMoKT45bdUi+l JaZlN5jA3h2FQl9TQr9sNE9euBBEcy4jeSMZrI4krtpkdKYjEi7w3LZ+Q02sHMsnYZ/FrgFVaUG pPzQp+UCVyPWHnzDL44J6du2cvkZAXzSFxmjAbs7st+LyZL2QwoJrEsMQ15wm3OlSWcUFRqEZw7 twB4P3qMeY4auPJ4Aywdoqkf7lBhJw== X-Received: by 2002:a05:6000:25c4:b0:43b:8f56:1e1d with SMTP id ffacd0b85a97d-43fe3dc10demr61510778f8f.13.1777218448919; Sun, 26 Apr 2026 08:47:28 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.amarulasolutions.com (host-82-56-22-134.retail.telecomitalia.it. [82.56.22.134]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-44123d23e0bsm34489985f8f.15.2026.04.26.08.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 08:47:28 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Bin Meng , Dinesh Maniyam , Heinrich Schuchardt , Ilias Apalodimas , Javier Martinez Canillas , Jerome Forissier , Jonathan GUILLOT , Kory Maincent , Marek Vasut , Mattijs Korpershoek , Michal Simek , Padmarao Begari , Patrice Chotard , Patrick Delaunay , Quentin Schulz , Rasmus Villemoes , Simon Glass , Sughosh Ganu , Tom Rini , =?utf-8?q?Vincent_Stehl=C3=A9?= , uboot-stm32@st-md-mailman.stormreply.com Subject: [PATCH v7 0/8] Support metadata-driven A/B boot for STM32MP25 Date: Sun, 26 Apr 2026 17:46:53 +0200 Message-ID: <20260426154724.2042569-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 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=Mw8H+Rzv; 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: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This series, the mainline version of [1], provides the necessary changes in U-Boot to support the metadata-driven A/B update flow for STM32MP25 boards. It implements the logic required to dynamically select the boot bank based on FWU metadata. These changes are designed to be backward compatible while providing the necessary infrastructure for the A/B scheme. The series has been tested on the STM32MP257F-EV1 board. Additionally, some patches in the series propose changes with general-purpose utility: 1/7 lib: uuid: add partition type GUID for extended bootloader 4/7 cmd: part: support lookup by UUID in 'part number' 6/7 fwu: add helper to get image GUID by type and bank index [1] https://github.com/STMicroelectronics/u-boot/pull/6 Changes in v7: - Add Reviewed-by of Simon Glass for patc 7/8 of "test: dm: fwu_mdata: add test for fwu_mdata_get_image_guid". Changes in v6: - Add Reviewed-by of Simon Glass to patch 3/8 "test: cmd: add unit tests for part command" Changes in v5: - Update doc/usage/cmd/part.rst to reflect the changes related to the part command. - Add Acked-by of Ilias Apalodimas to patch 6/8 "fwu: add helper to get image GUID by type and bank index" Changes in v4: - Place the part command tests in the cmd suite rather than the dm suite. - Order the include files according the U-Boot coding style. - Add patch 7/8 test: dm: fwu_mdata: add test for fwu_mdata_get_image_guid Changes in v3: - Wrap lines exceeding 80 columns in test/cmd/part.c file. - Combine run_command() and ut_asserteq() -> ut_asserteq(1, run_command( - Add kerneldoc comment for fwu_mdata_get_image_guid() above its declaration in fwu.h. - Add log_warning() messages to fwu_platform_hook() to catch inconsistent FWU metadata (boot GUID found but root GUID missing or viceversa), as suggested by Simon Glass. Changes in v2: - Add links to the XBOOTLDR specification in the commit message of patch 1/7 lib: uuid: add partition type GUID for extended bootloader. - Update help for 'part start', 'part size' to mention UUID. - Add kerneldoc comment for fwu_mdata_get_image_guid(). - Pass efi_guid_t by pointer in fwu_mdata_get_image_guid(). - Add patches: 5/7 test: cmd: part: add UUID lookup tests 3/7 test: cmd: add unit tests for part command 2/7 test: dm: part: add test for part_get_info_by_uuid Dario Binacchi (8): lib: uuid: add partition type GUID for extended bootloader test: dm: part: add test for part_get_info_by_uuid test: cmd: add unit tests for part command cmd: part: support lookup by UUID test: cmd: part: add UUID lookup tests fwu: add helper to get image GUID by type and bank index test: dm: fwu_mdata: add test for fwu_mdata_get_image_guid board: st: stm32mp25: support dynamic A/B bank bootup board/st/stm32mp2/stm32mp2.c | 32 ++++ cmd/part.c | 12 +- doc/README.gpt | 2 + doc/usage/cmd/part.rst | 6 +- include/configs/stm32mp25_st_common.h | 15 ++ include/fwu.h | 11 ++ include/part_efi.h | 3 + lib/fwu_updates/fwu.c | 33 ++++ lib/uuid.c | 1 + test/cmd/Makefile | 1 + test/cmd/part.c | 209 ++++++++++++++++++++++++++ test/dm/fwu_mdata.c | 48 ++++++ test/dm/part.c | 53 +++++++ 13 files changed, 419 insertions(+), 7 deletions(-) create mode 100644 test/cmd/part.c