From patchwork Sun Apr 19 14:31:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 4543 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 287C23F1C5 for ; Sun, 19 Apr 2026 16:32:58 +0200 (CEST) Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-488c16958e9sf15252585e9.1 for ; Sun, 19 Apr 2026 07:32:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1776609177; cv=pass; d=google.com; s=arc-20240605; b=iE++Kh/ld/odde2mVshpnVYMBor0DLS0KcsaauXxdCz5WevtDSL4MZ59nxbTmJduHP U8xELHrqdm/U/dG/dBY9JR0aqtYhkhzZYXlsH2CrcpTjkvHKbsixpRH08A6gaI2U5jVq kqSgO/nO1DAhz8GRhZFedWxTt/KqBiRqOKR3BtD68VF/GeDN0cYaXvOfnA7ybCbrFhSz 9UvBWd1w2uas7yIi20W5NllHRryTgIJ716o8PZea4WiLCFShoKUrxzYm3dXuCCd4gsHd KMYlxJ7IGIbB2rej2Gv4ZQqRgQUe2acdRRb3XB2WUAKtd8Zj/Ilic9p8IxAgzMB2uQHu SAsw== 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=H0Bshth2UCDH/BMnnqrH25GOQIBYPq83c2R9b/vW7Nk=; fh=ZJPgzpOS9AHzhWcgibek5k11+rKcbRHoRecyhSx2dG8=; b=auOniT52bdIiYuzxk/HOrReP1/u6yb7O8RmS87+nt4EGhD03mKwXbe4k1X4Hq6sxMT HVyYNNJXr+m2B4txyqdkfI6ENeOH2CpXeu7NWJOeQjasUTT2qOsQCu3gW/lsLL8rWH+P hC7fugDPaid5sBFFVuiaHo6MNl7L5H18KTMySsdrVRJxLyQWRxxWHr5LNY+vCcfY0hye RXUTGTvjIirqXM5P/pv+OVZVNUmDTubFpvF6+2G1uW4EAsdVXm3XHdFz8Mp4bwcwa3ze C+k4uFNSlOxtyQZNUPHMchrWMShCrOV2gn4gch4VyksqrTFE/pKXdT7z5M7DWwlDt969 jWsQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pkI0k8Zi; 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=1776609177; x=1777213977; 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=H0Bshth2UCDH/BMnnqrH25GOQIBYPq83c2R9b/vW7Nk=; b=cpzuolpGTX9xZq6QjSx5kspQ8jo5n/qoskcUQVw9XtZaTGPO2xIDt6kuPFeGLTfMCT Nd2zpaXFDGIE/0k1YimDYerlUYW4HHI0ZbSAMrBqVbhKHpnWG4AZXUnNWTmPQkN2bYz2 y6+buk65M3WJ+lZogrZL87iT362acL8BuwwJg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776609177; x=1777213977; 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=H0Bshth2UCDH/BMnnqrH25GOQIBYPq83c2R9b/vW7Nk=; b=sygnJrCCSQMgmxNRrwIc63Pr0gN2P22yZJdDtgYs11QBTHkSInYNkj9y6wFq3B3tfy AYOUSQ3AvjEjKoipnFCZrsPjwiYHEs1Cin1EYLOjYLrMR0J8dAoB8w1u5o7E1IKCIRXs v5dCCQWcVP5w9gOCqA04uZ4I2l1sLzKkhQSu3T19kXCSfBaQPkdRwhHeIMYOw80Q+0hK eKRzUyPwvaiQxMmSqf4WI9MOO8p8tMoPKsn9nXmOXnTwCkeAAnLXy52Z6rB8QWZn81K6 beoZTVXFzqVUEvR7UXqFpntC7M6ranzqqEQbMHuz1e3NGC4ajUAU1WY3BpEp8TiPcIgt 8SkQ== X-Forwarded-Encrypted: i=2; AFNElJ9asERh4XHwnS3lcWLWPFxB+qaa/kxU/vNyF3qzq/ff7D4oCbxFi3gPyD9R+QX7ho/2YNGx5sF4f3t9M2/m@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0YxbhqNfNXdbdylkxehRblJZSkswYzlRkqMwA5tYyIh2ySeVtMNY aD9X2wFQjaqZUkN0hs7OYN0OHJTGE0umL+hTsLTA17zKVHmYzpIjOzcc330xqPlewk6BMQ== X-Received: by 2002:a05:600c:8b38:b0:488:b14f:b8ed with SMTP id 5b1f17b1804b1-488fb6e815amr150561755e9.0.1776609177439; Sun, 19 Apr 2026 07:32:57 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com; h="AYAyTiJbjzrLALCb6vcnlrOVVKyyS6VOF/JDELxPWtW+SDOBcw==" Received: by 2002:a05:600d:6443:10b0:485:3f21:7f96 with SMTP id 5b1f17b1804b1-488f4b317e9ls21142815e9.1.-pod-prod-07-eu; Sun, 19 Apr 2026 07:32:55 -0700 (PDT) X-Received: by 2002:a05:600c:530e:b0:485:4eaf:eb53 with SMTP id 5b1f17b1804b1-488fb768db3mr149403495e9.19.1776609175615; Sun, 19 Apr 2026 07:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776609175; cv=none; d=google.com; s=arc-20240605; b=LdFwkvYPgOnISjDx/CQ1jxIOYBXOsluLKUJlZE/8Z+D7GuroNQ1URAUk2aF9Nrcnzy jLnP3wS7d0Tp2rpzyuG5mUVRZqS6J/yShgKwvFeEYULxKb7s0aKQRrt3zDzgtinrBqvP 48Jbv0y0nivAr1KYRbVc5Of9gvwGJesOiCRD2uFtfCY2NJeb/a2o7YjTCtCGpMjf0LZ3 Vzh0oR2EwHl/M6uXy8YDsw4dDD3xrGNDBQrrMbnJtvldsnQPtKzpNOSxMCGOqQZ8oEJ8 Y0BmRtnEcFx5mZKp5jMDGoo8pZML220dW+8wEPM40SUHXEOwEh8SMvuo+6yJpSzOFF53 aIQQ== 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=SkM7z/RI8tzs7t4yVAlnuLnFIB/0Nbr6u3YHDWU9clc=; fh=1++I4mQPFaF8M6MCMd+mjFLZt9O3Ou9wuU4eNHco1NQ=; b=WVU5iZwRduC6yaZsdm0YuVeYHU0K80PHi1i4EX9YXR47/KDBsGtTW2szljIP4YqOia sDrA28RinaU27IJiIfJCAJyQoUEQ9C2O9Yez2Eh9VGe92gJdMrygMw43ORda+5XRX0Ep QDCFavt7bgVfYlY65AHzZ37sP5Ya3zm6CpW6iDtd1H+5O350T7xVVOmZBfAbxpWLfqn3 rD133ROFVN43xRwWKUQzqVsdNwcQpRV6yQNC3WstDYI1cg/7TLJ2Q8PCywWAXgBJLJ+F NqfBxJHTdeW5px+l0A9SjjSafUCCgyqid2ug+zuDmYgjIq8gTt/YqvAOU+DqyMjv+frc 3TLA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pkI0k8Zi; 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-488fc142c88sor12382525e9.14.2026.04.19.07.32.55 for (Google Transport Security); Sun, 19 Apr 2026 07:32:55 -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: AeBDieuWxxQjiW69QSS6iJ1cFUhKUym+yPiMX12SrMWvSsU9LV8Gh+/xJLmx34W5KhQ uNrrlvI8hrq24Dj6hx1vxXdHK+JJhkXTHVehcYlJIRxOx6xEw8ksJBfShA6yehpaZ4YeCvXpXEx 4VuC8JzRe5VluN+IC9pwMuQAfVCortNGqZ+lI8gzuY6mGnC9FxGxBD0QKOTJKl6UMtthyUWlBZW 4de+rUmXYovTGLO+UzP5OZllMreBqEp2KBKVt77JQDom+/PUg+ML2wipCPOTg2RK6ZNIDwfd8TU kR+8+N7l2VMcn3rqoCIyimpJz7y94krEPI5wgumOBfAx7LGv0D/J83c/72c4umcDyqCtEU40Hm9 AzF7/qc3SmZIyasBhMJyC5Z3LhppmyQYcNrc8u7tN2nLX0A0aY9xCYU6XSRCczFN2+AFxS+3k9w PgZ9QR1Un2Bm1jh3hSZF6NIGwgSMjqqn4ceqCNYFU0UQnVsIpX7JuV2IK78/d+p4UhRrYRJXIoF bAV3nRHvH8QtM3lE1XmG0VGcATtt3WcNl9UztnoCuC2zK9E8n+ZVPqIv7Guny4JpTcAzTQIFROY hs0NImKpZyZd8xQmoHv3cewpDv9HVMyA X-Received: by 2002:a05:600c:8183:b0:488:b187:3c with SMTP id 5b1f17b1804b1-488fb765ab5mr158660815e9.14.1776609175076; Sun, 19 Apr 2026 07:32:55 -0700 (PDT) Received: from dario-ThinkPad-P14s-Gen-5.homenet.telecomitalia.it (host-79-20-97-39.retail.telecomitalia.it. [79.20.97.39]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb755938sm86864245e9.3.2026.04.19.07.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2026 07:32:54 -0700 (PDT) From: Dario Binacchi To: u-boot@lists.denx.de Cc: linux-amarula@amarulasolutions.com, Dario Binacchi , Dinesh Maniyam , Heinrich Schuchardt , Ilias Apalodimas , Javier Martinez Canillas , Jerome Forissier , John Toomey , 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 v4 0/8] Support metadata-driven A/B boot for STM32MP25 Date: Sun, 19 Apr 2026 16:31:40 +0200 Message-ID: <20260419143247.437733-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=pkI0k8Zi; 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 v4: - Place the part command tests in the cmd suite rather than the dm suite. - 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 + 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 +++++++ 12 files changed, 416 insertions(+), 4 deletions(-) create mode 100644 test/cmd/part.c